Example #1
0
        public unsafe static LsaHandle LsaOpenLocalPolicy(PolicyAccessRights access)
        {
            LSA_OBJECT_ATTRIBUTES attributes = new LSA_OBJECT_ATTRIBUTES();

            Imports.LsaOpenPolicy(null, &attributes, access, out LsaHandle handle).ThrowIfFailed();
            return(handle);
        }
        public static LsaHandle LsaOpenLocalPolicy(PolicyAccessRights access)
        {
            LSA_OBJECT_ATTRIBUTES attributes = new LSA_OBJECT_ATTRIBUTES();
            LsaHandle             handle;
            NTSTATUS status;

            unsafe
            {
                status = Imports.LsaOpenPolicy(null, &attributes, access, out handle);
            }

            if (status != NTSTATUS.STATUS_SUCCESS)
            {
                throw ErrorMethods.GetIoExceptionForNTStatus(status);
            }

            return(handle);
        }
Example #3
0
 public unsafe static extern NTStatus LsaOpenPolicy(
     UNICODE_STRING *SystemName,
     LSA_OBJECT_ATTRIBUTES *ObjectAttributes,
     PolicyAccessRights DesiredAccess,
     out LsaHandle PolicyHandle);