_GetRegistryKey

#include <vmmreg.h>

_GetRegistryKey(DWORD dwType, LPSTR lpszDeviceName, 
                DWORD dwFlags, LPHKEY lphDevKey);    
 

Gets a registry key handle for the given device name under the branch of the registry tree specified by the dwType parameter. Uses C calling convention. Caller should use _RegCloseKey to close the returned HKEY.

ERROR_INVALID_PARAMETER
ERROR_REGISTRY_IO_FAILED
ERROR_REGISTRY_CORRUPT
ERROR_BADDB
ERROR_FILE_NOT_FOUND

dwType
Defines the registry branch for the key. Must be REGTYPE_CLASS, REGTYPE_VXD or REGTYPE_ENUM.
lpszDevName
Address of null terminated string specifying device name.
dwFlags
Flags for the registry. Must be either REGKEY_OPEN or REGKEY_CREATE_IFNOTEXIST.
lphKey
Address of the buffer that receives the HKEY.