Commit Graph

88454 Commits

Author SHA1 Message Date
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
bcd4c718c1 [HALX86] Use correct HalpComPortIrqMapping values in PC98
In addition, there is no COM port IRQ mapping on the Xbox,
so exclude this from the Xbox HAL build.
2026-03-19 21:53:12 +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
fe6ee1223a [NTOS:KDBG] Fix misleading indentation
Address second part of comment
3726b992ed (r50112970)
2026-03-19 21:52:12 +01:00
Hermès Bélusca-Maïto
bc7d0f1ec6 [NTOS:KD] i386/kdserial.c: Improve "Kernel Debugger:" messages; use correct default baud rate
- Use DEFAULT_DEBUG_BAUD_RATE for the debug serial port.

- Use a less dramatic "Serial port not available" (without '!')
  instead of "Serial port not found!" message, in case ReactOS
  BSODs without a debugger attached to a serial port.
  Sometimes people mistake this informational line as one of the
  reasons why ReactOS BSODed or whatnot...

- Replace "Serial port found" by "Using COM..." message.
2026-03-19 21:52:10 +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
Hermès Bélusca-Maïto
530a48ce89 [CMAKE] Add the BCD hive only on EFI-compatible platforms
This excludes NEC PC-98 and Xbox.

CORE-16216, CORE-17977
2026-03-18 20:47:53 +01:00
Hermès Bélusca-Maïto
6a56468731 [BOOTDATA] Reorganize the mkisofs ISO boot-related options, making them modular (#4425)
CORE-11954, CORE-16216, CORE-17518, CORE-17604, CORE-17977

The mkisofs options are quite long and repetitive (mostly duplicated 4 times
for the current 4 different ISO targets), and are also hard to read (i.e.
which group of options go together).

Reorganize the mkisofs ISO boot-related options in different thematic sets
and make them modular too. This also allow to conditionally add/remove ISO
boot entries for different platforms, for example:
- BIOS-based PC builds (only x86/x64) get the BIOS bootsector (excluded from IA64 and ARM32/64);
- EFI-based architectures get the EFI boot entry.

Based on a suggestion by Mark Jansen (see PR #4407).
Dedicated to Justin Miller ;)
2026-03-18 20:19:26 +01:00
Timo Kreuzer
31b1e2376a [OPENGL] Disable some GCC 13 warnings 2026-03-18 17:29:12 +02:00
Timo Kreuzer
d31b043fff [VCRUNTIME] comutil.h: Remove redundant _variant_t::operator VARIANT()
_variant_t inherits from tagVARIANT aka VARIANT and C++ will always prioritize the built-in conversion to the base class over the use of a user-defined conversion operator.

Fixes GCC 13 warning:

In file included from C:/ReactOS/reactos/sdk/include/vcruntime/comdef.h:19,
                 from C:/ReactOS/reactos/sdk/lib/comsupp/comsupp.cpp:16:
C:/ReactOS/reactos/sdk/include/vcruntime/comutil.h:423:3: error: converting '_variant_t' to a base class 'VARIANT' {aka 'tagVARIANT'} will never use a type conversion operator [-Werror=class-conversion]
  423 |   operator VARIANT() const throw();
      |   ^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
155970dca1 [RSHELL] Disable GCC 13 overloaded-virtual warning
Someone familiar with this should do a more proper fix.

C:/ReactOS/reactos/sdk/lib/atl/atlcom.h: In instantiation of 'class ATL::CComObject<CRShellClassFactory>':
C:/ReactOS/reactos/sdk/include/reactos/shellutils.h:357:45:   required from 'HRESULT ShellObjectCreatorInit(T1, const IID&, void**) [with T = CRShellClassFactory; T1 = _GUID; HRESULT = long int; IID = _GUID]'
C:/ReactOS/reactos/base/shell/rshell/misc.cpp:256:55:   required from here
C:/ReactOS/reactos/base/shell/rshell/misc.cpp:210:28: error: 'virtual HRESULT CRShellClassFactory::CreateInstance(LPUNKNOWN, const IID&, void**)' was hidden [-Werror=overloaded-virtual=]
  210 |     virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
      |                            ^~~~~~~~~~~~~~
In file included from C:/ReactOS/reactos/base/shell/rshell/misc.cpp:33:
C:/ReactOS/reactos/sdk/lib/atl/atlcom.h:171:27: note:   by 'static HRESULT ATL::CComObject<Base>::CreateInstance(ATL::CComObject<Base>**) [with Base = CRShellClassFactory; HRESULT = long int]'
  171 |     static HRESULT WINAPI CreateInstance(CComObject<Base> **pp)
      |                           ^~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
bbce31f601 [UNIATA] Disable GCC 13 misleading-indentation warning
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp: In function 'BOOLEAN UniataChipDetectChannels(PVOID, PPCI_COMMON_CONFIG, ULONG, PPORT_CONFIGURATION_INFORMATION)':
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:111:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
  111 |     for(i=deviceExtension->AHCI_PI_mask, n=0; i; n++, i=i>>1);
      |     ^~~
In file included from C:/ReactOS/reactos/drivers/storage/ide/uniata/stdafx.h:13,
                 from C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:48:
C:/ReactOS/reactos/drivers/storage/ide/uniata/atapi.h:154:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  154 | #define KdPrint2(_x_)  {;}
      |                        ^
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:112:5: note: in expansion of macro 'KdPrint2'
  112 |     KdPrint2((PRINT_PREFIX "mask -> %d chans\n", n));
      |     ^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
782ffca2ce [ROSTESTS] Disable GCC 13 misleading-indentation warning
This warning is caused by todo_wine, etc.
2026-03-18 17:29:12 +02:00
Timo Kreuzer
54c20b83ff [OLEAUT32] Disable GCC 13 misleading-indentation warning
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c: In function '_VarI1FromUI1':
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:159:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  159 |   if (in > (dest)tst) return DISP_E_OVERFLOW; *out = in; return S_OK; }
      |   ^~
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:166:1: note: in expansion of macro 'POSTST'
  166 | POSTST(signed char, BYTE, VarI1FromUI1, I1_MAX)
      | ^~~~~~
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:159:47: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  159 |   if (in > (dest)tst) return DISP_E_OVERFLOW; *out = in; return S_OK; }
      |                                               ^
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:166:1: note: in expansion of macro 'POSTST'
  166 | POSTST(signed char, BYTE, VarI1FromUI1, I1_MAX)
      | ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
aa1cac9d22 [ACPI] Apply consistent indentation (tabs)
Fixes GCC 13 warning about misleading indentation.

C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c: In function 'acpi_evaluate_reference':
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:367:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  367 |     if (buffer.Pointer)
      |     ^~
In file included from C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acpi.h:70,
                 from C:/ReactOS/reactos/drivers/bus/acpi/precomp.h:6,
                 from C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:26:
C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acoutput.h:496:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  496 | #define return_ACPI_STATUS(s)           return(s)
      |                                         ^~~~~~
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:370:9: note: in expansion of macro 'return_ACPI_STATUS'
  370 |         return_ACPI_STATUS(status);
      |         ^~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
9ef9bf5c25 [WININET] Fix missing braces (from wine-10.0)
Fixes GCC 13 warning about misleading indentation.

C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c: In function 'func_cred':
C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c:809:5: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
  809 |     else
      |     ^~~~
In file included from C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c:28:
C:/ReactOS/reactos/sdk/include/wine/test.h:168:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
  168 | #define trace_(file, line)    (winetest_set_location(file, line), 0) ? (void)0 : winetest_trace
      |                               ^
C:/ReactOS/reactos/sdk/include/wine/test.h:176:18: note: in expansion of macro 'trace_'
  176 | #define trace    trace_(__FILE__, __LINE__)
      |                  ^~~~~~
C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c:812:9: note: in expansion of macro 'trace'
  812 |         trace("domain password:\n");
      |         ^~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
dbaf14d4a1 [SHELL32] Reduce diff to wine (indentation)
Fixes GCC 13 warnings about misleading indentation.

C:/ReactOS/reactos/dll/win32/shell32/wine/classes.c: In function 'HCR_GetIconA':
C:/ReactOS/reactos/dll/win32/shell32/wine/classes.c:357:5: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
  357 |     else
      |     ^~~~
C:/ReactOS/reactos/dll/win32/shell32/wine/classes.c:360:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
  360 |         return ret;
      |         ^~~~~~

C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c: In function 'SHCreateStdEnumFmtEtc':
C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c:2455:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
 2455 |     if (FAILED(hRes))
      |     ^~
In file included from C:/ReactOS/reactos/sdk/include/psdk/objbase.h:252,
                 from C:/ReactOS/reactos/sdk/include/psdk/ole2.h:25,
                 from C:/ReactOS/reactos/sdk/include/psdk/shlobj.h:22,
                 from C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c:32:
C:/ReactOS/build-gcc-x86/sdk/include/psdk/objidl.h:9734:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
 9734 | #define IEnumFORMATETC_AddRef(This) (This)->lpVtbl->AddRef(This)
      |                                     ^
C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c:2458:9: note: in expansion of macro 'IEnumFORMATETC_AddRef'
 2458 |         IEnumFORMATETC_AddRef(pef);
      |         ^~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
8187f60f00 [LIBTIFF] Disable GCC 13 array-parameter warning
Triggered by GCC 13:

C:/ReactOS/reactos/dll/3rdparty/libtiff/tif_luv.c:822:18: error: argument 1 of type 'float[3]' with mismatched bound [-Werror=array-parameter=]
  822 | XYZtoRGB24(float xyz[3], uint8 rgb[3])
      |            ~~~~~~^~~~~~
In file included from C:/ReactOS/reactos/sdk/include/reactos/libs/libtiff/tiffiop.h:64,
                 from C:/ReactOS/reactos/dll/3rdparty/libtiff/precomp.h:3,
                 from C:/ReactOS/reactos/dll/3rdparty/libtiff/tif_luv.c:25:
C:/ReactOS/reactos/sdk/include/reactos/libs/libtiff/tiffio.h:507:24: note: previously declared as 'float *'
  507 | extern void XYZtoRGB24(float*, uint8*);
      |                        ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
193b1eb1c4 [MSDMO] Disable GCC 13 array-parameter warning
Triggered by GCC 13:

C:/ReactOS/reactos/dll/directx/wine/msdmo/dmoreg.c:342:52: error: argument 2 of type 'WCHAR[]' {aka 'short unsigned int[]'} with mismatched bound [-Werror=array-parameter=]
  342 | HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR name[])
      |                                              ~~~~~~^~~~~~
In file included from C:/ReactOS/reactos/sdk/include/dxsdk/dmo.h:31,
                 from C:/ReactOS/reactos/dll/directx/wine/msdmo/dmoreg.c:31:
C:/ReactOS/reactos/sdk/include/dxsdk/dmoreg.h:47:36: note: previously declared as 'WCHAR[80]' {aka 'short unsigned int[80]'}
   47 | HRESULT WINAPI DMOGetName(REFCLSID,WCHAR[80]);
      |                                    ^~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
1d292695fc [GLU32] Fix a parameter in gluTessVertex() declaration
Fixes GCC 13 warning:

C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/tess.c:415:46: error: argument 2 of type 'GLdouble[3]' {aka 'double[3]'} with mismatched bound [-Werror=array-parameter=]
  415 | gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
      |                                     ~~~~~~~~~^~~~~~~~~
In file included from C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/mesh.h:38,
                 from C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/tess.h:40,
                 from C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/tess.c:40:
C:/ReactOS/reactos/dll/opengl/glu32/include/GL/glu.h:345:69: note: previously declared as 'GLdouble *' {aka 'double *'}
  345 | GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
      |                                                           ~~~~~~~~~~^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
74a0a56efc [RSAENH] Fix GCC 13 array-parameter warning
C:/ReactOS/reactos/dll/win32/rsaenh/sha2.c:507:29: error: argument 1 of type 'sha2_byte[]' {aka 'unsigned char[]'} with mismatched bound [-Werror=array-parameter=]
  507 | void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
      |                   ~~~~~~~~~~^~~~~~~~
In file included from C:/ReactOS/reactos/dll/win32/rsaenh/sha2.c:37:
C:/ReactOS/reactos/dll/win32/rsaenh/sha2.h:73:19: note: previously declared as 'sha2_byte[32]' {aka 'unsigned char[32]'}
   73 | void SHA256_Final(sha2_byte[SHA256_DIGEST_LENGTH], SHA256_CTX*);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/dll/win32/rsaenh/sha2.c:570:44: error: argument 2 of type 'char[]' with mismatched bound [-Werror=array-parameter=]
  570 | char *SHA256_End(SHA256_CTX* context, char buffer[]) {
      |                                       ~~~~~^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
db5bf7c828 [D3DX9_WINETEST] Disable GCC 13 sizeof-array-div warning
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c: In function 'test_update_semantics':
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c:4837:34: error: expression does not compute the number of elements in this array; element type is 'D3DVERTEXELEMENT9' {aka 'struct _D3DVERTEXELEMENT9'}, not 'int' [-Werror=sizeof-array-div]
 4837 |     for (i = sizeof(declaration0)/sizeof(*decl_mem); i < sizeof(declaration)/sizeof(*decl_mem); i++)
      |                                  ^
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c:4837:42: note: add parentheses around '*decl_mem' to silence this warning
 4837 |     for (i = sizeof(declaration0)/sizeof(*decl_mem); i < sizeof(declaration)/sizeof(*decl_mem); i++)
      |                                         ~^~~~~~~~~~
      |                                         (          )
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c:4667:23: note: array 'declaration0' declared here
 4667 |     D3DVERTEXELEMENT9 declaration0[] =
      |                       ^~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
a217ad83a4 [DDRAW] Disable GCC 13 stringop-overflow warning
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c: In function 'd3d_device3_ComputeSphereVisibility':
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c:4637:5: error: 'compute_sphere_visibility' accessing 192 bytes in a region of size 96 [-Werror=stringop-overflow=]
 4637 |     compute_sphere_visibility(plane, enabled_planes, TRUE, centers, radii, sphere_count, return_values);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c:4637:5: note: referencing argument 1 of type 'struct wined3d_vec4[12]'
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c:4589:13: note: in a call to function 'compute_sphere_visibility'
 4589 | static void compute_sphere_visibility(struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
3723e5a4dd [EXT2] Disable GCC 13 address-of-packed-member warning
C:/ReactOS/reactos/drivers/filesystems/ext2/src/ext4/ext4_extents.c: In function 'ext4_ext_insert_index':
C:/ReactOS/reactos/drivers/filesystems/ext2/src/ext4/ext4_extents.c:788:22: warning: taking address of packed member of 'struct ext4_extent_header' may result in an unaligned pointer value [-Waddress-of-packed-member]
  788 |         le16_add_cpu(&curp->p_hdr->eh_entries, 1);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02: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
daeb0bb257 [FTP] Fix invalid call to free()
While our glob is a dummy anyway and always returns NULL, the basic idea is that glob returns a NULL terminated array of pointers. The original code only calls blkfree to free any allocation in the array after the first one and doesn't free the array itself. Our code tried to be "smart" and free the array as well, but the array pointer was already changed by a "globbed++", resulting in trying to free an invalid address. Also the free was only called, when glob returned more than one result. This is now fixed by removing the "++", doing the blkfree on "&globbed[1]" and calling free on the originally returned array in all cases.

Fixes GCC 13 warning:

C:/ReactOS/reactos/base/applications/network/ftp/cmds.c: In function 'globulize':
C:/ReactOS/reactos/base/applications/network/ftp/cmds.c:1684:25: error: 'free' called on pointer 'globbed' with nonzero offset 4 [-Werror=free-nonheap-object]
 1684 |                         free((char *)globbed);
      |                         ^~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/applications/network/ftp/cmds.c:1669:19: note: returned from 'glob'
 1669 |         globbed = glob(*cpp);
      |                   ^~~~~~~~~~

In our port glob is a dummy that always returns NULL, and the original code does not have a free here, either.
2026-03-18 17:29:12 +02:00
Timo Kreuzer
40378122c4 [SHLWAPI] Disable GCC 13 overloaded-virtual warning
This some C++ virtual inheritance nonsense. Someone familiar with this stuff should do a more proper fix.
2026-03-18 17:29:12 +02:00
Timo Kreuzer
46121f4643 [SHELL32] Disable GCC 13 overloaded-virtual warning
This is some ATL weirdness. Someone familiar with this should do a more proper fix.

C:/ReactOS/reactos/sdk/lib/atl/atlcom.h: In instantiation of 'class ATL::CComObject<IDefClFImpl>':
C:/ReactOS/reactos/sdk/include/reactos/shellutils.h:401:45:   required from 'HRESULT ShellObjectCreatorInit(T1, T2, T3, const IID&, void**) [with T = IDefClFImpl; T1 = long int (__attribute__((stdcall)) *)(IUnknown*, const _GUID&, void**); T2 = long int*; T3 = const _GUID*; HRESULT = long int; IID = _GUID]'
C:/ReactOS/reactos/dll/win32/shell32/shell32.cpp:202:47:   required from here
C:/ReactOS/reactos/dll/win32/shell32/shell32.cpp:172:16: error: 'virtual HRESULT IDefClFImpl::CreateInstance(IUnknown*, const IID&, void**)' was hidden [-Werror=overloaded-virtual=]
  172 | HRESULT WINAPI IDefClFImpl::CreateInstance(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppvObject)
      |                ^~~~~~~~~~~
In file included from C:/ReactOS/reactos/dll/win32/shell32/precomp.h:32,
                 from C:/ReactOS/reactos/dll/win32/shell32/shell32.cpp:22:
C:/ReactOS/reactos/sdk/lib/atl/atlcom.h:171:27: note:   by 'static HRESULT ATL::CComObject<Base>::CreateInstance(ATL::CComObject<Base>**) [with Base = IDefClFImpl; HRESULT = long int]'
  171 |     static HRESULT WINAPI CreateInstance(CComObject<Base> **pp)
      |                           ^~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
96a365e27d [ROSAUTOTEST] Fix invalid use of delete operator
Fixes GCC 13 warning:

C:/ReactOS/reactos/modules/rostests/rosautotest/tools.cpp: In function 'std::wstring AsciiToUnicode(const char*)':
C:/ReactOS/reactos/modules/rostests/rosautotest/tools.cpp:231:12: error: 'void operator delete(void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
  231 |     delete UnicodeString;
      |            ^~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
b5e5debea5 [MMSYS] Don't compare array against NULL
Fixes GCC 13 warning:

C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c: In function 'ShowSoundScheme':
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c:995:17: error: the comparison will always evaluate as 'true' for the address of 'szValue' will never be NULL [-Werror=address]
  995 |             if (pLabelContext->szValue && wcslen(pLabelContext->szValue) > 0)
      |                 ^~~~~~~~~~~~~
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c:44:11: note: 'szValue' declared here
   44 |     WCHAR szValue[MAX_PATH];
      |           ^~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
1c64719677 [CMD] Fix GCC 13 misleading-indentation warning
C:/ReactOS/reactos/base/shell/cmd/del.c: In function 'ProcessDirectory':
C:/ReactOS/reactos/base/shell/cmd/del.c:333:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  333 |                 if (!(f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
      |                 ^~
In file included from C:/ReactOS/reactos/base/shell/cmd/precomp.h:14,
                 from C:/ReactOS/reactos/base/shell/cmd/del.c:48:
C:/ReactOS/reactos/sdk/include/crt/tchar.h:246:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  246 | #define _tcscpy wcscpy
      |                 ^~~~~~
C:/ReactOS/reactos/base/shell/cmd/del.c:338:21: note: in expansion of macro '_tcscpy'
  338 |                     _tcscpy(pFilePart, f.cFileName);
      |                     ^~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
3413675193 [CMD] Clear global pointer to local variable after use
GCC 13 doesn't like if you keep a dangling pointer around.

C:/ReactOS/reactos/base/shell/cmd/for.c: In function 'ForF':
C:/ReactOS/reactos/base/shell/cmd/for.c:307:20: error: storing the address of local variable 'Variables' in '*fc.values' [-Werror=dangling-pointer=]
  307 |         fc->values = Variables;
      |         ~~~~~~~~~~~^~~~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/for.c:141:12: note: 'Variables' declared here
  141 |     LPTSTR Variables[32];
      |            ^~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/for.c:57:14: note: 'fc' declared here
   57 | PFOR_CONTEXT fc = NULL;
      |              ^~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
f2b85d2a79 [CMD] Fix GCC 13 use-after-free warning
Make the code simpler, so GCC doesn't get confused.

C:/ReactOS/reactos/base/shell/cmd/misc.c: In function 'add_entry':
C:/ReactOS/reactos/base/shell/cmd/misc.c:216:14: error: pointer 'oldarg' may be used after 'realloc' [-Werror=use-after-free]
  216 |         *arg = oldarg;
      |         ~~~~~^~~~~~~~
In file included from C:/ReactOS/reactos/base/shell/cmd/cmd.h:29,
                 from C:/ReactOS/reactos/base/shell/cmd/precomp.h:34,
                 from C:/ReactOS/reactos/base/shell/cmd/misc.c:35:
C:/ReactOS/reactos/base/shell/cmd/cmddbg.h:30:31: note: call to 'realloc' here
   30 | #define cmd_realloc(ptr,size) realloc(ptr, size)
      |                               ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/misc.c:212:12: note: in expansion of macro 'cmd_realloc'
  212 |     *arg = cmd_realloc (oldarg, (*ac + 2) * sizeof (LPTSTR));
      |            ^~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
504ec9a619 [NSLOOKUP] Fix GCC 13 stringop-truncation warning
Don't strncpy 0 bytes. Also add an assert that source and dest are not the same.

C:/ReactOS/reactos/base/applications/network/nslookup/utility.c: In function 'ReverseIP':
C:/ReactOS/reactos/base/applications/network/nslookup/utility.c:264:5: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation]
  264 |     strncpy( &pReturn[k], &pIP[i + 1], (j - i) );
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
af417da2f7 [MSPAINT] Don't use ZeroMemory on a non-POD object
Instead give IMAGE_PART a complete default contructor. Fixes GCC 13 warning.

In file included from C:/ReactOS/reactos/sdk/include/psdk/minwindef.h:171,
                 from C:/ReactOS/reactos/sdk/include/psdk/windef.h:17,
                 from C:/ReactOS/reactos/base/applications/mspaint/precomp.h:17,
                 from C:/ReactOS/reactos/base/applications/mspaint/history.cpp:9:
C:/ReactOS/reactos/base/applications/mspaint/history.cpp: In constructor 'ImageModel::ImageModel()':
C:/ReactOS/build-gcc-x86/sdk/include/psdk/winnt.h:8732:47: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct IMAGE_PART'; use assignment or value-initialization instead [-Werror=class-memaccess]
 8732 | #define RtlFillMemory(Dest,Length,Fill) memset((Dest),(Fill),(Length))
      |                                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/build-gcc-x86/sdk/include/psdk/winnt.h:8733:36: note: in expansion of macro 'RtlFillMemory'
 8733 | #define RtlZeroMemory(Dest,Length) RtlFillMemory((Dest),(Length),0)
      |                                    ^~~~~~~~~~~~~
C:/ReactOS/reactos/sdk/include/psdk/minwinbase.h:31:20: note: in expansion of macro 'RtlZeroMemory'
   31 | #define ZeroMemory RtlZeroMemory
      |                    ^~~~~~~~~~~~~
C:/ReactOS/reactos/base/applications/mspaint/history.cpp:41:5: note: in expansion of macro 'ZeroMemory'
   41 |     ZeroMemory(m_historyItems, sizeof(m_historyItems));
      |     ^~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
2d5371e078 [NTOSKRNL] Fix GCC 13 stringop-overflow warnings regarding KiNtVdmState
GCC 13 thinks that a global 'const PULONG' that is initialized to a non-NULL value points to an object that is "likely at address zero".
- Turn the macros that cause the issue into inline functions and wrap them with a GCC diagnostic pragma to silence the warning
- Use KiNtVdmState in vdm/vdmexec.c
- Remove the (duplicated) VdmState macro

In function '_InterlockedAnd',
    inlined from 'KiVdmOpcodePOPF' at C:/ReactOS/reactos/ntoskrnl/ke/i386/v86vdm.c:164:5:
C:/ReactOS/reactos/sdk/include/vcruntime/mingw32/intrin_x86.h:245:16: error: '__sync_fetch_and_and_4' writing 4 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  245 |         return __sync_fetch_and_and(value, mask);
      |                ^~~~~~~~~~~~~~~~~~~~
In function 'KiVdmOpcodePOPF':
cc1.exe: note: destination object is likely at address zero
2026-03-18 17:29:12 +02:00
Timo Kreuzer
0e999beea1 [UDFS] Fix GCC 13 warnings about uninitialized variables
Also apply _SEH2_VOLATILE where needed (all variables that are set in the __try block and referenced in the __except or __finally block).
It's hard to tell whether these are false positives, because the code is quite a mess.

C:/ReactOS/reactos/drivers/filesystems/udfs/udfinit.cpp: In function 'NTSTATUS UDFDismountDevice(PUNICODE_STRING)':
C:/ReactOS/reactos/drivers/filesystems/udfs/udfinit.cpp:643:36: error: 'Buffer' is used uninitialized [-Werror=uninitialized]
  643 |     PFILE_FS_ATTRIBUTE_INFORMATION Buffer;
      |                                    ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
63c4a85d76 [NTDLL_APITEST] Suppress GCC 13 infinite-recursion warning
Suppress warning about infinite recursion, because that is the whole point of this test.

C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c: In function 'infinite_recursive':
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c:23:1: error: infinite recursion detected [-Werror=infinite-recursion]
   23 | infinite_recursive(void)
      | ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c:58:5: note: recursive call
   58 |     infinite_recursive();
      |     ^~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
e8df04f413 [CRT_APITEST] Don't compare arrays against NULL.
Fixes GCC 13 warning:

C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c: In function 'Test___badioinfo':
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c:75:20: error: the comparison will always evaluate as 'true' for the address of '__badioinfo' will never be NULL [-Werror=address]
   75 |     ok(__badioinfo != NULL, "__badioinfo is NULL\n");
      |                    ^~
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c:74:28: note: '__badioinfo' declared here
   74 |     _CRTIMP extern ioinfo* __badioinfo[];
      |                            ^~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
806c3fb3d8 [IPHLPAPI_APITEST] Don't compare arrays against NULL.
Fixes GCC 13 warning:

C:/ReactOS/reactos/modules/rostests/apitests/iphlpapi/GetNetworkParams.c: In function 'test_GetNetworkParams':
C:/ReactOS/reactos/modules/rostests/apitests/iphlpapi/GetNetworkParams.c:171:28: error: the comparison will always evaluate as 'true' for the address of 'HostName' will never be NULL [-Werror=address]
  171 |     ok(FixedInfo->HostName != NULL, "FixedInfo->HostName is NULL\n");
      |                            ^~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
5d6987462d [DHCPCSVC] Fix GCC 13 stringop-overflow warning
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c: In function 'AdapterDiscoveryThread':
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c:326:28: error: 'AdapterFindByHardwareAddress' accessing 16 bytes in a region of size 8 [-Werror=stringop-overflow=]
  326 |             if ((Adapter = AdapterFindByHardwareAddress(Table->table[i].bPhysAddr, Table->table[i].dwPhysAddrLen)))
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c:326:28: note: referencing argument 1 of type 'u_int8_t[16]' {aka 'unsigned char[16]'}
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c:544:15: note: in a call to function 'AdapterFindByHardwareAddress'
  544 | PDHCP_ADAPTER AdapterFindByHardwareAddress( u_int8_t haddr[16], u_int8_t hlen ) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
0b80033e5a [CMAKE] gcc.cmake: Disable GCC 13 nonnull-compare warnings 2026-03-18 17:29:12 +02:00
Timo Kreuzer
cd55e25141 [CMAKE] Disable some GCC 13 builtins
These have conflicting prototypes that don't match the Windows ones.

Fixes GCC 13 warnings:

In file included from C:/ReactOS/reactos/modules/rostests/winetests/ucrtbase/thread.c:21:
C:/ReactOS/reactos/sdk/include/ucrt/process.h:281:35: error: conflicting types for built-in function 'execv'; expected 'int(const char *, char * const*)' [-Werror=builtin-declaration-mismatch]
  281 |         _DCRTIMP intptr_t __cdecl execv(
      |                                   ^~~~~
C:/ReactOS/reactos/sdk/include/ucrt/process.h:287:35: error: conflicting types for built-in function 'execve'; expected 'int(const char *, char * const*, char * const*)' [-Werror=builtin-declaration-mismatch]
  287 |         _DCRTIMP intptr_t __cdecl execve(
      |                                   ^~~~~~
C:/ReactOS/reactos/sdk/include/ucrt/process.h:294:35: error: conflicting types for built-in function 'execvp'; expected 'int(const char *, char * const*)' [-Werror=builtin-declaration-mismatch]
  294 |         _DCRTIMP intptr_t __cdecl execvp(
      |                                   ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
cf6dbef20a [CMAKE] gcc.cmake: Move all warning options into the same place 2026-03-18 17:29:12 +02:00
Timo Kreuzer
1453bd8946 [CMAKE] Remove Clang specific option from GCC command line
-Wno-unknown-warning-option is Clang specific and causes extra warnings on later GCC versions, when at least one warning is shown.
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
Václav Zouzalík
0f021bf73a [PING] Update Czech (cs-CZ) translation (#8729) 2026-03-17 17:32:12 +01:00
Daniel Victor
b0bd092c0d [FREELDR] Make ASSERT bugcheck on failure (#8730)
Show a bugcheck with message showing where and why the ASSERT failed.
2026-03-17 16:24:14 +01:00
Stefan Schramm
b3ff1ff98f [RAPPS] Fix loading of default settings (#8715)
Fixes a bug that causes the duplication of items in the general settings list when clicking the "Default" button.
2026-03-17 10:13:49 -05:00