3.2.4.7 Canceling a Pending Peek or Receive

The client MAY trigger this event while processing the Closing a Queue event as specified in section 3.2.4.9, to explicitly cancel all pending peek and receive operations on the queue, prior to closing the queue.

To cancel a pending peek or receive, the following inputs are expected:

A queue handle value acquired from the phQueue out parameter of the qmcomm:R_QMOpenRemoteQueue method, as specified in [MS-MQMP] section 3.1.4.2.

RequestId: The requestId that uniquely identifies the pending remote read operation.

The client MUST perform the following actions to process this event:

  • Find the PendingRemoteReadEntry, referred to as rPendingRemoteReadEntry, in the rPendingRemoteReadEntryCollection, where rPendingRemoteReadEntry.OpenQueueDescriptorHandle = QueueHandle, and rPendingRemoteReadEntry.RequestId = RequestId.

  • Call the RemoteQMCancelReceive method with the following:

    • hQueue set to QueueHandle.

    • pQueue set to the dwpQueue out parameter of the qmcomm:R_QMOpenRemoteQueue method, as specified in [MS-MQMP] section 3.1.4.2.

    • dwRequestID set to RequestId.

  • Remove the rPendingRemoteReadEntry element from rPendingRemoteReadEntryCollection.