void NativeMethods.IEffectivePermission.GetEffectivePermission(Guid pguidObjectType, IntPtr pUserSid, string pszServerName, IntPtr pSD, out ObjectTypeList[] ppObjectTypeList, out uint pcObjectTypeListLength, out uint[] ppGrantedAccessList, out uint pcGrantedAccessListLength)
 {
     System.Diagnostics.Debug.WriteLine(string.Format("GetEffectivePermission: {0}, {1}", pguidObjectType, pszServerName));
     if (pguidObjectType == Guid.Empty)
     {
         ppGrantedAccessList       = prov.GetEffectivePermission(pUserSid, pszServerName, pSD);
         pcGrantedAccessListLength = (uint)ppGrantedAccessList.Length;
         ppObjectTypeList          = new ObjectTypeList[] { ObjectTypeList.Self };
         pcObjectTypeListLength    = (uint)ppObjectTypeList.Length;
     }
     else
     {
         ppGrantedAccessList       = prov.GetEffectivePermission(pguidObjectType, pUserSid, pszServerName, pSD, out ppObjectTypeList);
         pcGrantedAccessListLength = (uint)ppGrantedAccessList.Length;
         pcObjectTypeListLength    = (uint)ppObjectTypeList.Length;
     }
 }
示例#2
0
 void IEffectivePermission.GetEffectivePermission(Guid pguidObjectType, PSID pUserSid, string pszServerName, IntPtr pSecDesc, out OBJECT_TYPE_LIST[] ppObjectTypeList, out uint pcObjectTypeListLength, out uint[] ppGrantedAccessList, out uint pcGrantedAccessListLength)
 {
     System.Diagnostics.Debug.WriteLine($"GetEffectivePermission: {pguidObjectType}, {pszServerName}");
     if (pguidObjectType == Guid.Empty)
     {
         ppGrantedAccessList       = prov.GetEffectivePermission(pUserSid, pszServerName, pSecDesc);
         pcGrantedAccessListLength = (uint)ppGrantedAccessList.Length;
         ppObjectTypeList          = new [] { OBJECT_TYPE_LIST.Self };
         pcObjectTypeListLength    = (uint)ppObjectTypeList.Length;
     }
     else
     {
         ppGrantedAccessList       = prov.GetEffectivePermission(pguidObjectType, pUserSid, pszServerName, pSecDesc, out ppObjectTypeList);
         pcGrantedAccessListLength = (uint)ppGrantedAccessList.Length;
         pcObjectTypeListLength    = (uint)ppObjectTypeList.Length;
     }
 }