INtime SDK Help
RegQueryInfoKey (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > RegQueryInfoKey (iwin32)

Retrieves information about the specified registry key.

LONG RegQueryInfoKey(
    HKEY hKey,
    LPTSTR lpClass,
    LPDWORD lpcClass,
    LPDWORD lpReserved,
    LPDWORD lpcSubKeys,
    LPDWORD lpcMaxSubKeyLen,
    LPDWORD lpcMaxClassLen,
    LPDWORD lpcValues,
    LPDWORD lpcMaxValueNameLen,
    LPDWORD lpcMaxValueLen,
    LPDWORD lpcSecurityDescriptor,
    PFILETIME lpftLastWriteTime
);

Parameters

hKey
Handle to a currently open key or any of the following predefined reserved handle values:

HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS HKEY_PERFORMANCE_DATA

lpClass
Pointer to a buffer that receives the key's class name. This parameter can be NULL.
lpcClass
Pointer to a variable that specifies the number of characters in the buffer pointed to by the lpClass parameter. This size should include the terminating null character. When the call returns, this variable contains the length of the class string stored in the buffer. The returned count does not include the terminating null character. If the buffer is not big enough, the call returns ERROR_MORE_DATA, and the variable contains the size of the string, in characters, without counting the null character.

If lpClass is NULL, lpcClass can be NULL.

If the lpClass parameter is a valid address, but the lpcClass parameter is not (for example, it is NULL), the call returns ERROR_INVALID_PARAMETER.
lpReserved
Reserved; must be NULL.
lpcSubKeys
Pointer to a variable that receives the number of subkeys contained by the specified key. This parameter can be NULL.
lpcMaxSubKeyLen
Pointer to a variable that receives the length, in characters, of the key's subkey with the longest name. The returned count does not include the terminating null character. This parameter can be NULL.
lpcMaxClassLen
Pointer to a variable that receives the length, in characters, of the longest string that specifies a subkey class. The count returned does not include the terminating null character. This parameter can be NULL.
lpcValues
Pointer to a variable that receives the number of values associated with the key. This parameter can be NULL.
lpcMaxValueNameLen
Pointer to a variable that receives the length, in characters, of the key's longest value name. The count returned does not include the terminating null character. This parameter can be NULL.
lpcMaxValueLen
Pointer to a variable that receives the length, in bytes, of the longest data component among the key's values. This parameter can be NULL.
lpcSecurityDescriptor
Pointer to a variable that receives the length, in bytes, of the key's security descriptor. This parameter can be NULL.
lpftLastWriteTime
Pointer to a FILETIME structure. This parameter can be NULL.

The call sets the FILETIME structure's members to indicate the last time that the key or any of its value entries was modified.

Remarks

The key identified by the hKey parameter must be opened with KEY_QUERY_VALUE access (KEY_READ access includes KEY_QUERY_VALUE access).

Return Values

ERROR_SUCCESS
Success.
A nonzero status code defined in RTWIN32.H.
Failure. For extended error information, see GetLastError

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h iwin32.h
iwin32rt.h
rt.lib

Note

This function operates in the real-time portion of your application.

See Also

RegDeleteKey, RegEnumKeyEx, RegEnumValue, RegQueryValueEx, iwin32 API, iwin32 Overview