Compartilhar via


NdisAllocateMdl (Compact 2013)

3/26/2014

This function allocates an MDL that describes the memory buffer at the specified virtual address.

Syntax

PMDL
  NdisAllocateMdl(
    IN  NDIS_HANDLE  NdisHandle,
    IN  PVOID  VirtualAddress,
    IN  UINT  Length
    );

Parameters

  • NdisHandle
    An NDIS handle that was obtained during caller initialization.
  • VirtualAddress
    A pointer to the base virtual address of the buffer that the MDL is to describe.
  • Length
    The size, in bytes, of the memory buffer.

Return Value

NdisAllocateMdl returns a pointer to the allocated MDL. If the allocation fails, the return value is NULL.

Remarks

All MDLs that are allocated by calling NdisAllocateMdl must be freed by calling the NdisFreeMdl function.

Note   NdisAllocateMdl allocates memory and builds the MDL in one step. This process differs from IoAllocateMdl, which only allocates memory for the MDL so the caller must build the MDL by calling either MmBuildMdlForNonPagedPool or MmProbeAndLockPages.

Requirements

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NdisFreeMdl