When an instance of IEnumString in the ETQW World Editor is used to provide shell autocompletion strings, a crash can occur because its implementation of IEnumString::Next never initializes the output number of strings returned on success, which results in the uninitialized count being used to expand the enumerated strings array without bound.
To determine if a string was successfully retrieved from IEnumString::Next, the enumeration of autocompletion strings now retrieves only one string at a time and checks the returned HRESULT for appropriate success. This avoids reliance on the output count for determining success.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51630
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8239
I tripped over this function while trying to run a game, so I thought I would have a go at it :-)
The implementation is very similar to what is done in `Local32Info16` already.
Regarding the place to put the function: I am not sure about the exact relationship between `kernel32` and `kernelbase`, but as most of the heap related functions are implemented in `kernelbase` I opted to add it to the latter. The tests reside in the `kernel32` directory though.
The tests are currently pretty basic as I was a bit hesitant to compare against hard coded sizes for reserved / committed memory (that could break if someone made changes to the heap implementation).
Also, I am not entirely sure about the semantics of the `cbMaxReserve` field. I opted to always set it to the same value as `cbReserved`, which seems *good enough™*.
Let me know if this needs improvement!
--
v3: kernelbase: Implement HeapSummary
https://gitlab.winehq.org/wine/wine/-/merge_requests/8237
I tripped over this function while trying to run a game, so I thought I would have a go at it :-)
The implementation is very similar to what is done in `Local32Info16` already.
Regarding the place to put the function: I am not sure about the exact relationship between `kernel32` and `kernelbase`, but as most of the heap related functions are implemented in `kernelbase` I opted to add it to the latter. The tests reside in the `kernel32` directory though.
The tests are currently pretty basic as I was a bit hesitant to compare against hard coded sizes for reserved / committed memory (that could break if someone made changes to the heap implementation).
Also, I am not entirely sure about the semantics of the `cbMaxReserve` field. I opted to always set it to the same value as `cbReserved`, which seems *good enough™*.
Let me know if this needs improvement!
--
v2: kernelbase: Implement HeapSummary
https://gitlab.winehq.org/wine/wine/-/merge_requests/8237
I tripped over this function while trying to run a game, so I thought I would have a go at it :-)
The implementation is very similar to what is done in `Local32Info16` already.
Regarding the place to put the function: I am not sure about the exact relationship between `kernel32` and `kernelbase`, but as most of the heap related functions are implemented in `kernelbase` I opted to add it to the latter. The tests reside in the `kernel32` directory though.
The tests are currently pretty basic as I was a bit hesitant to compare against hard coded sizes for reserved / committed memory (that could break if someone made changes to the heap implementation).
Also, I am not entirely sure about the semantics of the `cbMaxReserve` field. I opted to always set it to the same value as `cbReserved`, which seems *good enough™*.
Let me know if this needs improvement!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8237
--
v2: ole32/tests: Check calling a proxy after re-creating the STA.
ole32/tests: Add more tests with RPC from the wrong thread.
ole32/tests: Add an test with implicit MTA creation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8235
OSmesa is deprecated and has been removed from latest mesa releases, this replaces it with pbuffer rendering and flushing of the surface onto the bitmap at some specific sync points. The tests show that this is roughly how Windows seem to behave anyway, instead of rendering directly to the memory as OSmesa does.
--
v4: win32u: Remove now unnecessary context and pbuffer funcs.
win32u: Drop now unnecessary OSMesa dependency.
win32u: Use a pbuffer to implement GL on memory DCs.
opengl32/tests: Relax memory DC pixel format selection.
opengl32: Expose every pixel format on memory DCs.
winex11: Check XVisualInfo vs GLXFBConfig depth to avoid BadMatch.
winex11: Flag offscreen formats as bitmap compatible if possible.
winemac: Use opengl_funcs for glFlush.
winex11: Use opengl_funcs for glFlush / glFinish.
opengl32: Move glFlush / glFinish hooking from win32u.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8210
We use 4*3 as the stride for GdipCreateBitmapFromScan0 in all test cases in test_CloneBitmapArea,
but bmp_3x3_data_24bpp_rgb only has 9 bytes per row. GdipCreateBitmapFromScan0 also expects the
stride to be a multiple of 4, so pad bmp_3x3_data_24bpp_rgb to be 12 bytes per row.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8218
On Fri Jun 6 18:17:35 2025 +0000, eric pouech wrote:
> @jacek just testing this (yeah a bit late sorry), it looks like the .pdb
> file only contains the public symbols.
> using: clang version 20.1.5
> do we need a later clang version?
I tested mostly with LLVM git, but version 19 seems to work too, unless I'm checking it wrong. For example, I get:
```
$ llvm-pdbutil dump --symbols programs/notepad/x86_64-windows/notepad.pdb |grep NOTEPAD_WndProc
7468 | S_LPROC32 [size = 56] `NOTEPAD_WndProc`
```
Do you not see such symbols in your build or did you mean something else?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8193#note_105685
--
v3: widl: Add rows for the requires keyword.
widl: Add rows for the exclusiveto attribute.
widl: Add rows for the uuid attribute.
widl: Add rows for the interface type.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8222
According to a comment in emf_create, description is expected to be "App name\0Title\0\0". But in
the test cases we only ever passed "winetest\0", so emf_create reads out-of-bound trying to find the
title.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8219
IWinInetHttpInfo_QueryInfo returns a multibyte string, not a wide string. We
were also wrongly expecting it to have a NUL terminator.
* * *
this one doesn't feel good. IWinInetHttpInfo_QueryInfo calls HttpInfo_QueryInfo (urlmon), which calls HttpQueryInfoA (wininet), so it returns char*. but inside, HttpQueryInfoA is calling HttpQueryInfoW and does charset conversion. so we are converting the string to multibyte and back.
maybe there's an API that returns wchar* i don't know about.
--
v2: mshtml: Fix misuse of IWinInetHttpInfo_QueryInfo.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8228
IWinInetHttpInfo_QueryInfo returns a multibyte string, not a wide string. We
were also wrongly expecting it to have a NUL terminator.
* * *
this one doesn't feel good. IWinInetHttpInfo_QueryInfo calls HttpInfo_QueryInfo (urlmon), which calls HttpQueryInfoA (wininet), so it returns char*. but inside, HttpQueryInfoA is calling HttpQueryInfoW and does charset conversion. so we are converting the string to multibyte and back.
maybe there's an API that returns wchar* i don't know about.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8228
This MR does:
- improve startup time when loading a large PDB file
(a chromium based PDB file (larger than 4G) now loads in 3,5s)
(at the begining of this rewrite, loading the very same PDB file
ended with a reboot triggered by the Linux OOM after 30 minutes
of heavy swap)
- finally untie the new PDB backend for the old one (they are now
considered as two independant debug formats, so that we can
eventually drop the old one at some point)
--
v2: dbghelp: Let new PDB reader exist independantly of the old one.
dbghelp: Rename declarations for old PBD backend.
dbghelp: Simplify signature of PDB unwinders.
dbghelp: Get fpo stream information directly in new PDB reader.
dbghelp: Speed up global symbols at startup.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8225
getItemAndInstanceFromTable only checks if the table is NULL, but didn't check
if it actually contains any entries. It just assumes it does and will return
index 1 in some cases, resulting in out-of-bound access of the table down the
line.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8230
If the "Properties" button is clicked in the printdlg it opens the print properties dlg. The problem is the values set in the properties dlg don't get passed through correctly to the final printing stage. This prevents properties like duplex and page size from working.
--
v4: comdlg32: Don't use a shadow devmode structure in PrintDlgA.
comdlg32/tests: Add tests for changing devmode properties in the hook procedure for PrintDlgA.
comdlg32: Don't use a shadow devmode structure in PrintDlgW.
comdlg32/tests: Add tests for changing devmode properties in the hook procedure for PrintDlgW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8220
These patches replace the existing libtxc_dxtn texture compression/decompression source files with new libraries that can handle more formats. This is will be helpful when we begin to share code with d3dx10/d3dx11, as we will be able to use bcdec to decode all supported compressed formats, and stb_dxt to compress BC1-BC5.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8226
please amend the tests in the `---------- Testing copy part` (after line 3387 in test_builtins.cmd), the tests you've amended are meant to test the return codes, not really the final behavior)
and likely all these tests up to the ascii/binary part should be amended to check whether the names are printed or not
if needed, you can work around builtin find.exe missing the /c switch by using
```
:count_lines
@set "lines=0"
@for /F %%a in (%1) do set /A lines+=1
@exit /b %lines%
```
using `call :count_lines <file>` and you'll get the number of lines in %errorlevel% variable (but IMO in most of the cases testing for a file name printed should serve the same purpose)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8200#note_105647
If the "Properties" button is clicked in the printdlg it opens the print properties dlg. The problem is the values set in the properties dlg don't get passed through correctly to the final printing stage. This prevents properties like duplex and page size from working.
--
v3: comdlg32: Don't use a shadow devmode structure in PrintDlgA.
comdlg32/tests: Add tests for changing devmode properties in the hook procedure for PrintDlgA.
comdlg32: Don't use a shadow devmode structure in PrintDlgW.
comdlg32/tests: Add tests for changing devmode properties in the hook procedure for PrintDlgW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8220
--
v2: widl: Add rows for the requires keyword.
widl: Add rows for the exclusiveto attribute.
widl: Add rows for the uuid attribute.
widl: Add rows for the interface type.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8222
This MR does:
- improve startup time when loading a large PDB file
(a chromium based PDB file (larger than 4G) now loads in 3,5s)
(at the begining of this rewrite, loading the very same PDB file
ended with a reboot triggered by the Linux OOM after 30 minutes
of heavy swap)
- finally untie the new PDB backend for the old one (they are now
considered as two independant debug formats, so that we can
eventually drop the old one at some point)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8225
The read loop could exit while a async read request is still in flight, which
could complete after test_read_device has returned. This results in a stack
use-after-return of `overlapped`.
* * *
Finally had something caught by the unix side AddressSanitizer, PE ASan wouldn't
have caught this.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8224
On Windows, applications can disable titlebar by extending the client rect to a bigger rect which will cover the area of the titlebar from WM_NCCALCSIZE: https://learn.microsoft.com/en-us/windows/win32/dwm/customframe#removing-th…
Our current x11 and Mac driver doesn't handle this case.
Attached is a test case for reproducing the issue.
[hide_caption.c](/uploads/46a725e32569a6a0a929a0f183cf9ed8/hide_caption.c)
--
v2: winemac.drv: Disable native titlebar while lacking enough space for SM_CYCAPTION.
winex11.drv: Disable native titlebar while lacking enough space for SM_CYCAPTION.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7024
When button_count is 0, we would allocate 0 bytes for line_widths, but later line_count would be 1
so we would still try to access line_widths[0] which is out-of-bound.
--
v2: comctl32: Make sure line_widths is big enough.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8205
I have no idea what the previous test was trying to do, but it was clearly wrong and misleading. First, it placed the fragment for no reason in file_name_buf because it then replaced it with a NUL, making you believe it's part of it but when it really was not. Then, it opened the original index.html to write XXX to it, so the fragment filename never actually existed in the first place, and was never tested.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8221
Compositors send a "done" event after every text-input commit, even if
the reported state (preedit etc) hasn't changed. Acting on such events
is at best wasteful, but can additionally lead to incorrect IME related
effects (e.g., deleting the currently selected text), so ignore them,
similarly to what Qt and GTK do.
The first commit performs some state related cleanups.
--
This solves an IME problem I have been experiencing with compositors that support text-input-v3 (e.g., kwin).
1. Run notepad
2. Write some text
3. Try to select text
Expected result: text is selected
Actual result: text is deleted
What happens is that while the user is selecting text the driver gets a series of `SetIMECompositionRect` callback which cause a series of text-input-v3 `set_cursor_rectangle`-`commit` requests. These `commit`s elicit `done` events from the compositor with no state changes, which we interpret as "clear the composition string" (and by extension the active selection), because that's what such states normally means, and forward them to windows IME.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8196
If the "Properties" button is clicked in the printdlg it opens the print properties dlg. The problem is the values set in the properties dlg don't get passed through correctly to the final printing stage. This prevents properties like duplex and page size from working.
--
v2: comdlg32: Don't use a shadow devmode structure in PrintDlgA.
comdlg32/tests: Add tests for changing devmode properties in the hook procedure for PrintDlgA.
comdlg32: Don't use a shadow devmode structure in PrintDlgW.
comdlg32/tests: Add tests for changing devmode properties in the hook procedure for PrintDlgW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8220
Wine applications crash in VNC/headless environments due to invalid all-zero monitor coordinates.
The root cause is:
- Environment Issue: VNC systems report all displays as RR_Disconnected
- Faulty Fallback: Wine incorrectly reverts to legacy XRandR 1.0 API when no "connected" displays are detected
- API Incompatibility: Modern XRandR 1.6 doesn't support Wine's XRandR 1.0 implementation, causing XRRSizes() to return empty display modes
- Uninitialized Data: This leaves critical display fields (dmPelsWidth/Height) at initialization value 0
--
v3: winex11: handle fallback display modes when XRandR fails
https://gitlab.winehq.org/wine/wine/-/merge_requests/8216
Wine applications crash in VNC/headless environments due to invalid all-zero monitor coordinates.
The root cause is:
- Environment Issue: VNC systems report all displays as RR_Disconnected
- Faulty Fallback: Wine incorrectly reverts to legacy XRandR 1.0 API when no "connected" displays are detected
- API Incompatibility: Modern XRandR 1.6 doesn't support Wine's XRandR 1.0 implementation, causing XRRSizes() to return empty display modes
- Uninitialized Data: This leaves critical display fields (dmPelsWidth/Height) at initialization value 0
--
v2: winex11: handle fallback display modes when XRandR fails
server: prevent division by zero in coordinate mapping
https://gitlab.winehq.org/wine/wine/-/merge_requests/8216
Wine applications crash in VNC/headless environments due to invalid all-zero monitor coordinates.
The root cause is:
Environment Issue: VNC systems report all displays as RR_Disconnected
Faulty Fallback: Wine incorrectly reverts to legacy XRandR 1.0 API when no "connected" displays are detected
API Incompatibility: Modern XRandR 1.6 doesn't support Wine's XRandR 1.0 implementation, causing XRRSizes() to return empty display modes
Uninitialized Data: This leaves critical display fields (dmPelsWidth/Height) at initialization value 0
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8216
If the "Properties" button is clicked in the printdlg it opens the print properties dlg. The problem is the values set in the properties dlg don't get passed through correctly to the final printing stage. This prevents properties like duplex and page size from working.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8220
Please see: https://marc.info/?l=wine-devel&m=174715050805731 as well as the commit messages for more information.
--
v6: ntdll: Report more info about heap problems detected by ASan.
ntdll: Show (partial) stack trace in ASan reports.
ntdll: Add heap quarantine for ASan.
ntdll: Add asan poisoning and redzoning to heap allocator
ntdll: Implement ASan fake stack.
ntdll: Don't use address of local variables as the frame address.
ntdll: During unwind, also check if frame is on fake stack.
ntdll: Implement __asan_{un,}poison_memory_region.
ntdll: Make sure to not write into poisoned memory in KeUserModeCallback.
ntdll: Implement __asan_set_shadow_*.
ntdll: Implement reporting of ASan errors.
ntdll: Implement __asan_{memory,region}_is_poisoned.
ntdll: Implement __asan_{un,}poison_stack_memory.
ntdll: Unpoison stack in __asan_handle_no_return.
ntdll: Add API for checking whether address is in fake stack frame.
kernel32: Check for poison in LocalLock if ASan is enabled.
kernel32: Fix ASan reports in IsBad*
ntdll: Call __asan_handle_no_return in RtlRestoreContext.
makedep: Support sanitizer flags.
asan_dynamic_thunk: Add ASan dynamic thunk for DLLs.
ntdll: Add stub ASan runtime.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8026
In native Windows, the COPY command will display the names of the files as they are copied. Wine should do the same. This change enables that.
--
v6: cmd: COPY should output file names as they are copied.
cmd/tests: Add tests for unexpected COPY filename output.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8200
The source rect is set to be 2x2, and sizeof(pixdata) is used as the row pitch. Which means the
second row is located beyond the end of pixdata.
Tests added back in be8afaff686e, commit message doesn't seem to indicate this was trying to test
out-of-bound read. So use the correct row pitch here.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8215
OSmesa is deprecated and has been removed from latest mesa releases, this replaces it with pbuffer rendering and flushing of the surface onto the bitmap at some specific sync points. The tests show that this is roughly how Windows seem to behave anyway, instead of rendering directly to the memory as OSmesa does.
--
v3: win32u: Remove now unnecessary context and pbuffer funcs.
win32u: Drop now unnecessary OSMesa dependency.
win32u: Use a pbuffer to implement GL on memory DCs.
opengl32/tests: Relax memory DC pixel format selection.
opengl32: Expose every pixel format on memory DCs.
winex11: Check XVisualInfo vs GLXFBConfig depth to avoid BadMatch.
winex11: Flag offscreen formats as bitmap compatible if possible.
winemac: Use opengl_funcs for glFlush.
winex11: Use opengl_funcs for glFlush / glFinish.
opengl32: Move glFlush / glFinish hooking from win32u.
win32u: Avoid closing NULL egl_handle on dlopen failure.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8210
d2d_fp_fast_expansion_sum_zeroelim contains many instances of this pattern:
```c
if (a_idx < a_len)
{
use(a_curr);
a_curr = a[++a_idx];
}
```
Here if a_idx is already a_len - 1, a[++a_idx] reads past the last element of a.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8213
OSmesa is deprecated and has been removed from latest mesa releases, this replaces it with pbuffer rendering and flushing of the surface onto the bitmap at some specific sync points. The tests show that this is roughly how Windows seem to behave anyway, instead of rendering directly to the memory as OSmesa does.
--
v2: win32u: Remove now unnecessary context and pbuffer funcs.
win32u: Drop now unnecessary OSMesa dependency.
win32u: Use a pbuffer to implement GL on memory DCs.
opengl32: Expose every pixel format on memory DCs.
winex11: Check XVisualInfo vs GLXFBConfig depth to avoid BadMatch.
winex11: Flag offscreen formats as bitmap compatible if possible.
winemac: Use opengl_funcs for glFlush.
winex11: Use opengl_funcs for glFlush / glFinish.
opengl32: Move glFlush / glFinish hooking from win32u.
win32u: Avoid closing NULL egl_handle on dlopen failure.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8210
OSmesa is deprecated and has been removed from latest mesa releases, this replaces it with pbuffer rendering and flushing of the surface onto the bitmap at some specific sync points. The tests show that this is roughly how Windows seem to behave anyway, instead of rendering directly to the memory as OSmesa does.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8210
--
v2: ucrtbase: Fix case mapping and ctype1 tables for utf8 locale.
ucrtbase: Fix CP_UTF8 handling in _tolower_l.
ucrtbase: Fix CP_UTF8 handling in _toupper_l.
msvcrt: Print FIXME when WideCharToMultiByte() fails in create_locinfo().
https://gitlab.winehq.org/wine/wine/-/merge_requests/8198