1921 Commits

Author SHA1 Message Date
Justin Miller
094b7d9c79 [FORMATTING] Start Kernel Arbiter with clean instance 2025-10-03 07:32:33 -07:00
Timo Kreuzer
571ac5e608 [NTOS:PO] Implement SystemBatteryState in NtPowerInformation
This should get us proper battery status display.
2025-09-13 11:38:38 +03:00
Hermès Bélusca-Maïto
186404274c [NTOS:EX] Fix trivial typos in comments 2025-08-25 22:53:47 +02:00
Hermès Bélusca-Maïto
2164b35683 [NTOS:PS] Implement NtQueryInformationThread(ThreadBreakOnTermination)
Invoked by `RtlSetThreadIsCritical()` for returning the previous flag value,
and fixes the following error:
```
(ntoskrnl/ps/query.c:3155) Not implemented: 18
```

The implementation is "identical" to that of NtQueryInformationProcess()
`ProcessBreakOnTermination`, with the necessary adaptations, of course.
2025-08-25 21:00:41 +02:00
Hermès Bélusca-Maïto
47b92973a9 [NTOS:PS] query.c: Improve some DPRINTs and comments 2025-08-25 21:00:40 +02:00
Hermès Bélusca-Maïto
a449eb3e0e [NTOS:PS] Improve some PspCatchCriticalBreak() messages 2025-08-25 21:00:38 +02:00
Timo Kreuzer
6d321562c9 [NTOS][NTDLL][UCRTBASE] Use new setjmp/longjmp
This fixes 2 todo tests
2025-08-22 09:12:51 +03:00
Timo Kreuzer
f709f6f22f [NTOS:KE/x64] Initialize FP control word to INITIAL_FPCSR 2025-08-22 09:12:51 +03:00
Timo Kreuzer
80bef4fe40 [XDK][NTOS:KE] Update XSAVE_AREA 2025-08-22 09:12:51 +03:00
Timo Kreuzer
cdfae35256 [NTOS:KDBG] Set default disassembly style to Intel
Seriously!
2025-08-22 09:12:51 +03:00
Doug Lyons
05caf99940 [NTOS:MM] Fix Lazarus hang when closing running project with "X" (#8331)
CORE-20172
Make DbgkUnMapViewOfSection in function MiRosUnmapViewOfSection contingent on MapCount being 0.
2025-08-20 14:18:25 -05:00
Serge Gautherie
f6346c6228 [NTOS:KE] Fix X86_FEATURE_MTTR typo (#8330)
"MTTR" should read: "MTRR".
2025-08-13 12:25:43 +02:00
Timo Kreuzer
64701d0798 [NTOS:EX] Fix query of SystemFirmwareTableInformation 2025-08-05 16:20:02 +03:00
Timo Kreuzer
3a0f9f2fa0 [NTOS:EX] Fix query of SystemLookasideInformation
Prevents a failed ASSSERT
2025-08-05 16:20:02 +03:00
Ratin Gao
49e652b7b7 [NTOS:PS] Implement ProcessImageFileNameWin32 information class 2025-07-17 18:18:47 +03:00
George Bișoc
624c3fd847 [SDK] Introduce the PO GUID library
This library aims to include all the public and global power manager related GUID identifiers into one shared library, of which they can be accessed across multiple modules of ReactOS, e.g. the kernel, ACPI, PCI, et al.

This patch is needed for the development of the Power Manager (#5719) to continue.

CORE-18969
2025-07-16 20:15:15 +02:00
Timo Kreuzer
7e4f12743f [NTOS:PS/x64] Use KiGetTrapContext from PspGetOrSetContextKernelRoutine 2025-07-10 14:57:09 +03:00
Timo Kreuzer
61b6cd9d28 [NTOS:KE] Implement KiGetTrapContextInternal 2025-07-10 14:57:09 +03:00
Carl J. Bialorucki
a753f34e30 [PSDK][XDK][NDK][INCLUDE/WINE] Make header changes to sync crypt32, kernel32, and user32 winetests (#8114)
- [PSDK] Sync wincrypt.h to Wine 10.0, keeping our SAL annotated function definitions behind an #ifdef guard
- [XDK] Add definitions to our winnt header that Wine 10.0's winternl.h depends on.
- [INCLUDE/WINE] Sync winternl.h to Wine 10.0
- [OTHER] Fix breaking changes with the synced winternl.h.
2025-07-05 15:14:31 -06:00
Timo Kreuzer
24b0857a72 [NTOS:MM] Handle failure of MmSetPageEntrySectionSegment
This prevents a crash when paged pool is low.

No, I will not fix all other instances!
2025-07-03 22:38:50 +03:00
Timo Kreuzer
2cd05a3756 [NDK] Update SYSTEM_INFORMATION_CLASS
See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi/system_information_class.htm and Windows 10/11 pdb files
2025-07-03 22:21:05 +03:00
Eric Kohl
c720dd4960 [NTOS:IO] NtPlugPlayControl.PlugPlayControlUnlockDevice is not implemented
It was probably used in previous versions of Windows NT.
2025-06-29 23:43:09 +02:00
Eric Kohl
b364fee806 [NTOS:IO] Implement NtPlugPlayControl.PlugPlayControlDeviceClassAssociation
The unregistration part is not implemented yet.
2025-06-29 17:34:27 +02:00
Oleg Dubinskiy
63ca8c414e [NTOS:EX] Implement NtSetSystemInformation().SystemLoadGdiDriverInSystemSpaceInformation (#8180)
Implement SystemLoadGdiDriverInSystemSpaceInformation case of NtSetSystemInformation() function.
According to https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/gdi_driver.htm, it does the similar thing to SystemLoadGdiDriverInformation (these two cases even have the same shared SYSTEM_GDI_DRIVER_INFORMATION structure).
The only difference is, SystemLoadGdiDriverInSystemSpaceInformation uses the global system space (without passing an additional flag to MmLoadSystemImage()), while SystemLoadGdiDriverInformation uses the session space instead.
Since the session space is not supported yet, for now simply redirect SystemLoadGdiDriverInSystemSpaceInformation to SystemLoadGdiDriverInformation case, which we have already implemented. However, this code needs to be updated appropriately (an additional flag should be passed to MmLoadSystemImage() call for SystemGdiDriverInformation as well) once a support for session space is implemented.
This fixes VM starting failure for VirtualBox 3.1.0 - 4.0.24 and 4.3.0 - 4.3.12 versions. Newer versions of VirtualBox still don't work because of another blocking bugs.
CORE-20257
2025-06-29 15:00:41 +02:00
Timo Kreuzer
1a11aa059f [NTOS:MM] Fix section related test failures
Fixes all failures, except pointer counts.
2025-06-21 18:19:01 +00:00
Timo Kreuzer
736015f36f [NTOS:MM] Fix a bad cast 2025-06-21 18:19:01 +00:00
Timo Kreuzer
e9ab780527 [NTOS:MM] Fix some unimplemented cases of NtQuerySection 2025-06-21 18:19:01 +00:00
Timo Kreuzer
6653bb5224 [NTOS:KE] Detect CPU support for XSAVE, AVX, AVX2 and AVX512 2025-06-21 07:55:06 +00:00
Timo Kreuzer
294eb31cfd [NTOS:KE/x64] Handle extended processor state on context switch 2025-06-21 07:55:06 +00:00
Timo Kreuzer
d6874fe7b9 [NTOS:KE/x64] Implement KiSave/RestoreXState 2025-06-21 07:55:06 +00:00
Timo Kreuzer
410cf69b0c [NTOS:KE/x64] Handle XState allocation on the stack 2025-06-21 07:55:06 +00:00
Timo Kreuzer
72fbbdf854 [NTOS:KE/x64] Implement KiInitializeXStateConfiguration 2025-06-21 07:55:06 +00:00
Timo Kreuzer
f4fd842be1 [NTOS:KE/X64] Move initialization of keFeatureBits 2025-06-21 07:55:06 +00:00
Serge Gautherie
9832737843 [NTDLL_WINETEST][NTOS:PS] Fix a few NtQueryInformationProcess(Process*) handling cases (#8136)
* [NTDLL_WINETEST] `test_query_process_debug_object_handle()`: one WINESYNC

Cherry-pick WineTest part of:
52d733b5c4
server: Implement retrieving the debug object of a process.
by: Alexandre Julliard <julliard@winehq.org>

* [NTOS:PS] Fix `NtQueryInformationProcess(ProcessDebugObjectHandle)`

Close the retrieved `DebugPort` on failure.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] Optimize `NtQueryInformationProcess(ProcessWow64Information)` on 32-bit.

No need to do the ExAcquire/ReleaseRundownProtection rigamarole since
we aren't retrieving the `Process->Wow64Process` on 32-bit builds.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] Fix `NtQueryInformationProcess(ProcessExecuteFlags)`

s/return/break/ on a failure case.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] NtQueryInformationProcess(): Optimize `*ReturnLength` assignment

Enter the SEH block only if we know we'll have to set `*ReturnLength` on return.
Addendum to commit 2278c2914 (r23175).
2025-06-19 18:47:31 +02:00
Serge Gautherie
4f7e9dc2ed [NTOS:PS] Fix NtQueryInformationProcess(ProcessImageInformation) (#8134)
Do not overwrite Status failure value.

Addendum to commit bf493b93a (r59859).
2025-06-19 12:23:32 +02:00
Eric Kohl
0b1a448150 [NTOS:PNP] Implement NtPlugPlayControl.PlugPlayControlGetInterfaceDeviceAlias 2025-06-19 11:06:20 +02:00
Adam Słaboń
81a4d8344b [NTOS:SE] SeValidSecurityDescriptor: Use relative security descriptor header size for length calculation (#8127)
Fixes Win2k3 ntfs.sys on x64
2025-06-18 23:55:27 +02:00
Eric Kohl
37cc1e2fd6 [NTOS:IO] Move location paths code because they are not stored in the registry 2025-06-15 23:36:53 +02:00
Timo Kreuzer
946f17e93d [NTOS] Fix x64 definition of MMPFN
Adjust the definition of COLORED_LIST_HEAD to always match the new MI_PTE_FRAME_BITS define.
2025-05-04 07:28:41 +00:00
Hermès Bélusca-Maïto
d489f1a170 [NTOS:KD] Supplement minimal handling in KdSend/ReceivePacket when no kernel debugger is present.
CORE-20107

Improve the minimal handling done in the fall-back KdSend/ReceivePacket()
routines when they are invoked by KD64 (in Release build).

Part of my `kdbg_tests_kdio_split` branch for splitting kd/kdio.c
into a separate KD dll.

KdSendPacket:
- Silently ignore PACKET_TYPE_KD_STATE_CHANGE32/64 DbgKdLoadSymbolsStateChange notification.
- Partially manage and log the unhandled PACKET_TYPE_KD_STATE_CHANGE DbgKdExceptionStateChange notification.
- Log other unhandled PACKET_TYPE_KD_STATE_CHANGE32/64 and PACKET_TYPE_KD_STATE_MANIPULATE notifications.

When KdSendPacket receives the DbgKdExceptionStateChange notification,
it cannot handle it (no debugger is there!). However, we need to claim
the debugger to be present, so that its KD64 caller: KdpSendWaitContinue(),
can call back KdReceivePacket(PACKET_TYPE_KD_STATE_MANIPULATE), which,
in turn, informs KD that the exception cannot be handled, by returning
a failure code in the ManipulateState's ContinueStatus.

During bugchecks, this allows KiBugCheckDebugBreak() to not loop infinitely,
but instead fall back into calling HalHaltSystem() to halt the computer.
2025-04-19 20:01:10 +02:00
Serge Gautherie
0e21c6f3fd [NTOS:KD] Accept some packet types without KDBG (#7892)
When KDBG isn't included in the kernel (Release build), the fall-back
KdSend/ReceivePacket() routines are invoked by KD64. A minimal handling
of the basic packets needs to be done:
PACKET_TYPE_KD_STATE_CHANGE32/64 for KdSendPacket(),
and PACKET_TYPE_KD_POLL_BREAKIN, PACKET_TYPE_KD_STATE_MANIPULATE
for KdReceivePacket().

Addendum to commit 2046a17ef4
CORE-20107
2025-04-19 20:01:09 +02:00
Hermès Bélusca-Maïto
a7d86fe3a7 [NTOS][RTL] Remove unused deprecated ReactOS-only DbgBreakPointNoBugCheck()
This helper was introduced in commit b041530f2d (r8551), and its
last remaining usage removed in commit f038f4a895 (r23636).
2025-04-19 20:01:06 +02:00
Timo Kreuzer
aa60e56199 [NTOS] Fix MSVC warnings
Be strict about string length to prevent overflows.
2025-04-18 17:28:49 +00:00
Timo Kreuzer
2e85425c53 [NTOS:MM] Remove one more instance of MmLocateMemoryAreaByAddress 2025-04-17 22:22:08 +00:00
Timo Kreuzer
0e58b59794 [NTOS:MM] Get rid of more calls to MmLocateMemoryAreaByAddress 2025-04-17 22:22:08 +00:00
Timo Kreuzer
1f27911997 [NTOS:MM] Reduce the magnitude of the MiRosProtectVirtualMemory hack 2025-04-17 22:22:08 +00:00
Timo Kreuzer
f60128b69d [NTOS:MM] Remove usage of memory area in MiProtectVirtualMemory 2025-04-17 22:22:08 +00:00
Timo Kreuzer
edecbf4799 [NTOS:MM] Remove usage of memory area in MiUnmapViewOfSection 2025-04-17 22:22:08 +00:00
Timo Kreuzer
a8f4a76c7b [NTOS:MM] Improve MiDeleteVirtualAddresses
- Fix parameter annotations
- Add an ASSERT
2025-04-17 22:22:08 +00:00
Timo Kreuzer
8851d86847 [NTOS:MM] Remove Vad pointer from MEMORY_AREA 2025-04-17 22:22:08 +00:00