The NdisAllocateSharedMemory function allocates shared memory from a shared memory provider.
NDIS_STATUS NdisAllocateSharedMemory( NDIS_HANDLE NdisHandle, PNDIS_SHARED_MEMORY_PARAMETERS SharedMemoryParameters, PNDIS_HANDLE pAllocationHandle );
An NDIS driver or instance handle that was obtained during caller initialization. For example, a miniport driver can use the NDIS handle that it obtained from the NdisMRegisterMiniportDriver or MiniportInitializeEx function. Other NDIS drivers can use the handles from the following functions:
A pointer to an NDIS_SHARED_MEMORY_PARAMETERS structure that defines the requested attributes for the shared memory.
A pointer to a location for a handle that identifies the shared memory that was allocated. The handle is available when the function returns or it is NULL if the function fails. The caller must use this handle to free the shared memory that was allocated successfully.
NdisAllocateSharedMemory can return the following status values:
||The operation completed successfully.|
||The operation failed because there were insufficient resources to complete the operation.|
||The operation failed because of an invalid input parameter.|
||The operation failed for unspecified reasons.|
The SharedMemoryParameters parameter contains a pointer to an NDIS_SHARED_MEMORY_PARAMETERS structure that defines the requested attributes for the shared memory. If the NDIS_SHARED_MEM_PARAMETERS_CONTIGUOUS flag is not set in the Flags member, shared memory can be specified in a scatter-gather list that is contained in non-contiguous memory.
NDIS calls the NetAllocateSharedMemory function of a shared memory provider from the context of the call to NdisAllocateSharedMemory.
The driver must call the NdisFreeSharedMemory function to free the shared memory that it allocates with NdisAllocateSharedMemory.
|Minimum supported client||Supported in NDIS 6.20 and later.|
|Header||ndis.h (include Ndis.h)|
Send feedback about: