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