Hermès Bélusca-Maïto
1b564c1ba8
[REACTOS] Use the RT_* resource type defines where possible ( #6023 )
...
And use the self-documenting `MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)`
instead of `0` for the `LDR_RESOURCE_INFO::Language` structure member.
2025-04-08 20:21:07 +02:00
Hermès Bélusca-Maïto
111c8cc62a
[REACTOS] Usage improvements for some RtlFindMessage invocations ( #6023 )
...
Use `RT_MESSAGETABLE` and `MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)`
instead of hardcoding their values.
2025-04-08 20:19:54 +02:00
Hermès Bélusca-Maïto
125f94d8ab
[NTOS:EX] Check whether the boot-time drivers are safe to use on MP systems ( #7744 )
...
Invoke the MmVerifyImageIsOkForMpUse() helper. If the boot-time driver
only supports a uniprocessor system, bugcheck with UP_DRIVER_ON_MP_SYSTEM.
https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-0x92--up-driver-on-mp-system
Note that we don't do this check very soon at boot time (e.g. in
MiReloadBootLoadedDrivers or MiInitializeLoadedModuleList), but only
after loading the drivers' debug symbols (if any).
The reason is simply to ease debugging in case we bugcheck: this allows
having the debugger set up with the symbols for this driver.
For automatic and manual driver loading, MmVerifyImageIsOkForMpUse()
is invoked by MmCheckSystemImage() but in this case, there is graceful
failure and no bugcheck.
2025-04-04 13:05:22 +02:00
Hermès Bélusca-Maïto
3022d74beb
[NTOS:EX/KE][HALX86] Add support for NUMPROC, BOOTPROC, MAXPROC, ONECPU boot switches ( #6024 )
...
These SMP-specific switches allow to test and control configurations
with various number of CPUs on multiprocessor systems.
- NUMPROC: maximum number of logical processors that can be started
(including dynamically, not currently supported by ReactOS) at run-time.
- BOOTPROC: maximum number of logical processors that can be started at
boot-time.
- MAXPROC: forces the OS to report the maximum possible number of CPUs
as existing on the system.
- ONECPU (MP HAL-only boot switch): causes the HAL to only use one
(the boot) CPU on a multiprocessor system. Attempting to start other
processors will fail.
For more information, see:
https://www.geoffchappell.com/notes/windows/boot/bcd/osloader/numproc.htm
https://www.geoffchappell.com/notes/windows/license/processors.htm
https://rmscrypt.wordpress.com/2011/02/
https://codeinsecurity.wordpress.com/2022/04/07/cpu-socket-and-core-count-limits-in-windows-10-and-how-to-remove-them/
Generic references about BOOT.INI switches:
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-options-in-a-boot-ini-file
https://www.itprotoday.com/cloud-computing/what-switches-can-be-used-bootini
http://franck.kiechel.free.fr/dbr_eng/BootIni.htm
References about BCD options:
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/bcdedit--set
http://www.mistyprojects.co.uk/documents/BCDEdit/files/commands.6.1.7601.htm#TYPES%20OSLOADER
2025-04-04 12:51:49 +02:00
Hermès Bélusca-Maïto
7093412f4e
[NTOS] Build mproc.c _only_ for MP ntoskrnl, not for single-processor
...
The usage of the BUILD_MP cmake variable was inadequate.
2025-04-04 12:51:29 +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
Hervé Poussineau
0f36ef3392
[NTOS:KD64] Improve KdSystemDebugControl
...
- Explicitly return STATUS_NOT_IMPLEMENTED on not implemented classes
- Return STATUS_INVALID_INFO_CLASS on all other classes
2025-01-28 22:00:37 +01:00
Hermès Bélusca-Maïto
a0b009f1ed
[NTOS:EX:KD64] Add Doxygen documentation for Nt/KdSystemDebugControl.
...
Based from external documentation:
https://www.ivanlef0u.tuxfamily.org/?p=21
https://www.ivanlef0u.tuxfamily.org/?p=382
http://pds8.egloos.com/pds/200807/09/51/Subverting_Windows_2003_Service_Pack_1_Kernel_Integrity_Protection.pdf
http://www.nynaeve.net/?p=114
https://media.defcon.org/DEF%20CON%2030/DEF%20CON%2030%20presentations/Eran%20Segal%20-%20The%20COW%20%28Container%20On%20Windows%29%20Who%20Escaped%20the%20Silo.pdf
https://vidstromlabs.com/blog/memory-dumping-with-ntsystemdebugcontrol/
https://www.kernelmode.info/forum/viewtopic0aa3.html?t=5317
2025-01-28 22:00:36 +01:00
Hermès Bélusca-Maïto
317f1e8391
[NDK][NTOS:EX:KD64] Add SAL annotations to Kd/Nt/ZwSystemDebugControl.
2025-01-28 22:00:35 +01:00
Hermès Bélusca-Maïto
5d78952024
[NTOS:KD64] Simplify some code in debugging helpers
2025-01-28 22:00:34 +01:00
Hermès Bélusca-Maïto
1c61d4ce90
[NTOS:KD64] Add annotations to debugger control routines used in Kd/Nt/ZwSystemDebugControl
2025-01-28 22:00:33 +01:00
Hervé Poussineau
20bd5e8a9c
[NTOS:MM] Allow not providing MMDBG_COPY_UNSAFE in MmDbgCopyMemory
...
Replace an assert by a log, as this works most of the times.
2025-01-28 22:00:31 +01:00