Commit Graph
979 Commits
Author SHA1 Message Date
Timo Kreuzer d0b292cda6 [VCSTARTUP] Separate the library from vcruntime
Previously this was mixed with vcruntime, with some objects being shared. But this is messy. Instead use a separate library and link ucrtbase to this as well. This also matches more closely how native libraries are organized, where vcstartup is merged into the CRT import libraries, while vcruntime is merged into the static CRT libraries.
2026-06-21 12:30:32 +00:00
Timo Kreuzer 991830a0e8 [CRTHEAP] Add static library for crt heap functions
The purpose is to link to this library for wine modules that use only malloc/free/calloc/_recalloc, so they don't require to be linked to msvcrt.
2026-06-18 23:27:41 +00:00
Katayama Hirofumi MZ 300e1d525d [MSVCRT][CRT][UCRT] Disable intrinsic string functions on MSVC (#9157)
VS2022 version 17.2 and later (`_MSC_VER >= 1932`) added new intrinsic
functions (`strncmp`, `strncpy`, `wcsncmp`, and `wcsncpy`).
As we implement these ourselves, we have to avoid compiler error C2169.

This problem surfaced with a recent GitHub Actions update:
https://github.com/actions/runner-images/issues/14017

Use `#pragma function(...)` to disable new intrinsic functions.
2026-06-13 18:10:15 +03:00
Timo Kreuzer 4ba2db3c6e [KERNELBASE][PATHCCH] Unhack path.c 2026-06-09 17:40:07 +00:00
Timo Kreuzer c806131675 [RTL][NTDLL] Implement RtlInterlockedPushListSListEx
It is the same function as RtlInterlockedPushListSList, but with stdcall calling convention instead of fastcall.
On x86 this is a wrapper, on all other architectures it is simply a forwarder.
2026-06-02 18:58:04 +00:00
Timo Kreuzer 156d29ae80 [RTL] Fix a 64 bit MSVC warning 2026-05-29 18:21:33 +00:00
Jiahe Wang 5b2f79fe07 [RTL] Fix RtlVirtualUnwind for UWOP_*_FAR, UWOP_EPILOG and UWOP_SPARE_CODE 2026-05-29 13:37:18 +00:00
Timo Kreuzer d119feb2c7 [RTL][NTDLL] Implement RtlExpandEnvironmentStrings 2026-05-21 12:07:24 +00:00
Timo Kreuzer ef70bdf990 [RTL][NTDLL] Implement RtlQueryEnvironmentVariable
Make RtlQueryEnvironmentVariable_U a wrapper around RtlQueryEnvironmentVariable.
2026-05-21 12:07:24 +00:00
Timo Kreuzer 07537ae6a1 [RTL] Fix formatting of env.c
- Fix indentation
- Apply SAL2  annotations
2026-05-21 12:07:24 +00:00
Timo Kreuzer 9989b9ec1d [RTL] Improve RtlCreateProcessParameters
- Use the NT6 structure of _RTL_USER_PROCESS_PARAMETERS
- Fix string alignment to match Vista+
- Use ImageName as fallback for the CommandLine
- Use NULL-string as fallback fo RuntimeData
- Copy the environment instead of just copying the pointer
- Fixes a number of ntdll_winetest:env tests
2026-05-21 12:07:24 +00:00
Timo Kreuzer e9a67ff1bd [RTL] Fix an NTSTATUS to dos error translation
Fixes remaining test failure in ntdll_winetest error
2026-05-21 12:07:24 +00:00
Timo Kreuzer 33a19d05f4 [RTL] Fix atom table signature
Fixes a wine test.
2026-05-21 12:07:24 +00:00
Timo Kreuzer 40a0840834 [RTL] Fix ROUND_DOWN macro for 64 bit 2026-05-21 12:07:24 +00:00
Timo Kreuzer 15fa25299f [RTL][NTDLL][KERNEL32] Implement (Rtl)GetProductInfo 2026-05-19 14:40:01 +00:00
Ahmed Arif 0e64048812 [NDK][RTL] Fix packing leak and ARM64 heap layouts (#9020)
Stop `PS_JOB_TOKEN_FILTER`'s pack(1) scope from leaking into `EJOB`, which misaligns kernel fields on ARM64.

Use the Win64 heap entry layout on ARM64 and assert the heap metadata offsets verified against NT ARM64 symbols.

Keep heap alignment masks pointer-sized and size `STACK_TRACE_DATABASE` `ERESOURCE` padding for all Win64 targets.

CORE-18200
2026-05-18 23:48:41 +02:00
Ahmed ARIF 99ec6cbf07 [CMLIB] Fix hive validation loop for missing bins 2026-05-14 11:37:59 +02:00
Timo Kreuzer fa433604cf [COMSUPP] Define WIN32_LEAN_AND_MEAN
This is needed to prevent compile errors, when _INC_WINDOWS is defined.
So far WIN32_LEAN_AND_MEAN is wrongly defined by some idl generated headers.
In VS with native headers similar issues exist.
2026-05-11 18:21:34 +00:00
Timo Kreuzer 101f7652df [UUID] Don't use a precompiled header
We cannot use a precompiled header, because it would include headers before including initguid.h, preventing GUIDs to be defined.
2026-05-11 18:21:34 +00:00
Timo Kreuzer e7216ce67f [RTL/x64] Improve RtlCaptureContext/RtlRestoreContext
In user mode use fxsave64/fxrstor64, which handle legacy FP, MMX and XMM and MXCSR, in kernel mode save/restore XMM registers and MXCSR manually.
2026-05-08 19:04:31 +00:00
Timo Kreuzer da64ad34ef [CRT] Stop implementing non-conforming swprintf / vswprintf
- Don't compile the non-conformng swprintf (it is identical to _swprinf)
- Rename swprintf to _swprintf
- Forward non-conforming exports to the underscored versions in CRT dlls
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
Timo Kreuzer f2c094caf3 [LIBWINE] Fix debug output synchronization
Previously the debug macros printed file/line, class and message separately, which resulted in possible intermingling with other debug messages, e.g. from rosautotest. This caused random parse errors for testman.
This is fixed by using a temp buffer for the prefix in rosfmt_default_dbg_vlog and then calling vDbgPrintExWithPrefix. Also make the __WINE_DPRINTF macro identical between GCC and MSVC.

See ROSTESTS-178
2026-05-06 08:34:12 +00:00
Timo Kreuzer 081a6366df [KSECDD][NTOS][RTL] Change license of some of my code to MIT 2026-04-23 12:39:01 +00:00
Eric Kohl 8dc9e50c09 [NETCFGX][REACTOS][UUID] Uncover one of many secrets of netcfgx.dll
The second parameter of the first function of the INetCfgComponentPrivate interface seems to be a REFIID.
Netsh calls this function with an undocumented GUID called ITcpipProperties (see https://github.com/nihilus/GUID-Finder/blob/master/GUID-Finder/Interfaces.txt).
2026-04-21 22:23:18 +02:00
Timo Kreuzer c7a4ea9d48 [CRT] Remove _mbstrlen 2026-04-21 13:13:33 +00:00
Doug Lyons 7ee14831a1 [CHKDSK][VFATLIB] Chkdsk improve code (#8857)
CORE-20546

Avoid second "lseek" if we do not have "use_read" and do not need to do read alignment.
2026-04-14 16:02:19 -05:00
Doug LyonsandHermès BÉLUSCA - MAÏTO 5a4823b5f7 [CHKDSK][VFATLIB] Fix assert when in read-only mode alternate method (#8842)
CORE-20539

Move an "assert" added by Pierre Schweitzer in [b0b7df](https://github.com/reactos/reactos/commit/b0bf7df).
Relocate his added "assert" inside an "if (FsCheckFlags & FSCHECK_IMMEDIATE_WRITE)".
This avoids some asserts when running in read-only mode.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
2026-04-14 15:51:23 -05:00
Eric Kohl b481fb5674 [PSDK][UUID] Add the INetCfgSysPrep, INetCfgComponentSysPrep and INetCfgComponentUpperEdge interfaces 2026-04-05 18:23:19 +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
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
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
Justin Miller 752f99ee3d [ANSI-SYNC-HACKS][NFSD] Small library to sync ANSI code (#8800)
The point of kernel32_vista was to provide a dll that can be used for winesyncs to still have NT6 APIs.
We're now switching to an architecture where we'll have kernelbase OR a kernel32_win7 depending on NT target compile
but this means that for an ANSI exe such as this, we need an alternative solution.
Thankfully it's pretty much only for this but just in case i made it a library.
2026-03-29 02:48:46 +00:00
Mikhail Tyukin 22ca1e736a [KERNEL32_VISTA][NTDLL_VISTA] add required functions for winhttp 2026-03-28 11:35:17 -07:00
Hermès Bélusca-Maïto 2d07d8a7cd [CONUTILS] Improve library build interface; avoid using winuser.h; fix x64 build warnings
conutils\pager.c(658):
  warning C4267: '=': conversion from 'size_t' to 'DWORD', possible loss of data
conutils\outstream.c(179),(263):
  warning C4267: '=': conversion from 'size_t' to 'DWORD', possible loss of data
conutils\outstream.c(433):
  warning C4267: '=': conversion from 'size_t' to 'INT', possible loss of data
2026-03-28 14:11:23 +01:00
Hermès Bélusca-Maïto 3ac86990e3 [SDK:DELAYIMP] Simplify code following commit 5840b212a8 (#7784)
CORE-10935

Addendum to commit 5840b212a8, as well as to
commits 91d86a9a91 (r71190) and e5904542d6 (PR #377).
2026-03-22 17:56:48 +01:00
Eric Kohl c364fe7fb1 [SDK][UUID] Add notification object interfaces
Add INetCfgComponentNotifyBinding, INetCfgComponentNotifyGlobal and INetCfgComponentSetup.
2026-03-22 15:04:48 +01:00
Timo Kreuzer ddf58eb2f8 [VFATLIB] Add packing to LFN_ENT structure
The structure is packed in the original dosfstools code, too.

Fixes GCC 13 warning:

C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c: In function 'lfn_add_slot':
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c:208:5: warning: converting a packed 'DIR_ENT' pointer (alignment 1) to a 'LFN_ENT' pointer (alignment 2) may result in an unaligned pointer value [-Waddress-of-packed-member]
  208 |     LFN_ENT *lfn = (LFN_ENT *) de;
      |     ^~~~~~~
In file included from C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/dosfsck.h:8,
                 from C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/vfatlib.h:25,
                 from C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c:24:
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/fsck.fat.h:165:9: note: defined here
  165 | typedef struct {
      |         ^~~~~~
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c:29:9: note: defined here
   29 | typedef struct {
      |         ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer deb89436bc [STDC++COMPAT] Add rand_s for GCC 13 and pre-NT6 builds
GCC 13 STL requires this.
2026-03-18 17:29:12 +02:00
Ahmed Arif ff6bd79221 [PSEH] Fix x64 ABI compliance and register clobbering in exception filters (#8700)
pseh2_64 relied on inline-asm clobbers across a C/asm funclet jump, which is not a reliable ABI boundary.
On AMD64 gcc path, this can corrupt non-volatile state during exception filtering/unwind.

This change makes the trampoline ABI-safe by explicitly preserving and restoring non-volatile registers and keeping unwind metadata/prologue consistent.

Changes:
- Save/restore rbx, rdi, rsi, r12-r15 in `__seh2_global_filter_func`.
- Adjust stack allocation/unwind annotation to match the new prologue/epilogue.
- Keep filter return in eax and jump back through `__seh2_global_filter_func_exit`.

Note: This is exception-only path: extra stack usage is acceptable for correctness.

How to test: Build and run ReactOS with gcc 13/15; you should no longer see stack exhaustion.
2026-03-17 22:42:37 +01:00
Dmitry BorisovandHermès Bélusca-Maïto aabd163d73 [CPORTLIB:PC98] Refactor serial support code (#8558)
CORE-17977

- Fix a bug when subsequent port detection attempts fail because of
  broken FIFO management. If FIFO logic is enabled the hardware will
  not decode the legacy 0x30 and 0x32 I/O ports.
  Therefore care should be taken when accessing these ports.

- Fix hang on boot when a serial device was not connected to the COM1 port.
  Unlike 16550, a call to `CpDoesPortExist()` for the 8251 will succeed
  even when if the user has not plug the serial port into PC-98 machine.
  (I do not know how to put the 8251 into loopback mode.)
  Fix this by checking for CTS prior to the LSR loop.

- Fix hang on boot when the chosen baud rate becomes too large due to
  `DEFAULT_DEBUG_BAUD_RATE` being set to 115200.

- Some NP21/W workarounds were being incorrectly applied,
  fix them and consolidate them into one check.

- Reuse exsisting code from the NS16550 driver to avoid code duplication.

- Rename HW definitions for better naming.

Co-authored-by: Hermès Bélusca-Maïto <[email protected]>
2026-03-15 22:56:14 +01:00
Hermès Bélusca-Maïto dabc74d468 [CPORTLIB] Split cport.c into the NS16550-specific routines and the rest
Preparing the way for a future library refactoring, along the way of the
one in Windows, which has been updated in Windows 10 and is now documented:
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/uart/
2026-03-15 22:48:25 +01:00
Hermès Bélusca-Maïto a204d174f0 [CPORTLIB] Prepare splitting cport.c into the NS16550-specific routines and the rest 2026-03-15 22:23:28 +01:00
Mikhail Tyukin 374207770d [FECLIENT] Import from Wine-10.0 (#8301)
* [LIBWINE] add dll_canunload library

* [FECLIENT] Import from Wine-10.0
2026-03-13 16:05:55 -07:00
Ahmed Arif 08e57f6bc2 [CRT/GCC] Fix infinite recursion in memset/memcpy/memmove at -O2 2026-03-02 20:14:06 +02:00
Mikhail Tyukinandbuddyjojo 3518663767 [COMBASE][COML2] Sync to wine-10.0
Co-Authored-By: buddyjojo <[email protected]>
2026-03-01 10:38:42 +02:00
Timo Kreuzer 1f97ad1f93 [RTL] Sync actctx.c to wine 10.0 2026-03-01 10:38:42 +02:00
Katayama Hirofumi MZ 0c4091cd04 [FREETYPE][NTGDI] Update FreeType from 2.10.0 to 2.10.4 (#8671)
Modernize modules.
JIRA issue: CORE-17390
- Update FreeType to 2.10.4.
- Delete ChangeLog.
- Delete sdk/lib/3rdparty/freetype/src/gxvalid
  (useless for us).
- Delete sdk/lib/3rdparty/freetype/src/otvalid
  (useless for us).
- Keep ReactOS hacks on FreeType.
- Adapt ntgdi/freetype.c to new FreeType.
2026-02-26 09:32:57 +09:00
Timo Kreuzer de7e707459 [CRT] Remove obsolete CRT files 2026-02-17 17:52:19 +02:00