Fixed #175 per detail for GetLogicalProcessorInformationEx

pull/180/head
dahall 2020-11-04 13:05:34 -07:00
parent db7884b6f5
commit c3a6add0a4
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Vanara.Extensions;
@ -1229,7 +1230,7 @@ namespace Vanara.PInvoke
(ref uint sz) => BoolToLastErr(GetLogicalProcessorInformationEx(RelationshipType, IntPtr.Zero, ref sz) || sz > 0),
(IntPtr p, ref uint sz) => BoolToLastErr(GetLogicalProcessorInformationEx(RelationshipType, p, ref sz)),
out info,
(p, sz) => p.ToArray<SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>((int)sz / Marshal.SizeOf(typeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX))));
(p, sz) => p.LinkedListToIEnum<SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(i => i.Size, sz).ToArray());
}
/// <summary>

View File

@ -55,7 +55,7 @@ namespace Vanara.PInvoke.Tests
[Test]
public void GetLogicalProcessorInformationExTest()
{
Assert.That(GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP.RelationGroup, out var info), ResultIs.Successful);
Assert.That(GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP.RelationAll, out var info), ResultIs.Successful);
Assert.That(info.Length, Is.GreaterThan(0));
info.WriteValues();
}