Expand Minimize

WdfPdoInitAssignRawDevice method

[Applies to KMDF only]

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


DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

DeviceClassGuid [in]

A pointer to a GUID that identifies a device setup class that was previously installed on the computer.

Note   You should always specify a custom class GUID. You should not specify an existing class GUID. If you specify an existing class GUID, other drivers that attempt to specify that existing class GUID might fail to install or might install with incorrect security settings.

For more information, see the following Remarks section.

Return value

If the operation succeeds, the method returns STATUS_SUCCESS. Otherwise it returns STATUS_INVALID_PARAMETER.


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 specifies.

For more information about using the registry, see Setting Device Object Registry Properties After Installation.


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(


Minimum KMDF version



Wdfpdo.h (include Wdf.h)


Wdf01000.sys (see Framework Library Versioning.)



DDI compliance rules

ChildDeviceInitAPI, DriverCreate, InitFreeDeviceCallback, InitFreeDeviceCreate, InitFreeNull, KmdfIrql, KmdfIrql2, PdoDeviceInitAPI, PdoInitFreeDeviceCallback, PdoInitFreeDeviceCreate

See also




Send comments about this topic to Microsoft

© 2014 Microsoft