Expand Minimize

WdfPdoInitAssignRawDevice method

[Applies to KMDF only]

The WdfPdoInitAssignRawDevice method indicates that the calling driver can support a specified device in raw mode.

Syntax


NTSTATUS WdfPdoInitAssignRawDevice(
  [in]  PWDFDEVICE_INIT DeviceInit,
  [in]  const GUID *DeviceClassGuid
);

Parameters

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.

Remarks

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.

Examples

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

Minimum KMDF version

1.0

Header

Wdfpdo.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

PASSIVE_LEVEL

DDI compliance rules

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

See also

WdfDeviceInitAssignSDDLString
WdfDeviceInitSetDeviceType
WdfDeviceInitSetCharacteristics
WdfDeviceInitSetExclusive

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.