PROPID_MGMT_QUEUE_LOCATION
Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista
(Read-only, introduced in MSMQ 3.0.) The PROPID_MGMT_QUEUE_LOCATION property indicates whether the queue is or is not located on the computer.
Property ID
PROPID_MGMT_QUEUE_LOCATION
Type Indicator
VT_LPWSTR
MQPROPVARIANT Field
pwszVal
Property Value
One of the following Unicode strings:
L"LOCAL" (MGMT_QUEUE_LOCAL_LOCATION)
The queue is located on the computer.
L"REMOTE" (MGMT_QUEUE_REMOTE_LOCATION)
The queue is not located on the computer, or the queue is a connector queue.
Remarks
To retrieve a string that indicates whether the queue is located on the computer, include PROPID_MGMT_QUEUE_LOCATION in the MQMGMTPROPS structure, and then call MQMgmtGetInfo.
This property can be retrieved only for an active queue. MQMgmtGetInfo will return a non-specific error (MQ_ERROR) if your application attempts to retrieve this information for a queue that does not contain messages and is not opened by an application.
When specifying PROPID_MGMT_QUEUE_LOCATION in the MQMGMTPROPS structure, set its type indicator to VT_NULL. During the function call, Message Queuing automatically changes the type indicator to VT_LPWSTR and creates the string buffer needed to receive the property value. After you no longer need the string buffer, you must free the memory allocated for it using MQFreeMemory.
The format name of an outgoing queue is also a format name of the corresponding destination queue. Thus, the value of PROPID_MGMT_QUEUE_LOCATION returned for an outgoing queue is determined by the location of the corresponding destination queue. This fact can be used to identify the outgoing queues included in the list of active queues on a specific computer returned in PROPID_MGMT_MSMQ_ACTIVEQUEUES. This is because the value of PROPID_MGMT_QUEUE_LOCATION returned for an active outgoing queue residing on the computer specified in a call to MQMgmtGetInfo will refer to the destination queue residing on a different computer and will be MGMT_QUEUE_REMOTE_LOCATION.
Equivalent COM Property
When using COM components, you can determine whether a queue is located on a specified computer using the MSMQManagement.IsLocal property.
Example Code
The following code fragment shows how PROPID_MGMT_QUEUE_LOCATION is specified in arrays that can be used to initialize an MQMGMTPROPS structure.
aMgmtPropID[i] = PROPID_MGMT_QUEUE_LOCATION; // Property identifier
aMgmtPropVar[i].vt = VT_NULL; // Type indicator
i++;
The following line of code shows how to free the memory allocated for the property value.
MQFreeMemory(aMgmtPropVar[i].pwszVal);
See Also
Management Properties
MQFreeMemory
MQMgmtGetInfo
MSMQManagement.IsLocal
PROPID_MGMT_MSMQ_ACTIVEQUEUES