[NTOS] Fix broken NtSetSystemEnvironmentValueEx stub which had the wrong amount of...
authorStefan Ginsberg <stefanginsberg@gmail.com>
Wed, 9 Sep 2015 11:21:02 +0000 (11:21 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Wed, 9 Sep 2015 11:21:02 +0000 (11:21 +0000)
[NDK] Add define guard for HalEndSystemInterrupt because it is no longer compatible with Windows, and add back the old definition. Fix NtSetSystemEnvironmentValueEx prototype.
[KERNEL32] Export SetFileCompletionNotificationModes (MSDN and headers documents it as Vista-only, but this is not entirely correct).

svn path=/trunk/; revision=69144

reactos/dll/ntdll/def/ntdll.spec
reactos/dll/win32/kernel32/client/file/iocompl.c
reactos/dll/win32/kernel32/client/vista.c
reactos/dll/win32/kernel32/kernel32.spec
reactos/include/ndk/exfuncs.h
reactos/include/ndk/halfuncs.h
reactos/ntoskrnl/ex/sysinfo.c
reactos/ntoskrnl/include/sysfuncs.h
reactos/ntoskrnl/include/sysfuncs64.h
reactos/ntoskrnl/sysfuncs.lst

index a70f9f2..26fc1f6 100644 (file)
 @ stdcall NtSetInformationToken(long long ptr long)
 @ stdcall NtSetIntervalProfile(long long)
 @ stdcall NtSetIoCompletion(ptr long ptr long long)
 @ stdcall NtSetInformationToken(long long ptr long)
 @ stdcall NtSetIntervalProfile(long long)
 @ stdcall NtSetIoCompletion(ptr long ptr long long)
-@ stdcall NtSetLdtEntries(long double long double) ; CHECKME
+@ stdcall NtSetLdtEntries(long int64 long int64)
 @ stdcall NtSetLowEventPair(ptr)
 @ stdcall NtSetLowWaitHighEventPair(ptr)
 @ stdcall NtSetQuotaInformationFile(ptr ptr ptr long)
 @ stdcall NtSetSecurityObject(long long ptr)
 @ stdcall NtSetSystemEnvironmentValue(ptr ptr)
 @ stdcall NtSetLowEventPair(ptr)
 @ stdcall NtSetLowWaitHighEventPair(ptr)
 @ stdcall NtSetQuotaInformationFile(ptr ptr ptr long)
 @ stdcall NtSetSecurityObject(long long ptr)
 @ stdcall NtSetSystemEnvironmentValue(ptr ptr)
-@ stdcall NtSetSystemEnvironmentValueEx(ptr ptr)
+@ stdcall NtSetSystemEnvironmentValueEx(ptr ptr ptr ptr ptr)
 @ stdcall NtSetSystemInformation(long ptr long)
 @ stdcall NtSetSystemPowerState(long long long)
 @ stdcall NtSetSystemTime(ptr ptr)
 @ stdcall NtSetSystemInformation(long ptr long)
 @ stdcall NtSetSystemPowerState(long long long)
 @ stdcall NtSetSystemTime(ptr ptr)
 @ stdcall ZwSetInformationToken(long long ptr long)
 @ stdcall ZwSetIntervalProfile(long long)
 @ stdcall ZwSetIoCompletion(ptr long ptr long long)
 @ stdcall ZwSetInformationToken(long long ptr long)
 @ stdcall ZwSetIntervalProfile(long long)
 @ stdcall ZwSetIoCompletion(ptr long ptr long long)
-@ stdcall ZwSetLdtEntries(long double long double) ; CHECKME
+@ stdcall ZwSetLdtEntries(long int64 long int64)
 @ stdcall ZwSetLowEventPair(ptr)
 @ stdcall ZwSetLowWaitHighEventPair(ptr)
 @ stdcall ZwSetQuotaInformationFile(ptr ptr ptr long)
 @ stdcall ZwSetSecurityObject(long long ptr)
 @ stdcall ZwSetSystemEnvironmentValue(ptr ptr)
 @ stdcall ZwSetLowEventPair(ptr)
 @ stdcall ZwSetLowWaitHighEventPair(ptr)
 @ stdcall ZwSetQuotaInformationFile(ptr ptr ptr long)
 @ stdcall ZwSetSecurityObject(long long ptr)
 @ stdcall ZwSetSystemEnvironmentValue(ptr ptr)
-@ stdcall ZwSetSystemEnvironmentValueEx(ptr ptr)
+@ stdcall ZwSetSystemEnvironmentValueEx(ptr ptr ptr ptr ptr) NtSetSystemEnvironmentValueEx
 @ stdcall ZwSetSystemInformation(long ptr long)
 @ stdcall ZwSetSystemPowerState(long long long)
 @ stdcall ZwSetSystemTime(ptr ptr)
 @ stdcall ZwSetSystemInformation(long ptr long)
 @ stdcall ZwSetSystemPowerState(long long long)
 @ stdcall ZwSetSystemTime(ptr ptr)
index 0ee9800..86af261 100644 (file)
 #define NDEBUG
 #include <debug.h>
 
 #define NDEBUG
 #include <debug.h>
 
+/*
+ * SetFileCompletionNotificationModes is not entirely Vista-exclusive,
+ * it was actually added to Windows 2003 in SP2. Headers restrict it from
+ * pre-Vista though so define the flags we need for it.
+ */
+#if (_WIN32_WINNT < 0x0600)
+#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
+#define FILE_SKIP_SET_EVENT_ON_HANDLE        0x2
+#endif
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SetFileCompletionNotificationModes(IN HANDLE FileHandle,
+                                   IN UCHAR Flags)
+{
+    if (Flags & ~(FILE_SKIP_COMPLETION_PORT_ON_SUCCESS | FILE_SKIP_SET_EVENT_ON_HANDLE))
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+
+    UNIMPLEMENTED;
+    return FALSE;
+}
+
 /*
  * @implemented
  */
 /*
  * @implemented
  */
index e5cd45f..451becb 100644 (file)
@@ -675,25 +675,6 @@ GetFileBandwidthReservation(IN HANDLE hFile,
 }
 
 
 }
 
 
-/*
- * @unimplemented
- */
-BOOL
-WINAPI
-SetFileCompletionNotificationModes(IN HANDLE FileHandle,
-                                   IN UCHAR Flags)
-{
-    if (Flags & ~(FILE_SKIP_COMPLETION_PORT_ON_SUCCESS | FILE_SKIP_SET_EVENT_ON_HANDLE))
-    {
-        SetLastError(ERROR_INVALID_PARAMETER);
-        return FALSE;
-    }
-
-    UNIMPLEMENTED;
-    return FALSE;
-}
-
-
 /*
  * @unimplemented
  */
 /*
  * @unimplemented
  */
index 58d96b6..26297df 100644 (file)
 @ stdcall SetFileApisToOEM()
 @ stdcall SetFileAttributesA(str long)
 @ stdcall SetFileAttributesW(wstr long)
 @ stdcall SetFileApisToOEM()
 @ stdcall SetFileAttributesA(str long)
 @ stdcall SetFileAttributesW(wstr long)
-;@ stdcall -stub SetFileCompletionNotificationModes(ptr long); 2K3 SP2 has it!
+@ stdcall SetFileCompletionNotificationModes(ptr long)
 @ stdcall SetFilePointer(long long ptr long)
 @ stdcall SetFilePointerEx(long double ptr long)
 @ stdcall SetFileShortNameA(long str)
 @ stdcall SetFilePointer(long long ptr long)
 @ stdcall SetFilePointerEx(long double ptr long)
 @ stdcall SetFileShortNameA(long str)
index 4570137..41dc986 100644 (file)
@@ -549,7 +549,10 @@ NTSTATUS
 NTAPI
 NtSetSystemEnvironmentValueEx(
     _In_ PUNICODE_STRING VariableName,
 NTAPI
 NtSetSystemEnvironmentValueEx(
     _In_ PUNICODE_STRING VariableName,
-    _In_ LPGUID VendorGuid
+    _In_ LPGUID VendorGuid,
+    _In_ PVOID Value,
+    _Inout_ PULONG ReturnLength,
+    _Inout_ PULONG Attributes
 );
 
 NTSYSCALLAPI
 );
 
 NTSYSCALLAPI
index 0d3ba75..29877c5 100644 (file)
@@ -150,13 +150,23 @@ HalEnableSystemInterrupt(
     _In_ KINTERRUPT_MODE InterruptMode
 );
 
     _In_ KINTERRUPT_MODE InterruptMode
 );
 
+#ifdef __REACTOS__
 NTHALAPI
 VOID
 NTAPI
 HalEndSystemInterrupt(
 NTHALAPI
 VOID
 NTAPI
 HalEndSystemInterrupt(
-    KIRQL Irql,
+    _In_ KIRQL Irql,
     _In_ PKTRAP_FRAME TrapFrame
 );
     _In_ PKTRAP_FRAME TrapFrame
 );
+#else
+NTHALAPI
+VOID
+NTAPI
+HalEndSystemInterrupt(
+    _In_ KIRQL Irql,
+    _In_ UCHAR Vector
+);
+#endif
 
 #ifdef _ARM_ // FIXME: ndk/arm? armddk.h?
 ULONG
 
 #ifdef _ARM_ // FIXME: ndk/arm? armddk.h?
 ULONG
index 570bf91..14cea68 100644 (file)
@@ -499,7 +499,10 @@ NtQuerySystemEnvironmentValueEx(IN PUNICODE_STRING VariableName,
 NTSTATUS
 NTAPI
 NtSetSystemEnvironmentValueEx(IN PUNICODE_STRING VariableName,
 NTSTATUS
 NTAPI
 NtSetSystemEnvironmentValueEx(IN PUNICODE_STRING VariableName,
-                              IN LPGUID VendorGuid)
+                              IN LPGUID VendorGuid
+                              IN PVOID Value,
+                              IN OUT PULONG ReturnLength,
+                              IN OUT PULONG Attributes)
 {
     UNIMPLEMENTED;
     return STATUS_NOT_IMPLEMENTED;
 {
     UNIMPLEMENTED;
     return STATUS_NOT_IMPLEMENTED;
index ef6f243..b900287 100644 (file)
     SVC_(SetQuotaInformationFile, 4)
     SVC_(SetSecurityObject, 3)
     SVC_(SetSystemEnvironmentValue, 2)
     SVC_(SetQuotaInformationFile, 4)
     SVC_(SetSecurityObject, 3)
     SVC_(SetSystemEnvironmentValue, 2)
-    SVC_(SetSystemEnvironmentValueEx, 2)
+    SVC_(SetSystemEnvironmentValueEx, 5)
     SVC_(SetSystemInformation, 3)
     SVC_(SetSystemPowerState, 3)
     SVC_(SetSystemTime, 2)
     SVC_(SetSystemInformation, 3)
     SVC_(SetSystemPowerState, 3)
     SVC_(SetSystemTime, 2)
index 7b79b2c..7c95817 100644 (file)
@@ -573,7 +573,7 @@ SVC_(SetSystemCodeIntegrityRoots, 0) // FIXME
 #endif
 SVC_(SetSystemEnvironmentValue, 2)
 #if (NTDDI_VERSION >= NTDDI_VISTA)
 #endif
 SVC_(SetSystemEnvironmentValue, 2)
 #if (NTDDI_VERSION >= NTDDI_VISTA)
-SVC_(SetSystemEnvironmentValueEx, 2)
+SVC_(SetSystemEnvironmentValueEx, 5)
 #endif
 SVC_(SetSystemInformation, 3)
 SVC_(SetSystemPowerState, 3)
 #endif
 SVC_(SetSystemInformation, 3)
 SVC_(SetSystemPowerState, 3)
index 1b6baea..6d504fe 100644 (file)
@@ -246,7 +246,7 @@ NtSetLowWaitHighEventPair 1
 NtSetQuotaInformationFile 4
 NtSetSecurityObject 3
 NtSetSystemEnvironmentValue 2
 NtSetQuotaInformationFile 4
 NtSetSecurityObject 3
 NtSetSystemEnvironmentValue 2
-NtSetSystemEnvironmentValueEx 2
+NtSetSystemEnvironmentValueEx 5
 NtSetSystemInformation 3
 NtSetSystemPowerState 3
 NtSetSystemTime 2
 NtSetSystemInformation 3
 NtSetSystemPowerState 3
 NtSetSystemTime 2