SetupDiGetHwProfileList function (setupapi.h)

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

Syntax

WINSETUPAPI BOOL SetupDiGetHwProfileList(
  [out]           PDWORD HwProfileList,
  [in]            DWORD  HwProfileListSize,
  [out]           PDWORD RequiredSize,
  [out, optional] PDWORD CurrentlyActiveIndex
);

Parameters

[out] HwProfileList

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

[in] HwProfileListSize

The number of DWORDs in the HwProfileList buffer.

[out] 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.

[out, optional] 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

Requirement Value
Minimum supported client 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