http://bugs.winehq.org/show_bug.cgi?id=36506
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |win64 Status|UNCONFIRMED |NEW CC| |focht@gmx.net Summary|Wolfenstein - The New Order |Wolfenstein - The New Order |fails to start |fails to start | |(glGetString(GL_VENDOR) | |without a current WGL | |context) Ever confirmed|0 |1
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello folks,
the game calls 'glGetString(GL_VENDOR)' on a secondary thread without a current WGL context.
There is no previous call to 'wglMakeCurrent' hence the TEB GL function pointer table pointer is obviously not set. Anything doing 'funcs->gl.ptr( ...)' will crash.
--- snip --- $ pwd /home/focht/wine-games/wineprefix-wothneor/wineprefix/drive_c/Program Files (x86)/Wolfenstein The New Order
$ WINEDEBUG=+tid,+seh,+relay,+wgl,+debugstr wine ./WolfNewOrder_x64.exe
log.txt 2>&1
... 0009:Call KERNEL32.OutputDebugStringA(0c1ca360 "CreateOpenGLContextForCurrentThread: Assuming pre-checked Graphics Vendor: "NVIDIA Corporation"\n") ret=1409c8e54 0009:warn:debugstr:OutputDebugStringA "CreateOpenGLContextForCurrentThread: Assuming pre-checked Graphics Vendor: "NVIDIA Corporation"\n" 0009:Ret KERNEL32.OutputDebugStringA() retval=00000000 ret=1409c8e54 0009:Call user32.CreateWindowExA(00000000,140ee7938 "wolf_CONTEXT",140ee7918 "Wolfenstein The New Order",00cf0000,00000000,100000000,00000020,00000020,00000000,00000000,140000000,00000000) ret=14046ca87 0009:Call winex11.drv.CreateDesktopWindow(00010020) ret=7f6c535ea56f 0009:Ret winex11.drv.CreateDesktopWindow() retval=00000001 ret=7f6c535ea56f ... 0009:Ret window proc 0x7f6c53538c84 (hwnd=0x10068,msg=WM_CREATE,wp=00000000,lp=0c1ce200) retval=00000000 0009:Call winex11.drv.CreateWindow(00010068) ret=7f6c535e8dd3 0009:Ret winex11.drv.CreateWindow() retval=00000001 ret=7f6c535e8dd3 0009:Ret user32.CreateWindowExA() retval=00010068 ret=14046ca87 0009:Call user32.GetDC(00010068) ret=14046caaa 0009:Call winex11.drv.GetDC(00180043,00010068,00010068,0c1ce130,0c1ce120,00000014) ret=7f6c535c26e1 0009:Ret winex11.drv.GetDC() retval=00000001 ret=7f6c535c26e1 0009:Call winex11.drv.EnumDisplayMonitors(00000000,00000000,7f6c535d2dcd,0c1ce010) ret=7f6c535bad33 0009:Ret winex11.drv.EnumDisplayMonitors() retval=00000001 ret=7f6c535bad33 0009:Ret user32.GetDC() retval=00180043 ret=14046caaa 0009:Call gdi32.SetPixelFormat(00180043,00000003,141d1e8e4) ret=14046c24a 0009:Call opengl32.wglSetPixelFormat(00180043,00000003,141d1e8e4) ret=7f6c53238c78 0009:Call gdi32.__wine_get_wgl_driver(00180043,0000000b) ret=7f6c50b3b381 0009:Ret gdi32.__wine_get_wgl_driver() retval=7f6c509bc2a0 ret=7f6c50b3b381 0009:trace:wgl:set_pixel_format (0x180043,3) 0009:trace:wgl:get_pixel_format Returning fmt_id=0x107 for iPixelFormat=3 0009:trace:wgl:set_pixel_format FBConfig have : 0009:trace:wgl:set_pixel_format - FBCONFIG_ID 0x107 0009:trace:wgl:set_pixel_format - VISUAL_ID 0x24 0009:trace:wgl:set_pixel_format - DRAWABLE_TYPE 0x7 0009:trace:wgl:set_win_format created GL drawable 4e00003 for win 0x10068 format 107 0009:Call winex11.drv.WindowPosChanging(00010068,00000000,0000181f,0c1cdf00,0c1cdef0,0c1cde70,0c1cde48) ret=7f6c535f6bb5 0009:Call winex11.drv.SystemParametersInfo(00000029,00000000,0c1cd2f0,00000000) ret=7f6c535d4ea3 0009:Ret winex11.drv.SystemParametersInfo() retval=00000000 ret=7f6c535d4ea3 0009:Ret winex11.drv.WindowPosChanging() retval=00000000 ret=7f6c535f6bb5 0009:Call winex11.drv.WindowPosChanged(00010068,00000000,0000181f,0c1cdf00,0c1cdef0,0c1cde70,00000000,00000000) ret=7f6c535f7145 0009:Ret winex11.drv.WindowPosChanged() retval=00000000 ret=7f6c535f7145 0009:Ret opengl32.wglSetPixelFormat() retval=00000001 ret=7f6c53238c78 0009:Ret gdi32.SetPixelFormat() retval=00000001 ret=14046c24a 0009:Call opengl32.glGetString(00001f00) ret=14046c8bc 0009:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7f6c50b42159 ip=7f6c50b42159 tid=0009 0009:trace:seh:raise_exception info[0]=0000000000000000 0009:trace:seh:raise_exception info[1]=00000000000003f8 0009:trace:seh:raise_exception rax=0000000000000000 rbx=00000000085a60a0 rcx=0000000000001f00 rdx=00007f6c531adcb5 0009:trace:seh:raise_exception rsi=000000000c1ce380 rdi=000000000c1ce300 rbp=000000000c1ce2d0 rsp=000000000c1ce1f0 0009:trace:seh:raise_exception r8=0005006800170004 r9=0000000000000000 r10=0000000000000000 r11=0000003157381420 0009:trace:seh:raise_exception r12=0000000000000000 r13=00000000012c31e8 r14=000000000c1cf700 r15=000000014161db20 --- snip ---
I had a look at the calls following the (failing) call:
wglCreateContextAttribsARB() wglMakeCurrent()
This indicates the engine indeed assumes 'glGetString()' can be called without WGL context or it must have been implicitly created by previous SetPixelFormat().
Interestingly there is another GL render thread already set up which does all things in correct order (also calling 'glGetString(GL_VENDOR)').
--- snip --- ... 0024:Call KERNEL32.OutputDebugStringA(012becf0 "---registered context window class\n") ret=1409c8e54 0024:warn:debugstr:OutputDebugStringA "---registered context window class\n" 0024:Ret KERNEL32.OutputDebugStringA() retval=00000000 ret=1409c8e54 0024:Call user32.CreateWindowExA(00000000,140ee7580 "wolf_WGL_FAKE",140ee7560 "Wolfenstein The New Order",00cf0000,00000028,100000028,00000280,000001e0,00000000,00000000,140000000,00000000) ret=14046c5cd ... 0024:Ret user32.CreateWindowExA() retval=0001005c ret=14046c5cd 0024:Call user32.GetDC(0001005c) ret=14046c5f5 0024:Ret user32.GetDC() retval=00080039 ret=14046c5f5 0024:Call opengl32.wglCreateContext(00080039) ret=14046c601 0024:Call gdi32.__wine_get_wgl_driver(00080039,0000000b) ret=7f6c50b3b381 0024:Ret gdi32.__wine_get_wgl_driver() retval=7f6c509bc2a0 ret=7f6c50b3b381 0024:trace:wgl:glxdrv_wglCreateContext 0x80039 -> 0x85a3c00 0024:Call ntdll.RtlAllocateHeap(00010000,00000008,00000028) ret=7f6c50b3c584 0024:Ret ntdll.RtlAllocateHeap() retval=085d9020 ret=7f6c50b3c584 0024:Ret opengl32.wglCreateContext() retval=00010000 ret=14046c601 0024:Call opengl32.wglMakeCurrent(00080039,00010000) ret=14046c610 0024:trace:wgl:glxdrv_wglMakeCurrent (0x80039,0x85a3c00) 0024:trace:wgl:describeContext Context 0x85a3c00 have (vis:0x7f6c4c216120): 0024:trace:wgl:describeContext - FBCONFIG_ID 0x107 0024:trace:wgl:describeContext - VISUAL_ID 0x24 0024:trace:wgl:glxdrv_wglMakeCurrent hdc 0x80039 drawable 4800004 fmt 0x85a1d40 ctx 0x7f6c4c097ca8 0024:trace:wgl:glxdrv_wglMakeCurrent 0x80039,0x85a3c00 returning 1 0024:Ret opengl32.wglMakeCurrent() retval=00000001 ret=14046c610 0024:Call opengl32.glGetString(00001f00) ret=14046c61b 0024:Ret opengl32.glGetString() retval=3883f49cf4 ret=14046c61b 0024:Call opengl32.glGetString(00001f01) ret=14046c62d 0024:Ret opengl32.glGetString() retval=68046044 ret=14046c62d 0024:Call opengl32.glGetString(00001f02) ret=14046c63f 0024:Ret opengl32.glGetString() retval=68000080 ret=14046c63f 0024:Call KERNEL32.GetLastError() ret=140acb2cc 0024:Ret KERNEL32.GetLastError() retval=00000000 ret=140acb2cc 0024:Call KERNEL32.GetLastError() ret=140acb2cc 0024:Ret KERNEL32.GetLastError() retval=00000000 ret=140acb2cc 0024:Call KERNEL32.GetTickCount() ret=1409da649 0024:Ret KERNEL32.GetTickCount() retval=00174963 ret=1409da649 0024:Call ntdll.RtlTryEnterCriticalSection(00063b90) ret=1409de2a9 0024:Ret ntdll.RtlTryEnterCriticalSection() retval=00000001 ret=1409de2a9 0024:Call KERNEL32.WriteFile(00000274,012bed00,00000044,012bec70,00000000) ret=1409d54df 0024:Ret KERNEL32.WriteFile() retval=00000001 ret=1409d54df 0024:Call KERNEL32.OutputDebugStringA(012bed00 "GetWGLExtensionsWithFakeWindow: OpenGL Vendor: "NVIDIA Corporation"\n") ret=1409c8e54 0024:warn:debugstr:OutputDebugStringA "GetWGLExtensionsWithFakeWindow: OpenGL Vendor: "NVIDIA Corporation"\n" ... --- snip ---
Regards