Windows Driver Kit: Kernel-Mode Driver Framework
WdfPdoInitAssignRawDevice
The WdfPdoInitAssignRawDevice method indicates that the calling driver can support a specified device in raw mode.
NTSTATUS
WdfPdoInitAssignRawDevice(
IN PWDFDEVICE_INIT DeviceInit,
IN CONST GUID* DeviceClassGuid
);
Parameters
- DeviceInit
- A pointer to a WDFDEVICE_INIT structure.
- DeviceClassGuid
- A pointer to a GUID that identifies a device setup class that was previously installed on the computer. For more information, see the following Comments section.
Return Value
If the operation succeeds, the method returns STATUS_SUCCESS. Otherwise it returns STATUS_INVALID_PARAMETER.
Comments
The driver must call WdfPdoInitAssignRawDevice before calling WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.
The registry can contain values that override the values that a driver specifies when it calls WdfDeviceInitAssignSDDLString, WdfDeviceInitSetDeviceType, WdfDeviceInitSetCharacteristics, and WdfDeviceInitSetExclusive. The WdfPdoInitAssignRawDevice method's DeviceClassGuid parameter specifies a GUID that identifies the section of the registry that contains the override values. The DeviceClassGuid parameter only identifies a section of the registry and does not actually set the device setup class for the device. The INF Version section in your device and driver's INF file sets the device setup class. Typically, the DeviceClassGuid parameter's GUID should match the GUID that the INF Version section file specifies.
For more information about using the registry, see Setting Device Object Registry Properties After Installation.
Example
The following code example indicates that a driver can support the specified device in raw mode and that the device belongs to the keyboard setup class.
NTSTATUS status;
status = WdfPdoInitAssignRawDevice(
pDeviceInit,
&GUID_DEVCLASS_KEYBOARD
);
Requirements
Versions: The WdfPdoInitAssignRawDevice method is available in version 1.0 and later versions of KMDF.
IRQL: PASSIVE_LEVEL
Headers: Declared in wdfpdo.h. Include wdf.h.
See Also
WdfDeviceInitAssignSDDLString, WdfDeviceInitSetDeviceType, WdfDeviceInitSetCharacteristics, WdfDeviceInitSetExclusive