7.7 WFMOpenKey

HRESULT WFMOpenKey ( hKey, lpszSubKey, phkResult )

Opens the specified key.

Parameters HKEY hKey

Handle to a currently open key, or the predefined handle value:
WFS_CFG_HKEY_XFS_ROOT
The key opened by this function is a subkey of the key identified by this parameter.

LPSTR lpszSubKey

Pointer to a null-terminated string containing the name of the key to be opened. If this parameter is NULL, or points to an empty string, the function opens another handle to the key identified by the hKey parameter (and does not close any previously opened handles).

PHKEY phkResult

Pointer to a variable that receives the handle of the opened key.

Comments In contrast with the WFMCreateKey function, this function does not create the specified key if it does not exist.

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions.

WFS_ERR_CFG_INVALID_HKEY
The specified hKey parameter does not correspond to a currently open key.
WFS_ERR_CFG_INVALID_SUBKEY
The key specified by lpszSubKey does not exist.
WFS_ERR_INVALID_POINTER
A pointer parameter does not point to accessible memory.