PROPID_M_PRIV_LEVEL

The PROPID_M_PRIV_LEVEL property specifies the privacy level of the message to be sent.

Type Indicator
VT_UI4 (or VT_NULL)
PROPVARIANT Field
ulVal
Property Values
This property can be set to one or more of the following values:
MQMSG_PRIV_LEVEL_BODY
Privacy is enforced. End-to-end encryption of the message body is used.
MQMSG_PRIV_LEVEL_NONE
The default. No privacy. The message body is sent as clear text.

Remarks

MSMQ can send private messages throughout the MSMQ enterprise. For a discussion on privacy issues, see Private Messages. For a complete example of sending private messages (including creating a queue that can only accept private messages), see Sending Private Messages.

To send a private message, pass PROPID_M_PRIV_LEVEL to MQSendMessage. If PROPID_M_PRIV_LEVEL is set to MQMSG_PRIV_LEVEL_BODY, the body of the message is encrypted using the algorithm specified by PROPID_M_ENCRYPTION_ALG.

To find out if a message was sent encrypted, pass PROPID_M_PRIV_LEVEL to MQReceiveMessage and look at the returned value. When passing PROPID_M_PRIV_LEVEL to MQReceiveMessage, the corresponding VT field in the aPropVar array can be set to VT_NULL.

The target queue can also have its own privacy level (PROPID_Q_PRIV_LEVEL), indicating that it will only receive private (encrypted) messages. If the target queue forces privacy, non-encrypted messages will be rejected.

Example

This example shows how PROPID_M_PRIV_LEVEL is specified in the MQMSGPROPS structure:

MsgProps.aPropID[i] = PROPID_M_PRIV_LEVEL;          //PropId
MsgProps.aPropVar[i].vt = VT_UI4;                   //Type
MsgProps.aPropVar[i].ulVal = MQMSG_PRIV_LEVEL_BODY; //Value

For an example of using PROID_QM_MACHINE_ID, see Sending Private Messages.

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, MQSendMessage, PROPID_M_ENCRYPTION_ALG, PROPID_Q_PRIV_LEVEL