SetupDiGetHwProfileListExA function (setupapi.h)

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

Syntax

WINSETUPAPI BOOL SetupDiGetHwProfileListExA(
  [out]           PDWORD HwProfileList,
  [in]            DWORD  HwProfileListSize,
  [out]           PDWORD RequiredSize,
  [out, optional] PDWORD CurrentlyActiveIndex,
  [in, optional]  PCSTR  MachineName,
                  PVOID  Reserved
);

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

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

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

Caution

Using this function to access remote machines is not supported beginning with Windows 8 and Windows Server 2012, as this functionality has been removed.

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.

Remarks

Note

The setupapi.h header defines SetupDiGetHwProfileListEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

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

See also

SetupDiGetHwProfileFriendlyNameEx