Freigeben über


NdisQueryBufferSafe (Windows CE 5.0)

Send Feedback

This function is the safe version of NdisQueryBuffer. Unlike NdisQueryBuffer, this function does not cause a bug check if system resources are low or exhausted. Drivers should call this function instead of NdisQueryBuffer.

VOID NdisQueryBufferSafe(PNDIS_BUFFERBuffer,PVOID* VirtualAddressOPTIONAL,PUINTLength,MM_PAGE_PRIORITYPriority);

Parameters

  • Buffer
    [in] Points to the buffer descriptor.
  • VirtualAddress
    [out] Points to a caller-supplied variable in which this function returns the base virtual address of the range described, or set to NULL if:
    • System resources are low or exhausted and Priority was set to**LowPagePriority or NormalPagePriority
    • System resources are exhausted and Priority was set to**HighPagePriority
  • Length
    [out] Points to a caller-supplied variable in which this function returns the number of bytes in the virtual range.
  • Priority
    [in] Indicates the priority of the request as one of the following:
    • LowPagePriority

      Specifies a low priority. It is acceptable for NdisQueryBufferSafe to fail if system resources are low.

    • NormalPagePriority

      Specifies a normal priority. It is acceptable for NdisQueryBufferSafe to fail if system resources are low.

    • HighPagePriority

      Specifies a high priority. It is not acceptable for NdisQueryBufferSafe to fail unless system resources are exhausted.

Return Values

Returns the base virtual address if successful.

Remarks

NdisQueryBufferSafe retrieves the size of the range, and optionally its base virtual address, from a buffer descriptor.

NDIS drivers use NdisQueryBufferSafe to retrieve information from the buffer descriptors chained to incoming packets for subsequent transfer operations.

If Priority was set to LowPagePriority or NormalPagePriority, NdisQueryBufferSafe returns NULL if system resources are low or exhausted. If Priority was set to HighPagePriority, NdisQueryBufferSafe returns NULL if system resources are exhausted.

The driver must release any spin lock it is holding before calling NdisQueryBufferSafe.

Drivers should call NdisQueryBufferSafe instead of NdisQueryBuffer. If system resources are low or exhausted, calling NdisQueryBuffer causes a bug check. NDIS 5.1 miniports must call NdisQueryBufferSafe instead of NdisQueryBuffer.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.

See Also

NdisGetFirstBufferFromPacketSafe | NdisMoveFromMappedMemory | NdisMoveMemory | NdisMoveToMappedMemory | NdisQueryBuffer | NdisQueryBufferOffset | NdisQueryPacket | NdisRawReadPortBufferUchar | NdisRawReadPortBufferUlong | NdisRawReadPortBufferUshort | NdisRawWritePortBufferUchar | NdisRawWritePortBufferUlong | NdisRawWritePortBufferUshort | NdisReleaseSpinLock | NdisUnchainBufferAtBack | NdisUnchainBufferAtFront

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.