Hardware Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize

WdfDeviceInitSetRequestAttributes method

[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 [in]

A caller-supplied pointer to a WDFDEVICE_INIT structure.

RequestAttributes [in]

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

Show:
© 2015 Microsoft