mirror of https://github.com/dahall/Vanara.git
Fixed #175 per detail for GetLogicalProcessorInformationEx
parent
db7884b6f5
commit
c3a6add0a4
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Vanara.Extensions;
|
using Vanara.Extensions;
|
||||||
|
@ -1229,7 +1230,7 @@ namespace Vanara.PInvoke
|
||||||
(ref uint sz) => BoolToLastErr(GetLogicalProcessorInformationEx(RelationshipType, IntPtr.Zero, ref sz) || sz > 0),
|
(ref uint sz) => BoolToLastErr(GetLogicalProcessorInformationEx(RelationshipType, IntPtr.Zero, ref sz) || sz > 0),
|
||||||
(IntPtr p, ref uint sz) => BoolToLastErr(GetLogicalProcessorInformationEx(RelationshipType, p, ref sz)),
|
(IntPtr p, ref uint sz) => BoolToLastErr(GetLogicalProcessorInformationEx(RelationshipType, p, ref sz)),
|
||||||
out info,
|
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>
|
/// <summary>
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace Vanara.PInvoke.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void GetLogicalProcessorInformationExTest()
|
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));
|
Assert.That(info.Length, Is.GreaterThan(0));
|
||||||
info.WriteValues();
|
info.WriteValues();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue