WdfDeviceInitSetRequestAttributes function

[Applies to KMDF and UMDF]

The WdfDeviceInitSetRequestAttributes method sets object attributes that will be used for all of the framework request objects that the framework delivers to the driver from the device's I/O queues.

Syntax

VOID WdfDeviceInitSetRequestAttributes(
  _In_ PWDFDEVICE_INIT        DeviceInit,
  _In_ PWDF_OBJECT_ATTRIBUTES RequestAttributes
);

Parameters

DeviceInit

A caller-supplied pointer to a WDFDEVICE_INIT structure.

RequestAttributes

A pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure that contains attributes for the device's request objects.

Return Value

None

Remarks

Your driver can call WdfDeviceInitSetRequestAttributes to specify the object context space that the framework will assign to the request objects that it creates for your driver. For more information about this context space, see Using Request Object Context.

The framework does not use the specified object attributes for request objects that it creates when a driver calls WdfRequestCreate or WdfRequestCreateFromIrp.

Your driver must call WdfDeviceInitSetRequestAttributes from within its EvtDriverDeviceAdd callback function, before it calls WdfDeviceCreate. For more information, see Creating a Framework Device Object.

Examples

The following code example initializes a WDF_OBJECT_ATTRIBUTES structure and calls WdfDeviceInitSetRequestAttributes.

typedef struct _REQUEST_CONTEXT {
  ULONG_PTR  Information;
} REQUEST_CONTEXT, *PREQUEST_CONTEXT;
WDF_OBJECT_ATTRIBUTES  attributes;

WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(
                                        &attributes,
                                        REQUEST_CONTEXT
                                        );
WdfDeviceInitSetRequestAttributes(
                                  DeviceInit,
                                  &attributes
                                  );

Requirements

   
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL "<= DISPATCH_LEVEL"
DDI compliance rules ChildDeviceInitAPI, ControlDeviceInitAPI, DeviceInitAPI, DriverCreate, KmdfIrql, KmdfIrql2, PdoDeviceInitAPI

See Also

EvtDriverDeviceAdd

Send comments about this topic to Microsoft