2.2.2.2 MQSHARE

The MQSHARE enumeration defines values that indicate the requested exclusivity level when opening a Queue. When a queue is opened for exclusive access, other clients of this protocol MUST NOT be permitted to open the same queue. Also, a client of this protocol MUST NOT acquire exclusive access to a queue that is already opened by another client.

 typedef enum 
 {
   MQ_DENY_NONE = 0,
   MQ_DENY_RECEIVE_SHARE = 1
 } MQSHARE;

MQ_DENY_NONE:  This value indicates that the Queue is to be opened for nonexclusive access. If any OpenQueueDescriptor that refers to the Queue has a ShareMode value of DenyReceive, the IMSMQQueueInfo4::Open method MUST return an error HRESULT. The ShareMode property of the OpenQueueDescriptor that was created by the Open method MUST be set to DenyNone. This value maps to the QueueShareMode enumeration constant of DenyNone, as defined in [MS-MQDMPR] section 3.1.1.17.

MQ_DENY_RECEIVE_SHARE:  The Queue MUST be opened for exclusive access. If any OpenQueueDescriptor already refers to the Queue, the Open method MUST return an error HRESULT. If the Queue is opened successfully, the ShareMode property of the OpenQueueDescriptor MUST be set to DenyReceive. This value maps to the QueueShareMode enumeration constant of DenyReceive as defined in [MS-MQDMPR], section 3.1.1.17.

Note the difference between MQSHARE and MQACCESS:

  • MQSHARE specifies whether a client has exclusive access to a queue, thereby making the queue inaccessible to other clients.

  • MQACCESS determines the access to messages in a queue, such as read-only or read/write access to messages.

Used by:

  • IMSMQQueueInfo::Open