SetupDiGetHwProfileListExA function

The SetupDiGetHwProfileListEx function retrieves a list of all currently defined hardware profile IDs on a local or remote computer.

Syntax

WINSETUPAPI BOOL SetupDiGetHwProfileListExA(
  PDWORD HwProfileList,
  DWORD  HwProfileListSize,
  PDWORD RequiredSize,
  PDWORD CurrentlyActiveIndex,
  PCSTR  MachineName,
  PVOID  Reserved
);

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 that are 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.

CurrentlyActiveIndex

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

MachineName

A pointer to a NULL-terminated string that contains the name of a remote system for which to retrieve the list of hardware profile IDs. This parameter is optional and can be NULL. If this parameter is NULL, the list is retrieved for the local system.

Reserved

Must 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. If the required size is larger than HwProfileListSize, SetupDiGetHwProfileListEx returns FALSE and a call to GetLastError returns ERROR_INSUFFICIENT_BUFFER.

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

See Also

SetupDiGetHwProfileFriendlyNameEx