From 8e45e7a97921189c5ea32c357a701bc41caa6a18 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Wed, 9 Sep 2015 11:21:02 +0000 Subject: [PATCH] [NTOS] Fix broken NtSetSystemEnvironmentValueEx stub which had the wrong amount of parameters. [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 | 8 +++--- .../dll/win32/kernel32/client/file/iocompl.c | 28 +++++++++++++++++++ reactos/dll/win32/kernel32/client/vista.c | 19 ------------- reactos/dll/win32/kernel32/kernel32.spec | 2 +- reactos/include/ndk/exfuncs.h | 5 +++- reactos/include/ndk/halfuncs.h | 12 +++++++- reactos/ntoskrnl/ex/sysinfo.c | 5 +++- reactos/ntoskrnl/include/sysfuncs.h | 2 +- reactos/ntoskrnl/include/sysfuncs64.h | 2 +- reactos/ntoskrnl/sysfuncs.lst | 2 +- 10 files changed, 55 insertions(+), 30 deletions(-) diff --git a/reactos/dll/ntdll/def/ntdll.spec b/reactos/dll/ntdll/def/ntdll.spec index a70f9f26fdd..26fc1f69dfd 100644 --- a/reactos/dll/ntdll/def/ntdll.spec +++ b/reactos/dll/ntdll/def/ntdll.spec @@ -373,13 +373,13 @@ @ 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 NtSetSystemEnvironmentValueEx(ptr ptr) +@ stdcall NtSetSystemEnvironmentValueEx(ptr ptr ptr ptr ptr) @ stdcall NtSetSystemInformation(long ptr long) @ stdcall NtSetSystemPowerState(long long long) @ stdcall NtSetSystemTime(ptr ptr) @@ -1218,13 +1218,13 @@ @ 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 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) diff --git a/reactos/dll/win32/kernel32/client/file/iocompl.c b/reactos/dll/win32/kernel32/client/file/iocompl.c index 0ee98005894..86af261e7f3 100644 --- a/reactos/dll/win32/kernel32/client/file/iocompl.c +++ b/reactos/dll/win32/kernel32/client/file/iocompl.c @@ -12,6 +12,34 @@ #define NDEBUG #include +/* + * 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 */ diff --git a/reactos/dll/win32/kernel32/client/vista.c b/reactos/dll/win32/kernel32/client/vista.c index e5cd45f5104..451becba923 100644 --- a/reactos/dll/win32/kernel32/client/vista.c +++ b/reactos/dll/win32/kernel32/client/vista.c @@ -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 */ diff --git a/reactos/dll/win32/kernel32/kernel32.spec b/reactos/dll/win32/kernel32/kernel32.spec index 58d96b60f8b..26297dfbf83 100644 --- a/reactos/dll/win32/kernel32/kernel32.spec +++ b/reactos/dll/win32/kernel32/kernel32.spec @@ -809,7 +809,7 @@ @ 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) diff --git a/reactos/include/ndk/exfuncs.h b/reactos/include/ndk/exfuncs.h index 4570137c890..41dc9866873 100644 --- a/reactos/include/ndk/exfuncs.h +++ b/reactos/include/ndk/exfuncs.h @@ -549,7 +549,10 @@ NTSTATUS NTAPI NtSetSystemEnvironmentValueEx( _In_ PUNICODE_STRING VariableName, - _In_ LPGUID VendorGuid + _In_ LPGUID VendorGuid, + _In_ PVOID Value, + _Inout_ PULONG ReturnLength, + _Inout_ PULONG Attributes ); NTSYSCALLAPI diff --git a/reactos/include/ndk/halfuncs.h b/reactos/include/ndk/halfuncs.h index 0d3ba75cdae..29877c5a584 100644 --- a/reactos/include/ndk/halfuncs.h +++ b/reactos/include/ndk/halfuncs.h @@ -150,13 +150,23 @@ HalEnableSystemInterrupt( _In_ KINTERRUPT_MODE InterruptMode ); +#ifdef __REACTOS__ NTHALAPI VOID NTAPI HalEndSystemInterrupt( - KIRQL Irql, + _In_ KIRQL Irql, _In_ PKTRAP_FRAME TrapFrame ); +#else +NTHALAPI +VOID +NTAPI +HalEndSystemInterrupt( + _In_ KIRQL Irql, + _In_ UCHAR Vector +); +#endif #ifdef _ARM_ // FIXME: ndk/arm? armddk.h? ULONG diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 570bf91f545..14cea68bc95 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -499,7 +499,10 @@ NtQuerySystemEnvironmentValueEx(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; diff --git a/reactos/ntoskrnl/include/sysfuncs.h b/reactos/ntoskrnl/include/sysfuncs.h index ef6f2438ae1..b900287d4e5 100644 --- a/reactos/ntoskrnl/include/sysfuncs.h +++ b/reactos/ntoskrnl/include/sysfuncs.h @@ -246,7 +246,7 @@ SVC_(SetQuotaInformationFile, 4) SVC_(SetSecurityObject, 3) SVC_(SetSystemEnvironmentValue, 2) - SVC_(SetSystemEnvironmentValueEx, 2) + SVC_(SetSystemEnvironmentValueEx, 5) SVC_(SetSystemInformation, 3) SVC_(SetSystemPowerState, 3) SVC_(SetSystemTime, 2) diff --git a/reactos/ntoskrnl/include/sysfuncs64.h b/reactos/ntoskrnl/include/sysfuncs64.h index 7b79b2caa5b..7c958174879 100644 --- a/reactos/ntoskrnl/include/sysfuncs64.h +++ b/reactos/ntoskrnl/include/sysfuncs64.h @@ -573,7 +573,7 @@ SVC_(SetSystemCodeIntegrityRoots, 0) // FIXME #endif SVC_(SetSystemEnvironmentValue, 2) #if (NTDDI_VERSION >= NTDDI_VISTA) -SVC_(SetSystemEnvironmentValueEx, 2) +SVC_(SetSystemEnvironmentValueEx, 5) #endif SVC_(SetSystemInformation, 3) SVC_(SetSystemPowerState, 3) diff --git a/reactos/ntoskrnl/sysfuncs.lst b/reactos/ntoskrnl/sysfuncs.lst index 1b6baea0ea6..6d504fed247 100644 --- a/reactos/ntoskrnl/sysfuncs.lst +++ b/reactos/ntoskrnl/sysfuncs.lst @@ -246,7 +246,7 @@ NtSetLowWaitHighEventPair 1 NtSetQuotaInformationFile 4 NtSetSecurityObject 3 NtSetSystemEnvironmentValue 2 -NtSetSystemEnvironmentValueEx 2 +NtSetSystemEnvironmentValueEx 5 NtSetSystemInformation 3 NtSetSystemPowerState 3 NtSetSystemTime 2 -- 2.17.1