MSMQQueueInfo.PrivLevel (Compact 2013)

3/26/2014

This property specifies whether the queue accepts private (encrypted) messages, nonprivate messages, or both.

Syntax

HRESULT get_PrivLevel( 
  long* plPrivLevel 
);
HRESULT put_PrivLevel( 
  long lPrivLevel
);

Parameters

  • plPrivLevel or lPrivLevel
    Specifies whether the queue accepts private messages, nonprivate messages, or both. The following table shows the possible values.

    Value

    Description

    MQ_PRIV_LEVEL_NONE

    The queue accepts only nonprivate (clear) messages.

    MQ_PRIV_LEVEL_BODY

    The queue accepts only private (encrypted) messages.

    MQ_PRIV_LEVEL_OPTIONAL

    The default. The queue does not force privacy.

    It accepts private (encrypted) messages and nonprivate (clear) messages.

Return Value

The following table describes the 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

The application can set the privacy level of queues and messages.

If the privacy level of the message does not correspond to the privacy level of the queue, the message is rejected by the queue.

If the sending application requested a negative acknowledgment message when it sent the message, MQMSG_CLASS_BAD_ENCRYPTION is returned to the sending application to indicate the message was rejected.

Setting and Retrieving the Privacy Level

To specify the privacy level when creating the queue, set MSMQQueueInfo.PrivLevel and call the MSMQQueueInfo.Create method.

To reset the privacy level of an open queue, set MSMQQueueInfo.PrivLevel to a new level and call the MSMQQueueInfo.Update method.

This method updates the queue information stored by Message Queuing.

For public queues, this information is stored in the directory service.

To retrieve the stored privacy level of a queue, call the MSMQQueueInfo.Refresh method and inspect the MSMQQueueInfo.PrivLevel property.

Encrypting messages

Private messages can be encrypted in two ways.

  • By the sending queue manager
  • By the sending application

Equivalent Function property

When using functions, the privacy level of the queue can be set and retrieved using the PROPID_Q_PRIV_LEVEL property.

Requirements

Header

mqoai.h

Library

mqoa.lib

See Also

Reference

MSMQQueueInfo