public OemString(SafeOemStringPointer oemStringPtr) { this.Buffer = oemStringPtr; if (oemStringPtr == null) { this.Length = 0; this.MaximumLength = 0; } else if (oemStringPtr.Length >= ushort.MaxValue) { throw new ArgumentOutOfRangeException("oemStringPtr"); } else { // Length of the oem string. this.Length = (ushort)oemStringPtr.Length; this.MaximumLength = (ushort)oemStringPtr.Length; } }
internal static NtStatus RtlCalculateLmOwfPassword(SafeOemStringPointer password, out byte[] hash) { // Allocate output buffer hash = new byte[LMHashNumBytes]; return(RtlCalculateLmOwfPassword(password, hash)); }
private static extern NtStatus RtlCalculateLmOwfPassword(SafeOemStringPointer password, [MarshalAs(UnmanagedType.LPArray, SizeConst = LMHashNumBytes), In, Out] byte[] hash);
internal static NtStatus RtlCalculateLmOwfPassword(SafeOemStringPointer password, out byte[] hash) { // Allocate output buffer hash = new byte[LMHashNumBytes]; return RtlCalculateLmOwfPassword(password, hash); }