[PATCH 0/1] MR9986: OpenGL32 check if HDC is invalid
Regression from 10.13 - https://bugs.winehq.org/show_bug.cgi?id=58506 When Waves VST tries to load it errors: 0024:warn:win:get_window_pixel_format getting format on win (nil) not supported 0024:warn:opengl:update_context Failed to re-create context for wglShareLists 0024:warn:opengl:wglMakeCurrent wglMakeCurrent returned 0xc0000005 After that it stucks in the loop and main app (DAW) needs to be SIGTERM. Fix checks if the HDC is valid before going further. This makes Waves VST load and work fine. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986
From: GoranKovac <gorankovacstudio@gmail.com> Regression from 10.13 - https://bugs.winehq.org/show_bug.cgi?id=58506 When Waves VST tries to load it errors: 0024:warn:win:get_window_pixel_format getting format on win (nil) not supported 0024:warn:opengl:update_context Failed to re-create context for wglShareLists 0024:warn:opengl:wglMakeCurrent wglMakeCurrent returned 0xc0000005 After that it stucks in the loop and main app (DAW) needs to be SIGTERM. Fix checks if the HDC is valid before going further. This makes Waves VST load and work fine. --- dlls/opengl32/unix_wgl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 09b1bbf063b..d6db3b881d8 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -396,6 +396,11 @@ static struct context *update_context( TEB *teb, HGLRC client_context, struct co if (ctx->tid) return ctx; /* currently in use */ if (ctx->share == (HGLRC)-1) return ctx; /* not re-shared */ + if (!NtUserWindowFromDC( ctx->hdc )) + { + WARN( "Skipping context re-create, invalid HDC\n" ); + return ctx; + } share = ctx->share ? get_updated_context( teb, ctx->share ) : NULL; if (!funcs->p_wgl_context_reset( &ctx->base, ctx->hdc, share ? &share->base : NULL, ctx->attribs )) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9986
Rémi Bernon (@rbernon) commented about dlls/opengl32/unix_wgl.c:
if (ctx->tid) return ctx; /* currently in use */ if (ctx->share == (HGLRC)-1) return ctx; /* not re-shared */ + if (!NtUserWindowFromDC( ctx->hdc )) + { + WARN( "Skipping context re-create, invalid HDC\n" ); + return ctx; + }
share = ctx->share ? get_updated_context( teb, ctx->share ) : NULL; if (!funcs->p_wgl_context_reset( &ctx->base, ctx->hdc, share ? &share->base : NULL, ctx->attribs )) { WARN( "Failed to re-create context for wglShareLists\n" ); return ctx; }
This seems to be that the stored hdc isn't valid anymore at the time we try to recreate the context. The thing is that we probably don't need the hdc, but rather only the pixel format. The pixel format is stored already, we just need a way to use it rather than the hdc when updating a context for re-sharing. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128255
On Wed Jan 28 11:02:37 2026 +0000, Rémi Bernon wrote:
This seems to be that the stored hdc isn't valid anymore at the time we try to recreate the context. The thing is that we probably don't need the hdc, but rather only the pixel format. The pixel format is stored already, we just need a way to use it rather than the hdc when updating a context for re-sharing. Does https://gitlab.winehq.org/wine/wine/-/merge_requests/9991 help for instance?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128256
On Wed Jan 28 11:32:43 2026 +0000, Rémi Bernon wrote:
Does https://gitlab.winehq.org/wine/wine/-/merge_requests/9991 help for instance? will check
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128258
On Wed Jan 28 11:34:18 2026 +0000, Goran Kovac wrote:
will check Unfortunately not, still hits same errors and app needs to be SIGTERM since its not responding anymore (like before). Only difference now is it does not even create window (before it created it but was black/empty)
``` 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 02a0:warn:threadname:NtSetInformationThread Thread renamed to L"wine_rpcrt4_server" 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 0024:warn:win:get_window_pixel_format getting format on win (nil) not supported 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 0024:warn:opengl:update_handle_context Failed to re-create context for wglShareLists 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 0024:warn:opengl:wglMakeCurrent wglMakeCurrent returned 0xc0000005 ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128259
On Wed Jan 28 11:50:42 2026 +0000, Goran Kovac wrote:
Unfortunately not, still hits same errors and app needs to be SIGTERM since its not responding anymore (like before). Only difference now is it does not even create window (before it created it but was black/empty) ``` 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 02a0:warn:threadname:NtSetInformationThread Thread renamed to L"wine_rpcrt4_server" 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 0024:warn:win:get_window_pixel_format getting format on win (nil) not supported 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 0024:warn:opengl:update_handle_context Failed to re-create context for wglShareLists 12:46:02 [WaveShell1-VST3 14.12_x64-378LUpst] [Wine STDERR] 0024:warn:opengl:wglMakeCurrent wglMakeCurrent returned 0xc0000005 ``` I apologize... was testing wrong prefix... yes that fixes it. Loads and works without issues
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128309
On Wed Jan 28 21:08:12 2026 +0000, Goran Kovac wrote:
I apologize... was testing wrong prefix... yes that fixes it. Loads and works without issues Nice, thanks!
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128345
This merge request was closed by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986
participants (3)
-
Goran Kovac (@gorankovacstudio) -
GoranKovac -
Rémi Bernon (@rbernon)