MSMQMessage.SenderId (Compact 2013)

3/26/2014

This property is an array of bytes that represents the identifier of the sending user. Typically, Message Queuing sets this property when the message is sent.

Syntax

HRESULT get_SenderId( 
  VARIANT* pvarSenderId 
);

Parameters

  • pvarSenderId
    An array of bytes generated by MSMQ.

Return Value

The following table describes common return values.

Value

Description

S_OK

Success

E_INVALIDARG

One or more arguments are invalid

E_NOTIMPL

The function contains no implementation

E_OUTOFMEMORY

Out of memory

Remarks

SenderId is set by MSMQ, and is used primarily by the receiving queue manager when authenticating a message. The receiving queue manager uses the sender identifier in this property to verify who sent the message and to verify that the sender has access rights to a queue.

By default, Message Queuing sets this property when a message is sent. However, Message Queuing will not attach the sender identifier to the message if the sending application has set MSMQMessage.SenderIdType to MQMSG_SENDERID_TYPE_NONE, indicating that the sending application does not want Message Queuing to validate who sent the message.

The receiving application can use SenderId to retrieve information about who sent the message. However, the information in SenderId is only trustworthy if the message was authenticated.

Requirements

Header

mqoai.h

Library

mqoa.lib

See Also

Reference

MSMQMessage
MSMQMessage.SenderIdType