Commit graph

78855 commits

Author SHA1 Message Date
Timo Kreuzer 52d1bb5ec9 [NTOS:KE:X64] Simplify KiInitializeUserApc 2020-10-31 14:23:16 +01:00
Timo Kreuzer aaa86d078e [NTOS:KE:X64] Move KiInitializeUserApc to usercall.c 2020-10-31 14:23:16 +01:00
Timo Kreuzer fbdff437fd [NTOS:KE:X64] Implement flushing the GDI batch 2020-10-31 14:23:16 +01:00
Timo Kreuzer c86c55ace7 [NTOS:KE:X64] Change the logic of KeSwitchKernelStack and friends to be standards conforming
The previous version (like the x86 one) used a combination of C and asm code, called from C code to switch the stack. This is problematic, since there is no guarantee what assumptions C code makes about the stack (i.e. it can place any kind of stack pointers into registers or on the stack itself.) The new algorithm returns back to the systemcall entry point in asm, which then calls KiConvertToGuiThread, which is also asm and calls KeSwitchKernelStack ...
2020-10-31 14:23:16 +01:00
Timo Kreuzer 18b1aafd82 [NTOS:KE:X64] Improve kernel stack switching on GUI system calls
To be 100% correct and not rely on assumptions, stack switching can only be done when all previous code - starting with the syscall entry point - is pure asm code, since we can't rely on the C compiler to not use stack addresses in a way that is not transparent. Therefore the new code uses the same mechanism as for normal system calls, returning the address of the asm function KiConvertToGuiThread, which is then called like an Nt* function would be called normally. KiConvertToGuiThread then allocated a new stack, switches to it (which is now fine, since all the code is asm), frees the old stack, calls PsConvertToGuiThread (which now will not try to allocate another stack, since we already have one) and then jumps into the middle of KiSystemCallEntry64, where the system call is handled again.
Also simplify KiSystemCallEntry64 a bit by copying the first parameters into the trap frame, avoiding to allocate additional stack space for the call to KiSystemCallHandler, which now overlaps with the space that is allocated for the Nt* function.
Finally fix the locations where r10 and r11 are stored, which is TrapFrame->Rcx and TrapFrame->EFlags, based on the situation in user mode.
2020-10-31 14:23:16 +01:00
Timo Kreuzer a6732905b8 [NTOS:KE:X64] Implement KiConvertToGuiThread, KeSwitchKernelStack and support for win32k syscalls in KiSystemCallHandler 2020-10-31 14:23:16 +01:00
Timo Kreuzer fe6752f852 [NTOS:KE:X64] Fix bugs in KeContextToTrapFrame and KeTrapFrameToContext
Set valid EFlags, the non-volatiles need to be taken from the exception frame, because the ones from the trap frame might not be set.
2020-10-31 14:23:16 +01:00
Timo Kreuzer a662c6f180 [NTOS:KE:X64] Silence KiRundownThread, it has nothing to do 2020-10-31 14:23:16 +01:00
Timo Kreuzer eda01e5be7 [NTOS:KE:X64] Fix KiWriteSystemTime 2020-10-31 14:23:16 +01:00
Timo Kreuzer 7e6dce6aa1 [ASM:X64] Save GS base MSR in trap frame 2020-10-31 14:23:16 +01:00
Timo Kreuzer 8ec888487a [ASM:X64] ASSERT that interrupts are enabled, when returning to user mode 2020-10-31 14:23:16 +01:00
Timo Kreuzer ce5aa24c50 [ASM:X64] Add initial version of kxamd64.inc, macamd64.inc 2020-10-31 14:23:16 +01:00
Timo Kreuzer fe36f081c7
[COMPILER_APITEST] Add SEH tests from MS (#2435)
* [COMPILER_APITEST] Import MS EH/SEH tests

Taken from https://github.com/microsoft/compiler-tests

* [CRT] Add missing declaration of _longjmpex

* [COMPILER_APITEST] Add cmake build files for MS SEH test

It is built as a static library

* [COMPILER_APITEST] Fix GCC build of MS SEH tests

There are a number of hacks in there now. Also the volatile hacks should be separated and sent upstream.

* [COMPILER_APITEST] Fix x64 build of MS SEH tests

* [COMPILER_APITEST] Fix clang build of MS SEH tests

* [COMPILER_APITEST] Include MS SEH tests
2020-10-31 11:08:27 +01:00
Serge Gautherie 698a8e6554
[DOC] 3rd Party Files.txt: Add 'rdesktop' entry (#3333) 2020-10-30 15:35:49 +03:00
Hermès Bélusca-Maïto 731eddfe40
[BASESRV] Re-enable and actually fix the CsrValidateMessageBuffer() checks in BaseSrvDefineDosDevice(). (#3304)
Addendum to commit 0a392b18.

The actual problem that existed all along was that the buffers being
validated with CsrValidateMessageBuffer() were not the correct ones!

What had to be checked is the string buffer **INSIDE** the UNICODE_STRING
structures! Indeed, it is these buffers that we are allocating on client side,
see https://github.com/reactos/reactos/blob/9b421af1/dll/win32/kernel32/client/dosdev.c#L324-L336

Dedicated to Pierre Schweitzer.
2020-10-30 01:58:16 +01:00
Hermès Bélusca-Maïto f4279fc356
[CSRSRV] Clarify few comments, and use MAXULONG. 2020-10-30 01:55:16 +01:00
Mark Jansen 9b421af118
[NTDLL_APITEST] Fix LdrEnumResources testdata initialization
ROSTESTS-361
2020-10-29 20:17:58 +01:00
Timo Kreuzer 0e5a4d5afe [PSDK] Import some SAL headers from MS
Taken from https://github.com/microsoft/ChakraCore/tree/master/pal/inc/rt

* Move _Check_return_opt_ and _Check_return_wat_ to crtdefs.h
* Update sal.h from https://github.com/microsoft/ChakraCore/blob/master/pal/inc/rt/sal.h
* Import no_sal2.h from MS and remove the one in NDK
* Import specstrings.h from MS
* Import specstrings_strict.h from MS
* Add specstrings_undef.h (based on defines in specstrings_strict.h)
* Remove __REACTOS__ hacks from cdfs
2020-10-29 06:51:28 +01:00
Jérôme Gardou 95d873091b [CMAKE] Make reactos_cab_inf really depend on reactos.inf
Instead of being always out of date & always trigger reactos.cab creation
2020-10-28 18:03:34 +01:00
Jérôme Gardou b2cf5a4c03 Revert "[CMAKE] Make unattended bootcd configurable via cmake"
This reverts commit cfd4ef9384.
This was way more controversial than I would have thought
2020-10-26 18:13:50 +01:00
Mark Jansen c3b3fcd111
[RAPPS] Abort screenshot iteration on the first not found
This should decrease startup time / db parse time
2020-10-25 20:30:03 +01:00
Mark Jansen 964c22c1ca
[RAPPS][RAPPS.COM] Introduce a rapps console shim
rapps.com will be launched when running 'rapps' from cmd or
from run, and since it is a console application, explorer/ cmd will
wait for it.
This rapps.com passes the commandline to rapps.exe,
and wait for rapps.exe to exit before closing.

CORE-17281
2020-10-25 15:44:33 +01:00
Carlo Bramini 4ffd9fb3a0
[DBGHELP] Add missing support for AMD64. (#3083)
See:
https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-context
2020-10-25 12:30:37 +01:00
Doug Lyons 8081ba9332
[WIN32SS] Repaint the whole window frame on some style bits set (#3199)
This fixes the ReactOS Calculator buttons disappearing in CORE-16827
2020-10-24 22:35:45 +03:00
Thomas Faber 303f17f884
[FASTFAT] Implement the overflow queue. CORE-17344 CORE-17328
This avoids blocking all Ex worker threads in fastfat, thereby making Cc
unable to issue the lazy writes that would unblock those workers.
This is more or less directly taken from fastfat_new.
2020-10-24 19:53:36 +02:00
Oleg Dubinskiy cdb48b8219
[SHELL32] Stub SHGetShellStyleHInstance and SHGetAttributesFromDataObject CORE-17337 (#3295)
They are required by MS Picture and Fax Viewer (shimgvw.dll), together with MS browseui.dll.
CORE-17337
2020-10-24 18:04:54 +03:00
Oleg Dubinskiy d0a7df49fa
[BROWSEUI] CCommonBrowser class should support aggregation (#3308)
It will remove the following error from the log when use MS shell32.dll in ReactOS:
`fixme:(dll/win32/ole32/compobj.c:3454) Class {af604efe-8897-11d1-b944-00a0c90312e1} does not support aggregation`.
References:
https://www.geoffchappell.com/studies/windows/ie/browseui/classes/ccommonbrowser.htm
https://docs.microsoft.com/en-us/cpp/atl/reference/aggregation-and-class-factory-macros?view=vs-2019
CORE-17345
2020-10-24 18:02:18 +03:00
Victor Perevertkin dcfb80c47a
[DOC] Add more files to "3rd Party Files.txt" 2020-10-24 17:07:13 +03:00
Timo Kreuzer a713e63b8b [COMPILER_APITEST] Add new compiler_apitest, using pseh tests 2020-10-24 13:26:33 +02:00
Timo Kreuzer 69e80a1e74 [PSEH2_TEST] Move it to apitests
The folder name is compiler, because it is going to be part of a new compiler_apitest.
2020-10-24 13:26:33 +02:00
Timo Kreuzer 1fa9fdb625 [PSEH2_TEST] Fix compilation with MSVC 2020-10-24 13:26:33 +02:00
Piotr Hetnarowicz 16d8190f51 [SHELL32] PL-pl Dialogs fix v2
shell32.dll PL-pl
-FIXED: invisible icon,text & description
2020-10-24 10:20:59 +02:00
Serge Gautherie be08d69bc3 [MLANG] Fix scripts values in fnIMLangFontLink2_GetScriptFontInfo()
MSVC:
'...\mlang.c(3568): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)'

Import
2dc0758b5d
2020-10-24 10:17:05 +02:00
Victor Perevertkin 119f102f63
[DOC] Make "3rd Party Files.txt" a main source about 3rd party projects
- Add path and license information to "3rd Party Files.txt"
- Merge README.FSD with it
- Rename README.WINE to WINESYNC.txt
2020-10-24 06:34:55 +03:00
Serge Gautherie a2a6038e56
[CMAKE] MSVC RUNTIME_CHECKS is a 'Debug'-only feature
"cl : Command line error D8016 : '/Ox' and '/RTC1' command-line options are incompatible"

Addendum to 92dfec219d.
2020-10-24 04:28:16 +03:00
Jérôme Gardou de40118362 [CMAKE] Make unattended bootcd configurable via cmake
Instead of messing around with a file in the source tree and risk commiting it

use cmake -DUNATTENDED_BOOTCD=yes to enable it, and use the UNATTENDED_BOOTCD_* cache variables to configure
2020-10-23 10:31:57 +02:00
Jérôme Gardou 23e04ae1ee [CMAKE] Use an INTERFACE library to perform the msvcrt <-> msvcrtex binding 2020-10-22 18:07:27 +02:00
Jérôme Gardou bada20a361 [APISETS] Declare them as modules instead of win32dll 2020-10-22 18:07:27 +02:00
Jérôme Gardou 5c25e816bf [CMAKE] Only link msvcrtex to win32cui, win32gui, win32dll, win32ocx and cpl modules 2020-10-22 18:07:27 +02:00
Jérôme Gardou 840fe4d6ac [CMAKE] Introduce the REACTOS_MODULE_TYPE target property
And set it in set_module_type function
2020-10-22 18:07:27 +02:00
Jérôme Gardou c321d3e88b [CRTDLL] Make this a stand-alone CRT DLL
Because CRTs must be isolated from each other.
This basically reverts commit f0c91ae
2020-10-22 18:07:27 +02:00
Victor Perevertkin 953c03c336
[DEVMGR] Avoid buffer overflow when device reg key size is > 100 chars 2020-10-22 14:38:55 +03:00
Jérôme Gardou bbe47e61b1 |CMAKE] Use ExternalProject for host-tools build 2020-10-22 09:31:11 +02:00
Katayama Hirofumi MZ 6cb3b62b4c [APISETS] Revert 'Try to fix build of both case of MSVC AND CLANG' 2020-10-22 09:18:32 +09:00
Katayama Hirofumi MZ 926ada989c [APISETS] Try to fix build of both case of MSVC AND CLANG 2020-10-22 09:07:15 +09:00
Katayama Hirofumi MZ 89bd2d12da [INCLUDE] Use HeapAlloc/HeapFree in layout.h
CORE-17341
2020-10-22 08:07:32 +09:00
Katayama Hirofumi MZ de8d156e2c
[SHELL32] Resizable for SHBrowseForFolder (#3299)
Make the dialog box of SHBrowseForFolder function resizable. CORE-17341
2020-10-21 22:25:16 +09:00
Victor Perevertkin ba09834c5e
[PARPORT] Fix I/O port length check
The Standard Parallel Port (SPP) has 3 registers, not 4: data, status, control
This fixes the driver on the Compaq N600c laptop
2020-10-21 15:24:10 +03:00
Jérôme Gardou f26754e6dd [NTOSKRNL] Completely disable optimizations when using GDB 2020-10-21 13:11:20 +02:00
Jérôme Gardou ab825334dd Apply suggestions from code review
Beautification and clarity

Co-authored-by: Victor Perevertkin <victor@perevertkin.ru>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-10-20 21:44:54 +02:00