The SetupDiOpenClassRegKeyEx function opens the device setup class registry key, the device interface class registry key, or a specific class's subkey. This function opens the specified key on the local computer or on a remote computer.
WINSETUPAPI HKEY SetupDiOpenClassRegKeyExA( CONST GUID *ClassGuid, REGSAM samDesired, DWORD Flags, PCSTR MachineName, PVOID Reserved );
A pointer to the GUID of the class whose registry key is to be opened. This parameter is optional and can be NULL. If this parameter is NULL, the root of the class tree (HKLM\SYSTEM\CurrentControlSet\Control\Class) is opened.
The registry security access for the key to be opened. For information about registry security access values of type REGSAM, see the Microsoft Windows SDK documentation.
The type of registry key to be opened, which is specified by one of the following:
Open a setup class key. If ClassGuid is NULL, open the root key of the class installer branch.
Open an interface class key. If ClassGuid is NULL, open the root key of the interface class branch.
Optionally points to a string that contains the name of a remote computer on which to open the specified key.
Reserved. Must be NULL.
SetupDiOpenClassRegKeyEx returns a handle to an opened registry key where information about this setup class can be stored/retrieved.
If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
Depending on the value that is passed in the samDesired parameter, it might be necessary for the caller of this function to be a member of the Administrators group.
SetupDiOpenClassRegKeyEx does not create a registry key if it does not already exist.
Callers of this function must close the handle returned from this function by calling RegCloseKey.
|Windows version||Available in Microsoft Windows 2000 and later versions of Windows.|
|Header||setupapi.h (include Setupapi.h)|