Partager via


3.1.1.4 32-Bit and 64-Bit Key Namespaces

A remote registry server on a 64-bit system MUST also have separate sets of 32-bit and 64-bit keys.

The 32-bit key namespace in the Data Store is named KEYS32. The 64-bit key namespace in the Data Store is named KEYS64.

The remote registry server indicates to clients that it supports both 64-bit and 32-bit key namespaces by setting the value of the lpdwVersion parameter of the BaseRegGetVersion method. If the server sets the value of lpdwVersion to 6, the server MUST support both 32-bit and 64-bit key namespaces.

The remote registry server MUST support the separate 32-bit and 64-bit key namespace for only a subset of keys in the complete registry key hierarchy. The 32-bit key namespace MUST be stored as a subkey within the 64-bit key namespace as specified in the following table.

Subset 32-bit Key

Storage Path in 64-bit Key Namespace

HKEY_LOCAL_MACHINE\Software

HKEY_LOCAL_MACHINE\Software\Wow6432Node

HKEY_USERS\*\Software

HKEY_USERS\*\Software\Wow6432Node

HKEY_LOCAL_MACHINE\Software\Classes

HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node

HKEY_USERS\*\Software\Classes

HKEY_USERS\*\Software\Classes\Wow6432Node

An * indicates that the server MUST support the 32-bit key namespace for each immediate subkey of HKEY_USERS.

The server MUST also maintain a symbolic link between HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes and HKEY_LOCAL_MACHINE\Software\Classes\Wow6432node. All server operations (for example, BaseRegOpenKey, BaseRegCreateKey, and BaseRegSetValue) enacted against HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes MUST be redirected to HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node.

Remote registry server clients specify on which namespace (32-bit or 64-bit) a method operates by using the parameter of REGSAM type on methods that operate on registry keys, including: BaseRegOpenKey, BaseRegCreateKey, and BaseRegDeleteKeyEx.

The following two bit fields in the REGSAM type allow the client to indicate on which namespace (32-bit or 64-bit) the method operates.

Value

Meaning

0x00000100

(KEY_WOW64_64KEY) When set, indicates that the registry method operates on the 64-bit key namespace.

0x00000200

(KEY_WOW64_32KEY) When set, indicates that the registry method operates on the 32-bit key namespace.

The server SHOULD<6> ignore client requests to operate on the 32-bit key namespace and instead operate only on the 64-bit key namespace for an implementation-specific set of FQN registry key paths. Remote registry clients SHOULD<7> specify which key namespace to operate on using the KEY_WOW64_64KEY and KEY_WOW64_32KEY bit flags in any remote registry method that has a parameter of type REGSAM.

If neither KEY_WOW64_64KEY or KEY_WOW64_32KEY are set, the server MUST operate on the 64-bit key namespace. If both KEY_WOW64_64KEY and KEY_WOW64_32KEY are set for any method that has a samDesired parameter, the server SHOULD<8> fail the method and return ERROR_INVALID_PARAMETER.

If the server does not support a 64-bit key namespace, any request made with KEY_WOW64_64KEY set MUST fail and return ERROR_ACCESS_DENIED. Similarly, any request made with both KEY_WOW64_64KEY and KEY_WOW64_32KEY set on a server that does not support a 64-bit key namespace MUST fail and return ERROR_ACCESS_DENIED.

Remote registry servers that support both 32-bit and 64-bit keys MAY<9> copy updates to any key or value from the 32-bit key namespace to the 64-bit key namespace and vice versa for an implementation-specific set of registry keys. The aforementioned sets of registry keys MUST be the same. The copy operation SHOULD be performed immediately, but MAY<10> be postponed until the handle to the key is closed with the BaseRegCloseKey method.

Remote registry servers that set the value of the lpdwVersion parameter of the BaseRegGetVersion method to any value less than 6 MUST NOT support a 64-bit key namespace.