18.104.22.168.62 ApiAddNotifyKey (Opnum 61)
(Protocol Version 2) The ApiAddNotifyKey method instructs the server to begin queuing event indications. Event indications correspond to internal clusterregistry state and configuration changes that map to a value in the designated filter of the designated version 1 notification port. Indications are queued for the cluster registry key represented by the designated context handle.
The server MUST monitor the designated key for changes in the key, its security descriptor, or any of its values, and post the corresponding CLUSTER_CHANGE event indication. If the WatchSubTree parameter is set to TRUE, the server MUST extend the scope of monitoring to all subkeys and to their security descriptors and values under the designated key, and post individual event indications for each detected change.
The server SHOULD accept an ApiAddNotifyKey request if its protocol server state is read-only and MUST accept the request for processing if it is in the read/write state, as specified in section 3.1.1.
error_status_t ApiAddNotifyKey( [in] HNOTIFY_RPC hNotify, [in] HKEY_RPC hKey, [in] DWORD dwNotifyKey, [in] DWORD dwFilter, [in] BOOL WatchSubTree );
hKey: A pointer to an HKEY_RPC (section 22.214.171.124) context handle that was obtained in a previous ApiGetRootKey (section 126.96.36.199.29), ApiCreateKey (section 188.8.131.52.30) or ApiOpenKey (section 184.108.40.206.31) method call that indicates the key in the cluster registry that is monitored for changes.
dwNotifyKey: A 32-bit integer context value chosen by the client. This value MUST be returned to the client via a subsequent completion of the ApiGetNotify (section 220.127.116.11.66) method, if the name of the object pertaining to the event matches the name of the object designated by hKey (the second parameter).
dwFilter: A 32-bit integer containing one or more registry-specific values in a CLUSTER_CHANGE (section 18.104.22.168) enumeration. The value of this parameter MUST be set to the bitwise OR operator of one or more of the following values: CLUSTER_CHANGE_REGISTRY_NAME, CLUSTER_CHANGE_REGISTRY_ATTRIBUTES, or CLUSTER_CHANGE_REGISTRY_VALUE.
WatchSubTree: A Boolean value where TRUE indicates that a change in any subkeys and/or values under the specified cluster registry key will cause event indications to be queued when a change corresponding to the appropriate filter has been detected.
Return Values: The method MUST return the following error codes for the specified conditions.
Return value/code Description
The data that is pointed to by the hNotify parameter or the hKey parameter does not respectively represent a valid HNOTIFY_RPC (section 22.214.171.124) or HKEY_RPC (section 126.96.36.199) context handle.
For any other condition, this method MUST return a value that is not one of the values listed in the preceding table. The client MUST behave in one consistent, identical manner for all values that are not listed in the preceding table. The client SHOULD treat errors specified in section 188.8.131.52 as recoverable errors and initiate the reconnect procedure as specified in section 184.108.40.206.