SetupDiGetHwProfileList function

The SetupDiGetHwProfileList function retrieves a list of all currently defined hardware profile IDs.

Syntax

WINSETUPAPI BOOL SetupDiGetHwProfileList(
  PDWORD HwProfileList,
  DWORD  HwProfileListSize,
  PDWORD RequiredSize,
  PDWORD CurrentlyActiveIndex
);

Parameters

HwProfileList

A pointer to an array to receive the list of currently defined hardware profile IDs.

HwProfileListSize

The number of DWORDs in the HwProfileList buffer.

RequiredSize

A pointer to a variable of type DWORD that receives the number of hardware profiles currently defined. If the number is larger than HwProfileListSize, the list is truncated to fit the array size. The value returned in RequiredSize indicates the array size required to store the entire list of hardware profiles. In this case, the function fails and a call to GetLastError returns ERROR_INSUFFICIENT_BUFFER.

CurrentlyActiveIndex

A pointer to a variable of type DWORD that receives the index of the currently active hardware profile in the retrieved hardware profile list. This parameter is optional and can be NULL.

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.

Remarks

Call SetupDiGetHwProfileListEx to retrieve the hardware profile IDs for a remote computer.

Requirements

   
Windows version Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header setupapi.h (include Setupapi.h)
Library Setupapi.lib
DLL Setupapi.dll

See Also

SetupDiCreateDevRegKey

SetupDiOpenDevRegKey