The R_SetUserAcknowledgementClass method sets the acknowledgment class property of a message in the queue. This allows marking the message as rejected.<30> This method MUST be called subsequent to calls to R_StartTransactionalReceive and R_EndTransactionalReceive (Opnum 15) (section 3.1.4.15) and before the transaction is committed or aborted.

 HRESULT R_SetUserAcknowledgementClass(
   [in] handle_t hBind,
   [in] QUEUE_CONTEXT_HANDLE_NOSERIALIZE phContext,
   [in] ULONGLONG LookupId,
   [in] USHORT usClass
 );

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

phContext: MUST be set by the client to a QUEUE_CONTEXT_HANDLE_NOSERIALIZE handle representing the queue containing the message on which to set the acknowledgment class. 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 MQ_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.

LookupId: MUST be set by the client to the lookup identifier of the message on which to set the acknowledgment class.

usClass: The acknowledgment class to set. It MUST be set by the client to one of the following values.

Value

Meaning

0x0000

No-op. No change is made to the acknowledgment class.

MQMSG_CLASS_NACK_RECEIVE_REJECTED

0xC004

Marks the message as rejected.

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 MUST treat all failure HRESULTs identically.

MQ_OK (0x00000000)

MQ_ERROR_INVALID_HANDLE (0xC00E0007)

MQ_ERROR_TRANSACTION_USAGE (0xC00E0050)

MQ_ERROR_MESSAGE_NOT_FOUND (0xC00E0088)

Exceptions Thrown:

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

When processing this call, the server MUST do the following: