Partager via


MSMQQueueInfo.IsWorldReadable2

 

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

(Introduced in MSMQ 3.0.) The IsWorldReadablel2 property of the MSMQQueueInfo object indicates whether all members of the Everyone group can read the messages in the queue.

IsWorldReadable2 is a Boolean property that supersedes the non-Boolean MSMQQueueInfo.IsWorldReadable property.

Data type: Boolean
Run-time access: Read-only
Property IsWorldReadable2 As Boolean  

Property Value

A Boolean set to one of the following values:

True (-1)

All members of the Everyone group can read messages in the queue and its queue journal.

False (0)

Default. Only the owner of the queue can read the messages in the queue.

Remarks

Message Queuing initially sets the IsWorldReadable2 property based on setting of the MSMQQueueInfo.IsWorldReadable argument of the MSMQQueueInfo.Create call when the queue is created. After the queue is created, Message Queuing resets IsWorldReadable2 whenever the security descriptor of the queue is changed to allow or disallow read access to all members of the Everyone group. For information on security descriptors and access control, see Access Control.

This property has no effect on sending messages to the queue.

IsWorldReadable2 supersedes MSMQQueueInfo.IsWorldReadable and should be used whenever possible. IsWorldReadable2 returns Boolean values that are consistent with the Microsoft® Visual Basic® Boolean data type. Otherwise, both properties are functionally equivalent.

To retrieve the IsWorldReadable2 property of an existing queue, your application must first obtain an MSMQQueueInfo object that represents the queue. This object can be returned by a query using the MSMQQuery.LookupQueue method or created by the sending or receiving application.

Before using an application-created MSMQQueueInfo object, the application must initialize it to reference the queue by setting its MSMQQueueInfo.PathName or MSMQQueueInfo.FormatName property. For public queues, setting the FormatName property with a cached public format name instead of the PathName property frees Message Queuing from the need to retrieve information stored in the directory service to generate this format name. Direct format names can be used only for local private queues.

To retrieve the stored value of the IsWorldReadable2 property for a queue, call the MSMQQueueInfo.Refresh method and inspect the IsWorldReadable2 property. For public queues, the IsWorldReadable2 property is stored in the directory service. For private queues, this information is stored on the local computer. The property values of the MSMQQueueInfo object are not updated with the values stored by Message Queuing until the MSMQQueueInfo.Refresh method is called.

In C++ COM applications, you must use a smart pointer to the IMSMQQueueInfo3 interface to expose the IsWorldReadable2 property.

Equivalent API Function Property

There is no equivalent API function property.

Example Code

The following example is included in Using Message Queuing.

For an example of See
Retrieving the IsWorldReadable2 property Visual Basic Code Example: Retrieving MSMQQueueInfo.IsWorldReadable2

Requirements

Windows NT/2000/XP: Included in Windows XP and Windows Server 2003.

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

MSMQQueueInfo
MSMQQueueInfo.Create
MSMQQueueInfo.IsWorldReadable