The MQGetQueueProperties function retrieves the specified set of properties for a specific queue.
HRESULT APIENTRY MQGetQueueProperties(
LPCWSTR lpwcsFormatName,
MQQUEUEPROPS *pQueueProps
);
On input, the cProp member of MQQUEUEPROPS specifies the number of properties to be retrieved, and the aPropID array specifies the specific properties.
On output, the aPropVar array indicates the current values of the requested properties, and the optional aStatus array indicates their status (to use the property status array, include aStatus in MQQUEUEPROPS declaration).
To change access rights, call MQSetQueueSecurity.
The properties of a public queue can be retrieved at any time; however, you can only retrieve the properties of a private queue if it is located on your local computer.
If the format name of the queue is unknown, see Format Name to find ways to obtain a new format name.
To retrieve the queue's pathname (PROPID_Q_PATHNAME) or label (PROPID_Q_LABEL), the corresponding property's variant type must be initially set to VT_NULL so that MSMQ knows to allocate memory for the returned value. After using the retrieved value, the application must then call MQFreeMemory to free the memory allocated by MSMQ.
To retrieve the queue's identifier (PROPID_Q_INSTANCE) or type (PROPID_Q_TYPE), a buffer of type CLSID must be declared to hold the returned GUID.
A public queue's properties cannot be retrieved if there is no connection to Active Directory. This restriction applies to dependent client computers, independent client computers (working offline), and MSMQ routing servers (FRS).
For information on… | See… |
---|---|
Offline operations | MSMQ Offline Support |
A complete set of examples | Retrieving a Queue's Properties |
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.
MQFreeMemory, PROPID_Q_LABEL, PROPID_Q_PATHNAME