The PROPID_M_PRIV_LEVEL property specifies the privacy level of the message to be sent.
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.
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.
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.
MQReceiveMessage, MQSendMessage, PROPID_M_ENCRYPTION_ALG, PROPID_Q_PRIV_LEVEL