PROPID_M_SENDERID

The PROPID_M_SENDERID property identifies who sent the message.

Type Indicator
VT_VECTOR | VT_UI1
PROPVARIANT Field
caub
Property Values
An array of bytes generated by MSMQ.

Remarks

The PROPID_M_SENDERID property is used primarily by MSMQ security to authenticate messages when they are retrieved from the queue. For information on authenticating messages, see Sending Authenticated Messages.

The PROPID_M_SENDERID property is also used internally to verify that the sender has access rights to the queue. The receiving Queue Manager performs this verification when it receives the message.

When a message is sent (and PROPID_M_SENDERID_TYPE is not set to MQMSG_SENDERID_TYPE_NONE), MSMQ attaches PROPID_M_SENDERID to the message.

Receiving applications can pass PROPID_M_SENDERID to MQReceiveMessage to verify who sent a message. To find out the length of the buffer needed for the sender identifier, peek at the message by calling MQReceiveMessage (specifying PROPID_M_SENDERID_LEN) to find out the length of the sender identifier. Then call MQReceiveMessage again (specifying PROPID_M_SENDERID), setting the caub.cElems field of PROPID_M_SENDERID to the actual length returned by the first call to MQReceiveMessage.

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQReceiveMessage, PROPID_M_SENDERID_LEN, PROPID_M_SENDERID_TYPE