Skip to content

Commit c09a3f4

Browse files
committed
Fix Issue #79, convert to ushorts rather than shorts as Version doesn't like negative numbers.
1 parent 590cbca commit c09a3f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

NtApiDotNet/NtObjectUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ internal static async Task<NtResult<S>> MapAsync<T, S>(this Task<NtResult<T>> ta
787787

788788
internal static Version UnpackVersion(ulong version)
789789
{
790-
short[] parts = new short[4];
790+
ushort[] parts = new ushort[4];
791791
ulong[] original = new ulong[] { version };
792792

793793
Buffer.BlockCopy(original, 0, parts, 0, sizeof(ulong));
@@ -797,7 +797,7 @@ internal static Version UnpackVersion(ulong version)
797797

798798
internal static ulong PackVersion(Version version)
799799
{
800-
short[] parts = new short[4] { (short)version.Revision, (short)version.Build, (short)version.Minor, (short)version.Major };
800+
ushort[] parts = new ushort[4] { (ushort)version.Revision, (ushort)version.Build, (ushort)version.Minor, (ushort)version.Major };
801801
ulong[] original = new ulong[1];
802802

803803
Buffer.BlockCopy(parts, 0, original, 0, sizeof(ulong));

0 commit comments

Comments
 (0)