NdisAllocateSharedMemory function (ndis.h)
The NdisAllocateSharedMemory function allocates shared memory from a shared memory provider.
Syntax
NDIS_STATUS NdisAllocateSharedMemory(
[in] NDIS_HANDLE NdisHandle,
[in] PNDIS_SHARED_MEMORY_PARAMETERS SharedMemoryParameters,
[in, out] PNDIS_HANDLE pAllocationHandle
);
Parameters
[in] NdisHandle
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:
[in] SharedMemoryParameters
A pointer to an NDIS_SHARED_MEMORY_PARAMETERS structure that defines the requested attributes for the shared memory.
[in, out] pAllocationHandle
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.
Return value
NdisAllocateSharedMemory can return the following status values:
Return code | Description |
---|---|
|
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. |
Remarks
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.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.20 and later. |
Target Platform | Universal |
Header | ndis.h (include Ndis.h) |
Library | Ndis.lib |
IRQL | PASSIVE_LEVEL |