Commit graph

1677 commits

Author SHA1 Message Date
Dmitry Borisov adf534b284 [NTOS:IO] Initialize InterruptObject to NULL on failure
Fixes a pool corruption when trying to handle IRP_MN_REMOVE_DEVICE in the driver

CORE-17256
2024-02-11 20:24:15 +03:00
Hermès Bélusca-Maïto 475098c8b1
[NTOS:IO] Don't uppercase the ServiceName in IopDisplayLoadingMessage().
Problematic behaviour was added in commit a97f262ed (r26067), and
commit c39812d1b (r46193) converted to RtlUpcaseUnicodeString() call.

This was modifying the caller's given string. This is not really
a good practice to do so just to make display fancier.

For example, IopInitializeBuiltinDriver(), that calls the display
function, also uses the passed ServiceName later after.

Because IopDisplayLoadingMessage() executes only in SOS mode,
uppercasing the ServiceName in one case but not the other would
implicitly modify the observable OS behaviour.

IopSuffixUnicodeString() is adapted to be similar to RtlPrefixUnicodeString().
2024-02-09 17:16:20 +01:00
Hermès Bélusca-Maïto 3b60f4fa13
[NTOS:IO] Fix a count in characters vs. bytes mismatch. 2024-02-09 17:14:19 +01:00
Hermès Bélusca-Maïto d1b3115afa
[NTOS:IO] IopDisplayLoadingMessage(): Display the loading messages only in SOS mode.
- Make the boolean SosEnabled from ex/init.c visible globally so that
  it can be checked against by IopDisplayLoadingMessage().

- Also use RtlString* function to construct the string.
2024-02-09 17:13:30 +01:00
Hermès Bélusca-Maïto 17c59456cd
[NTOS:IO] Minor formatting for IopSuffixUnicodeString and IopDisplayLoadingMessage.
- Doxygen comments;
- SAL annotations;
- These two functions are local to driver.c file only -> static'ify them.
- 2 -> sizeof(WCHAR);
- Rename Length to NumChars;
- static const'ify the L".SYS" string.
2024-02-09 17:00:25 +01:00
Hermès Bélusca-Maïto 08afb1f4b4
[NTOS:INBV] Don't include the fancy splashscreen logo as well
CORE-19449
2024-02-09 12:00:01 +01:00
Hermès Bélusca-Maïto ee2e256ebf
[NTOS:INBV] Disable fancy boot splashscreen features
CORE-19449
2024-02-09 11:52:23 +01:00
Adam Słaboń 1f28f715ba
[NTOS:FSTUB] Pack the MASTER_BOOT_RECORD structure (#6416)
Otherwise the USHORT members are aligned to 4-byte boundary space
which overflows the disk sector buffer and ultimately results in crash.
This can be reproduced by trying to format the USB drive with Rufus.

Also put some additional C_ASSERT checks for extra safety.
2024-02-08 01:02:19 +03:00
Hervé Poussineau 9e43518da5 [NTOS:PO] Set SystemBatteriesPresent when having a battery device in the system
This is (at least) used by powercfg.cpl to know if it needs to display some additional pages.
2024-02-05 18:04:02 +01:00
Hervé Poussineau dff8b93ee2 [NTOS:PO] Give the power device type to PopAddRemoveSysCapsCallback function 2024-02-05 18:04:02 +01:00
Oleg Dubinskiy 5abf0c76b7
[NTOS:KE/x86/arm] Use a better boot process affinity value (#6399)
Use a value that is independent of the CPU bitness.
Addendum to commit 96d5b6281
2024-01-24 17:52:56 +01:00
Justin Miller 748a2e1655
[NTOS] Fix boot on UP build - PrcbLocks are not used on UP (#6391)
On the uniprocessor kernel KiAcquirePrcbLock is a stub that doesn't modify the current Prcb's PrcbLock value.
Quickly protect this assert around CONFIG_SMP
2024-01-20 08:59:13 -08:00
Oleg Dubinskiy ab528ac6ae
[NTOS:KE] Acquire PRCB lock before marking thread ready for execution in dispatch interrupt routine (#6387)
Fixed in x86 and ARM (this was already done in x64).

This is needed because thread preparation routine KxQueueReadyThread()
releases PRCB lock, but does not acquire it, so that the locking must
always be done outside the function, same as in all its other usage cases.
This fixes an assert from release PRCB routine, when booting x86 ReactOS
in SMP mode, because it attempts to release the lock when it is not
actually acquired.

Addendum to commit a011d19ed.

+ Add an assert in KxQueueReadyThread() to ensure the PRCB lock is actually acquired.
2024-01-20 15:58:39 +01:00
Oleg Dubinskiy f72d6dd4c5
[NTOS:KE] Set IRQL to SYNCH_LEVEL when exiting from idle after the thread is ready for execution (#6386)
CORE-1697

Raise IRQL to SYNCH_LEVEL when exiting from the idle thread in the
idle loop, in case it is scheduled for execution. Then restore it
back to DISPATCH_LEVEL, after this is done.
This behaviour is a bit similar to the way it's done on x64.

This IRQL raise is necessary only in SMP builds.
Calls are placed in CONFIG_SMP ifdef: this avoids unnecessary IRQL
changes on UP, since SYNCH_LEVEL and DISPATCH_LEVEL are identical
there, unlike in MP, where SYNCH_LEVEL is IPI_LEVEL - 2 actually.

This prevents bugcheck DRIVER_IRQL_NOT_LESS_OR_EQUAL when booting
SMP x86 ReactOS, in KiTimerExpiration when calling it 2nd time.
The BSOD happened due to IRQL levels mismatch.
2024-01-20 15:55:20 +01:00
Timo Kreuzer 9c1cfe0587 [NTOS:KE] Fix initialization of node block for application processors
- Initialize KeNodeBlock[0] statically
- Update Prcb->ParentNode->ProcessorMask for all processors
2024-01-18 22:41:46 +01:00
Hermès Bélusca-Maïto feb67576dd
[NTOS:CM][CMLIB] In PE mode, allow registry hives (except system ones) to use read/write access.
+ Improve related comments.

Registry hives are opened in shared read access when NT is loaded in PE
mode (MININT) or from network (the hives residing on a network share).
This is true in particular for the main system hives (SYSTEM, SOFTWARE,
DEFAULT, ...).

However, in PE mode, we can allow other hives, e.g. those loaded by the
user (with NtLoadKey) to be loaded with full read/write access, since we
boot from a local computer.
2024-01-17 22:13:03 +01:00
Hermès Bélusca-Maïto 793ee786cd
[NTOS:CM] Initially start the registry in read-only mode.
Disable registry hive writes, until the IO subsystem is initialized
and disk access is enabled (when the SM signals so after AUTOCHK).
2024-01-17 22:09:45 +01:00
Hermès Bélusca-Maïto 76f1da5631
[NTOS:CM][CMLIB] Minor code styling
In particular remove some extra-parentheses around single code tokens,
and replace few "DPRINT1 + while (TRUE);" by UNIMPLEMENTED_DBGBREAK.

+ Improve some comments.
2024-01-17 22:09:37 +01:00
Timo Kreuzer 96d5b6281d [NTOS:KE/x64] Fix boot process affinity 2024-01-16 08:15:53 +01:00
Timo Kreuzer 1ee23d33ac [NTOS:KE] Fix some KAFFINITYs 2024-01-16 08:15:53 +01:00
Hermès Bélusca-Maïto a70ce994f0
🎊 🍾 🥳 Happy New Year 2024 to the ReactOS Community! 🎆 ⚛️ ☢️
.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.██████╗  ██████╗ ██████╗ ██╗  ██╗
 __,  ,__)            __,  ,__)       __, ,__)         ╚════██╗██╔═████╗╚════██╗██║  ██║
(--|__| _ ,_ ,_      (--|\ | _       (--\ | _  _ ,_     █████╔╝██║██╔██║ █████╔╝███████║
  _|  |(_||_)|_)(_|    _| \|(/_(_|_)     \|(/_(_||     ██╔═══╝ ████╔╝██║██╔═══╝ ╚════██║
 (        |  |  ,_|   (                (__|            ███████╗╚██████╔╝███████╗     ██║
.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.╚══════╝ ╚═════╝ ╚══════╝     ╚═╝
2024-01-01 00:00:00 +01:00
Hermès Bélusca-Maïto 434ac241df
[NTOS:INBV:PO] Consolidate shutdown logo routines where all the boot theming is implemented.
And it's late now, but... Merry Christmas 2023 as well! 🎄
Logo design by contributor 'TheCustomFHD'

"From ReactOS with Love" ;^)
2023-12-25 21:43:20 +01:00
Hermès Bélusca-Maïto 6d265d1fd8
[NTOS:INBV] Isolate the bitmap resources pertaining to the boot theme/animation into their resource sub-file. 2023-12-24 22:39:36 +01:00
Hermès Bélusca-Maïto 0f3da97456
[NTOS:KE:EX] Fix comment typo. 2023-12-24 22:39:35 +01:00
Hermès Bélusca-Maïto 7b410fb8ca
[NTOS:INBV] Don't hardcode the off-screen rot-bar-bits buffer size. 2023-12-24 21:54:24 +01:00
Hermès Bélusca-Maïto 81dc30a434
[NTOS:INBV] Improve comment & define name. 2023-12-24 21:54:23 +01:00
Hermès Bélusca-Maïto 7aec73a76c
[NTOS:INBV] Minor code style. 2023-12-24 21:54:16 +01:00
Hermès Bélusca-Maïto 3812996042
[NTOS:INBV] Fix build when INBV_ROTBAR_IMPLEMENTED is not defined. 2023-12-24 21:40:36 +01:00
Ratin Gao ffb20d3330
[REACTOS] Fix typos (#6198)
- Adress -> Address
- Currupted -> Corrupted

3rd-party files are not modified.
2023-12-23 21:37:08 +01:00
Timo Kreuzer 1831bc6add [NTOS:KE/x64] Implement initial IPI code 2023-12-18 23:16:39 +02:00
Serge Gautherie 1244659d4c
[NTOSKRNL] Remove remnant internal/arm/asmmacro.S (#6052)
Addendum to 6212c82 (r67715).
2023-12-14 13:48:31 +00:00
Timo Kreuzer e5c5efe2ad [NTOS:KE/x64] Set the idle thread's IdealProcessor for application processors 2023-12-08 20:16:51 +02:00
Timo Kreuzer b1a9e72e92 [NTOS:KE/x64] Do not call HalInitSystem from application processors 2023-12-08 20:16:51 +02:00
Timo Kreuzer d0f6874d92 [NTOS:KE/x64] Factor out KiIntializeProcessorBootStructures 2023-12-08 20:16:51 +02:00
Timo Kreuzer 8c466c3e36 [NTOS:KE/x64] Improve KiInitializePcr 2023-12-08 20:16:51 +02:00
Timo Kreuzer d2a3b1c791 [NTOS:KE/x64] Factor out KiInitializeP0BootStructures 2023-12-08 20:16:51 +02:00
Timo Kreuzer e655594609 [NTOS:KE/x64] (Re)move initialization of IRQL and TR 2023-12-08 20:16:51 +02:00
Timo Kreuzer 0a7255e4bf [NTOS:KE/x64] Move Initialization of TSS 2023-12-08 20:16:51 +02:00
Timo Kreuzer 160980aba1 [NTOS:KE/x64] Move initialization of PCR 2023-12-08 20:16:51 +02:00
Timo Kreuzer ba62dd0aaa [NTOS:KE/x64] Move initialization of KeLoaderBlock 2023-12-08 20:16:51 +02:00
Timo Kreuzer e1497d43d7 [NTOS:KE/x64] Improve KiInitializeTss 2023-12-08 20:16:51 +02:00
Timo Kreuzer bbe16859b5 [NTOS:KE/x64] Rename P0 boot stacks 2023-12-08 20:16:51 +02:00
Timo Kreuzer 6c5b3f203d [NTOS:KE/x64] Add back a stubs.c file 2023-12-08 19:38:59 +02:00
Timo Kreuzer 57c7f06004 [NTOS:KE/x64] Rename stubs.c to traphandler.c 2023-12-08 19:38:59 +02:00
Timo Kreuzer d87b45bee7 [NDK] Add Affinity helper inline functions 2023-12-08 19:28:57 +02:00
Hermès Bélusca-Maïto 2f0a5e546f
[NTOS:KE] Don't hardcode pool tag and TSS flag values (#6051)
Co-authored-by: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
2023-12-03 17:33:10 +01:00
Eric Kohl d8ba5920a2 [NTOS:PNP][UMPNPMGR] GUID_DEVICE_ENUMERATED should be a DeviceInstallEvent
- Move the GUID_DEVICE_ENUMERATED event from the TargetDeviceChangeEvent category to the DeviceInstallEvent category
- Create a new function that handles DeviceInstallEvent category events
2023-12-03 14:00:34 +01:00
Timo Kreuzer f92c44b217 [NTOS:KE] Remove KiMask32Array
It's useless and also broken in the way it is used. Replace it with a simple shift and make it correct for 64 bit.
2023-11-30 13:03:52 +02:00
Eric Kohl 12a5971b7a [NTOS:PNP] Queue a device change event on interface enable or disable 2023-11-27 22:36:52 +01:00
Serge Gautherie b386ea728f [NTOSKRNL] Remove unused internal/amd64/asmmacro.S
Added, but never(?) used.

Addendum to 99e6ad7 (r46620).
2023-11-27 22:51:51 +02:00