1389 Commits

Author SHA1 Message Date
Dmitry Borisov
e7518a9c79 [PCI] Fix data type checking for the bus interface (#8939)
Fixes MS storport.sys not being able to work with the qla1xxx.sys driver.
Storport miniport drivers use the PCIConfiguration value
to access the PCI configuration space
(see StorPortGetBusData and StorPortSetBusDataByOffset).

CORE-13866 CORE-20545 CORE-20628
2026-09-04 13:40:16 +03:00
Hermès Bélusca-Maïto
3e86817970 [PCIX] Fix newline format
Addendum to commit b82fc1e2b3 (PR #9479).
2026-09-03 16:34:17 +02:00
Justin Miller
b82fc1e2b3 [PCIX] Preperation for initial PCIX Arbiters to be enabled (#9479)
* [PCIX] Use the bridge's parent bus in the IRQ translator constructor

* [PCIX] Stop the limit descriptor scan from running off the array

* [PCIX] Build a real resource requirements list for each function

* [PCIX] Skip the right descriptors when draining a device-private group

* [PCIX] Record assigned resources against the BAR they satisfy

* [PCIX] Program device BARs with their arbitrated addresses

---------

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2026-09-03 00:17:15 -07:00
John Rowe
fbcef39dd6 [NETKVM] Fix the va_list handling in DebugPrint (#9459)
DebugPrint starts a va_list with va_start and formats from it, but never
calls va_end on any path. On the targets ReactOS builds for this happens
to be harmless, but it is undefined behaviour and breaks on any ABI
where va_end has real work to do.

The VIRTIO_DBG_USE_IOPORT block has the same problem in a worse form: it
hands the list to RtlStringCbVPrintfA after PrintProcedure has already
walked it, so on that configuration the second pass formats from an
indeterminate va_list. End the list right after the first consumer and
start a fresh one for the second, ending that too.

netkvm is listed in media/doc/3rd Party Files.txt, but the entry pins a
commit-tree URL rather than a branch, because upstream virtio-win
deleted its NDIS5 driver: this copy has no live upstream to send the fix
to, and ReactOS has already patched this same file locally. Hence
ReactOS rather than virtio-win, and no __REACTOS__ guard - there are
none anywhere in this directory.

CORE-15841

Reviewed-by: Whindmar Saksit <whindsaks@proton.me>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>	
Signed-off-by: John Rowe <opensource@rowe.lol>
2026-08-30 18:22:19 +03:00
Justin Miller
4cee655099 [PCIIDEX] Enable AHCI/SATA flags while keeping existing ones (#9430)
Do not erase existing controller flags in AhciGetControllerProperties().

CORE-17256
2026-08-22 20:40:26 +03:00
Daniil Tatianin
8157b00610 [ACPI_NEW] Update uACPI to 6.0.1 2026-08-16 21:27:27 +00:00
Justin Miller
81f04b39ba [PCIX] Initial pass of PCI Interfaces (#8465)
* [PCIX] Start implementation of PciPdoIrpQueryInterface
* [PCIX] Fill in Bus Interface and PME Interface
2026-08-16 14:42:24 +00:00
Justin Miller
d0e71de116 [SDK:ARBITER] Implement OrderingList Support and rename default callbacks (#9393)
* [PCIX][NTOS:IO][ARBITER] Rename the default callbacks
* [SDK:ARBITER] Implement OrderingList Support

This implements the arbiter ordering list.

When you have a PCI device let's say and it provides a wide range of placements that satisfies it, Arbiter has some functionality to apply some "preferred rule-sets" even before these assignments start happening. While windows can Rebalance PNP, there are some quirks that the kernel can't immediately see right away. So this was more for some BIOSes to have a static set of rules and avoid rebalancing too many times per boot as this was expensive, and couldn't account for ALL of these quirks.
Honestly if you are super bored and care that much about these things you can pull up BIOSINFO.inf on different installs of pre-vista windows and see what kind of vendor hooks exists, There's a lot. Vista prebakes this.
2026-08-15 00:51:18 +00:00
Pavel Parfenov
39ca039e02 [I8042PRT] Compensate for inverted PS/2 mouse Y-axis under Hyper-V (#9254)
Since Windows 11 24H2 (host build 26100), Hyper-V's emulated PS/2
mouse reports vertical movement already in Windows orientation, so
the usual PS/2 -> Windows Y inversion made the pointer move
backwards. The same host regression also affects other legacy
guests such as Windows XP.

Detect this via the CPUID hypervisor interface (Hyper-V signature
and host build number) combined with the SMBIOS system identity,
so that other hypervisors exposing the Hyper-V CPUID interface
(e.g. VMware/VirtualBox on top of the Windows Hypervisor Platform)
are never affected, and skip the Y negation in that case.

Also OR the flags in the SMBIOS hardware table matching instead of
overwriting them, so flags set by other detections are preserved.

CORE-20561

Signed-off-by: Pavel Parfenov <pavel.parfenov91@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 15:48:38 +03:00
Oleg Dubinskiy
efde4f04f1 [PORTCLS] Debug more data fields from the audio miniport's Filter Descriptor (#9386)
Debug more members of PCFILTER_DESCRIPTOR and its sub-items (PCPIN_DESCRIPTOR, PCNODE_DESCRIPTOR and PCCONNECTION_DESCRIPTOR).
This allows to achieve the following things:
1) Actually debug more contents from the internal Filter Descriptor's definition of any audio miniport driver, including proprietary ones (e. g., Intel AC97, Realtek HD Audio codec etc.), and therefore to learn better how the Filters, Pins, Nodes and Connections are organized inside it.
2) Hence the proper debugging of them is also very useful and helpful for developing new audio miniport drivers both for Windows and ReactOS as well (as an example, it helps a lot to develop a new generic HD audio miniport driver for ReactOS personally for me).
Proposed changes:
- Debug DataFlow, Communication, Category and Name fields of all Pins and Nodes inside Filter Descriptor in particular. This allows to see the actual names and types for the audio-related items, to know whether the Pin or Node is of an input, output or bridge type and which is its actual purpose (for example, which thing the Node should do: Volume, Mute, Mux etc. and with which extental physical or virtual device the Pin is associated: WaveOut, WaveIn, Topology Speaker, Microphone, Headphones etc.).
- Reorganize debug output of the Connections list: first debug FromNode and ToNode, and only then FromPin and ToPin fields of PCCONNECTION_DESCRIPTOR. This follows the original sequence of the members in the structure as it's defined at MSDN and improves readability and understandability of the Connections list in general (at least personally for me).
- Wrap debug-only functions into #if DBG condition, to ensure they are enabled only for debug builds, but not for release ones.
- Enable the call of the main DumpFilterDescriptor() debug routine inside PcCreateSubdeviceDescriptor() (which actually converts audio miniport's Filter Descriptor to the understandable format for the system PortCls driver), to make it possible to debug it at all. Mute some DPTINTs (debug prints) appropriately, so now debug output is printed ONLY in case when NDEBUG is NOT defined (so hence it's possible to get it by either disabling #define NDEBUG line at the top, or modifying it to #define YDEBUG instead). Since no any other debug prints are currently added in this source file (undoc.cpp), nothing else will be printed except Filter Descriptor debugging.
- Fix code formatting for all related "for()" loops a little bit. Add one space between the for keyword and the condition of the loop iteration.
2026-08-11 11:10:14 +02:00
Hervé Poussineau
c4517f4b0a [I8042PRT] Fix number of function keys
On 101-key keyboards, function keys are from F1 to F12.
2026-08-10 18:56:59 +02:00
Hervé Poussineau
ded9969049 [ATAPI] Correctly register GUID_DEVINTERFACE_STORAGEPORT interface
IoRegisterDeviceInterface() is taking a PDO as argument.
Otherwise, it is failing with STATUS_INVALID_DEVICE_REQUEST.
2026-08-03 22:29:57 +02:00
Timo Kreuzer
9675f756ce [NDK] Fix definition of OB_CLOSE_METHOD 2026-07-28 12:16:32 +00:00
Dmitry Borisov
af36fc655d [NVNET] Fix two typos (#9345)
- Fix ETH_IS_EMPTY macro condition (5th octet)
- Add missing assignment of maximum VLAN ID

CORE-15872
2026-07-26 19:52:51 +03:00
Timo Kreuzer
ccc242ed6f [ARBITERS][NDIS] Try to fix the repository 2026-07-21 08:52:34 +00:00
Justin Miller
708d289dbf [NDIS] Use the PCI standard bus interface for config access (#8452)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Co-authored-by: Dmitry Borisov <di.sean@protonmail.com>
2026-07-19 10:33:34 -07:00
Mikhail Tyukin
248aa75023 [WSHTCPIP][TCPIP] Implement SO_KEEPALIVE, SIO_KEEPALIVE_VALS 2026-07-19 15:33:29 +02:00
Alex Mendoza
ae50d745ca [USBHUB] USBH_FdoQueryBusRelations: Fix an off by one (#9298)
Fix an out of bounds heap read when compacting the ghost device list.

Change the loop condition from `GhostPort < DeviceRelations->Count` to
`GhostPort < DeviceRelations->Count - 1` so the array shift never reads
past the last valid entry.
2026-07-17 22:48:18 +03:00
Ahmed Arif
63deca5a96 [ACPI][UEFI] Use bootloader-provided ACPI root pointer in OSL (#8980)
Fix ACPI table discovery on the UEFI boot path by teaching the ACPI OSL
to use the loader-provided ACPI root table information instead of relying
only on legacy BIOS RSDP scanning:

- Build a synthetic RSDP from the ACPI BIOS configuration node
  populated by the bootloader
- Fallback to the old scan only if that data is unavailable
- Keep full 64-bit physical addresses when mapping ACPI tables
- Improve failure diagnostics if initialization still fails

This lets ACPICA initialize from the UEFI-provided RSDT/XSDT path.
CORE-11954

So QEMU Q35 on UEFI is now able to discover ACPI tables through the loader-
provided root table path, which fixes 0x7B INACCESSIBLE_BOOT_DEVICE bugcheck:

https://github.com/user-attachments/assets/25d4d9c9-4197-496b-84f9-e5642c65809d
2026-07-09 01:40:17 +03:00
Dmitry Borisov
c54a9ca090 [DC21X4] Improve MII link status indication (#9220)
This code should be generic for all MII PHYs so always read the BMSR register twice.
2026-06-28 20:35:01 +02:00
Ahmed Arif
1b91127bbe [FLOPPY] Fix double-free of the interrupt object on init failure (#9225)
AddControllers already disconnects the controller interrupt on its error paths but left InterruptObject pointing at the freed object.

Now that DriverEntry runs Cleanup on failure (and Unload() routes through it too), that stale pointer is handed to IoDisconnectInterrupt a second time, bugchecking with BAD_POOL_HEADER.

Clear InterruptObject right after disconnecting so Cleanup() skips it.

CORE-20669
2026-06-28 10:23:39 -05:00
Ahmed ARIF
9dce9a82e9 [FLOPPY] fix driver unloading 2026-06-25 12:07:57 +00:00
Hervé Poussineau
9e09b5c5b9 [KDSTUB] Implement driver for KDNET extension stubs
CORE-20385
2026-06-15 08:42:50 -07:00
Alex Mendoza
f800886dc0 [WDMAUD] WdmAudGetDeviceInterface(): fix memory leak and protect the buffer (#9012)
- Fix memory leak in WdmAudGetDeviceInterface() (FreeItem(Device) was not called on STATUS_BUFFER_OVERFLOW early return path).
- Wrap user-mode buffer write in ProbeForWrite() + SEH2().
2026-05-26 19:35:16 +02:00
Timo Kreuzer
151c67ebfc [ROSTESTS] Implement automatic test discovery
This uses the START_TEST macro to create test entries in a ".test" section in the binary.
2026-05-15 16:50:48 +00:00
Timo Kreuzer
b13e568d99 [CMAKE] Remove global _CRT_NON_CONFORMING_SWPRINTFS
Instead define it only in 3rd-party code where required.
Most of these will go away with future wine-syncs.
2026-05-07 06:27:58 +00:00
Timo Kreuzer
1cf31524d5 [REACTOS] Stop using non-conforming swprintf / vswprintf
Use the underscored versions instead.
2026-05-07 06:27:58 +00:00
Oleg Dubinskiy
2ec1f64c96 [HDAUDBUS] Sync to the current upstream
Import the following upstream commits:
30a807de7d
76dbc244c3
afb1d55817
da286c7824
5477b93a3b
which contain new supported devices added in inf file and two bugfixes from me, which fix all playback distortions with all XP-compatible HD audio codecs.
Tested and works fine with Realtek HD audio codec R2.74 on ALC660 controller at least, but it still needs to be tested with other codecs as well (like SigmaTel etc.).
Also update the commit hash in 3rd party files.txt appropriately.
2026-04-27 23:05:40 +02:00
Timo Kreuzer
081a6366df [KSECDD][NTOS][RTL] Change license of some of my code to MIT 2026-04-23 12:39:01 +00:00
Dmitry Borisov
e2aa54321a [BOOTVID] Rename some function parameters
Delta       -> Stride
TopDelta -> Height
2026-04-21 15:08:17 -05:00
Dmitry Borisov
7d33f7503b [UNIATA] Disable the driver and enable the new ATA stack
Also fix descriptions for devices 1166:0241 and 1166:0242.
See https://bugzilla.kernel.org/show_bug.cgi?id=10424 and
aeb74914ef

CORE-17256
2026-04-21 15:01:22 -05:00
Dmitry Borisov
ac33647888 [ATAPI] Add ATA storage driver
CORE-17256
CORE-17191
CORE-17716
CORE-17977
CORE-13976
CORE-16216
2026-04-21 15:01:22 -05:00
Dmitry Borisov
ae2827f481 [PCIIDEX] Add DMA support
CORE-17256
2026-04-21 15:01:22 -05:00
Dmitry Borisov
c741c39025 [ATAPI] Disable the driver 2026-04-21 15:01:22 -05: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
Justin Miller
20494b84ef [PCIX] PciComputeNewCurrentSettings skip CmResourceSharedDeviceExclusive (#8464) 2026-04-01 09:29:34 +00:00
Hermès Bélusca-Maïto
5923d37e1f [KDCOM][KDGDB] Fix kdcom.dll/kdgdb.dll file naming on MSVC-built ISOs
CORE-20528

Addendum to commit 912c8ad987 (PR #5187)

Fix a bug where "KDCOM/KDGDB_NAME_ON_CD" CMake variables weren't used
as variables, but directly as names.
2026-03-23 13:29:58 +01:00
Hermès Bélusca-Maïto
6e51f4abb0 [KDVM] Rename KdVmKdVmExchangeData to KdVmExchangeData 2026-03-21 23:17:39 +01:00
Hermès Bélusca-Maïto
20e16781bb [KDCOM][KDGDB][KDVM] Adjust the file names reported in their version resources 2026-03-21 23:16:12 +01:00
Hermès Bélusca-Maïto
9669b3124f [KDGDB] Fix build with x86 and x64 MSVC (#5187)
```
gdb_input.c(243): error C4477: '_snprintf' : format string '%p' requires
  an argument of type 'void *', but variadic argument 1 has type 'UINT_PTR'

i386_sup.c(98): error C4090: 'return': different 'const' qualifiers
amd64_sup.c(115): error C4090: 'return': different 'const' qualifiers
```
2026-03-21 22:52:16 +01:00
Hermès Bélusca-Maïto
6e3e7f0d23 [KDGDB] Recognize both 'DEBUGPORT=GDB' and 'DEBUGPORT=COM' syntaxes (#5187) 2026-03-21 22:52:09 +01:00
Hermès Bélusca-Maïto
912c8ad987 [KDGDB] Don't make GDB a separate citizen (#5187)
But add KDGDB compilation only for x86 and x64, since for other
architectures (e.g. ARM) it currently emits the following error:
```
drivers/base/kdgdb/kdgdb.h(149): fatal error C1189: #error:
    "Please define relevant macros for your architecture"
```

For the time being, keep the "GDB" build configuration macro, used for
Gitpod testing... but this needs to be replaced with a more robust solution.
Because of this, rename kdgdb.dll to kdcom.dll, and kdcom.dll to kdser.dll
so that GDB is used by default, and we don't get a file name clash too.

Revert also commit 57cf5cdc5d.
2026-03-21 22:46:58 +01:00
Hermès Bélusca-Maïto
d012a8c4a3 [KDGDB] Minor formatting/typo fixes 2026-03-21 18:16:07 +01:00
Hermès Bélusca-Maïto
6c532e771e [FREELDR][KDCOM][KDGDB] Allow specifying the serial port address in the DEBUGPORT option
This is the same feature as the one that already exists in the
NTOS:KD!kdmain.c module used by the in-kernel KDBG debugger
(GCC builds), first introduced in commit 4ce30245de (r54473),
and documented at:
https://reactos.org/wiki/Debugging#Changing_the_serial_port_address

This feature is useful if one uses a PCI, PCIe, PCMCIA, or ExpressCard
serial card on real hardware (these cards are used e.g. with laptops
without a built-in serial port), or with AMT serial over LAN.
After determining the serial port I/O address (say, 0xCC00), specify
the debug port as follows:

/DEBUGPORT=COM:0xCC00

instead of the usual syntax: /DEBUGPORT=COMn (n an integer).

The same syntax can be used for debugging FreeLoader as well: in the
FREELDR.INI file, add a "Debug" line in the "FREELOADER" section,
as follows:

```
[FREELOADER]
Debug=/DEBUG /DEBUGPORT=COM:0xCC00 /BAUDRATE=115200
```

----

NOTE for KDCOM/KDGDB:

Since `strtoul()` is used, but isn't exported by ntoskrnl, link against
the "strtol" static library that has been introduced in commit d317d4fbcc
(r71481).
2026-03-21 00:10:21 +01:00
Hermès Bélusca-Maïto
956d9f7973 [FREELDR][KDCOM][KDGDB][KDVM][NTOS:KD] Don't overrun the command-line when parsing "DEBUGPORT"
Don't loop past the end of the command-line buffer, if the command-line
terminates with a lone "DEBUGPORT" without any extra parameter following.
For example: "some things   DEBUGPORT  "
2026-03-21 00:06:20 +01:00
Hermès Bélusca-Maïto
c4d60756dd [FREELDR][KDCOM][KDGDB][NTOS:KD] Some code "nits"
- Don't hardcode constant string lengths.

- Use `_strnicmp()` -- Ideally we shouldn't have to unconditionally upcase
  the global kernel command-line string to perform substrings comparisons.

- Cast `atol()` returned value to `ULONG`.
2026-03-19 22:49:29 +01:00
Hermès Bélusca-Maïto
4d0642b67f [FREELDR][KDCOM][KDGDB][NTOS:KD] Minor code comments enhancements 2026-03-19 22:14:00 +01:00
Hermès Bélusca-Maïto
b1a31610ac [FREELDR][KDCOM][KDGDB] Remove deprecated "IRQ" debugger command-line option
- The "IRQ" debugger option was introduced in commit 5a6adb4f13 (r2546).
  It was used by the in-kernel GDB stub, to manually wire an interrupt
  handler `GspBreakIn()` to allow the debugger to break into the system
  when a command is received on the GDB serial port.

  Side-remark:
  The hooking was done via `HalGetInterruptVector()` + `IoConnectInterrupt()`,
  but only at phase 1 initialization when the memory manager was up, which
  can be "late" enough during system boot initialization.
  Instead of using `IoConnectInterrupt()`, one could have used explicit
  `KeInitializeInterrupt()` + `KeConnectInterrupt()` calls that would
  have worked much earlier in the boot stage.

- This functionality was soon after disabled in commit c804ca06be (r2946)
  in the GDB stub (see `ntoskrnl/kd/gdbstub.c!KdGdbStubInit()`), never
  to be re-enabled again.
  It was removed completely in commit e160c0fb26 (r14799).

- Since ReactOS was (until recently) always debugged locally using the
  in-kernel KDBG debugger, break-in was done with TAB-K keypress,
  intercepted by the keyboard driver that triggered a `DbgBreakPoint()`,
  thus no break-in via serial port interrupt was necessary.

- Remote debugger break-in detection, which is the standard method that
  is used when remote-debugging using KD transport DLLs and WinDbg, was
  introduced in commit 12e7593f24 (r25984). As with the rest of debugger
  communication and as done on Windows, detection is done by polling the
  serial port at certain times, namely in the `KeUpdateSystemTime()`
  kernel procedure periodically invoked by the timer interrupt.
  This break-in detection was then erroneously removed in commit bf8b9467dc
  (r45140), and reinstated in commit 014b23b9a (r56194).

- Parsing of this "IRQ" option was copy-pasted in other modules (FreeLoader,
  KDCOM, and KDGDB), even though it was never used. The parsing was then
  removed in KDBG itself in commit 95faf65ebf, but left in the other
  modules... until now!
2026-03-19 21:52:14 +01:00
Hermès Bélusca-Maïto
d436f2e76b [EXT2FS] Fix an uninitialized variable usage RTC failure
Cherry-picking commit
3158b917a2

See https://github.com/bobranten/Ext4Fsd/issues/83 for more information,
and debug traces.

## How to reproduce:

- Format a partition in Ext2 with Paragon Hard Disk Manager 2010 Professional.

- Compile ReactOS with MSVC, ensuring that the driver is compiled with
  `EXT2_HTREE_INDEX` defined and set to 1, and with Run-time error checks
  enabled with the `/RTC1` flag (this is the default in our source tree).

- Install ReactOS on this partition.

## What's being observed:

After reboot, some filesystem paths are accessed, and the code inside the
`#ifdef EXT2_HTREE_INDEX` block is taken (in ext2/src/dirctl.c#L777-L794).
For some reasons, the retrieved `rc` doesn't get the "expected" value and
the `goto errorout;` path is taken. After this label, `FileIndex` was
reset to `ByteOffset`, which remained uninitialized.
A bugcheck ensues because of the failed check (usage of uninitialized variable).
2026-03-18 21:11:35 +01:00