Commit Graph
88595 Commits
Author SHA1 Message Date
Hermès Bélusca-Maïto cea19d2e0f [NTOS:IO] IopAttachDeviceToDeviceStackSafe(): Attach the device to the device list UNDER lock!
This function is the internal helper for the `IoAttachDevice*()` functions,
in particular for `IoAttachDeviceToDeviceStackSafe()`.

Because the function modifies the chained list of stacked devices, it must
hold the device list lock (the I/O system database lock) while doing the
devices attachment.
In particular, modifying the `SourceDevice`'s extension `AttachedTo` field,
but also modifying its other fields and the `AttachedDevice` ones as well.

This fix is similar to the one already committed in f8cbc3e48c (r70496).

----

In MSDN [^1] it is indicated (although not as clearly as it could be) that
`IoAttachDeviceToDeviceStackSafe()` sets the returned `AttachedToDeviceObject`
pointer under the device list lock. The reason is best spelled in [^2][^3].
Indeed, when a filter attaches to a lower PDO (`PhysicalDevice`) by doing:
```c
myDeviceExtension->LowerDevice =
    IoAttachDeviceToDeviceStack(myFilterDevice, PhysicalDevice);
```
there exists a time window where the function finished attaching the filter
device to the PDO, but hasn't yet returned the device at the top of the
stack to be stored in `myDeviceExtension->LowerDevice` (which gets used
later internally by the filter to pass IRPs down the device stack).
During this time, the filter device may receive some IRPs and its
dispatch routine would use a not-yet initialized `LowerDevice` member.

The IoAttachDeviceToDeviceStackSafe() allows doing:
```c
Status = IoAttachDeviceToDeviceStackSafe(
    myFilterDevice, PhysicalDevice, &myDeviceExtension->LowerDevice);
```
and forbidding the IRPs to be delivered to the filter device, while the
`LowerDevice` member is being initialized with the device list lock held.

----

[^1]: "IoAttachDeviceToDeviceStackSafe function (ntddk.h)"
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-ioattachdevicetodevicestacksafe#remarks

[^2]: "IoAttachDeviceToDeviceStack gotcha" (Satya Das, Winprogger)
https://winprogger.com/ioattachdevicetodevicestack-gotcha/

[^3]: Community OSR answer (by Tony Mason)
https://community.osr.com/t/attach-filter-driver/9450/3
2026-04-07 20:23:54 +02:00
Hermès Bélusca-Maïto 45687e82f3 [NTOS:IO] Minor formatting for IopAttachDeviceToDeviceStackSafe()
- Fix few comments;
- Mark the function static.
- SAL2-ify its parameters.
2026-04-07 20:23:49 +02:00
Mikhail Tyukin 7675017f60 [CMAKE] Add and use add_idl_reg_scripts (#8813)
* [CMAKE] Add add_idl_reg_scripts
* [WINDOWSCODECS] use add_idl_reg_scripts
* [OLE32] use add_idl_reg_scripts
* [ACTXPRXY] use add_idl_reg_scripts
2026-04-07 16:56:14 +00:00
Katayama Hirofumi MZ 4671b481a3 [NTGDI][FREETYPE] FontLink: Request sub-font sizes (#8806)
A bug fix of FontLink'ed glyph size.
JIRA issue: CORE-20470
- Add FONTLINK_ENTRY structure
  and g_FontLinkEntries variable.
- Delete font-link cache mechanism.
- Don't access the registry while
  rendering is in progress.
- Request sub-font sizes while
  drawing FontLink text.
2026-04-07 14:06:50 +09:00
Eric Kohl 10092f8466 [DHCPCSVC] Load and update the alternate configuration data 2026-04-07 00:55:32 +02:00
Eric Kohl b2e9439a53 [NETCFGX] Call DhcpFallbackRefreshParams when the alternate configuration has been changed 2026-04-06 14:13:07 +02:00
Eric Kohl 4b9adaa971 [DHCPCSVC] Add the client code and server stub for DhcpFallbackRefreshParams
DhcpFallbackRefreshParams is called by the TCPIP notification object after the alternate configuration has been changed.
2026-04-06 13:42:03 +02:00
Mark Jansen a409e5dcd8 [EXPLORER-OLD] Retire explorer-old 2026-04-05 21:31:08 +02:00
Eric Kohl b481fb5674 [PSDK][UUID] Add the INetCfgSysPrep, INetCfgComponentSysPrep and INetCfgComponentUpperEdge interfaces 2026-04-05 18:23:19 +02:00
Eric Kohl 1ae75e00ae [NETCFGX] Replace calls to MessageBox by TRACE 2026-04-05 15:03:56 +02:00
Eric Kohl 1a04259951 [NETCFGX] Fix gateway and name server data management in the basic dialog 2026-04-05 14:58:33 +02:00
Eric Kohl 22f1afe4ea [PSDK] Fix typos in INetCfgComponentSetup macros 2026-04-05 13:35:00 +02:00
Eric Kohl 68d1570859 [NETCFGX] The IPAddress, SubnetMas and DefaultGateway values must be of type REG_MULTI_SZ 2026-04-05 12:46:47 +02:00
Eric Kohl 2a40a01d4a [NETCFGX] Call the ApplyProperties or CancelProperties method
Call the ApplyProperties or CancelProperties method when the user clicks the OK or Cancel button of the property sheet.
2026-04-05 12:43:04 +02:00
Doug LyonsandHermès BÉLUSCA - MAÏTO 2a2aaf98d4 [CHKDSK][VFATLIB] Chkdsk should not write unless using "-F" switch. (#8826)
CORE-20539

Before calling "fs_write" test if we are in a read-write mode by checking "rw".
I intend to re-evaluate this to try and reduce the difference to dosfschk in the future.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
2026-04-04 23:01:35 -05:00
Doug Lyons 57664f1c1e [CHKDSK][VFATLIB] Chkdsk, fix writes to wrong disk offsets (#8840)
CORE-20546

When an alignment is needed and a new read is required,
 make sure we seek back to the read position for our write.
2026-04-04 18:30:52 -05:00
Hermès Bélusca-Maïto 03de1f932f [FREELDR:NTLDR] Fix build following commit 9ff4e4b9ef 2026-04-04 22:34:53 +02:00
Hermès Bélusca-Maïto bf26ae38a5 [FREELDR] Make FreeLoader a bit more usable even if FREELDR.INI is missing
CORE-9023

In case FREELDR.INI is missing, or there are no operating systems listed
and available (either the corresponding section is missing, or is empty),
fall back to the FreeLoader Setup and Configuration F2 menu, that allows
performing a minimal number of operations (enabling FreeLoader debugging;
doing a custom boot... and more to come!)

Fix also a bug in `InitOperatingSystemList()`, that would allow
allocating an empty list with zero items. Now it returns NULL if
no operating systems are found.

Default to the Minimal text UI instead of the fullfledged one, if no
"MinimalUI" option can be found in FREELDR.INI (or if the INI is missing).
2026-04-04 22:19:18 +02:00
Hermès Bélusca-Maïto 9ff4e4b9ef [FREELDR][NTLDR] Move the ReactOS/NT-specific advanced boot menu to its separate file
CORE-9023

Make also the advanced boot menu depend on the operating system type.
It can be opened by pressing F8, or F5, as in the Windows' bootloader.

The FreeLoader-specific options are moved to a separate menu,
accessible via the F2 key from the main menu.

Work-in-progress: display the boot options that correspond to the
currently-selected boot entry.
2026-04-04 22:15:58 +02:00
Hermès Bélusca-Maïto 1ac657ed0e [FREELDR:NTLDR] Normalize the boot options as soon as possible, and fix the algorithm
Use `NtLdrGetNextOption()` to loop over each individual option and move
it to its proper place. This automatically trims any '/' option
separator, including repeated ones and whitespaces, and allow for
straightforward replacement with one single space.
2026-04-04 21:46:29 +02:00
Hermès Bélusca-Maïto e87a74f131 [FREELDR] LaunchSecondStageLoader(): Always return ESUCCESS if rosload.exe started correctly...
instead of returning an erroneous value, since the rosload.exe entry point
`RunLoader()` doesn't return any value. This allows exiting from rosload.exe
and NOT having the `LaunchSecondStageLoader()` returning 0, for example,
which would then be interpreted as an error condition and showing the
"Unable to load second stage loader." error box.
2026-04-04 21:46:28 +02:00
Eric Kohl 55f9484b95 [SYSSETUP] Move the security install step into the item completion thread 2026-04-04 10:36:31 +02:00
Doug Lyons 22ce5b1bc8 [CHKDSK][VFATLIB] Make ReactOS chkdsk output match MS for last 3 lines (#8839)
Added line for "bytes per cluster".
Improved formatting of output to align text for last 4 lines.
2026-04-03 12:32:14 -05:00
Eric Kohl a34fd324ef [NETCFGX] Keep two configurations in the TCPIP notification object
- Load an old configuration and a current configuration.
- Free the configurations properly.
- Call the ApplyPnPChanges method after the ApplyRegistryChanges method.
- Move changes to the TCPIP and DHCP services from the ApplyRegistryChanges method to the ApplyPnpChanges method.
2026-04-03 18:24:27 +02:00
Eric Kohl bbdbe763d9 [INCUDE] Fix a typo in the INetCfgComponentControl_ApplyPnpChanges macro 2026-04-03 15:48:29 +02:00
Hermès Bélusca-Maïto 56481e1b8d [FREELDR:ARCH] Modularize the disk registration code (#8736) 2026-04-02 17:36:10 +02:00
Hermès Bélusca-Maïto d2cbec0b5f [FREELDR:ARCH] Fix minor bugs; condense XboxDiskInit() a bit (#8732)
- `AtaInit()` returns the number of detected ATA devices. Therefore,
  when iterating over them, go from index 0 to the count _minus_ 1,
  in `Pc98InitializeBootDevices()` and in `XboxDiskInit()`.

- Initialize `DiskDrive->Type` to `DRIVE_TYPE_HDD` for detected SCSI
  hard-disk drives in `pc98disk.c!InitScsiDrive()`.

- Rearrange `XboxDiskInit()` and reduce its indentation level.
2026-04-02 17:23:39 +02:00
Hermès Bélusca-Maïto 62d71ebbd3 [FREELDR:ARCH] hwide.c: Don't rely on DEVICE_UNIT P; to be at the beginning of the HW_DEVICE_UNIT structure (#8732) 2026-04-02 17:20:20 +02:00
Hermès Bélusca-Maïto 9f42210478 [FREELDR:ARCH] Modularize the DiskError() functionality (#8732)
Move the `DiskReportError()` and `DiskError()` routines into the
`freeldr/disk/disk.c` file, reviving it as a collection of disk
devices helpers (and more in the future).

The architecture-specific disk modules only define the error code mapping
`DiskGetErrorCodeString()` function, that is then used by `DiskError()`.
2026-04-02 17:17:01 +02:00
Hermès Bélusca-Maïto c25c527c25 [FREELDR:ARCH] Simplify DetectPciBios() (#8732)
- Let it take a `MachFindPciBios` parameter, similar to the
  `GET_SERIAL_PORT MachGetSerialPort` parameter of `DetectSerialPorts()`.

- Remove the `FindPciBios` global.
- Reduce indentation level.
2026-04-02 17:16:54 +02:00
Ahmed Arif 229f7891a1 [FREELDR][HAL] Skip x86 BIOS emulator on UEFI boots (#8827)
Skip x86 BIOS emulator initialization on EFI boots by having FreeLdr populate EFI boot state in the loader block and making HAL consume it.

This keeps BIOS behavior unchanged while avoiding legacy BIOS/INT10 setup in the EFI path and preventing early EFI boot failures caused by entering the BIOS emulator path at all.
2026-04-02 13:37:43 +02:00
Ahmed Arif 5b7a4c948c [FREELDR] Tune MiniTUI progress bar colors (#8828)
If NTLDR_PROGRESSBAR is not defined, use Vista+ style TUI for progress bars in Freeldr. Also, add some macros to improve readability.
2026-04-02 13:04:14 +02:00
Ahmed ARIF 7509b428bf [DBGHELP][AMD64] Return the last valid frame at end of stack in StackWalk64 2026-04-02 12:06:19 +02:00
Oleg Dubinskiy b205c04173 [SETUPAPI] Fix wrong registry key opened by SetupDiCreateDeviceInterfaceRegKeyW()
The funstion should create/open "Device Parameters" subkey of a device reference key (and return a handle to it), instead of device instance subkey.
- Fix SetupDiCreateDeviceInterfaceRegKeyW() to open (and return a handle to) the correct registry key.
- Fix its usage in internal InstallOneInterface() helper, which is called by SetupDiInstallDeviceInterfaces().
This fixes audio devices enumeration failure of winmm.dll from Windows 2000 SP4 (and unneeded creation of wrong registry keys) when using ReactOS with audio stack replacement from Windows XP/2003.
CORE-19986
2026-04-02 12:03:31 +02:00
Ahmed ArifandAhmed ARIF 9a7f64a0c6 [FREELDR:UEFI] Add BGRT logo support and center it on the loading screen (#8820)
* [FREELDR][UEFI] Add BGRT logo support and center it on the loading screen
* [FREELDR][UEFI] Rework BGRT support and localize ACPI definitions
* [FREELDR][UEFI] Handle signed BGRT BMP height explicitly
* [FREELDR][UEFI] Use shared ACPI BGRT definitions

---------

Co-authored-by: Ahmed ARIF <[email protected]>
2026-04-02 11:35:09 +02:00
Oleg Dubinskiy 410dd824aa [DRIVERS] Update the name of the new HD audio bus driver
Remove *_new prefix from the new HDAudBus driver, since it's now used by default and the previous (old) one was removed.
[DOC] Update the path of the new HDAudBus driver to the current actual one.
2026-04-02 11:33:07 +02:00
Oleg Dubinskiy b308bcc311 [DRIVERS] Remove old HD audio bus driver
since it's obsolete now and is not used any more.
2026-04-02 11:33:07 +02:00
Mikhail Tyukin dcd45a59d1 [LIBJPEG][LIBPNG][LIBTIFF] Update (#8808)
* [LIBTIFF] Update to 4.7.1

* [LIBPNG] Update to 1.6.51

* [LIBJPEG] Update to 10
2026-04-01 17:27:34 +02:00
Alex Mendoza fd683dbba4 [SHELL32] AddCommasW: Use LOCALE_SGROUPING instead of harcoded grouping (#8814) 2026-04-01 14:27:17 +02:00
Justin Miller e68ebe19c6 [NTDLL] Revert Implict ThreadLocalStorage for now (#8823)
We will continue with this stuff when we can understand the root issues better

* Revert "[NTDLL_APITEST] Relicense implicit tls tests as MIT"

This reverts commit ec6bae2b31.

* Revert "[NTDLL:LDR] Add Implicit Thread Local Storage Support (#7594)"

This reverts commit 23043ce0b8.
2026-04-01 13:56:00 +02:00
Katayama Hirofumi MZ 45a4f95b04 [NTGDI][FREETYPE] Revert 'font look-up cache #8641' (#8816)
#8641 introduced some bugs. We revert it.
JIRA issue: CORE-20538
- Delete FONT_LOOKUP_CACHE and
  s_FontLookupCacheList.
- Delete FontLookUp_... functions.
- Revert FontLink_PrepareFontInfo and
  TextIntRealizeFont functions.
2026-04-01 19:23:17 +09:00
Mikhail Tyukin 7950ea3f07 [OLE32] Remove PropVariantChangeType (#8822)
Fix https://reactos.org/testman/detail.php?id=87298653&prev=87291347
PropVariantChangeType is exported in propsys, and before the ole32 sync PropVariantChangeType was commented out. This causes the linker to link against the stub in ole32 rather than the function in propsys.
2026-04-01 12:19:51 +02:00
Justin Miller 20494b84ef [PCIX] PciComputeNewCurrentSettings skip CmResourceSharedDeviceExclusive (#8464) 2026-04-01 09:29:34 +00:00
Eric Kohl 7139e57ff8 [NETCFGX] Fix the alternate network configuration
- Load and store alternate configurations properly.
- Use unique resource ids for the alternate configuration dialog.
- Fix code to enable or disable the name server address controls.
- Build the registry path to the network interface only once.

TODO: Fix the format of the alternate configuration data.
2026-04-01 00:35:20 +02:00
Václav Zouzalík e46a837fb7 [HOSTNAME] Update Czech (cs-CZ) and Slovak (sk-SK) translation (#8817) 2026-03-31 22:43:59 +02:00
Doug LyonsandCarl J. Bialorucki c2f56643b6 [VFATLIB][FMIFS][CHKDSK] Chkdsk fixes and improvements (#8810)
CORE-18432

Co-authored-by: Carl J. Bialorucki <[email protected]>
2026-03-31 13:13:31 -05:00
Carl J. Bialorucki ec6bae2b31 [NTDLL_APITEST] Relicense implicit tls tests as MIT
Approval from original author given to Carl Bialorucki in writing.
2026-03-31 16:56:51 +02:00
Mikhail Tyukin c93cbb9bf1 [BCRYPTPRIMITIVES] Import from wine-10.0 (#8818)
Import bcryptprimitives.dll from wine-10.0 for modern applications
2026-03-31 14:10:35 +00:00
Shane FournierandJustin Miller 23043ce0b8 [NTDLL:LDR] Add Implicit Thread Local Storage Support (#7594)
Before Windows Vista, TLS directories were ignored by Ldr* in any module loaded after process creation, which meant that the TLS index in any delay-loaded module remained 0. This means that when running an application targeting Vista and above and its delay-load modules have TLS directories, the following events can happen:

    One or more delay-load modules claim ThreadLocalStoragePointer idx 0, resulting in data corruption and possible buffer overflows as data intended for one of the immediate-load modules is overwritten.

    None of the immediate-load modules has a TLS directory, so ThreadLocalStoragePointer is not initialized. This means that the program crashes when one of the delay-load modules attempts to access its TLS data.

Adding implicit TLS support improves support for NT 6.x/10 user-mode applications, including all contemporary major web browsers.

JIRA issue: CORE-19413

---------

Co-authored-by: Justin Miller <[email protected]>
2026-03-31 11:21:57 +00:00
Hermès Bélusca-Maïto 97cc32519f [WLANCONF] Improve imports and fix x64 build warnings
wlanconf\wlanconf.c(592):
  warning C4267: '=': conversion from 'size_t' to 'DWORD', possible loss of data
wlanconf\wlanconf.c(602),(683):
  warning C4267: '=': conversion from 'size_t' to 'ULONG', possible loss of data
2026-03-30 21:46:10 +02:00