_RegQueryValue


include vmm.h

LONG _RegQueryValue(HKEY hkey, LPTSTR lpszSubKey, LPTSTR lpszValue, 
    PLONG pcbValue)

Retrieves the value associated with the unnamed value for a specified key in the registry. See the documentation for the Win32 function of the same name for additional information.

ERROR_KEY_DELETED

ERROR_MORE_DATA

ERROR_BADKEY

ERROR_REGISTRY_IO_FAILED

ERROR_REGISTRY_CORRUPT

ERROR_BADDB


hkey

Handle of an open key or one of the predefined keys:

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

HKEY_CURRENT_CONFIG

HKEY_DYN_DATA


lpszSubKey

Address of string that contains name of the subkey of the hkey parameter for which a value is to be retrieved.

lpszValue

Address of string that contains name of the subkey of the hkey parameter for which a value is to be retrieved. If this parameter is NULL and pcbValue is not NULL this service returns ERROR_SUCCESS and returns the size of the buffer needed the variable pointed to by pcbValue.

pcbValue

Address of variable specifying the size, in bytes, of the lpszValue buffer. The buffer should be big enough to contain the terminating null character. On return, the variable contains the size of the data copied to the buffer. If the passed in size is not big enough, the variable will contain the size needed and ERROR_MORE_DATA will be returned.

Of the predefined key values, only HKEY_LOCAL_MACHINE and HKEY_DYN_DATA are available to VxDs during initialization time. The entire registry space can only be accessed after VxD initialization is complete.