7.2 WFMCreateKey

HRESULT WFMCreateKey ( hKey, lpszSubKey, phkResult, lpdwDisposition )

Creates a new key, or if the specified key exists, opens it.

Parameters HKEY hKey

Handle to a currently open key, or the predefined handle value:
WFS_CFG_HKEY_XFS_ROOT
The key opened or created 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 created or opened.

PHKEY phkResult

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

LPDWORD lpdwDisposition

Pointer to a variable that receives one of the disposition values:
WFS_CFG_CREATED_NEW_KEY
WFS_CFG_OPENED_EXISTING_KEY

Comments If this function creates a new key, it has no values. The WFMSetValue function is used to create values.

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_INVALID_POINTER
A pointer parameter does not point to accessible memory.