[NDK] Fix prototype of Nt/ZwQuerySystemInformation
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 18 Aug 2017 08:44:08 +0000 (08:44 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 18 Aug 2017 08:44:08 +0000 (08:44 +0000)
svn path=/trunk/; revision=75606

reactos/dll/win32/kernel32/client/time.c
reactos/ntoskrnl/ex/sysinfo.c
reactos/sdk/include/ndk/exfuncs.h
reactos/win32ss/drivers/videoprt/videoprt.c

index c52dcc3..6ff8559 100644 (file)
@@ -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;
 
index bfdab89..1480947 100644 (file)
@@ -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;
index 44e833d..e6e78c8 100644 (file)
@@ -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
index 9bfb2a2..e840593 100644 (file)
@@ -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 *