From 0d5f8b292a694ff04536876953b97008fc7b55df Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 18 Aug 2017 08:44:08 +0000 Subject: [PATCH] [NDK] Fix prototype of Nt/ZwQuerySystemInformation svn path=/trunk/; revision=75606 --- reactos/dll/win32/kernel32/client/time.c | 2 +- reactos/ntoskrnl/ex/sysinfo.c | 15 +++++++++------ reactos/sdk/include/ndk/exfuncs.h | 12 ++++++------ reactos/win32ss/drivers/videoprt/videoprt.c | 6 ++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/time.c b/reactos/dll/win32/kernel32/client/time.c index c52dcc3dae0..6ff8559956a 100644 --- a/reactos/dll/win32/kernel32/client/time.c +++ b/reactos/dll/win32/kernel32/client/time.c @@ -534,7 +534,7 @@ GetSystemTimes(OUT LPFILETIME lpIdleTime OPTIONAL, { PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION ProcPerfInfo; LARGE_INTEGER TotalUserTime, TotalKernTime, TotalIdleTime; - SIZE_T BufferSize, ReturnLength; + ULONG BufferSize, ReturnLength; CCHAR i; NTSTATUS Status; diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index bfdab890a32..14809474dad 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1922,7 +1922,7 @@ QSI_DEF(SystemProcessorIdleInformation) { return STATUS_INFO_LENGTH_MISMATCH; } - + /* FIXME */ DPRINT1("NtQuerySystemInformation - SystemPowerInformation not implemented\n"); return STATUS_NOT_IMPLEMENTED; @@ -2599,11 +2599,14 @@ C_ASSERT(SystemBasicInformation == 0); /* * @implemented */ -NTSTATUS NTAPI -NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG Length, - OUT PULONG UnsafeResultLength) +__kernel_entry +NTSTATUS +NTAPI +NtQuerySystemInformation( + _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, + _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, + _In_ ULONG Length, + _Out_opt_ PULONG UnsafeResultLength) { KPROCESSOR_MODE PreviousMode; ULONG ResultLength = 0; diff --git a/reactos/sdk/include/ndk/exfuncs.h b/reactos/sdk/include/ndk/exfuncs.h index 44e833de0a3..e6e78c85ffa 100644 --- a/reactos/sdk/include/ndk/exfuncs.h +++ b/reactos/sdk/include/ndk/exfuncs.h @@ -407,9 +407,9 @@ NTSTATUS NTAPI NtQuerySystemInformation( _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, - _Out_ PVOID SystemInformation, - _In_ ULONG InformationLength, - _Out_opt_ PULONG ResultLength + _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, + _In_ ULONG SystemInformationLength, + _Out_opt_ PULONG ReturnLength ); NTSYSCALLAPI @@ -876,9 +876,9 @@ NTSTATUS NTAPI ZwQuerySystemInformation( _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, - _Out_ PVOID SystemInformation, - _In_ SIZE_T Length, - _Out_opt_ PSIZE_T ResultLength + _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, + _In_ ULONG SystemInformationLength, + _Out_opt_ PULONG ReturnLength ); NTSYSAPI diff --git a/reactos/win32ss/drivers/videoprt/videoprt.c b/reactos/win32ss/drivers/videoprt/videoprt.c index 9bfb2a24b0c..e840593be98 100644 --- a/reactos/win32ss/drivers/videoprt/videoprt.c +++ b/reactos/win32ss/drivers/videoprt/videoprt.c @@ -251,7 +251,6 @@ IntVideoPortFindAdapter( { WCHAR DeviceVideoBuffer[20]; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; - SIZE_T Size; NTSTATUS Status; VIDEO_PORT_CONFIG_INFO ConfigInfo; SYSTEM_BASIC_INFORMATION SystemBasicInfo; @@ -280,11 +279,10 @@ IntVideoPortFindAdapter( ConfigInfo.BusInterruptLevel = DeviceExtension->InterruptLevel; ConfigInfo.BusInterruptVector = DeviceExtension->InterruptVector; - Size = sizeof(SystemBasicInfo); Status = ZwQuerySystemInformation(SystemBasicInformation, &SystemBasicInfo, - Size, - &Size); + sizeof(SystemBasicInfo), + NULL); if (NT_SUCCESS(Status)) { ConfigInfo.SystemMemorySize = SystemBasicInfo.NumberOfPhysicalPages *