Export (0) Print
Expand All
Expand Minimize

SetupDiGetDeviceInstanceId function

The SetupDiGetDeviceInstanceId function retrieves the device instance ID that is associated with a device information element.

Syntax


BOOL SetupDiGetDeviceInstanceId(
  _In_       HDEVINFO DeviceInfoSet,
  _In_       PSP_DEVINFO_DATA DeviceInfoData,
  _Out_opt_  PTSTR DeviceInstanceId,
  _In_       DWORD DeviceInstanceIdSize,
  _Out_opt_  PDWORD RequiredSize
);

Parameters

DeviceInfoSet [in]

A handle to the device information set that contains the device information element that represents the device for which to retrieve a device instance ID.

DeviceInfoData [in]

A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet.

DeviceInstanceId [out, optional]

A pointer to the character buffer that will receive the NULL-terminated device instance ID for the specified device information element. For information about device instance IDs, see Device Identification Strings.

DeviceInstanceIdSize [in]

The size, in characters, of the DeviceInstanceId buffer.

RequiredSize [out, optional]

A pointer to the variable that receives the number of characters required to store the device instance ID.

Return value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved by making a call to GetLastError.

Requirements

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

See also

SetupDiCreateDeviceInfo
SetupDiCreateDevRegKey
SetupDiOpenDeviceInfo
SetupDiOpenDevRegKey
SP_DEVINFO_DATA

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft