Expand Minimize

SetupDiEnumDeviceInfo function

The SetupDiEnumDeviceInfo function returns a SP_DEVINFO_DATA structure that specifies a device information element in a device information set.

Syntax


BOOL SetupDiEnumDeviceInfo(
  _In_   HDEVINFO DeviceInfoSet,
  _In_   DWORD MemberIndex,
  _Out_  PSP_DEVINFO_DATA DeviceInfoData
);

Parameters

DeviceInfoSet [in]

A handle to the device information set for which to return an SP_DEVINFO_DATA structure that represents a device information element.

MemberIndex [in]

A zero-based index of the device information element to retrieve.

DeviceInfoData [out]

A pointer to an SP_DEVINFO_DATA structure to receive information about an enumerated device information element. The caller must set DeviceInfoData.cbSize to sizeof(SP_DEVINFO_DATA).

Return value

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

Remarks

Repeated calls to this function return a device information element for a different device. This function can be called repeatedly to get information about all devices in the device information set.

To enumerate device information elements, an installer should initially call SetupDiEnumDeviceInfo with the MemberIndex parameter set to 0. The installer should then increment MemberIndex and call SetupDiEnumDeviceInfo until there are no more values (the function fails and a call to GetLastError returns ERROR_NO_MORE_ITEMS).

Call SetupDiEnumDeviceInterfaces to get a context structure for a device interface element (versus a device information element).

Requirements

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

See also

SetupDiCreateDeviceInfo
SetupDiDeleteDeviceInfo
SetupDiEnumDeviceInterfaces
SetupDiOpenDeviceInfo
SP_DEVINFO_DATA

 

 

Send comments about this topic to Microsoft

Build date: 2/13/2014

Show:
© 2014 Microsoft. All rights reserved.