3.1.4.2.66 ApiGetNotify (Opnum 65)

(Protocol Version 3) The ApiGetNotify method instructs the server to retrieve the first queued event indication from the designated version 1 notification port. The server MUST NOT complete this method until an indication has been queued to the port or the port has been closed through a separate call to the ApiUnblockGetNotifyCall (section 3.1.4.2.107) method or the ApiCloseNotify (section 3.1.4.2.57) method.

The server MUST NOT return the following CLUSTER_CHANGE (section 2.2.2.7) enumeration values in the dwFilter parameter: CLUSTER_CHANGE_REGISTRY_SUBTREE, CLUSTER_CHANGE_CLUSTER_STATE, or CLUSTER_CHANGE_HANDLE_CLOSE. The server SHOULD<80> return the value CLUSTER_CHANGE_CLUSTER_RECONNECT in each case where the server fails to return one or more event indications on the port. How and when the server fails to return an event indication is implementation-specific.

The server SHOULD accept an ApiGetNotify 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.

The server SHOULD accept an ApiGetNotify request if the client's access level is at least "Read" (section 3.1.4).

 error_status_t ApiGetNotify(
   [in] HNOTIFY_RPC hNotify,
   [out] DWORD *dwNotifyKey,
   [out] DWORD *dwFilter,
   [out] DWORD *dwStateSequence,
   [out, string] LPWSTR *Name,
   [out] error_status_t *rpc_status
 );

hNotify: An HNOTIFY_RPC (section 2.2.1.6) context handle that was obtained in a previous ApiCreateNotify (section 3.1.4.2.56) method call.

dwNotifyKey: The address of a 32-bit integer that the server MUST write upon successful completion of this method. The value was supplied as the dwNotifyKey parameter in a previous call to one of the following methods: ApiAddNotifyCluster (section 3.1.4.2.58), ApiAddNotifyNode (section 3.1.4.2.59), ApiAddNotifyGroup (section 3.1.4.2.60), ApiAddNotifyResource (section 3.1.4.2.61), ApiAddNotifyKey (section 3.1.4.2.62), ApiAddNotifyNetwork (section 3.1.4.2.90), ApiAddNotifyNetInterface (section 3.1.4.2.99), ApiReAddNotifyNode (section 3.1.4.2.63), ApiReAddNotifyGroup (section 3.1.4.2.64), ApiReAddNotifyResource (section 3.1.4.2.65), ApiReAddNotifyNetwork (section 3.1.4.2.91), or ApiReAddNotifyNetInterface (section 3.1.4.2.100).

dwFilter: The address of a 32-bit integer value that the server MUST write upon successful completion of this method, which contains the CLUSTER_CHANGE (section 2.2.2.7) enumeration value, as specified in section 2.2.2.7, indicating the type of event. The value MUST match one or more filter blocks that were provided in a previous call to one of the following methods: ApiAddNotifyCluster, ApiAddNotifyNode, ApiAddNotifyGroup, ApiAddNotifyResource, ApiAddNotifyKey, ApiAddNotifyNetwork, ApiAddNotifyNetInterface, ApiReAddNotifyNode, ApiReAddNotifyGroup, ApiReAddNotifyResource, ApiReAddNotifyNetwork, or ApiReAddNotifyNetInterface.

dwStateSequence: The address of a 32-bit integer value that the server MUST write upon successful completion of this method. The client MUST retain this value for reuse when calling any of the following methods: ApiReAddNotifyNode, ApiReAddNotifyGroup, ApiReAddNotifyResource, ApiReAddNotifyNetwork, or ApiReAddNotifyNetInterface.

Name: The address of a pointer where the server MUST write, upon successful completion of this method, the address of a Unicode string buffer that contains the name of the object to which the event pertains. If a name is not associated with the event, then the buffer contains the null Unicode string.

rpc_status: A 32-bit integer used to indicate success or failure. The RPC runtime MUST indicate, by writing to this parameter, whether it succeeded in executing this method on the server. The encoding of the value passed in this parameter MUST conform to encoding for comm_status and fault_status, as specified in Appendix E of [C706].

Return Values: The method MUST return the following error codes for the specified conditions.

Return value/code

Description

0x00000000

ERROR_SUCCESS

Success.

0x00000006

ERROR_INVALID_HANDLE

The data that is pointed to by the hNotify parameter does not represent a valid HNOTIFY_RPC (section 2.2.1.6) context handle.

0x00000103

ERROR_NO_MORE_ITEMS

The notify port represented by the hNotify parameter has been closed.

0x00000001

ERROR_INVALID_FUNCTION

Either the ApiCloseNotify (section 3.1.4.2.57) method or the ApiUnblockGetNotifyCall (section 3.1.4.2.107) method has been called in another thread. The client SHOULD kill the notification thread.

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 3.2.4.6 as recoverable errors and initiate the reconnect procedure as specified in section 3.2.4.6.