///<summary>Creates an instance of the Lsa class for the specified computerName.</summary> public Lsa(string computerName) { try { LSA_OBJECT_ATTRIBUTES lsaAttr = new LSA_OBJECT_ATTRIBUTES(); lsaAttr.Length = Marshal.SizeOf(typeof(LSA_OBJECT_ATTRIBUTES)); LSA_UNICODE_STRING computer = ConvertToLsaUnicodeString(computerName); uint ntStatus = UnsafeNativeMethods.LsaOpenPolicy( computer, ref lsaAttr, (int)LsaPolicyAccess.POLICY_ALL_ACCESS, out lsaHandle ); TestNtStatus(ntStatus); } catch { throw; } }
internal static extern uint LsaOpenPolicy( LSA_UNICODE_STRING SystemName, ref LSA_OBJECT_ATTRIBUTES ObjectAttributes, int AccessMask, out IntPtr PolicyHandle );