Optional. The PROPID_Q_AUTHENTICATE property specifies whether or not the queue accepts only authenticated messages.
If the authentication level of the message (PROPID_M_AUTH_LEVEL) does not match the authentication level of the queue, the queue rejects the message. (For information on how MSMQ authenticates messages, see Message Authentication.)
When a message is rejected because the authentication levels of the queue and the message do not match and the sending application requested negative acknowledgment messages, a negative acknowledgment message with the message class MQMSG_CLASS_NACK_BAD_SIGNATURE is returned to the sending application. Negative acknowledgment messages are requested when the message is sent.
To set the initial authentication level of a new queue, specify PROPID_Q_AUTHENTICATE in the MQQUEUEPROPS structure and call MQCreateQueue.
To set the authentication level of an existing queue, specify PROPID_Q_AUTHENTICATE in the MQQUEUEPROPS structure and call MQSetQueueProperties. When changing the authentication level of the queue, the new setting impacts only arriving messages; it does not affect messages already in the queue.
To retrieve the authentication level of an existing queue, specify PROPID_Q_AUTHENTICATE in the MQQUEUEPROPS structure, and then call MQGetQueueProperties and examine its returned value.
The receiving application can also determine if a message was authenticated by checking the message's PROPID_M_AUTHENTICATED property.
This example shows how PROPID_Q_AUTHENTICATE is specified in the MQQUEUEPROPS structure for both setting and retrieving the queue's authentication level.
//To set the authentication level
aPropID[i] = PROPID_Q_AUTHENTICATE; // Property identifier
aVariant[i].vt = VT_UI1; // Type indicator
aVariant[i].bVal = MQ_AUTHENTICATE; // Authentication level of queue
i++
//To retrieve the authentication level
aPropID[i] = PROPID_Q_AUTHENTICATE; // Property identifier
aVariant[i].vt = VT_UI1; // Type indicator
i++
For complete examples of… | See… |
---|---|
Creating a public or private queue | Creating a Queue |
Retrieving the authentication level of the queue | Retrieving PROPID_Q_AUTHENTICATE |
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.
MQCreateQueue, MQGetQueueProperties, MQSetQueueProperties, PROPID_M_AUTH_LEVEL, PROPID_M_AUTHENTICATED