Skip to content

Commit

Permalink
Some compatibility fixes with new MAKELONG64 impl
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hall committed Jan 29, 2025
1 parent e7a2915 commit a5eb0d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PInvoke/ActiveDS/IADs.Interface2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ int LowPart
/// <summary>Converts interface values to <see cref="Int64"/>.</summary>
/// <param name="li">The <see cref="IADsLargeInteger"/> instance.</param>
/// <returns>A <see cref="long"/> value.</returns>
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);

/// <summary>
/// <para>
Expand Down
6 changes: 6 additions & 0 deletions PInvoke/Shared/WinUser/Macros.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ public static long ALIGN_TO_MULTIPLE(long value, int pow2) =>
/// <returns>The return value is a LONG value.</returns>
public static uint MAKELONG(IConvertible wLow, IConvertible wHigh) => (wHigh.ToUInt32(null) << 16) | (wLow.ToUInt32(null) & 0xffff);

/// <summary>Creates a LONG64 value by concatenating the specified values.</summary>
/// <param name="dwLow">The low-order double word of the new value.</param>
/// <param name="dwHigh">The high-order double word of the new value.</param>
/// <returns>The return value is a LONG64 value.</returns>
public static long MAKELONG64(IConvertible dwLow, int dwHigh) => ((long)dwHigh << 32) | (dwLow.ToInt64(null) & 0xffffffff);

/// <summary>Creates a LONG64 value by concatenating the specified values.</summary>
/// <param name="dwLow">The low-order double word of the new value.</param>
/// <param name="dwHigh">The high-order double word of the new value.</param>
Expand Down

0 comments on commit a5eb0d1

Please sign in to comment.