WdfPdoInitAssignDeviceID - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfpdo.h

NTSTATUS WdfPdoInitAssignDeviceID(
  [in] PWDFDEVICE_INIT  DeviceInit,
  [in] PCUNICODE_STRING DeviceID
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfpdo-wdfpdoinitassigndeviceid)

WdfPdoInitAssignDeviceID function

Description

[Applies to KMDF only]

The WdfPdoInitAssignDeviceID method updates the device ID for a child device.

Parameters

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

DeviceID [in]

A pointer to a UNICODE_STRING structure that contains a device ID string. The driver can allocate the string's buffer from paged pool.

Return value

If the operation succeeds, the method returns STATUS_SUCCESS. Additional return values include:

Return code Description
STATUS_INVALID_DEVICE_REQUEST The driver is initializing an FDO instead of a PDO.
STATUS_INSUFFICIENT_RESOURCES The driver could not allocate space to store the device ID string.

The method might also return other NTSTATUS values.

Remarks

A device ID is typically the first item in the list of hardware IDs that a device reports. For more information about device IDs and hardware IDs, see Device Identification Strings and How Setup Selects Drivers.

The driver must call WdfPdoInitAssignDeviceID before calling WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

Examples

The following code example reports a device ID that the KbFiltr sample driver uses.

#define  KBFILTR_DEVICE_ID L"{A65C87F9-BE02-4ed9-92EC-012D416169FA}\\KeyboardFilter\0"
DECLARE_CONST_UNICODE_STRING(deviceId,KBFILTR_DEVICE_ID);

status = WdfPdoInitAssignDeviceID(
                                  pDeviceInit,
                                  &deviceId
                                  );

See also

WdfPdoInitAddCompatibleID

WdfPdoInitAddHardwareID

WdfPdoInitAssignInstanceID