From: Timo Kreuzer Date: Thu, 1 May 2014 08:55:04 +0000 (+0000) Subject: [WIN32K] X-Git-Tag: backups/0.3.17@66124~1424 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=305c6b4fcc19a3bb024d3d35949e9f662af36ceb [WIN32K] Check return value of NtQuerySystemInformation in EngQuerySystemAttribute CID 513027 svn path=/trunk/; revision=63088 --- diff --git a/reactos/win32ss/gdi/eng/engmisc.c b/reactos/win32ss/gdi/eng/engmisc.c index 56d0fadd29b..c88a9c5b443 100644 --- a/reactos/win32ss/gdi/eng/engmisc.c +++ b/reactos/win32ss/gdi/eng/engmisc.c @@ -245,22 +245,34 @@ EngQuerySystemAttribute( { SYSTEM_BASIC_INFORMATION sbi; SYSTEM_PROCESSOR_INFORMATION spi; + NTSTATUS status; switch (CapNum) { case EngNumberOfProcessors: - NtQuerySystemInformation(SystemBasicInformation, - &sbi, - sizeof(SYSTEM_BASIC_INFORMATION), - NULL); + status = NtQuerySystemInformation(SystemBasicInformation, + &sbi, + sizeof(SYSTEM_BASIC_INFORMATION), + NULL); + if (!NT_SUCCESS(status)) + { + DPRINT1("Failed to query basic information: 0x%ls\n", status); + return FALSE; + } + *pCapability = sbi.NumberOfProcessors; return TRUE; case EngProcessorFeature: - NtQuerySystemInformation(SystemProcessorInformation, - &spi, - sizeof(SYSTEM_PROCESSOR_INFORMATION), - NULL); + status = NtQuerySystemInformation(SystemProcessorInformation, + &spi, + sizeof(SYSTEM_PROCESSOR_INFORMATION), + NULL); + if (!NT_SUCCESS(status)) + { + DPRINT1("Failed to query processor information: 0x%ls\n", status); + return FALSE; + } *pCapability = spi.ProcessorFeatureBits; return TRUE;