Commit graph

877 commits

Author SHA1 Message Date
Timo Kreuzer
76ef3c45a5 [PSDK] Add minwinbase.h 2025-07-31 16:00:13 +03:00
Carl J. Bialorucki
c9842e5aad
Move /sdk/include/reactos/wine to /sdk/include/wine, reorder global includes, remove unneeded includes (#8258)
- Move sdk\include\reactos\wine to sdk\include\wine
- Reorder the directories in include_directories() to be closer to alphabetical. This should make it easier to determine what global include directories can be removed in the future.
2025-07-29 13:57:12 -06:00
Timo Kreuzer
719ea022ec [UCRT] Fix GCC/Clang SIMD compilation
GCC and Clang need to mark functions that use SSE/AVX etc, either with a function attribute or a pragma around the function. strlen uses a template function that either uses SSE2 or AVX2. Previously the template was surrounded with pragmas to allow both SSE2 and AVX2, but that makes GCC assume that it can use AVX2 instructions even in the SSE2 version. To fix this the template instances are now build in individual compilation units for SSE2 and AVX, separate from the "dispatcher" function.
Now ucrtbase doesn't crash anymore on GCC build.

Another issue was the namespace around strnlen_mode, which has confused clang so much, that it forgot to instantiate the template code.
2025-07-29 09:22:15 +03:00
Timo Kreuzer
e2deec8235 [UCRT] Fix __crt_fast_encode_pointer
GCC was optimizing away the xor with __security_cookie when passing nullptr_t, because the return value was also nullptr_t, assuming it must be nullptr.
2025-07-29 09:22:15 +03:00
Timo Kreuzer
9750f6decd [RTL/x64] Improve RtlUnwindInternal
- Implement RtlpExecuteHandlerForUnwind in asm
- Implement RtlpExecuteHandlerForUnwindHandler
- Use the correct context in DISPATCHER_CONTEXT when unwinding
- Handle collided unwinds
2025-07-20 10:42:26 +03:00
George Bișoc
a5ab400689
[SDK] Swap initguid and wdm headers
The WDM header contains power manager related GUIDs that were declared but never initialized properly due to the fact the initguid.h header wasn't at the top.
This patch fixes a linker error in the kernel where GUIDs like GUID_LIDSWITCH_STATE_CHANGE are used.
It's a hotfix for 624c3fd.
2025-07-16 22:08:55 +02:00
George Bișoc
624c3fd847
[SDK] Introduce the PO GUID library
This library aims to include all the public and global power manager related GUID identifiers into one shared library, of which they can be accessed across multiple modules of ReactOS, e.g. the kernel, ACPI, PCI, et al.

This patch is needed for the development of the Power Manager (#5719) to continue.

CORE-18969
2025-07-16 20:15:15 +02: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
Oleg Dubinskiy
206b52833f [MMIXER] HACK: Decrease SteppingDelta for each volume value by 1
This workarounds broken changing volume level for left and right volume controls separately ("Speakers Volume" button in "Sound" tab of mmsys.cpl).
CORE-19190
2025-07-10 14:02:23 +02:00
Oleg Dubinskiy
376708b586 [MMIXER] Fix improperly working volume control
Fix broken volume level changing and left/right speakers balance level changing.
Get and set volume level value for all available output channels instead of only the 1st channel (available in MIXERCONTROLDETAILS.cChannels member), so other channels don't have a non-set volume values now. This allows to control the volume for all channels.
So now the volume control works correctly and hence, the volume level can be properly changed from Sound Properties (mmsys.cpl) and Volume Mixer (sndvol32.exe) as well.
Note that the volume level settings changed by user are not saved after reboot yet. We need to save (write) and then load (read) them at next boot from HKLM/System/CurrentControlSet/Control/DeviceClasses/KSCATEGORY_AUDIO/.../DeviceParameters/Mixer/.../* keys inside wdmaud.sys, similarly to as it's done in Windows XP/2003. It can be tested (and is tested sveral times by me and is confirmed) by using MS wdmaud.sys in ReactOS. It writes the values in that key, so the actual volume values are stored there.
Another key, HKCU/SOFTWARE/Microsoft/Windows/Applets/Volume Control/, is created and managed by sndvol32.exe instead, so it does not contain the actual values of volume levels.
CORE-17976
2025-07-10 14:02:23 +02:00
Timo Kreuzer
f026550f89 [RTL] Implement RtlGetUnwindContext 2025-07-10 14:57:09 +03:00
Timo Kreuzer
98ed87b556 [RTL] Fix RtlSetUnwindContext
Only set the registers requested by ContextFlags
2025-07-10 14:57:09 +03:00
Timo Kreuzer
d23ee5f365 [PSEH] Make structures more SEH3 compatible 2025-07-10 11:15:23 +03:00
Timo Kreuzer
cfb579dd67 [PSEH3] Fix unlinking of EH frames during unwind.
On Windows the function that calls the language specific exception handler function registers it's own exception handler, so the top of the exception chain does not point to our own handler. We need to take that into account when unwinding the stack and removing each handler as we go.
2025-07-10 11:15:23 +03:00
Timo Kreuzer
ff8d24cabb [PSEH3] Fix _SEH3_LEAVE
Previously, when leave was used in the except or finally block of a nested try block, it would jump back to the start of the except/finally block, resulting in an endless loop. This is fixed by jumping back to a label at the beginning of the try block, which is only visible from within the try block itself and from there to the end of the SEH block.
Fixes seh0055 testcase of MS SEH tests.
2025-07-10 11:15:23 +03:00
Justin Miller
02343c22f6
[RTL] Partial revert of Wine timer code in thread pooling (#8229)
* [SDK] Partial Revert of 0bf42067d2

It was found that the timer code from WINE doesn't work as well as ours,
This is a revert from that part of the PR as it doesn't change any of the real threadpool code in all reality. Thanks to the investigation of Julenuri and Simone
JIRA issue: CORE-20245
2025-07-08 12:05:53 -07:00
Vitaly Orekhov
5ffc6ceb55
[PSEH] Guard SEH2 macros for Clang on Linux x64 builders (#8194)
Hackfixing a corner case detected via broken entities of wlanwiz
due to its usage of STLport. This was already done to PSEH3 prior to me.

Corner case examples:
- broken: 1591123914
- "fixed": 1594570563

Guard SEH2 family macros behind #ifndef. CORE-6622 CORE-6905
2025-07-07 15:24:27 +03:00
Whindmar Saksit
212a1a5c74
[SDK][SHELL32_APITEST] Fix some warnings (#7031) 2025-07-06 21:12:37 +02:00
Timo Kreuzer
c507b701ab [CRT:MATH] Import frexp from musl 2025-06-30 09:19:47 +00:00
Timo Kreuzer
b734e3ba63 [CRT:MATH] Move some math functions from ucrt to crt 2025-06-30 09:19:47 +00:00
Timo Kreuzer
a9ee20cb9a [CRT:MATH] Import nextafter, nextafterf and nexttowardf from musl
Note: On Windows, where a long double is the same as a double, nextafterl is the same as nextafter, nexttowardl is the same as nexttoward.
Also nexttoward is the same as nextafter.
2025-06-30 09:19:47 +00:00
Timo Kreuzer
5c26ccdb29 [CRT:MATH] Import scalbn/scalbnf from musl 2025-06-30 09:19:47 +00:00
Timo Kreuzer
3f71ab80ad [CRT:MATH] Implement _isnan and _isnanf 2025-06-30 09:19:47 +00:00
Timo Kreuzer
e01231bd49 [CRT:MATH] Implement _finite, _finitef 2025-06-30 09:19:47 +00:00
Timo Kreuzer
50028685dc [CRT:MATH] Implement _dsign and _dsignf 2025-06-30 09:19:47 +00:00
Timo Kreuzer
0e5d6af68e [CRT:MATH] Implement x86 sse2 math functions
These are just wrappers around the normal functions and lack any optimization.
2025-06-30 09:19:47 +00:00
Timo Kreuzer
5c6912f561 [CRT][UCRTBASE] Add round/roundf 2025-06-30 09:19:47 +00:00
Timo Kreuzer
d736b55644 [CRT:MATH] Fix a bug in _handle_error 2025-06-30 09:19:47 +00:00
Timo Kreuzer
35bc1e1d9e [CRT] Add crtmath library 2025-06-30 09:19:47 +00:00
Hermès Bélusca-Maïto
db96138813
[SDK][KERNELBASE][PATHCCH] Compile a collection of PathCch libraries (#8085)
CORE-12686

This collection of libraries consist in:

- a down-level `pathcch_static` PathCch library, to be used for programs
  that need to run on Windows 7 and below;

- Windows 8+ compatible libraries importing from either kernelbase.dll
  (`pathcch_kernelbase`), or from the corresponding APISET
  api-ms-win-core-path-l1-1-0.dll (`pathcch`, which is Win8+ PSDK
  compatible).

The down-level static library is compiled by reusing the newly-introduced
kernelbase's path.c, instead of using a specific pathcch.c.
Unrelated functions are excluded from compilation by putting them into
`#ifndef STATIC_PATHCCH ..... #endif` blocks.
2025-06-24 16:48:03 +02:00
Hermès Bélusca-Maïto
8ed6ec437b
[SDK] Move pathcch.h to the PSDK (#8085)
CORE-12686
2025-06-24 16:47:56 +02:00
Timo Kreuzer
d5286af2e1 [NTDLL_VISTA] Export RtlLcidToLocaleName and RtlLocaleNameToLcid 2025-06-19 17:36:40 +00:00
Timo Kreuzer
e431470ff9 [REACTOS] Fix build with VS 17.14.2 / CL 19.44.35207.1 2025-05-31 09:51:33 +00:00
Katayama Hirofumi MZ
e43e639c30
[CICERO] Move sdk/lib/cicero to base/ctf/cicero (#8055)
The CTF modules depend on Cicero
static library. Cicero should be a
component in CTF.
This move will improve code
readability and grep-ability.
JIRA issue: CORE-19361
JIRA issue: CORE-19363
- Move sdk/lib/cicero to base/ctf/cicero.
- Adapt CMakeLists.txt to this move.
- No code content change except
  CMakeLists.txt.
2025-05-30 22:17:09 +09:00
Hervé Poussineau
f4992a4484 [RTL] Fix prototypes of RtlCreateUserSecurityObject and RtlCreateAndSetSD 2025-05-26 21:29:30 +02:00
Hermès Bélusca-Maïto
f20efc6007
[INCLUDE][ATL] Fix WM_SETHOTKEY macro wrappers
WM_SETHOTKEY / WM_GETHOTKEY messages encode the hotkey in a different
way than with the WM_HOTKEY message.
For more details, see:
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-gethotkey
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-sethotkey

Addendum to commit 6829350af9 (PR #7947)
2025-05-08 18:57:43 +02:00
Katayama Hirofumi MZ
2c475add8c
[IMM32][NETAPI32][SDK] Reduce Wine dependency (#7912)
Related to #7870. netapi32.dll uses NDK.
So, we have to reduce dependency on Wine.
JIRA issue: CORE-5743
- Introduce wine2ros module in
  sdk/lib/wine2ros/.
- Reduce Wine dependency.
2025-05-06 09:59:47 +09:00
Hermès Bélusca-Maïto
005f75bd61
[RTL] x64/ARM: Alias RtlpBreakWithStatusInstruction to DbgBreakPointWithStatus; x64: fix a bug.
RtlpBreakWithStatusInstruction is just a label for KD.

On machines that have register calling conventions (basically all except
x86), the `Status` parameter for `DbgBreakPointWithStatus` is stored in
the first argument register.

https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-dbgbreakpointwithstatus

On the x64 platform, `DbgBreakPointWithStatus` only uses the ECX register
and leaves EAX untouched. Verified on Windows.
2025-04-19 20:01:08 +02:00
Hermès Bélusca-Maïto
a7d86fe3a7
[NTOS][RTL] Remove unused deprecated ReactOS-only DbgBreakPointNoBugCheck()
This helper was introduced in commit b041530f2d (r8551), and its
last remaining usage removed in commit f038f4a895 (r23636).
2025-04-19 20:01:06 +02:00
Timo Kreuzer
52719b52ae [VCRUNTIME] Fix a bug in x64 __security_init_cookie 2025-04-07 13:57:17 +00:00
Oleg Dubinskiy
9aa299bea4
[MMIXER] Don't stop audio devices enumeration when one or more of them failed to initialize (#7863)
Skip unsuccessfully initialized devices and continue enumeration until all of devices are enumerated.
Patch by Johannes Anderwald with additional improvements from me.
This fixes 0 audio devices detected for HD audio controllers (e. g., Realtek), and hence allows to properly detect all available devices and play the sound with MMixer routines enabled (they are currently default).
Tested personally with Realtek HD Audio driver version R2.74 for Windows XP/Server 2003 in pair with hdaudbus.sys from Windows Vista SP2 on real hardware.
CORE-17285
2025-04-06 10:55:55 +02:00
Katayama Hirofumi MZ
1e6e5529c6
[FREETYPE][FTFD][DOC] Update FreeType to 2.10.0 from 2.9 (#7786)
Modernize font engine modules.
JIRA issue: CORE-16084
- Update FreeType to 2.10.0 from 2.9.
- Delete useless files.
- Add technical notes (TechNote.txt) on freetype.
- DbgPrint became FT_Message.
2025-04-04 20:50:25 +09:00
Mark Jansen
db9768f25d [PSDK] Add EmptyVC.idl 2025-03-26 13:58:40 +01:00
Mark Jansen
5ec739bf2e [RTL] Change comment to indicate a hack 2025-03-25 16:23:39 +01:00
Mark Jansen
08d575adf9 [RTL] Notify verifier when freeing the process page heap 2025-03-25 16:23:39 +01:00
Mark Jansen
5821136dfa [AVRF] Hook up debug functions, add noisy stub for AVrfpGetStackTraceAddress 2025-03-25 16:23:39 +01:00
Mark Jansen
a7a504a466 [SDK] Add avrf stop codes and VERIFIER_STOP macro 2025-03-25 16:23:39 +01:00
Timo Kreuzer
e01c32f3bd [RTL] Implement locale functions/tables
The locale table is currently hardcoded in rtl. On Vista+ (and Wine) this table is part of locale.nls, but we don't have that yet.
2025-03-25 09:55:17 +00:00
Timo Kreuzer
5b633d64f1 [UCRTBASE] Build without debug exports
Windows ships ucrtbase without debug exports and ucrtbased with debug exports. The wine test tests ucrtbase and loads it dynamically in some cases. Compiling it with _DEBUG requires it to be linked to ucrtbased, which causes problems, because it also dynamically loads ucrtbase, which will cause it to crash.
2025-03-24 23:02:06 +00:00
Timo Kreuzer
f81c82f5fa [VCSTARTUP] Implement atexit and _onexit
These must use a local table and cannot use the one from ucrtbase.
The table is initialized with a .CRT section initializer.
2025-03-24 23:02:06 +00:00