The R_MoveMessage method moves a message from one queue to another.<20> The source and destination queues MUST be related as follows:

hBind: MUST be an RPC binding handle parameter, as specified in [MS-RPCE] section 2.

phContextFrom: MUST be set by the client to a QUEUE_CONTEXT_HANDLE_NOSERIALIZE (section 2.2.4.1) handle representing the source queue. The handle MUST have been returned by the server in the pphQueue output parameter of a prior call to the R_OpenQueue (Opnum 2) (section 3.1.4.2) method with the dwAccess parameter set to RECEIVE_ACCESS and MUST NOT have been closed through a prior call to the R_CloseQueue (Opnum 3) (section 3.1.4.3) method. This value MUST NOT be NULL.

ullContextTo: MUST be set by the client to a QUEUE_CONTEXT_HANDLE_NOSERIALIZE handle representing the destination queue. The handle MUST have been returned by the server in the pMoveContext output parameter of a prior call to the R_OpenQueueForMove (Opnum 11) (section 3.1.4.11) method and MUST NOT have been closed through a prior call to the R_CloseQueue method. This value MUST NOT be NULL.

LookupId: MUST be set by the client to the lookup identifier of the message to be moved.

pTransactionId: MUST be set by the client as a pointer to a transaction identifier or to a zero value XACTUOW ([MS-MQMQ] section 2.2.18.1.8) structure. If the destination queue is not a transactional queue, this value MUST be a pointer to a zero value XACTUOW structure. If the value of the field is not zero, the transaction identifier MUST have been registered with the server through a prior call to the R_QMEnlistRemoteTransaction (Opnum 12) (section 3.1.4.12) method and MUST NOT be NULL.

Return Values: On success, this method MUST return MQ_OK (0x00000000).

If an error occurs, the server MUST return a failure HRESULT, and the client treat all failure HRESULTs identically.

Exceptions Thrown:

No exceptions are thrown except those thrown by the underlying RPC protocol, as specified in [MS-RPCE].

The R_MoveMessage method provides both transactional and non-transactional operations. When using a transaction identifier, this method provisionally moves a message from the source queue to the destination queue, pending notification of the transaction outcome. See section 3.1.6. The non-transactional operation moves a message from the source queue to the destination queue without enlisting in a transaction.

When processing this call, the server MUST: