Commit graph

1838 commits

Author SHA1 Message Date
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
Hervé Poussineau
69cd1e107a
[NTOS:EX] Allow calling ExLockUserBuffer up to DISPATCH_LEVEL 2025-01-28 22:00:30 +01:00
Hervé Poussineau
d8e25f06b1
[NTOS:EX] Add prototypes for ExLockUserBuffer/ExUnlockUserBuffer 2025-01-28 22:00:29 +01:00
Hermès Bélusca-Maïto
5962c44511
[NTOS:IO] Fix a typo in comment 2025-01-28 15:29:39 +01:00
Katayama Hirofumi MZ
fe11f7a2e5
[REACTOS] Refresh old URLs (#7632)
URLs are getting old. We have to
update URLs for documentation
purpose.
JIRA issue: CORE-19963
- Refresh old URLs.
- Add " (DEAD_LINK)" labels
  to dead links.
- Use MS Learn links rather
  than MSDN ones.
- Some dead links revived by
  Web Archive.
- Don't change Wine Tests
  and Wine Sync.
- Don't change 3rd party libraries.
- Don't append "redirected" labels.
2025-01-28 13:36:45 +09:00
Timo Kreuzer
647b518bd3 [NTOS:MM] Fix process affinity in MmCreatePeb 2025-01-25 16:33:27 +02:00
Timo Kreuzer
c07fba4508 [NTOS:KE] Make KeQueryActiveProcessors portable and non-paged
In Windows Vista and later, this routine can be called at any IRQL.
2025-01-24 18:38:34 +02:00
Hermès Bélusca-Maïto
a857b28008
[NTOS:INBV] We are now past Christmas time. 2025-01-22 17:30:43 +01:00
Timo Kreuzer
85f42a25d5 [NTOS:KE/x64] Improve freeze code
- Set ACTIVE flag on freeze owner like on Windows
- Add a nice state graph
- Change license to MIT
2025-01-22 14:04:18 +02:00
Hermès Bélusca-Maïto
0e01cbc6cd
[NTOS:IO] IoVolumeDeviceToDosName(): Fix returned DosName buffer initialization (#6990)
The VolumePath buffer returned by IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH
contains one string stored as a multi-NUL-terminated string, whose
total length is given by its `MultiSzLength` member.

The DosName UNICODE_STRING just returns the (single) string as a normal
NUL-terminated string. So, we need to remove the two NUL-terminators
from the `MultiSzLength` count to retrieve the correct length.
2025-01-21 19:16:03 +01:00
Hermès Bélusca-Maïto
f315111bb5
[NTOS:IO] Improve some comments in IoVolumeDeviceToDosName()
Addendum to commit 5afb7ab003.
2025-01-21 19:16:02 +01:00
Vincent Franchomme
6ada5978d0
[NTOS:MM] Do not use PAGE_ROUND_DOWN for LONGLONG values (#7603)
PAGE_ROUND_DOWN macro seems to not work correctly with LONGLONG values. It creates some random freezes in the 1st-stage setup after commit 69bf140506.
It's fixed by creating PAGE_ROUND_UP_64 and PAGE_ROUND_DOWN_64 macros for 64-bit only data types.

---------

Co-authored-by: Thamatip Chitpong <thamatip.chitpong@reactos.org>
2025-01-16 10:30:38 +07:00
Thamatip Chitpong
190f710942 [NTOS:MM] MiBalancerThread: Formatting fixes 2025-01-15 16:10:55 +07:00
Thamatip Chitpong
c69ad5efa2 [NTOS:MM] MmRequestPageMemoryConsumer: Properly mark CORE-17624 delay hack
Addendum to commit 2b14056600.
2025-01-15 16:10:55 +07:00
Thamatip Chitpong
a8322459ab [NTOS:MM] balance: Fix PageOutThreadActive value check 2025-01-15 16:10:55 +07:00
Hermès Bélusca-Maïto
6363f7820d
[NTOS:IO] Fix special case in IopQueryNameInternal() (#7592)
CORE-13525

This case is invoked from NtQueryObject(ObjectNameInformation).
2025-01-06 21:30:18 +01:00
Hermès Bélusca-Maïto
e4748fe448
[NTOS:IO] IoVolumeDeviceToDosName(): Add SAL2 annotations, fix pool tag (#6989)
The DEV2DOS tag value is from the official Windows pooltag.txt file.
2025-01-05 22:06:59 +01:00
Hermès Bélusca-Maïto
5afb7ab003
[NTOS:IO] IoVolumeDeviceToDosName(): Some stylistic changes.
Minor formatting and comments improvements (typo fixes etc.)
2025-01-05 22:03:55 +01:00
Hermès Bélusca-Maïto
7a05b393c5
[NTOS:IO] TAG_KINTERRUPT -> TAG_IO_INTERRUPT and change its value.
Change its value, as per the official Windows pooltag.txt file.
2025-01-05 21:16:56 +01:00
Hermès Bélusca-Maïto
02cff5abc1
[NTOS:IO] tag.h: Remove duplicated TAG_SYSB/TAG_SYS_BUF and rename it to TAG_IOBUF 2025-01-05 21:09:08 +01:00
Thamatip Chitpong
205eadcb84
[NTOS:PS] Fix returned flags for QUOTA_LIMITS_EX query (#7589)
Use the information from EPROCESS::Vm.
Addendum to commit 1e06829961.
2025-01-01 19:52:20 +07:00
Hermès Bélusca-Maïto
ebdb7b3e4d
A problem has been detected and ReactOS has been shut down to prevent
damage to your time machine warp core.

UNEXPECTED_NEW_YEAR_TIMESLIP

If this is the first time you have seen this Stop error screen,
restart your time machine. If this screen appears again, follow
these steps:

Check to make sure you wish the ReactOS Community a
🎊 🍾 🥳 *:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:* 🎆 ⚛️ ☢️

        █ █ █▀█ █▀█ █▀█ █ █          ██████╗  ██████╗ ██████╗ ███████╗    ██╗
        █▀█ █▀█ █▀▀ █▀▀ ▀█▀          ╚════██╗██╔═████╗╚════██╗██╔════╝    ██║
        ▀ ▀ ▀ ▀ ▀   ▀    ▀            █████╔╝██║██╔██║ █████╔╝╚█████╗     ██║
  █▄ █ █▀▀ █ █ █  █ █ █▀▀ █▀█ █▀█    ██╔═══╝ ████╔╝██║██╔═══╝  ╚═══██╗    ╚═╝
  █▀██ █▀▀ █ █ █  ▀█▀ █▀▀ █▀█ ██▀    ███████╗╚██████╔╝███████╗██████╔╝    ██╗
  ▀  ▀ ▀▀▀  ▀▀▀    ▀  ▀▀▀ ▀ ▀ ▀ ▀    ╚══════╝ ╚═════╝ ╚══════╝╚═════╝     ╚═╝
🎆 ⚛️ ☢️ *:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:* 🎊 🍾 🥳
Also, ensure you use the latest nightly ReactOS version and run it
attached to a debugger.

If problems continue, Keep Calm And Carry On Developing. Test your
code more thoroughly, use a sane compiler and debugger, or ask any
questions on ReactOS' official Mattermost channel.

Technical information:

*** STOP: 0x42000042 (0x67747770,0x000007E9,0x00000001,0x00000001)

***  jira.reactos.org   - Address chat.reactos.org Base at reactos.org
***  github.com/reactos - Address  git.reactos.org Base at reactos.org
2025-01-01 00:00:00 +01:00