Commit graph

1865 commits

Author SHA1 Message Date
Timo Kreuzer
030c1fe576 HACK HACK HACK: disable an ASSERT
We need proper IPIs to flush the TLB
2025-03-28 12:32:58 +02:00
Timo Kreuzer
e5c880df25 WIP [NTOS:KE/x64] Handle NewThread == OldThread in KiIdleLoop 2025-03-28 12:32:58 +02:00
Timo Kreuzer
6009f9c82a WIP KiIdleLoop PrcbLock 2025-03-28 12:32:58 +02:00
Timo Kreuzer
62ca4f1319 WIP add a bunch of ASSERTs 2025-03-28 12:32:58 +02:00
Timo Kreuzer
500236d65d [NTOS:KE] Handle SwapBusy in x64 KiIdleLoop 2025-03-28 12:32:58 +02:00
Timo Kreuzer
bfd661c1ce WIP [NTOS:KE/x64] Properly handle KiIdleSummary
TODO: Remove the chunk from KiSystemStartupBootStack? Shouldn't be needed.
What about other instances of KiIdleSummary?
2025-03-28 12:32:58 +02:00
Timo Kreuzer
c0e554b873 [NTOS:KE/x64] Lower IRQL to passive while running idle function 2025-03-28 12:32:57 +02:00
Timo Kreuzer
ef1d8ee72e [NTOS:KE/x64] Ignore DPCs from the idle loop
This is handled in the idle loop itself. The idle loop must not be preempted from a DPC.
2025-03-28 12:32:57 +02:00
Timo Kreuzer
fe4f962bc6 [NTOS:IO] Fix affinity of PsInitialSystemProcess
Add a hack to work around SMP-incompatible drivers
2025-03-28 12:32:57 +02:00
Timo Kreuzer
a29fcc3565 [NTOS:KE/x64] Move initialization of KeActiveProcessors 2025-03-28 12:32:57 +02:00
Timo Kreuzer
2d01fb8194 [HAL][NTOS] Implement x64 SMP startup code
TODO: fix lgdt macro to work with GAAS and ML
Works with PIIX3 and cdrom on AHCI or SCSI controller
When cdrom is on IDE controller it doesn't seem to work
2025-03-28 12:32:57 +02:00
Serge Gautherie
35ca454cab
[NTOSKRNL] Add missing \n to DPRINT() calls (#6012)
Improve debug logs.
- Add missing \n to DPRINT() calls
- And demote/promote some DPRINT()/DPRINT1().
2025-03-26 10:23:15 +01:00
Mark Jansen
5821136dfa [AVRF] Hook up debug functions, add noisy stub for AVrfpGetStackTraceAddress 2025-03-25 16:23:39 +01:00
Timo Kreuzer
0fc0d9ebb1 [NTOS:KE] Skip an "optimization" on SMP 2025-03-24 21:33:48 +00:00
Timo Kreuzer
0016d65532 NTOS:KE] Make KiSetAffinityThread SMP ready 2025-03-24 21:33:48 +00:00
Timo Kreuzer
9292cad39a [NTOS:KE] Implement KiFindIdealProcessor 2025-03-24 21:33:48 +00:00
Timo Kreuzer
c1369e8c41 [NTOS:KE] Select proper processor in KiDeferredReadyThread 2025-03-24 21:33:48 +00:00
Thomas Faber
1b2eeb23e0 [NTOS:EX] Fix BufferSize validation in NtCreateProfile.
See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/profile/bugdemo.htm
2025-03-24 20:56:30 +01:00
Justin Miller
656a5dcc1f
[NTOS:KE] Implement KeI386VirtualIntExtensions code paths for INT and IRET. CORE-19049 (#7742)
Co-authored-by: Thomas Faber <thomas.faber@reactos.org>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>

Continued from PR #6070

JIRA issue: CORE-19049
2025-03-12 05:24:36 -07:00
Hermès Bélusca-Maïto
f37138ce91
[NTOS:OB] Allow ObpCaseInsensitive to be configured via registry (#7751)
This feature can be controlled by the system policy:
"System objects: Require case insensitivity for non-Windows subsystems"
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/jj852277(v=ws.11)

It is also used in conjunction with NTFS to get system-wide filesystem case-sensitivity:
https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/929110

This is controlled with a REG_DWORD value named `ObCaseInsensitive`
inside the registry key
`HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel` .

Object case (in)sensitivity check is done in the ObpLookupObjectName() helper.
The `ObpCaseInsensitive` variable is used to retrieve the data,
hence it needs to be a ULONG.
2025-03-11 19:15:02 +01:00
Hermès Bélusca-Maïto
c71845ee8c
[NTOS:OB] ObpLookupEntryDirectory(): SearchShadow is a BOOLEAN 2025-03-11 19:12:36 +01:00
Hermès Bélusca-Maïto
bc62c17a7f
[KERNEL32][NTDLL][NTOS][WIN32K] Fix and sync the exports for RtlUnwindEx and RtlVirtualUnwind (#7749) 2025-03-11 18:59:22 +01:00
Timo Kreuzer
c6853581c5 [NTOS:MM] Fix broken ASSERT
There is no guarantee that all pages in the requested range actually exist.
2025-03-04 15:24:53 +02:00
Ratin Gao
4d605ec26f
[NTOS:MM:PS] Little fixes for NTDLL loading (#7707)
- [NTOS:PS] `STATUS_INVALID_IMAGE_PROTECT` returned by `MmCheckSystemImage` should be a fatal error too.
- [NTOS:PS] Fix object attributes for opening NTDLL.
- [NTOS:MM] Remove `MmCheckSystemImage` unused parameter.
- [NTOS:MM] Inline `MmVerifyImageIsOkForMpUse` in `MmCheckSystemImage`, reducing a call to `RtlImageNtHeader`.
2025-03-03 20:36:21 +01:00
Hermès Bélusca-Maïto
7c23a2e38e
[NTOS:MM] Split MmVerifyImageIsOkForMpUse() into an auxiliary inlined helper.
This helper is used when an existing NtHeader is already available.
2025-03-03 20:30:54 +01:00
Oleg Dubinskiy
a8669e023a [NTOS:IO] Rewrite OpenRegistryHandlesFromSymbolicLink
Also add a new IopOpenOrCreateSymbolicLinkSubKeys routine, which does some work for it.
CORE-17361
2025-02-02 23:30:38 +01:00
Oleg Dubinskiy
d617c8cf32 [NTOS:IO] Implement IoGetDeviceInterfaceAlias
Required by XP/2003 audio stack to be loaded properly.
CORE-17361
2025-02-02 23:30:38 +01:00
Timo Kreuzer
9b002025d4 [NTOS:KE/x86] Detect more KeFeatureBits 2025-02-01 19:45:21 +02:00
Timo Kreuzer
d09eb6f856 [NTOS:KE/x64] Add detection of SSE 4.2 2025-02-01 19:45:21 +02:00
Timo Kreuzer
be3dde7698 [NTOS] Make KeFeatureBits 64 bit 2025-02-01 19:45:21 +02:00
Hervé Poussineau
70bf3bb8fa [NTOS:KDBG] Add back 'cregs' command
This command was removed in commit baa47fa5e0
because there was no way to get the CRx registers from a CONTEXT structure.
Previous code was also displaying current GDTR/LDTR and IDT.

Rewrite the code to use KdSystemDebugControl(SysDbgReadControlSpace, ...)
to get CRx, GDTR/LDTR and IDT values just before entering debugger.
2025-01-29 18:25:24 +01:00
Hervé Poussineau
b9852e83d2
[NTOS:EX] HACK: on livecd, disable security features in NtSystemDebugControl
WinDBG can do some local debugging using 'windbg -kl'. In that case,
WinDBG tries to directly use NtSystemDebugControl. If this function
returns an error, WinDBG extracts a driver from its resources.
WinDBG will send IOCTLs to this driver, and this driver will call
KdSystemDebugControl.

However, on livecd (where %SYSTEMROOT% is read-only), WinDBG is unable
to extract the driver from its resources, and can't use the driver to
call KdSystemDebugControl.

As a work-around, allow all control classes in NtSystemDebugControl
in case of livecd.
WinDBG local debugging now also works on livecd (windbg -kl).
2025-01-28 22:00:56 +01:00
Hervé Poussineau
5547b74717
[NTOS:KD64] Fix freezes on first chance exception when KDBG is enabled and KdIgnoreUmExceptions is TRUE
This fixes the following use case:
- Execute 'kdbgctrl.exe -du'
- Execute 'kdbgctrl.exe -cu'
- See that last command never finishes
2025-01-28 22:00:55 +01:00
Hermès Bélusca-Maïto
7068a790b2
[NTOS:KD64] Add a missing KdEnteredDebugger reset in KdExitDebugger() 2025-01-28 22:00:54 +01:00
Hervé Poussineau
6b89a0da11
[NTOS:EX] Implement NtSystemDebugControl: SysDbgGetKdBlockEnable/SysDbgSetKdBlockEnable 2025-01-28 22:00:53 +01:00
Hervé Poussineau
d4546753f6
[NTOS:EX] Implement NtSystemDebugControl: SysDbgGetKdUmExceptionEnable/SysDbgSetKdUmExceptionEnable 2025-01-28 22:00:53 +01:00
Hervé Poussineau
734a043b22
[NTOS:EX] Implement NtSystemDebugControl: SysDbgGetPrintBufferSize 2025-01-28 22:00:51 +01:00
Hervé Poussineau
4dc0e5cc81
[NTOS:EX] Implement NtSystemDebugControl: SysDbgGetAutoKdEnable/SysDbgSetAutoKdEnable 2025-01-28 22:00:50 +01:00
Hervé Poussineau
4bae44e412
[NTOS:EX] Implement NtSystemDebugControl: SysDbgEnableKernelDebugger/SysDbgDisableKernelDebugger 2025-01-28 22:00:49 +01:00
Hervé Poussineau
7b4d618994
[NTOS:EX] Implement NtSystemDebugControl: SysDbgBreakPoint 2025-01-28 22:00:48 +01:00
Hervé Poussineau
1db1bceaa7
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgCheckLowMemory 2025-01-28 22:00:48 +01:00
Hervé Poussineau
2fe3de6c69
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadBusData/SysDbgWriteBusData 2025-01-28 22:00:47 +01:00
Hervé Poussineau
19046a253b
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadMsr/SysDbgWriteMsr 2025-01-28 22:00:46 +01:00
Hervé Poussineau
b187662f39
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadIoSpace/SysDbgWriteIoSpace 2025-01-28 22:00:46 +01:00
Hervé Poussineau
0589c178ba
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadControlSpace/SysDbgWriteControlSpace 2025-01-28 22:00:45 +01:00
Hervé Poussineau
42e038f227
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadPhysical/SysDbgWritePhysical 2025-01-28 22:00:43 +01:00
Hervé Poussineau
2efaa5ea1e
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgReadVirtual/SysDbgWriteVirtual 2025-01-28 22:00:42 +01:00
Hervé Poussineau
9f97f0b284
[NTOS:KD64] Implement KdSystemDebugControl: SysDbgQueryVersion 2025-01-28 22:00:40 +01:00
Hervé Poussineau
6338d51353
[NTOS:EX] In NtSystemDebugControl, check for SeDebugPrivilege 2025-01-28 22:00:39 +01:00
Hervé Poussineau
9e7c3770e3
[NTOS:EX] Improve NtSystemDebugControl
- Add SEH probing for user buffer
- Mark some classes as i386 only
- Explicitly return STATUS_NOT_IMPLEMENTED on disabled classes (must use KdSystemDebugControl instead)
- Explicitly return STATUS_NOT_IMPLEMENTED on not implemented classes
- Return STATUS_INVALID_INFO_CLASS on all other classes
2025-01-28 22:00:38 +01:00