ClusterRegQueryValue

The ClusterRegQueryValue function returns the name, type, and data components associated with a value for an open cluster database key.

LONG WINAPI ClusterRegQueryValue(
  HKEY hKey,              
  LPCWSTR lpszValueName,  
  LPDWORD lpdwValueType,  
  LPBYTE lpbData,         
  LPDWORD lpcbData        
);
 

Parameters

hKey
[in] Handle of the cluster database key to query.
lpszValueName
[in] Pointer to the name of the value to be queried.
lpdwValueType
[out] Pointer to the key's value type. The value returned through this parameter will be one of the following:
REG_BINARY
Binary data in any form.
REG_DWORD
A 32-bit number.
REG_EXPAND_SZ
A NULL-terminated Unicode string that contains unexpanded references to environment variables (for example, "%PATH%").
REG_MULTI_SZ
An array of NULL-terminated Unicode strings, terminated by two NULL characters.
REG_NONE
No defined value type.
REG_SZ
A NULL-terminated Unicode string.

The lpdwType parameter can be NULL if the type is not required.

lpbData
[out] Pointer to the value's data. This parameter can be NULL if the data is not required.
lpcbData
[in, out] On input, pointer to the count of bytes in the buffer pointed to by the lpbData parameter. On output, pointer to the count of bytes in the value's data, which is placed in the contents of lpbData if the caller passes in a valid pointer.

The lpcbData parameter can be NULL only if lpbData is also NULL.

Return Values

ERROR_SUCCESS
The operation was successful.
ERROR_MORE_DATA
The buffer pointed to by lpbData is not large enough to hold the data for the value. ClusterRegQueryValue stores the required size in the contents of lpcbData.
ERROR_NO_MORE_ITEMS
There are no more values.

Remarks

If lpbData is NULL, ClusterRegQueryValue returns ERROR_SUCCESS and stores the size of the value's data in the contents of lpcbData. This information allows the caller to correctly allocate a buffer to hold the data.

If lpdwValueType is set to REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ, then lpbData will also include a NULL terminator.

For more information, see the related Win32 function RegQueryValue.

QuickInfo

  Version: Use Windows NT Server Enterprise Edition 4.0.
  Windows CE: Unsupported.
  Header: Declared in clusapi.h.