Public Device Installation ...


Windows Driver Kit: Device Installation
SetupDiEnumDeviceInfo

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

WINSETUPAPI BOOL WINAPI
  SetupDiEnumDeviceInfo(
    IN HDEVINFO  DeviceInfoSet,
    IN DWORD  MemberIndex,
    OUT PSP_DEVINFO_DATA  DeviceInfoData
    );

Parameters

DeviceInfoSet
A handle to the device information set for which to return an SP_DEVINFO_DATA structure that represents a device information element.
MemberIndex
A zero-based index of the device information element to retrieve.
DeviceInfoData
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.

Comments

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

Versions: The SetupDiEnumDeviceInfo function is available in Microsoft Windows 2000 and later versions of Windows.

Headers: Declared in Setupapi.h. Include Setupapi.h.

Library: Contained in Setupapi.lib. Link to Setupapi.lib.

See Also

SetupDiCreateDeviceInfo, SetupDiDeleteDeviceInfo, SetupDiEnumDeviceInterfaces, SetupDiOpenDeviceInfo, SP_DEVINFO_DATA


Send feedback on this topic
Built on November 19, 2009
Page view tracker