The connection may be cached and checked for availability for request
before the server thread closes it.
(cherry picked from commit f75a8b3555)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
.NET 6's HTTP/Socket code queries this. Winsock allows getsockname
on the AcceptEx AcceptSocket, but only if SO_UPDATE_ACCEPT_CONTEXT
is set.
Signed-off-by: David Curtiss <david.curtiss@ni.com>
(cherry picked from commit 68d4643a67)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
gcc warns about this:
../wine/libs/wine/mmap.c: In function ‘wine_mmap_add_reserved_area_obsolete’:
../wine/libs/wine/mmap.c:504:9: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘(char *)addr + (sizetype)size’ must not be NULL [-Werror=address]
504 | if (!((char *)addr + size)) size--; /* avoid wrap-around */
| ^
(cherry picked from commit d17fe0a792)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
conhost.exe currently copies the user-specified face name from the
LOGFONT structure. This results in an invalid face name when the
specified font is not available.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 303f8042f9)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
The subkey handle is leaked when deleting a GPU entry succeeded. Also, there is no need
to restart the enumeration for the grandparent key hkey.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit e55515bf5b)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
__wine_dbg_output accumulates the output characters in a debug_info
structure, flushing it when it encounters '\n'. If debug_info plus the
new string exceed 1024 characters, append_output will print
> wine_dbg_output: debugstr buffer overflow
and then crash the process via abort().
wine_dbgstr_variant limits the length printed for any individual argument,
but a function with multiple parameters can still plausibly exceed 1024.
Fixed by formatting the TRACE for each argument on a separate line,
as similar places (like oleaut32/typelib.c:dump_DispParms) do.
(cherry picked from commit 0fb2d0f04e)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
GdipGetCompositingMode() fails when the object is busy, which happens
when flushing changes in GdipReleaseDC().
Fixes a test crash on Gitlab CI.
(cherry picked from commit fe7df46118)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
When height > 0, CreateFontA/W() should not return a font face exceeding the requested height.
For instance, Tahoma has 2049 units of ascent, 423 units of descent and its units per EM square is
2048. When requesting a font 20 pixels in height, ppem = units_per_EM * requested_height / (ascent + descent)
= 2048 * 20 / (2049 + 423) = 16.57 ~= 17. When getting the resulting height back from the ppem,
resulting_height = (ascent + descent) * ppem / units_per_EM = (2049.0 + 423) * 17 / 2048 = 20.52
~=21. So it ends up getting a larger font than requested and violates the spec.
Fix Nancy Drew: Legend of the Crystal Skull crash at start.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
(cherry picked from commit 58b477d158)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
mf_media_type_from_wg_format() may return NULL.
Fix Airborne Kingdom crash at start because WG_AUDIO_FORMAT_UNKNOWN is passed to
mf_media_type_from_wg_format().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
(cherry picked from commit 6f8990b431)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
NtQueryInformationProcess(ProcessImageFileNameWin32) may return an
empty string in some circumstances, which leads
QueryFullProcessImageNameW to crash if called with flags including
PROCESS_NAME_NATIVE, as that path assumed the image name had a length
of at least 2.
(cherry picked from commit a7937e83b2)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This prevents crashes when there is an invalid script
inside a tag property.
Because ParseProcedureText calls release_bytecode without
checking if compile_script failed, "code" is not set, and
this leads to a crash when release_bytecode tries to access it.
Signed-off-by: Santino Mazza <mazzasantino1206@gmail.com>
(cherry picked from commit d93712feee)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Sometimes error event serial is zero. For example, NVIDIA driver may send X_GLXCopyContext errors
with the event serial set to zero. When it's zero, previously the error handler passes the error
to the default error handler and cause application crashes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
(cherry picked from commit d328af75fe)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
glxCopyContext() may throw X errors and cause the current process to exit. For example, Mesa doesn't
support glxCopyContext() for direct rendering contexts and ends up using the code path for indirect
rendering contexts. When Xorg receives such requests, it rejects them because they're for direct
rendering contexts and reports an X error. We also can't use indirect rendering context because
it needs to be explicitly enabled in xorg.conf and has poor performance. So handle this error before
graphics drivers implement the support.
Fix Cladun X2 crash at start.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
(cherry picked from commit ed546bf190)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
va_list passed to RtlFormatMessage is modified even on error in this
case, if the buffer is not large enough, STATUS_BUFFER_OVERFLOW is
returned and FormatMessage tries again, but the va_list pointer is now
moved to a later argument, so the next call reads off the end,
crashing.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 1714963a5f)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This works around a spurious gcc warning:
../wine/dlls/ntdll/unix/system.c: In function ‘NtQuerySystemInformation’:
../wine/dlls/ntdll/unix/system.c:3176:36: error: ‘%s’ directive output between 0 and 2147483644 bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-truncation=]
3176 | snprintf( info, size, "%s%c%s%c%s%c%s", version, 0, wine_build, 0, buf.sysname, 0, buf.release );
| ^~ ~~~~~~~~~~
../wine/dlls/ntdll/unix/system.c:3176:9: note: ‘snprintf’ output between 8 and 2147483780 bytes into a destination of size 4294967295
3176 | snprintf( info, size, "%s%c%s%c%s%c%s", version, 0, wine_build, 0, buf.sysname, 0, buf.release );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(cherry picked from commit f66b49a496)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Fix the palette-building code used by IDirect3DTexture::InitFromFile
to use color components correctly. Also, fix and expand the tests to
properly check the components of a built palette.
(cherry picked from commit 293c6d24e3)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
In BMP files with 24-bit depth, color components are stored in BGR
order. Due to magic values being used several places in tests to reduce
the components, some logical errors are hard to spot.
Give names to the magic values to make logical errors more apparent.
(cherry picked from commit 77189a341f)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Clang generates SEH unwind info on ARM in both MSVC and mingw mode
since Clang 15. The unwind info gets which gets enabled automatically
by building with a new enough compiler.
For functions/trampolines that are implemented in assembly, the unwind
information needs to be provided by hand - in particular for cases
where unwinding should be diverted.
Contrary to AArch64, Clang got SEH assembler directives directly from
the start when SEH was implemented (when the __SEH__ compiler define
gets set), so there's no need for compiler version checks (like for
AArch64 in include/wine/asm.h), but the default check for __SEH__
works fine for enabling the __ARM_SEH() macro.
Use a custom unwind opcode in the private opcode space for unwinding
to a specific CONTEXT instead of up to the caller. (Contrary to
AArch64, there's no specific unwind opcode for restoring a full
CONTEXT, but the unwind opcode space does have a couple
unallocated values marked as "available", which can be used
for vendor specific needs here.)
This fixes unwinding in ARM PE builds.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2d43653a2e)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This also fixes the build with external libxml2 but bundled libxslt.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit c111332d1b)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This fixes builds with recent Clang 15 (which still is in development),
which errors out on implicit declarations.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 8f8b802e12)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
The result can arrive before we have time to abort.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53268
(cherry picked from commit 44a81794df)
Conflicts:
dlls/urlmon/tests/protocol.c
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Some applications spam this fixme.
fixme:cryptasn:CRYPT_GetBuiltinDecoder Unsupported decoder for lpszStructType 1.3.6.1.4.1.311.2.1.4
This OID is supported in wintrust.dll which crypt32 uses, so this console fixme doesn't make sense.
The fixme will only appear if no support for the requested decoder is available.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53800
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
(cherry picked from commit 42bd5ea4c4)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Fix MSXML 3.0 installer username edit control missing part of its edge. The application has a static
control overlapping an edit control. Repainting the edit control immediately will cause the edit
control to be painted under the static control.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
(cherry picked from commit a336b43a93)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Co-authored-by: Qian Hong <qhong@codeweavers.com>
Co-authored-by: Joel Holdsworth <joel@airwebreathe.org.uk>
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
(cherry picked from commit 3c4cdfa704)
Conflicts:
dlls/ntdll/tests/file.c
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
MSDN states, a NULL InfoValue parameter will return as the length.
unixODBC which we currently use, handles this scenario.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53714
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
(cherry picked from commit e8b7c1da6c)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>