SetupDiClassNameFromGuidExA function (setupapi.h)

The SetupDiClassNameFromGuidEx function retrieves the class name associated with a class GUID. The class can be installed on a local or remote computer.

Syntax

WINSETUPAPI BOOL SetupDiClassNameFromGuidExA(
  [in]            const GUID *ClassGuid,
  [out]           PSTR       ClassName,
  [in]            DWORD      ClassNameSize,
  [out, optional] PDWORD     RequiredSize,
  [in, optional]  PCSTR      MachineName,
                  PVOID      Reserved
);

Parameters

[in] ClassGuid

The class GUID of the class name to retrieve.

[out] ClassName

A pointer to a string buffer that receives the NULL-terminated name of the class for the specified GUID.

[in] ClassNameSize

The size, in characters, of the ClassName buffer.

[out, optional] RequiredSize

The number of characters required to store the class name (including a terminating null). RequiredSize is always less than MAX_CLASS_NAME_LEN.

[in, optional] MachineName

A pointer to a NULL-terminated string that contains the name of a remote system on which the class is installed. This parameter is optional and can be NULL. If MachineName is NULL, the local system name is used.

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 with a call to GetLastError.

Remarks

Note

The setupapi.h header defines SetupDiClassNameFromGuidEx 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

SetupDiClassGuidsFromNameEx

SetupDiClassNameFromGuid