Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OpenThreadToken() [3/3]

static bool Interop.Advapi32.OpenThreadToken ( TokenAccessLevels desiredAccess,
WinSecurityContext openAs,
out SafeAccessTokenHandle tokenHandle )
inlinestaticpackage

Definition at line 367 of file Interop.cs.

368 {
369 bool bOpenAsSelf = true;
370 if (openAs == WinSecurityContext.Thread)
371 {
372 bOpenAsSelf = false;
373 }
374 if (OpenThreadToken(Kernel32.GetCurrentThread(), desiredAccess, bOpenAsSelf, out tokenHandle))
375 {
376 return true;
377 }
378 if (openAs == WinSecurityContext.Both)
379 {
380 bOpenAsSelf = false;
381 if (OpenThreadToken(Kernel32.GetCurrentThread(), desiredAccess, bOpenAsSelf, out tokenHandle))
382 {
383 return true;
384 }
385 }
386 return false;
387 }
static bool OpenThreadToken(IntPtr ThreadHandle, TokenAccessLevels dwDesiredAccess, bool bOpenAsSelf, out SafeTokenHandle phThreadToken)

References Interop.Kernel32.GetCurrentThread(), and Interop.Advapi32.OpenThreadToken().