From a5eb0d16ad39ba070b5be7199735f2bc75a2a9e8 Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 29 Jan 2025 10:53:34 -0700 Subject: [PATCH] Some compatibility fixes with new MAKELONG64 impl --- PInvoke/ActiveDS/IADs.Interface2.cs | 2 +- PInvoke/Shared/WinUser/Macros.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/PInvoke/ActiveDS/IADs.Interface2.cs b/PInvoke/ActiveDS/IADs.Interface2.cs index 96af6e203..634442574 100644 --- a/PInvoke/ActiveDS/IADs.Interface2.cs +++ b/PInvoke/ActiveDS/IADs.Interface2.cs @@ -1545,7 +1545,7 @@ int LowPart /// Converts interface values to . /// The instance. /// A value. - public static long ToInt64(this IADsLargeInteger li) => Macros.MAKELONG64(unchecked((uint)li.LowPart), li.HighPart); + public static long ToInt64(this IADsLargeInteger li) => Macros.MAKELONG64(li.LowPart, li.HighPart); /// /// diff --git a/PInvoke/Shared/WinUser/Macros.cs b/PInvoke/Shared/WinUser/Macros.cs index 4b9789469..e54f03944 100644 --- a/PInvoke/Shared/WinUser/Macros.cs +++ b/PInvoke/Shared/WinUser/Macros.cs @@ -112,6 +112,12 @@ public static long ALIGN_TO_MULTIPLE(long value, int pow2) => /// The return value is a LONG value. public static uint MAKELONG(IConvertible wLow, IConvertible wHigh) => (wHigh.ToUInt32(null) << 16) | (wLow.ToUInt32(null) & 0xffff); + /// Creates a LONG64 value by concatenating the specified values. + /// The low-order double word of the new value. + /// The high-order double word of the new value. + /// The return value is a LONG64 value. + public static long MAKELONG64(IConvertible dwLow, int dwHigh) => ((long)dwHigh << 32) | (dwLow.ToInt64(null) & 0xffffffff); + /// Creates a LONG64 value by concatenating the specified values. /// The low-order double word of the new value. /// The high-order double word of the new value.