NdisMapFile (NDIS 5.1) function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NdisMapFile maps an already open file into a caller-accessible buffer if the file is currently unmapped.

Syntax

VOID NdisMapFile(
  _Out_ PNDIS_STATUS Status,
  _Out_ PVOID        *MappedBuffer,
  _In_  NDIS_HANDLE  FileHandle
);

Parameters

  • Status [out]
    Pointer to a caller-supplied variable in which this function returns the status of the mapping operation, which can be one of the following:

    NDIS_STATUS_SUCCESS

    The caller has exclusive access to the file contents until NdisUnmapFile is called.

    NDIS_STATUS_ALREADY_MAPPED

    The caller cannot access the file contents at this time.

MappedBuffer [out]

Pointer to a caller-supplied variable in which this function returns the base virtual address of the mapped file contents or NULL.

FileHandle [in]

Specifies the handle returned by a preceding call to NdisOpenFile.

Return value

None

Remarks

NdisMapFile associates (maps) a virtual address range with an opened file so the driver can access the file contents. NdisMapFile allows only one mapping of a particular file to be outstanding at any time. Consequently, a successful caller is given exclusive access to the file data until NdisUnmapFile or NdisCloseFile is called.

A NIC driver can map and unmap such an open file as necessary, using alternating calls to NdisMapFile and NdisUnmapFile. A call to NdisCloseFile releases the FileHandle and deallocates the buffer containing the file contents.

A NIC driver can call NdisMapFile only during initialization.

Requirements

Target platform

Universal

Version

See NdisMapFile.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH_LEVEL

See also

DriverEntry of NDIS Protocol Drivers

MiniportInitialize

NdisCloseFile

NdisOpenFile

NdisUnmapFile

 

 

Send comments about this topic to Microsoft