3.1.4.3 R_QMCloseRemoteQueueContext (Opnum 3)

The R_QMCloseRemoteQueueContext method closes a remote queue handle originally obtained from R_QMOpenRemoteQueue (section 3.1.4.2).

 void R_QMCloseRemoteQueueContext(
   [in, out] PCTX_OPENREMOTE_HANDLE_TYPE* pphContext
 );

pphContext:  An RPC context handle as defined in [MS-RPCE] section 2. This handle MUST have been acquired from the pphContext parameter of the R_QMOpenRemoteQueue method.

Return Values: None.

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:

  • Locate the RemoteQueueOpenContextHandle (section 3.1.1.8) ADM element instance in the iRemoteQueueOpenContextHandleTable (section 3.1.1.7) of the server where the value of the Handle attribute of the RemoteQueueOpenContextHandle ADM element instance equals pphContext.

  • If no such RemoteQueueOpenContextHandle ADM element instance exists, take no further action and immediately return.

  • Declare iLocatedRemoteQueueOpenContextHandle and set it to a reference to the located RemoteQueueOpenContextHandle ADM element instance.

  • If iLocatedRemoteQueueOpenContextHandle. OpenQueueDescriptorReference.RemoteReadState is Opened:

    • Generate a Close Queue ([MS-MQDMPR] section 3.1.7.1.6) event with the following argument value:

      • iQueueDesc := iLocatedRemoteQueueOpenContextHandle.OpenQueueDescriptorReference

  • Delete the iLocatedRemoteQueueOpenContextHandle from iRemoteQueueOpenContextHandleTable.

  • Set the pphContext parameter to NULL.