A client calls the rpc_ACCloseCursor method to close a cursor acquired from the rpc_ACCreateCursorEx (section 3.1.5.4) method of the qmcomm2 RPC interface.
HRESULT rpc_ACCloseCursor( [in] RPC_QUEUE_HANDLE hQueue, [in] DWORD hCursor );
hQueue: MUST contain the RPC_QUEUE_HANDLE (section 2.2.1.1.2) context handle passed to rpc_ACCreateCursorEx when the cursor specified by hCursor was created.
hCursor: MUST contain a DWORD value obtained from the pcc.hCursor out-parameter of rpc_ACCreateCursorEx, or the reserved value 0x0000000b.
Return Values: On success, this method MUST return MQ_OK (0x00000000); otherwise, the server MUST return a failure HRESULT,<54> and the client MUST treat all failure HRESULTs identically.
Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified in [MS-RPCE].
This method is invoked at the dynamically assigned endpoint returned by the R_QMGetRTQMServerPort (section 3.1.4.24) method when IP_HANDSHAKE (0x00000000) or IPX_HANDSHAKE (0x00000002) is the interface specified by the fIP parameter.
When processing this call, the server MUST:
If hCursor is 0x0000000b, take no further action and return MQ_OK (0x00000000).
Locate a LocalQueueContextHandle (section 3.1.1.3) ADM element instance in the server's iLocalQueueContextHandleTable (section 3.1.1.2) where the value of the Handle attribute of the LocalQueueContextHandle ADM element instance equals hQueue.
If such a LocalQueueContextHandle ADM element instance exists:
Declare iLocatedLocalQueueContextHandle and set it to a reference to the located LocalQueueContextHandle ADM element instance.
Locate a Cursor ([MS-MQDMPR] section 3.2) ADM element instance in iLocatedLocalQueueContextHandle.OpenQueueDescriptorReference.CursorCollection where the Handle attribute of the Cursor ADM element instance equals hCursor.
If no such Cursor ADM element instance exists, take no further action and return a failure HRESULT.
Generate a Close Cursor ([MS-MQDMPR] section 3.1.7.1.2) event with the following argument value:
iCursor := The Cursor ADM element instance located preceding.
Take no further action and return MQ_OK (0x00000000).
Else:
Locate a RemoteQueueProxyHandle (section 3.1.1.5) ADM element instance in the server's iRemoteQueueProxyHandleTable (section 3.1.1.4) where the value of the Handle attribute of the RemoteQueueProxyHandle ADM element instance equals hQueue.
If no such RemoteQueueProxyHandle ADM element instance exists, take no further action and return a failure HRESULT.
Declare iLocatedRemoteQueueProxyHandle and set it to a reference to the located RemoteQueueProxyHandle ADM element instance.
Locate a CursorProxy (section 3.1.1.6) ADM element instance in iLocatedRemoteQueueProxyHandle.CursorProxyCollection where the value of the Handle attribute of the CursorProxy ADM element instance equals hCursor.
If no such CursorProxy ADM element instance exists, take no further action and return a failure HRESULT.
Declare iLocatedCursorProxy and set it to a reference to the located CursorProxy ADM element instance.
Using the binding handle contained in iLocatedRemoteQueueProxyHandle.RemoteBindingHandle, invoke the RemoteQMCloseCursor method of the qm2qm RPC interface specified in [MS-MQQP] section 3.1.4.5 using the following parameter values:
hQueue := iLocatedRemoteQueueProxyHandle.RemoteContext
hCursor := iLocatedCursorProxy.RemoteCursorHandle
Delete iLocatedCursorProxy from iLocatedRemoteQueueProxyHandle.CursorProxyCollection.
Return the result from RemoteQMCloseCursor and take no further action.