209 Commits
Author SHA1 Message Date
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
Timo Kreuzer 1cf31524d5 [REACTOS] Stop using non-conforming swprintf / vswprintf
Use the underscored versions instead.
2026-05-07 06:27:58 +00:00
Justin Miller eb154533af [USBPORT][USBHUB] Improve Unplug and Plugin stability (#8624)
Dramatically improves stability when unplugging a bunch of devices at once (Except storage obviously)
and implements primitive ESD handling.
2026-01-26 19:55:44 +00:00
Justin MillerandHermès BÉLUSCA - MAÏTO 52006dd926 [USBCCGP][USBPORT][USBSTOR][USBHUB] Misc USB stack stability improvements. (#8453)
* [USBCCGP] CORE-18689 - Don't do a double IRP completion

* [USBPORT] CORE-17052 Handle port status better and CreateDevice
MaxPacketSize

* [USBSTOR] CORE-19773 Clamp LUN - Don't just assert on a POSSIBLE case

* [USB] Disable LIST_ENTRY_CHECKS privately for USB

* [CODEREVIEW]

Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>

* [CODEREVIEW]

Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>

---------

Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
2025-12-03 13:14:22 -08:00
Dmitry Borisov b558596409 [SPTILIB] Introduce SPTI static library for storage drivers (#8209)
Add a SCSI and ATA passthrough support helper library for direct use
from low-level storage drivers.

Tested with: CDRoller, CloneCD, Magic ISO
NOTE: Vbox seems to lack support for CD/DVD burning; tested on real hardware.

CORE-10191 CORE-16452
CORE-14788 CORE-18241
CORE-17256 CORE-13866
2025-07-13 22:49:51 +02:00
Johannes Anderwald dba4efbcae [USBCCGP] [USBPORT] USB Stack improvements (#7740)
[USBCCGP]

Ignore invalid devices
Group audio function interfaces together
[USBPORT]

Prevent infinite loop in USBPORT_OpenPipe when endpoint is not becoming ready
2025-03-19 01:35:36 -07:00
Timo Kreuzer 0c2cdcae83 [REACTOS] Add missing line breaks at end of file 2024-10-06 10:47:11 +03:00
Justin Miller a65b6ae946 [USBSTOR] Don't assert on clean up if initization didnt finish (#7412)
During investigation into some of the USB stack issues we've been running into I've found that when a USB storage device is already plugged in during boot and removed before it finishes initialization we run into this assert.

The logic in this function removes the pools made for the following entries in DeviceExtension indiscriminately this makes debugging a bit more difficult. Instead of depending on this behavior of ALWAYS being filled with valid data, let's free the following pools ONLY if they're initialized. This change prevents us from bugchecking when USB flash drives are removed early during boot. This makes the debugging experience a little more sane.
2024-10-02 23:21:50 +02:00
Timo Kreuzer 752c64d152 [USBOHCI] Fix broken indentation 2024-03-23 23:08:01 +01:00
Timo Kreuzer 5869af7821 [USBUHCI] Fix broken indentation 2024-03-23 23:08:01 +01:00
Adam Słaboń 20efea8fa4 [USBSTOR] Fix PdoHandleQueryInstanceId and increase serial number descriptor size to MAXIMUM_USB_STRING_LENGTH (#6413)
Serial number on some USB devices might exceed the number of 100 characters
(e.g. 120 characters on "SanDisk Ultra 3.2Gen1" pendrive) and cause buffer
overflow, resulting in usbstor.sys crash.

- Use pool allocation for instance ID generation.
  Fixes stack overflow on USB storage devices with large serial number.
- Print the LUN number as a hexadecimal, not as a character.
- Verify the serial number descriptor before using it.
- Increase the max descriptor size for serial number to
  MAXIMUM_USB_STRING_LENGTH. This fixes serial number string truncation.

Based on suggestions by disean and ThFabba.

CORE-17625
2024-02-16 18:48:33 +03:00
Serge Gautherie 5b54477d47 [BDASUP][PORTCLS][SYSAUDIO][USB] Use ExAllocatePoolZero() and ExFreePoolWithTag() (#5811) 2023-10-23 18:16:59 +02:00
Mark Jansen 9bb0b9137f [USBSTOR_NEW] Add missing poppack.h 2023-01-30 15:12:06 +01:00
Stanislav Motylkov bbccad0ed6 [INF] Set manufacturer as ReactOS Project for consistency
Also make it non-localizable. CORE-18191
2022-06-27 17:00:18 +03:00
Luke Luo f59c58d833 [TRANSLATION] Improve Simplified & Traditional Chinese translations (#4388)
Reviewed-by: Chan Chilung <[email protected]>
Reviewed-by: Stanislav Motylkov <[email protected]>
2022-03-31 20:38:52 +03:00
Thomas Faber f5c5426924 [USBPORT] Fix incorrect use of bitfields.
EndpointMoved == TRUE could never be true, because BOOL is a signed type,
and the only two values in a signed one-bit type are 0 and -1.

Courtesy of VS analysis warning C6299:
Explicitly comparing a bit field to a Boolean type will yield unexpected results.
2022-02-17 22:01:34 -05:00
Victor Perevertkin 7ed1883c8e [DRIVERS] Use IoForwardIrpSynchronously in drivers
Instead of having an own routine in each driver
IoForwardIrpSynchronously can be used.
2022-01-05 02:17:56 +03:00
Stanislav Motylkov 07c534c863 [BOOTDATA][USBSTOR] Add device definitions for SFF-8070i (ARMD-style devices)
Confirmed working with our usbstor driver by Vort.

CORE-17895
2021-12-08 17:52:07 +03:00
Thomas Faber fb3e2c7c8b [USBUHCI] Fix always-false HcFlavor checks.
Powered by clang-cl.
2021-10-27 19:27:33 -04:00
Thomas Faber 555eec0306 [USBEHCI] Avoid uninitialized return status in EHCI_ReopenEndpoint.
Powered by clang-cl.
2021-10-27 19:27:33 -04:00
Thomas Faber e7574ee5e8 [USBPORT] Don't use NTAPI for variadic function.
Powered by clang-cl.
2021-10-27 19:27:33 -04:00
Efe Itietie c73c86419e [USBUHCI] Fix wrong sizeof access (#4070)
Reviewed-by: Victor Perevertkin <[email protected]>
Reviewed-by: Thomas Faber <[email protected]>
2021-10-26 17:10:51 +03:00
Efe Itietie feae6fbc64 [USBEHCI] Fix coverity #1476930 "Wrong sizeOf access" (#4070)
Reviewed-by: Victor Perevertkin <[email protected]>
Reviewed-by: Thomas Faber <[email protected]>
2021-10-26 17:10:51 +03:00
Süleyman Poyraz 05c39d8d62 [TRANSLATION] Update Turkish (tr-TR) translations (#3958)
Reviewed-by: Can Taşan <[email protected]>
Signed-off-by: Süleyman Poyraz <[email protected]>
2021-10-10 16:00:12 +03:00
Hermès Bélusca-Maïto 9b1edceae1 [REACTOS] Fix some instances of DPRINTs with trailing whitespace before newlines. 2021-09-13 03:52:19 +02:00
Victor Perevertkin 34593d933b [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
Timo Kreuzer e693d5ffc0 [USBPORT] Make unload work 2021-05-28 22:29:44 +02:00
Mark Jansen 9f549dba1e [USBHUB] Mute debug spam 2021-05-20 08:35:39 +02:00
Mark Jansen 17acec6d13 [USBCCGP] Mute debug spam 2021-05-20 08:35:39 +02:00
Victor Perevertkin d14d7e5b8c [USBHUB] Add a delay hack for USB boot
CORE-7826
2021-01-27 05:15:15 +03:00
Victor Perevertkin 39c48a4d91 [USBSTOR] Remove workarounds for old storage stack 2020-12-06 23:32:29 +03:00
Victor Perevertkin f722be93d5 [USBSTOR] Enable USB (ATAPI) cdroms
With the cdrom_new driver, they now work

CORE-16112
2020-12-06 02:08:32 +03:00
Victor Perevertkin cbe88e287f [USBSTOR][SCSIPORT] Use STORAGE_ADAPTER_DESCRIPTOR from WIN8
This way, these drivers are more compatible with classpnp and cdrom used
by ReactOS (and don't fire asserts)
2020-12-06 01:57:56 +03:00
Jérôme Gardou d6ea8659c8 [CMAKE] Get rid of the set_cpp macro
Instead of messing with global variables and the like, we introduce two target properties:
 - WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions
 - WITH_CXX_RTTI: if you need RTTI in your module
You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments
We also introduce two libraries :
 - cpprt: for C++ runtime routines
 - cppstl: for the C++ standard template library

NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++

Finally, we manage the relevant flags with the ad-hoc generator expressions

So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module
2020-10-20 21:44:54 +02:00
Victor Perevertkin 1e512e29dc [USBSTOR] Correctly terminate a REG_MULTI_SZ string
returned by the IRP_MN_QUERY_ID handler
2020-06-24 21:15:58 +03:00
Victor Perevertkin 2540c3b1e8 [USBSTOR] Fix unused variable introduced in 94e61c3 2020-06-13 03:20:08 +03:00
Victor Perevertkin 493f2ace11 [USBSTOR] Fix wrong function name in a9b97ae 2020-06-13 03:07:00 +03:00
Victor Perevertkin 94e61c3080 [USBSTOR] Move PDO's Inquiry data and FDO's SCSI context
to their Device Extensions.
This way the driver can better handle low memory situations
2020-06-12 16:55:27 +03:00
Victor Perevertkin a9b97aeded [USBSTOR] General refactoring.
Remove unused structures and unused fields in device extensions.
Replaced magic numbers with constants
2020-06-12 16:55:27 +03:00
Amine Khaldi 139a3d6661 [CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03:00
Thomas Faber 71a4462ad5 [USBCCGP] Ignore IRP_MN_REMOVE_DEVICE return status and don't wait for it to complete. 2020-05-01 12:05:12 +02:00
Thomas Faber 823101274a [USBCCGP] Don't handle IRP_MN_QUERY_DEVICE_TEXT requests other than device description. 2020-05-01 12:05:11 +02:00
Thomas Faber 0d15b2a3cb [USBCCGP] Correctly stub PDO power IRP handling. 2020-05-01 12:05:11 +02:00
Thomas Faber 6c3a10c55a [USBCCGP] Always forward device relations IRPs. 2020-05-01 12:05:06 +02:00
Victor Perevertkin 019f21ee1d [MEDIA][CMAKE] Create add_driver_inf cmake function
*.inf files for drivers can now be placed along with the driver code
2020-04-26 20:28:04 +03:00
Eric Kohl 7bef5b882a [USBSTOR] Add missing compatible device id 5 2020-04-10 13:41:01 +02:00
Eric Kohl bac4e185fb [USBHUB] Set the Removable flag for all ports of a USB hub 2020-03-21 13:23:21 +01:00
Joachim Henze 23f6b36174 [USBHUB] Demote a DbgBreakPoint CORE-16394
The DbgBreakPoint() was reported to be continuable without
obvious side-effects by Doug Lyons.
Thank you for your tests Doug.

To prevent what end-users may otherwise perceive as a
freeze-regression caused by enabling the new driver in
0.4.13-dev-1048-g
6392c5a78c
2020-03-10 22:48:02 +01:00
Thomas Faber 67b3b73d82 [USBHUB] Partially implement USBH_ProcessHubStateChange. CORE-16704 2020-03-02 20:47:01 +01:00
Thomas Faber 76a075867e [USBHUB] Fix recipient in USBH_SyncClearPortStatus. CORE-16704 2020-03-02 20:46:56 +01:00