36 references to Advapi32
System.Security.AccessControl (36)
_generated\0\LibraryImports.g.cs (9)
7internal static partial bool LookupPrivilegeValue(string lpSystemName, string lpName, out global::Interop.Advapi32.LUID lpLuid) 14fixed (global::Interop.Advapi32.LUID* __lpLuid_native = &lpLuid) 29static extern unsafe int __PInvoke(ushort* __lpSystemName_native, ushort* __lpName_native, global::Interop.Advapi32.LUID* __lpLuid_native); 456internal static unsafe partial bool AdjustTokenPrivileges(global::Microsoft.Win32.SafeHandles.SafeTokenHandle TokenHandle, bool DisableAllPrivileges, global::Interop.Advapi32.TOKEN_PRIVILEGE* NewState, uint BufferLength, global::Interop.Advapi32.TOKEN_PRIVILEGE* PreviousState, uint* ReturnLength) 491static extern unsafe int __PInvoke(nint __TokenHandle_native, int __DisableAllPrivileges_native, global::Interop.Advapi32.TOKEN_PRIVILEGE* __NewState_native, uint __BufferLength_native, global::Interop.Advapi32.TOKEN_PRIVILEGE* __PreviousState_native, uint* __ReturnLength_native); 500internal static partial bool DuplicateTokenEx(global::Microsoft.Win32.SafeHandles.SafeTokenHandle ExistingTokenHandle, global::System.Security.Principal.TokenAccessLevels DesiredAccess, nint TokenAttributes, global::Interop.Advapi32.SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, global::System.Security.Principal.TokenType TokenType, ref global::Microsoft.Win32.SafeHandles.SafeTokenHandle DuplicateTokenHandle) 550static extern unsafe int __PInvoke(nint __ExistingTokenHandle_native, global::System.Security.Principal.TokenAccessLevels __DesiredAccess_native, nint __TokenAttributes_native, global::Interop.Advapi32.SECURITY_IMPERSONATION_LEVEL __ImpersonationLevel_native, global::System.Security.Principal.TokenType __TokenType_native, nint* __DuplicateTokenHandle_native);
System\Security\AccessControl\Privilege.cs (17)
16using Luid = Interop.Advapi32.LUID; 98if (!Interop.Advapi32.LookupPrivilegeValue(null, privilege, out luid)) 172if (!Interop.Advapi32.OpenProcessToken( 215if (!Interop.Advapi32.DuplicateTokenEx( 219Interop.Advapi32.SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, 310Interop.Advapi32.RevertToSelf(); 436Interop.Advapi32.TOKEN_PRIVILEGE newState; 439newState.Privileges.Attributes = enable ? Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_ENABLED : Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_DISABLED; 441Interop.Advapi32.TOKEN_PRIVILEGE previousState = default; 448if (!Interop.Advapi32.AdjustTokenPrivileges( 452(uint)sizeof(Interop.Advapi32.TOKEN_PRIVILEGE), 468this.initialState = ((previousState.Privileges.Attributes & Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_ENABLED) != 0); 538Interop.Advapi32.TOKEN_PRIVILEGE newState; 541newState.Privileges.Attributes = (this.initialState ? Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_ENABLED : Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_DISABLED); 543if (!Interop.Advapi32.AdjustTokenPrivileges(
System\Security\AccessControl\SecurityDescriptor.cs (1)
617if (!Interop.Advapi32.ConvertStringSdToSd(
System\Security\AccessControl\Win32.cs (6)
33if (!Interop.Advapi32.ConvertSdToStringSd(binaryForm, (uint)requestedRevision, (uint)si, out ByteArray, ref ByteArraySize)) 121errorCode = (int)Interop.Advapi32.GetSecurityInfoByName(name, (uint)resourceType, (uint)SecurityInfos, out SidOwner, out SidGroup, out Dacl, out Sacl, out ByteArray); 133errorCode = (int)Interop.Advapi32.GetSecurityInfoByHandle(handle, (uint)resourceType, (uint)SecurityInfos, &SidOwner, &SidGroup, &Dacl, &Sacl, &ByteArray); 183uint Length = Interop.Advapi32.GetSecurityDescriptorLength(ByteArray); 278errorCode = (int)Interop.Advapi32.SetSecurityInfoByName(name, (uint)type, unchecked((uint)securityInformation), OwnerBinary, GroupBinary, DaclBinary, SaclBinary); 290errorCode = (int)Interop.Advapi32.SetSecurityInfoByHandle(handle, (uint)type, (uint)securityInformation, OwnerBinary, GroupBinary, DaclBinary, SaclBinary);
System\Security\Principal\Win32.cs (3)
25if (!Interop.Advapi32.OpenThreadToken((IntPtr)(-2), dwDesiredAccess, openAsSelf, out phThreadToken)) 32if (!Interop.Advapi32.OpenThreadToken((IntPtr)(-2), dwDesiredAccess, openAsSelf, out phThreadToken)) 52if (!Interop.Advapi32.SetThreadToken(IntPtr.Zero, hToken))