March 6, 2026
4:31 p.m.
On Thu Mar 5 00:55:08 2026 +0000, Yeshun Ye wrote:
Based on my observations, the code, upon successfully checking `has_gdi_dc`, will proceed to call `gdi_dc_acquire` to obtain an `hdc` without any further checks. However, if the `graphics` was created using `GdipCreateFromHWND` and the corresponding `hwnd` has already been destroyed, the `hdc` cannot be obtained. This would cause Wine's behavior to differ from Windows. For this reason, I chose to add an extra check within `has_gdi_dc`. Perhaps you have a better suggestion? That's going to depend on whether the behavior of GdipMeasureString is typical.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10235#note_131503