The MQSetQueueSecurity function sets the access control security for the queue.
HRESULT APIENTRY MQSetQueueSecurity( LPCWSTR lpwcsFormatName, SECURITY_INFORMATION *SecurityInformation, PSECURITY_DESCRIPTOR *pSecurityDescriptor );
If access is denied, contact someone who has rights to modify the security descriptor.
Following are the default values for the security descriptor.
Default Value | Meaning |
Owner | The process user. |
Group | The process group. |
DACL | Full control for the process user. All processes of other users can get queue properties, get queue security, and send messages to the queue. |
SACL | None. |
The format name of the queue (specified by lpwcsFormatName) must be a public or private format name. MSMQ must be able to access MQIS (for public queues) or the local computer (for private queues) to get the queue's security descriptor.
If the format name of the queue is unknown, see Format Name to find ways to obtain a new format name.
The following access rights and privileges are required to change the queue's security descriptor.
Access Right/Privilege | Required To |
MQSEC_TAKE_QUEUE _OWNERSHIP |
Change the owner of the queue. This access right is equivalent to WRITE_OWNER as defined by the Win32 header files. |
SE_TAKE_OWNERSHIP _NAME |
Change the owner of the queue. This privilege can be used instead of having the MQSEC_TAKE_QUEUE_OWNERSHIP access on the queue. If a user has this privilege on the server, the user can change the owner of any public queue in the enterprise. If the user has this privilege on the local computer, the user can change the owner of any private queue. |
MQSEC_CHANGE_QUEUE _PERMISSIONS |
Change the queue's discretionary access control list (DACL) if the process is not the owner of the queue. This access right is equivalent to WRITE_DAC as defined by the Win32 header files. |
SE_SECURITY_NAME | Change the queue's system ACL (SACL); this privilege must be enabled for the calling process on MQIS for public queues and on the local computer for private queues. |
MQGetQueueSecurity cannot retrieve the security descriptor of a journal, dead letter, connector or foreign queues.
A public queue's security descriptor cannot be set by an independent client computer running offline. For information on offline operations, see MSMQ Offline Support.