Condividi tramite


PROPID_MGMT_MSMQ_DSSERVER

 

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_MSMQ_DSSERVER property returns the name of the current DS server for the computer.

Property ID

PROPID_MGMT_MSMQ_DSSERVER

Type Indicator

VT_LPWSTR

MQPROPVARIANT Field

pwszVal

Property Value

String that contains the name of the DS server (a NULL string is returned if the queue manager on the computer specified is operating offline).

Remarks

To retrieve the name of the current DS server for the computer, include PROPID_MGMT_MSMQ_DSSERVER in the MQMGMTPROPS structure, call MQMgmtGetInfo, and then examine the value returned.

When specifying PROPID_MGMT_MSMQ_DSSERVER 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.

Equivalent COM Property

When using COM components, you can retrieve the name of the current DS server for a computer using the MSMQApplication.DirectoryServiceServer property.

Example Code

The following code fragment shows how PROPID_MGMT_MSMQ_DSSERVER is specified in arrays that can be used to initialize an MQMGMTPROPS structure.

aMgmtPropID[i] = PROPID_MGMT_MSMQ_DSSERVER;    // Property identifier  
aMgmtPropVar[i].vt = VT_NULL;                  // Type indicator  
i++;  

The following line of code shows how to free the memory allocated for the name of the DS server.

MQFreeMemory(aMgmtPropVar[i].pwszVal);  

See Also

Management Properties
MQFreeMemory
MQMgmtGetInfo
MSMQApplication.DirectoryServiceServer