NetRequestQueueCreate function

Warning

Some information in this topic relates to prereleased product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

NetAdapterCx is preview only in Windows 10, version 1903.

Creates a net request queue object.

Syntax

NTSTATUS NetRequestQueueCreate(
  NET_REQUEST_QUEUE_CONFIG *NetRequestQueueConfig,
  WDF_OBJECT_ATTRIBUTES    *QueueAttributes,
  NETREQUESTQUEUE          *RequestQueue
);

Parameters

NetRequestQueueConfig

A pointer to a caller-allocated NET_REQUEST_QUEUE_CONFIG structure.

QueueAttributes

An optional pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure that specifies attributes for the net request queue object.

RequestQueue

An optional pointer to a location that receives a handle to the new net request queue object.

Return Value

This method returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method may return an appropriate NTSTATUS error code.

Remarks

The client driver typically calls this method from its EvtDriverDeviceAdd routine after the client has called WdfDeviceCreate and NetAdapterCreate.

The NETREQUESTQUEUE object represents an OID queue in the traditional NDIS model.

Example

Typically, the client creates a queue for regular (sequential) OIDs, and may optionally also create a second queue for direct (parallel) OIDs. This example shows how to create a sequential queue. Error handling has been omitted for clarify.

    NET_REQUEST_QUEUE_CONFIG config;

    // Initialize the Queue Config
    NET_REQUEST_QUEUE_CONFIG_INIT_DEFAULT_SEQUENTIAL(&config,
                                                     AdapterContext->GetNetAdapter());

    //
    // Register default handlers as needed
    //
    config.EvtRequestDefaultSetData = EvtNetRequestSetData;
    config.EvtRequestDefaultQueryData = EvtNetRequestQueryData;
    config.EvtRequestDefaultMethod = EvtNetRequestMethod;

    //
    // Add custom request handlers as needed
    //
    ...

    //
    // Create the default NETREQUESTQUEUE
    //
    status = NetRequestQueueCreate(&config,
                                   WDF_NO_OBJECT_ATTRIBUTES,
                                   NULL);

Requirements

   
Target Platform Universal
Minimum KMDF version 1.21
Header netrequestqueue.h (include netadaptercx.h)
Library NetAdapterCxStub.lib
IRQL PASSIVE_LEVEL

See Also

NET_REQUEST_QUEUE_CONFIG_ADD_METHOD_HANDLER

NET_REQUEST_QUEUE_CONFIG_ADD_QUERY_DATA_HANDLER

NET_REQUEST_QUEUE_CONFIG_ADD_SET_DATA_HANDLER

NET_REQUEST_QUEUE_CONFIG_INIT_DEFAULT_PARALLEL

NET_REQUEST_QUEUE_CONFIG_INIT_DEFAULT_SEQUENTIAL