mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 13:43:22 +00:00
[WIN32K]
Check return value of NtQuerySystemInformation in EngQuerySystemAttribute CID 513027 svn path=/trunk/; revision=63088
This commit is contained in:
parent
fc4372b2b8
commit
305c6b4fcc
1 changed files with 20 additions and 8 deletions
|
@ -245,22 +245,34 @@ EngQuerySystemAttribute(
|
||||||
{
|
{
|
||||||
SYSTEM_BASIC_INFORMATION sbi;
|
SYSTEM_BASIC_INFORMATION sbi;
|
||||||
SYSTEM_PROCESSOR_INFORMATION spi;
|
SYSTEM_PROCESSOR_INFORMATION spi;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
switch (CapNum)
|
switch (CapNum)
|
||||||
{
|
{
|
||||||
case EngNumberOfProcessors:
|
case EngNumberOfProcessors:
|
||||||
NtQuerySystemInformation(SystemBasicInformation,
|
status = NtQuerySystemInformation(SystemBasicInformation,
|
||||||
&sbi,
|
&sbi,
|
||||||
sizeof(SYSTEM_BASIC_INFORMATION),
|
sizeof(SYSTEM_BASIC_INFORMATION),
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!NT_SUCCESS(status))
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to query basic information: 0x%ls\n", status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
*pCapability = sbi.NumberOfProcessors;
|
*pCapability = sbi.NumberOfProcessors;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case EngProcessorFeature:
|
case EngProcessorFeature:
|
||||||
NtQuerySystemInformation(SystemProcessorInformation,
|
status = NtQuerySystemInformation(SystemProcessorInformation,
|
||||||
&spi,
|
&spi,
|
||||||
sizeof(SYSTEM_PROCESSOR_INFORMATION),
|
sizeof(SYSTEM_PROCESSOR_INFORMATION),
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!NT_SUCCESS(status))
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to query processor information: 0x%ls\n", status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
*pCapability = spi.ProcessorFeatureBits;
|
*pCapability = spi.ProcessorFeatureBits;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue