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) 30static extern unsafe int __PInvoke(ushort* __lpSystemName_native, ushort* __lpName_native, global::Interop.Advapi32.LUID* __lpLuid_native); 468internal 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) 504static 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); 513internal 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) 564static 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; 92if (!Interop.Advapi32.LookupPrivilegeValue(null, privilege, out luid)) 164if (!Interop.Advapi32.OpenProcessToken( 204if (!Interop.Advapi32.DuplicateTokenEx( 208Interop.Advapi32.SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, 296Interop.Advapi32.RevertToSelf(); 397Interop.Advapi32.TOKEN_PRIVILEGE newState; 400newState.Privileges.Attributes = enable ? Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_ENABLED : Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_DISABLED; 402Interop.Advapi32.TOKEN_PRIVILEGE previousState = default; 406if (!Interop.Advapi32.AdjustTokenPrivileges( 410(uint)sizeof(Interop.Advapi32.TOKEN_PRIVILEGE), 423_initialState = ((previousState.Privileges.Attributes & Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_ENABLED) != 0); 484Interop.Advapi32.TOKEN_PRIVILEGE newState; 487newState.Privileges.Attributes = (_initialState ? Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_ENABLED : Interop.Advapi32.SEPrivileges.SE_PRIVILEGE_DISABLED); 489if (!Interop.Advapi32.AdjustTokenPrivileges(
System\Security\AccessControl\SecurityDescriptor.cs (1)
455if (!Interop.Advapi32.ConvertStringSdToSd(
System\Security\AccessControl\Win32.cs (6)
30if (!Interop.Advapi32.ConvertSdToStringSd(binaryForm, (uint)requestedRevision, (uint)si, out ByteArray, ref ByteArraySize)) 109errorCode = (int)Interop.Advapi32.GetSecurityInfoByName(name, (uint)resourceType, (uint)SecurityInfos, out SidOwner, out SidGroup, out Dacl, out Sacl, out ByteArray); 121errorCode = (int)Interop.Advapi32.GetSecurityInfoByHandle(handle, (uint)resourceType, (uint)SecurityInfos, &SidOwner, &SidGroup, &Dacl, &Sacl, &ByteArray); 166uint Length = Interop.Advapi32.GetSecurityDescriptorLength(ByteArray); 255errorCode = (int)Interop.Advapi32.SetSecurityInfoByName(name, (uint)type, unchecked((uint)securityInformation), OwnerBinary, GroupBinary, DaclBinary, SaclBinary); 267errorCode = (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))