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[] =
| ^~~~~~~~~~~~
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,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
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);
| ^~~~~~~~~~~~~~~~~~~~~~~~
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 {
| ^~~~~~
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.
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)
| ^~~~~~~~~~~~~~
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;
| ^~~~~~~~~~~~~
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];
| ^~~~~~~
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);
| ^~~~~~~
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;
| ^~
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));
| ^~~~~~~~~~~
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) );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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));
| ^~~~~~~~~~
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
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;
| ^~~~~~
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();
| ^~~~~~~~~~~~~~~~~~~~
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[];
| ^~~~~~~~~~~
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");
| ^~
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 ) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
EMS support isn't platform-specific, so we can compile it everywhere
(as this is already done for the kernel and the SAC driver).
The only platform-specific code currently existing is the retrieval of
the system GUID, which is done on BIOS-based PC by reading the SMBIOS
table in the low-MB ROM region, but should be done differently on other
platforms. Add a compile-time warning for this.
A 32-bit ASM file can turn into an empty binary file in certain cases (compiled with MSVC).
MASM/ML produces a ".text$mn" section instead of the ".text", which makes obj2bin generate an empty binary file.
The problem didn't occur with our 16-bit artifacts (16-bit stubs, bootsectors...), because their object files all have similar sections pattern: the ".text" section and empty ".text$mn" section, which didn't matter since it is empty.
On the contrary, the .text$mn section(s) aren't empty for 32-bit stubs.
One visible case is the setup LiveCD error dialog, where the message box button can appear with a wrong bold/garbled look instead of the normal default-pushbutton appearance.
## Root cause
`win32ss/user/user32/controls/button.c` stores button state with `GetWindowLongPtrW` / `SetWindowLongPtrW`, but the control extra-byte layout was still defined as if the first slot were only `sizeof(LONG)`
On 64-bit builds, that causes the stored state to overlap the cached font, image, and UI-state fields.
- [SYSSETUP] Fix DST setting checkbox
Fix DST setting checkbox. The checkbox should be disabled and unchecked on timezones DST not applied, the checkbox should be enabled and checked on timezones DST applied. JIRA issue: CORE-20406
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 <hermes.belusca-maito@reactos.org>
- Read the interface metric from the registry.
- Assign an automatic metric to an interface if a registry value is not available.
- Determine the automatic metric from the link speed. The metric for the loopback interface is always 1.
- Identify 127.x.x.x addresses as on-link addresses.
- Modify the neighbor cache to map all 127.x.x.x addresses to the loopback address (127.0.0.1).
- Create a single entry for all 127.x.x.x addresses instead of one entry per address. This entry belongs to the loopback address.
CORE-7484
RtlConvertUlongToLargeInteger and RtlConvertLongToLargeInteger are
obsolete NT routines that assign a 32-bit integer to LARGE_INTEGER.QuadPart.
Replace all driver/DLL usages with inline .QuadPart assignments or
standard C/C++ casts. This removes unnecessary function calls.
CORE-19438
- [USER32_WINETEST] Sync to wine-10.0.
- [USER32_WINETEST] Define out some function definitions we can't build yet.
- [USER32_WINETEST] Skip parts of test that crash on ReactOS or Windows
- [USER32_WINETEST] Pass behaviors from WS03-Win10 1607
- psdk/mmsystem.h: Add a #ifndef guard around SC_SCREENSAVE, MS public headers have the same guard
- psdk/ole2.h: Add guards around CreateDataAdviseHolder that are similar to the guards used in MS public headers
- psdk/winuser.h: Add missing defines, use DWORD and LONG casts to fix test failures on x64. These same casts exist in MS public headers
- wine/test.h: Add defines for winetest_platform_is_wine, flaky, and flaky_wine. The flaky definitions depend on flaky_if, which is a stub that does nothing.