Commit graph

83394 commits

Author SHA1 Message Date
Timo Kreuzer
91bdeaeb09 cleanup 2023-05-09 23:24:22 +03:00
Timo Kreuzer
972d275765 Unhack kstack.c even more 2023-05-09 23:24:11 +03:00
Timo Kreuzer
98a3f5e99c Unhack kstack.c 2023-05-09 23:24:00 +03:00
Timo Kreuzer
2a14a9bad0 FIXME: Erase Stack PTEs before releasing them 2023-05-09 23:23:49 +03:00
Timo Kreuzer
544f89e92f ??? Move a delete in MiDeleteSystemPageableVm 2023-05-09 23:23:38 +03:00
Timo Kreuzer
ec3b4fd67c debug hacks 2023-05-09 23:23:26 +03:00
Timo Kreuzer
780f79e94b Use new kstack 2023-05-09 23:23:16 +03:00
Timo Kreuzer
51c35c0dfe +hacked kstack.c 2023-05-09 23:23:04 +03:00
Timo Kreuzer
333caf8b10 Implement new kernel stack PTE allocator for x64 2023-05-09 23:22:51 +03:00
Timo Kreuzer
8d33e43d6f +kvalayout.c 2023-05-09 23:22:38 +03:00
Timo Kreuzer
8cc6a6cc54 +system ptes 2023-05-09 23:22:27 +03:00
Timo Kreuzer
7432b6d794 [NTOS:MM/x64] Randomize location of system PTEs 2023-05-09 23:22:16 +03:00
Timo Kreuzer
9e655d3347 [NTOS:MM/x64] Allocate the debug PTE from system PTEs 2023-05-09 23:22:04 +03:00
Timo Kreuzer
6645cc4df6 [NTOS:MM:x64] Randomize system cache location 2023-05-09 23:21:51 +03:00
Timo Kreuzer
9eedc04a05 [NTOS:MM:x64] Randomize PFN database location 2023-05-09 23:21:40 +03:00
Timo Kreuzer
7ba7d99e65 [NTOS:MM:x64] Randomize non-paged pool location 2023-05-09 23:21:29 +03:00
Timo Kreuzer
ec240cc5a0 [NTOS:MM/x64] Randomize location of paged pool 2023-05-09 23:21:14 +03:00
Timo Kreuzer
3f8dce5133 [NTOS:MM/x64] "Reserve" the entire kernel space except system cache
RosMm uses MEMORY_AREAs to map sections and VACBs in system space. The previous implementation allowed them to be allocated everywhere, except for regions already used otherwise. This makes sense for x86, where the address space is limited, but we don't need that on x64.
This allows to place all other VA regions where we want without the need to allocate memory areas for completely unused regions that do not even have PXEs mapped.
2023-05-09 23:21:02 +03:00
Timo Kreuzer
34dc4b5c91 [NTOS:MM] Map PPEs and PDEs in MmCreateVirtualMappingUnsafe
This is required for both x86 and x64. On x86 we only got away without, because the page fault handler is buggy and considers a fault on kernel PTE addresses as a user mode fault and makes the PDE valid for us. On x64 this is not enough, because it only works for invalid PDEs, not for invalid PPEs and we only got away with this, because RosMm sections are allocated from the first range available for memory areas, which happens to be the system cache WS following directly after the shared user page, which already has a PPE mapped.
The bug in the fault handler needs to stay for now, since ARM3 also depends on it.
2023-05-09 23:20:49 +03:00
Timo Kreuzer
1f36aeb5ba [NTOS:MM/x64] Map PXEs of all assigned VA regions 2023-05-09 23:20:37 +03:00
Timo Kreuzer
5259e7d6e9 [NTOS:MM/x64] Implement initial KASLR support for x64 2023-05-09 23:20:25 +03:00
Justin Miller
f2a58733e8
[FREELDR][SDK] Build UEFI bootloader for ARM32 (#5196)
CORE-17604

- Disable some functions for ARM32;
- Remove some link options not used on ARM;
- Add get _controlfp() to LIBCNTPR to link properly on ARM;
- Unify Freeldr UI Drawing on ARM;
- Add qemu UART debugging for ARM32/ARM64.
2023-05-03 20:56:06 +02:00
Katayama Hirofumi MZ
a0bef1998e
[KBSWITCH] Rely on GetKeyboardLayoutList for getting list (#5263)
- Use GetKeyboardLayoutList to get the keyboard list instead of using Preload registry key.
- Get the special IDs from registry to handle special HKLs in newly-added LoadSpecialIds function.
- Add GetKLIDFromHKL, GetHKLFromLayoutNum, UpdateLayoutList, and GetKLIDFromLayoutNum helper functions.
CORE-13145, CORE-10667, CORE-18924
2023-05-03 07:45:35 +09:00
Katayama Hirofumi MZ
e6bced7a35
[EXPLORER][RUNDLL32] Restore minimized non-task windows (#5228)
The minimized non-task windows were not usable due to the bugs. In some situations, the system will restore the minimized non-task windows.
- Add IsTaskWnd helper function.
- Add SendPulseToTray function to send a pulse to the tray window.
- At some shell hook handlings, send a pulse to the tray window.
- Add IgnorePulse flag to control the timing of restoring.
- Add a timer to reset IgnorePulse flag.
- If the pulse has come and IgnorePulse flag is false, then restore the minimized non-task windows.
- Modify the rundll32 window procedure.
- Use WINDOWPLACEMENT to restore the minimized windows.
CORE-13895, CORE-18350
2023-05-03 07:39:05 +09:00
Joachim Henze
31fdaca8c0
[REGEDIT] Strip redundant include, minor formatting (#5264)
strsafe.h is already included via regedit.h
2023-05-01 16:50:01 +02:00
Vincent Franchomme
aaeb131bd4
[EXT2FS] Align with upstream and mark ReactOS diff (#5245)
NOTE: There are no new features in this PR, we stay with upstream version 0.69.
CORE-18645

- Add ifdefs to distinguish ReactOS code/fixes from the upstream code;
- If upstream code was overriden, reintroduce it in #else section;
- Re-align .rc version info with upstream (0.69).
2023-04-30 18:26:30 +02:00
Jose Carlos Jesus
39d5f1bf54
[SHELL32] Enable Network Connection Rename (#5073)
CORE-18750
- Add Network Connection pidl type 0x99;
- Add binary comparison to pidl memory range.
2023-04-30 15:40:10 +02:00
Doug Lyons
5c8ec78b71
[SETUPAPI] Sync setupapi/queue.c to Wine 4.8 (#5233)
Sync setupapi/queue.c to Wine 4.8 to improve cab extraction.
This fixes 'fixme:(dll/win32/setupapi/queue.c:418) awful hack: extracting cabinet'
2023-04-30 15:34:26 +02:00
Jose Carlos Jesus
a0d747fa50
[COMDLG32] Enable saving files with different extension (#4903)
As on Windows, gives precedence to the user's extension in file names if there is one.
Otherwise appends the selected extension. If not selected, append default extension.
2023-04-30 15:21:20 +02:00
Justin Miller
1fd9d11f16
[FREELDR] Add disk access handlers for UEFI (#5219)
CORE-11953
2023-04-30 14:57:10 +02:00
Joachim Henze
3c797b314f
[E1000] Stop logging MAC, is sensitive data of log-contributors (#5254) 2023-04-29 23:02:03 +02:00
Katayama Hirofumi MZ
7ee41e9e60
[KBSWITCH] Delete SHLoadRegUIString hack (#5260)
Because shlwapi!SHLoadRegUIString function is already implemented, so we don't need the hack any more. CORE-10667
2023-04-29 07:28:56 +09:00
Katayama Hirofumi MZ
7eda556c64
[INPUT] Remove fake SHLoadRegUIStringW hack (#5258)
Because shlwapi!SHLoadRegUIStringW function is already implemented, so we don't need the hack any more. CORE-11700
2023-04-29 07:27:54 +09:00
Katayama Hirofumi MZ
c9ed65e0cc
[NOTEPAD] Delete my name from resource copyright text (#5261)
The copyright text was too long. CORE-18837
2023-04-28 21:48:45 +09:00
Katayama Hirofumi MZ
31f3eb1d57
[RICHED20] RichEdit: CompForm and CandForm (#5257)
Correctly display the composition window and the candidate window.
- At update_caret function, set the position and font of the composition window.
- We don't use internal composition string. Rely on the composition window.
- Improve WM_IME_SETCONTEXT, WM_IME_CONTROL, WM_IME_SELECT, WM_IME_STARTCOMPOSITION, WM_IME_COMPOSITION and WM_IME_ENDCOMPOSITION message handlings.
CORE-11700
2023-04-28 08:28:57 +09:00
Mark Jansen
507aae4c30
[ATL] Take _ATL_FREE_THREADED into account
When it is not defined, COM should not be initialize multithreaded
2023-04-27 16:29:21 +02:00
Katayama Hirofumi MZ
f4b7087a0e
[ADVPACK_APITEST] Add advpack_apitest:DelNode testcase (#5256)
Preparation for advpack!DelNodeA/W functions implementation. CORE-13275, ROSTESTS-276
2023-04-27 20:35:41 +09:00
Mark Jansen
4cdcea5e65
[SHELL32] Implement SHQueryRecycleBinW 2023-04-26 22:50:11 +02:00
Mark Jansen
08d808cc44
[ATL] Add CAtlList::SwapElements 2023-04-26 22:48:29 +02:00
Katayama Hirofumi MZ
9d7d3314b3
[REGEDIT] Check whether pszSelectKey is NULL on CDN_FILEOK (#5255)
Avoid crash on exporting root. Add NULL check of pszSelectKey on CDN_FILEOK handling. CORE-18938
2023-04-25 18:04:36 +09:00
Thamatip Chitpong
560671a784
[NTUSER] Improve MsqPostMessage (#5225)
- MsqPostMessage: Fill Message structure before InsertTailList. For style consistency.
- MsqPostMessage: Fix the use of MessageQueue variable
2023-04-24 20:11:46 +02:00
Mark Jansen
d3feae5139
[ATL_APITEST] Add test for OBJECT_ENTRY_AUTO
CORE-18936
2023-04-22 21:24:04 +02:00
Mark Jansen
d12880829f
[ATL] Add OBJECT_ENTRY_AUTO for simpler com object registration
Of course gcc needs a nasty hack to include the symbol.
CORE-18936
2023-04-22 21:23:55 +02:00
Mark Jansen
bf29d98a54
[PSDK] Add some more argument names 2023-04-22 18:31:49 +02:00
George Bișoc
8e7b22a631
[NTOS:OB] Fix the SAL2 annotation of ObQueryTypeInfo
The data has to be written into ObjectTypeInfo based on the return length,
not only what is provided by the input buffer length. Fix suggested by
Hermès.
2023-04-22 17:18:57 +02:00
George Bișoc
00c69bcd15
[NTOS:OB] Properly calculate the return length in ObQueryTypeInfo
On a x86 system aligning the return length pointer to a 4-byte boundary
works best since pointers in general are 4-byte aligned for x86 systems.

However, what happens on a AMD64 system is that we still align this pointer
to 4-byte, ObjectTypeInfo is a 8-byte pointer and we might write into
the return length past the 4-byte boundary.

If one were to allocate a pool of memory with that length and query all
the object types info and free the said pool of memory thereafter, the
system will crash with BAD_POOL_HEADER because ObQueryTypeInfo overwrote
the return length past the 4-byte boundary length therefore leading up with
corrupted memory blocks in the pool header.

This symptom of BAD_POOL_HEADER happens exactly the same in Windows Server
2003 x64 Edition. Newer versions of Windows like 10 aren't affected.

But, Windows has another bug where they are using MaximumLength for the
calculation of the needed length to be returned to caller. MaximumLength
does not guarantee you that it includes the NULL-terminator in the length
and that potentially leads to a buffer overrun.

Also annotate the ObQueryTypeInfo function with SAL2.

https://processhacker.sourceforge.io/doc/object_8c_source.html (read the
comment in KphObjectTypeInformation).
2023-04-21 12:45:31 +02:00
Atharva Kulkarni
6eee9f9daf
[SCSIPORT] Flush and Free Map Registers (#5190)
- Flush Map registers once the DMA completes
- Free Map registers once the DMA completes
- Add support for SGL allocated from NonPagedPool

Test:
Force Allocations of SGL from Non Paged Pool and ensure OS boots and functions properly

Test Logs:
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
DHCPCSVC: Adapter Name: [{7cd69ac0-dabb-410a-b927-cb3961d174da}] (dynamic)
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
WARNING:  HalCalculateScatterGatherListSize at hal\halx86\generic\dma.c:1168 is UNIMPLEMENTED!
SpiAdapterControlFORCING ALLOCATION FROM SGPOOL
SpiAdapterControlFORCING ALLOCATION FROM SGPOO
2023-04-21 12:44:31 +02:00
Adam Słaboń
6eb8fe4f82
[NTOS:MM] MmCanFileBeTruncated: Check whether second (optional) parameter was passed (#5248)
Second parameter is optional, so mark it as such and check whether it was passed. Fixes a sporadic 0x24 bugcheck caused by access violation when running ReactOS on NTFS volume with WinXP ntfs.sys.
2023-04-19 23:12:11 +02:00
Vincent Franchomme
058726a2c1
[I8042PRT] Add Dell Latitude D410 to the hack list (#5246) 2023-04-18 10:03:16 +02:00
Mark Jansen
6e35c75035
[GITHUB] Add Labeler rule for ATL 2023-04-17 18:12:27 +02:00