LookupPrivilegeValue (advapi32)
Last changed: -194.118.130.251

.
Summary
TODO - a short description

C# Signature:

[DllImport("advapi32.dll")]
static extern bool LookupPrivilegeValue(string lpSystemName, string lpName,
   ref LUID lpLuid);

VB Signature:

Declare Function LookupPrivilegeValue Lib "advapi32.dll" (lpSystemName As String, _
   lpName As String, ByRef lpLuid As LUID) As Boolean

User-Defined Types:

LUID

PrivilegeNames

Notes:

Int64 could be used instead of LUID.

Tips & Tricks:

Please add some!

Sample Code:

        [DllImport("advapi32.dll")]
        public static extern bool LookupPrivilegeValue(string systemName, string privilegeName, ref LUID luid);

        public static bool LookupPrivilegeValue(string systemName, PrivilegeNames privilegeName, ref LUID luid)
        {
            return LookupPrivilegeValue(systemName, privilegeName.ToString(), ref luid);
        }

        public static LUID LookupPrivilegeValue(string systemName, PrivilegeNames privilegeName)
        {
            var luid = new LUID();
            return LookupPrivilegeValue(systemName, privilegeName, ref luid) ? luid : new LUID();
        }

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
LookupPrivilegeValueA on docs.microsoft.com LookupPrivilegeValueW on docs.microsoft.com