2.2.2.1 REMOTEREADDESC

This structure is used to encapsulate the information necessary to perform operations RemoteQMStartReceive, RemoteQMStartReceive2, and RemoteQMStartReceiveByLookupId.

 typedef struct _REMOTEREADDESC {
   DWORD hRemoteQueue;
   DWORD hCursor;
   DWORD ulAction;
   DWORD ulTimeout;
   [range(0, 4325376)] DWORD dwSize;
   DWORD dwQueue;
   DWORD dwRequestID;
   DWORD Reserved;
   DWORD dwArriveTime;
   REMOTEREADACK eAckNack;
   [unique, size_is(dwSize), length_is(dwSize)] 
     byte* lpBuffer;
 } REMOTEREADDESC;

hRemoteQueue: A handle to the queue as obtained from the phQueue parameter of the qmcomm:R_QMOpenRemoteQueue method, as specified in [MS-MQMP] section 3.1.4.2. This value is set by the client.

hCursor: If nonzero, specifies a handle to a cursor that MUST have been obtained from the phCursor parameter of the qmcomm:R_QMCreateRemoteCursor method, as specified in [MS-MQMP] section 3.1.4.4. This value is set by the client.

ulAction: The following table describes possible actions. The Peek and Receive operations both enable access to the contents of a message. This value is set by the client.

Value

Type/Meaning

MQ_ACTION_RECEIVE

0x00000000

Type = Receive

Reads and removes a message from the current cursor location if hCursor is nonzero or from the front of the queue if hCursor is set to zero.

MQ_ACTION_PEEK_CURRENT

0x80000000

Type = Peek

Reads a message from the current cursor location if hCursor is nonzero or from the front of the queue if hCursor is set to zero but does not remove it from the queue.

MQ_ACTION_PEEK_NEXT

0x80000001

Type = Peek

Reads a message following the message at the current cursor location but does not remove it from the queue.

MQ_LOOKUP_PEEK_CURRENT

0x40000010

Type = Peek

Reads the message specified by a lookup identifier but does not remove it from the queue.

MQ_LOOKUP_PEEK_NEXT

0x40000011

Type = Peek

Reads the message following the message specified by a lookup identifier but does not remove it from the queue.

MQ_LOOKUP_PEEK_PREV

0x40000012

Type = Peek

Reads the message preceding the message specified by a lookup identifier but does not remove it from the queue.

MQ_LOOKUP_RECEIVE_CURRENT

0x40000020

Type = Receive

Reads the message specified by a lookup identifier and removes it from the queue.

MQ_LOOKUP_RECEIVE_NEXT

0x40000021

Type = Receive

Reads the message following the message specified by a lookup identifier and removes it from the queue.

MQ_LOOKUP_RECEIVE_PREV

0x40000022

Type = Receive

Reads the message preceding the message specified by a lookup identifier and removes it from the queue.

ulTimeout: Specifies a time-out in milliseconds for the server to wait for a message to become available in the queue. This value is set by the client. To specify an infinite time-out, the client MUST set this field to 0xFFFFFFFF.

dwSize: Specifies the size, in bytes, of lpBuffer. The valid range is 0 to 0x00420000. This value is set by the server and MUST be set to 0 by the client.

dwQueue: A DWORD pointed to by the dwpQueue parameter of the qmcomm:R_QMOpenRemoteQueue method, as specified in [MS-MQMP] section 3.1.4.2. This value is set by the client.

dwRequestID: The client MUST set this member to a unique identifier for the receive request, which could later be used to identify and cancel the receive request. This value is set by the client. The client SHOULD NOT<6> reuse this identifier until a call to the RemoteQMEndReceive (Opnum 1) method or to the RemoteQMCancelReceive (Opnum 5) method has been made for that receive request.

Reserved: This is a reserved field of type DWORD that MUST be ignored.

Value

Meaning

0x00000000

Returned by client.

0x00000001

Returned by server.

dwArriveTime: The server MUST set this value to the time that the message was added to the queue. The time MUST be expressed as the number of seconds elapsed since 00:00:00.0, January 1, 1970 Coordinated Universal Time (UTC).

eAckNack: This is a reserved field and MUST be ignored by the client and the server.

lpBuffer: This field represents a pointer to a buffer containing the UserMessage Packet ([MS-MQMQ] section 2.2.20). The size of this field is specified by dwSize. This value is set by the server and MUST be set to NULL by the client.