C# Class NServiceBus.MessageQueueExtensions

Reads the Access Control Entries (ACE) from an MSMQ queue.
There is no managed API for reading the queue permissions, this has to be done via P/Invoke. by calling MQGetQueueSecurity API. See http://stackoverflow.com/questions/10177255/how-to-get-the-current-permissions-for-an-msmq-private-queue
Show file Open project: Particular/NServiceBus

Public Methods

Method Description
TryGetPermissions ( this queue, string user, MessageQueueAccessRights &rights ) : bool

Private Methods

Method Description
ConvertSidToStringSid ( [ pSID, IntPtr &ptrSid ) : bool
GetAce ( IntPtr pDacl, string sid ) : ACCESS_ALLOWED_ACE
GetAce ( IntPtr aclPtr, int aceIndex, IntPtr &acePtr ) : int
GetAclInformation ( IntPtr pAcl, ACL_SIZE_INFORMATION &pAclInformation, uint nAclInformationLength, ACL_INFORMATION_CLASS dwAclInformationClass ) : bool
GetLengthSid ( IntPtr pSID ) : int
GetPermissions ( string formatName, string sid ) : MessageQueueAccessRights
GetSecurityDescriptorDacl ( IntPtr pSD, bool &daclPresent, IntPtr &pDacl, bool &daclDefaulted ) : bool
GetSidForUser ( string username ) : string
MQGetQueueSecurity ( string formatName, int SecurityInformation, IntPtr SecurityDescriptor, int length, int &lengthNeeded ) : int

Method Details

TryGetPermissions() public static method

public static TryGetPermissions ( this queue, string user, MessageQueueAccessRights &rights ) : bool
queue this
user string
rights MessageQueueAccessRights
return bool