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

◆ LsaOpenPolicy()

static SafeLsaPolicyHandle System.Security.Principal.Win32.LsaOpenPolicy ( string systemName,
PolicyRights rights )
inlinestaticpackage

Definition at line 9 of file Win32.cs.

10 {
11 global::Interop.OBJECT_ATTRIBUTES Attributes = default(global::Interop.OBJECT_ATTRIBUTES);
12 SafeLsaPolicyHandle PolicyHandle;
13 uint num = global::Interop.Advapi32.LsaOpenPolicy(systemName, ref Attributes, (int)rights, out PolicyHandle);
14 switch (num)
15 {
16 case 0u:
17 return PolicyHandle;
18 case 3221225506u:
19 throw new UnauthorizedAccessException();
20 case 3221225495u:
21 case 3221225626u:
22 throw new OutOfMemoryException();
23 default:
24 {
25 uint error = global::Interop.Advapi32.LsaNtStatusToWinError(num);
26 throw new Win32Exception((int)error);
27 }
28 }
29 }

Referenced by System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts(), and System.Security.Principal.NTAccount.TranslateToSids().