-- v2: opengl32: Use generated wow64 thunk for wglCreateContextAttribsARB. opengl32: Use generated wow64 thunk for wglCreateContext. opengl32: Avoid unneeded wrapper return type casts. opengl32: Use manual_win_functions for wglGetCurrentReadDCARB.
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 18 ++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 54 ++++++++++++------------------------- 4 files changed, 34 insertions(+), 41 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index ec302a51c90..bd8bbb120d4 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -248,7 +248,6 @@ my %manual_wow64_thunks = "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, "wglMakeContextCurrentARB" => 1, - "wglMakeCurrent" => 1, "wglQueryCurrentRendererStringWINE" => 1, "wglQueryRendererStringWINE" => 1, ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index d8dab1a7874..19aa9084a7a 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -68,7 +68,7 @@ NTSTATUS wgl_wglGetProcAddress( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wgl_wglMakeCurrent( void *args ) +static NTSTATUS wgl_wglMakeCurrent( void *args ) { struct wglMakeCurrent_params *params = args; pthread_mutex_lock( &wgl_lock ); @@ -29941,6 +29941,22 @@ static NTSTATUS wow64_wgl_wglGetPixelFormat( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDc; + PTR32 newContext; + BOOL ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + params->ret = wrap_wglMakeCurrent( teb, ULongToPtr(params->hDc), ULongToPtr(params->newContext) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_wgl_wglSetPixelFormat( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 93573510057..4171b0ca8e3 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -38,8 +38,6 @@ extern NTSTATUS wgl_wglDeleteContext( void *args ); extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ); extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); -extern NTSTATUS wgl_wglMakeCurrent( void *args ); -extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ); extern NTSTATUS gl_glGetString( void *args ); extern NTSTATUS wow64_gl_glGetString( void *args ); extern NTSTATUS ext_glClientWaitSync( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 410178ac090..61643a9e0ac 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -365,6 +365,20 @@ static void free_handle_ptr( struct wgl_handle *ptr ) next_free = ptr; }
+static void update_teb32_context( TEB *teb ) +{ +#ifdef _WIN64 + TEB32 *teb32; + + if (!teb->WowTebOffset) return; + teb32 = (TEB32 *)((char *)teb + teb->WowTebOffset); + + teb32->glCurrentRC = (UINT_PTR)teb->glCurrentRC; + teb32->glReserved1[0] = (UINT_PTR)teb->glReserved1[0]; + teb32->glReserved1[1] = (UINT_PTR)teb->glReserved1[1]; +#endif +} + static int *memdup_attribs( const int *attribs ) { const int *attr; @@ -1020,21 +1034,20 @@ BOOL wrap_wglMakeCurrent( TEB *teb, HDC hdc, HGLRC hglrc ) teb->glReserved1[1] = hdc; teb->glCurrentRC = hglrc; teb->glTable = (void *)funcs; - return TRUE; } - if (prev) + else if (prev) { if (!funcs->p_wglMakeCurrent( 0, NULL )) return FALSE; prev->tid = 0; teb->glCurrentRC = 0; teb->glTable = &null_opengl_funcs; - return TRUE; } - if (!hdc) + else if (!hdc) { RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return FALSE; } + update_teb32_context( teb ); return TRUE; }
@@ -1427,18 +1440,6 @@ static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) return wow64_str; }
-static inline void update_teb32_context( TEB *teb ) -{ - void *teb32; - - if (!teb->WowTebOffset) return; - teb32 = (char *)teb + teb->WowTebOffset; - - ((TEB32 *)teb32)->glCurrentRC = (UINT_PTR)teb->glCurrentRC; - ((TEB32 *)teb32)->glReserved1[0] = (UINT_PTR)teb->glReserved1[0]; - ((TEB32 *)teb32)->glReserved1[1] = (UINT_PTR)teb->glReserved1[1]; -} - NTSTATUS wow64_wgl_wglCreateContext( void *args ) { struct @@ -1527,27 +1528,6 @@ NTSTATUS wow64_wgl_wglDeleteContext( void *args ) return status; }
-NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDc; - PTR32 newContext; - BOOL ret; - } *params32 = args; - struct wglMakeCurrent_params params = - { - .teb = get_teb64(params32->teb), - .hDc = ULongToPtr(params32->hDc), - .newContext = ULongToPtr(params32->newContext), - }; - NTSTATUS status; - if (!(status = wgl_wglMakeCurrent( ¶ms ))) update_teb32_context( params.teb ); - params32->ret = params.ret; - return status; -} - NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 19 ++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 27 ++------------------------- 4 files changed, 20 insertions(+), 29 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index bd8bbb120d4..cbb7e4c0bc8 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -247,7 +247,6 @@ my %manual_wow64_thunks = "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, - "wglMakeContextCurrentARB" => 1, "wglQueryCurrentRendererStringWINE" => 1, "wglQueryRendererStringWINE" => 1, ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 19aa9084a7a..cb8cfe2dc0d 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26757,7 +26757,7 @@ static NTSTATUS ext_wglGetSwapIntervalEXT( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglMakeContextCurrentARB( void *args ) +static NTSTATUS ext_wglMakeContextCurrentARB( void *args ) { struct wglMakeContextCurrentARB_params *params = args; pthread_mutex_lock( &wgl_lock ); @@ -78289,6 +78289,23 @@ static NTSTATUS wow64_ext_wglGetSwapIntervalEXT( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDrawDC; + PTR32 hReadDC; + PTR32 hglrc; + BOOL ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + params->ret = wrap_wglMakeContextCurrentARB( teb, ULongToPtr(params->hDrawDC), ULongToPtr(params->hReadDC), ULongToPtr(params->hglrc) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_wglQueryCurrentRendererIntegerWINE( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 4171b0ca8e3..2384f6f5cab 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -96,8 +96,6 @@ extern NTSTATUS ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); -extern NTSTATUS ext_wglMakeContextCurrentARB( void *args ); -extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ); extern NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ); extern NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ); extern NTSTATUS ext_wglQueryRendererStringWINE( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 61643a9e0ac..ea50bac6bab 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1254,15 +1254,15 @@ BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, HGLRC teb->glReserved1[1] = read_hdc; teb->glCurrentRC = hglrc; teb->glTable = (void *)funcs; - return TRUE; } - if (prev) + else if (prev) { if (!funcs->p_wglMakeCurrent( 0, NULL )) return FALSE; prev->tid = 0; teb->glCurrentRC = 0; teb->glTable = &null_opengl_funcs; } + update_teb32_context( teb ); return TRUE; }
@@ -1528,29 +1528,6 @@ NTSTATUS wow64_wgl_wglDeleteContext( void *args ) return status; }
-NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDrawDC; - PTR32 hReadDC; - PTR32 hglrc; - BOOL ret; - } *params32 = args; - struct wglMakeContextCurrentARB_params params = - { - .teb = get_teb64(params32->teb), - .hDrawDC = ULongToPtr(params32->hDrawDC), - .hReadDC = ULongToPtr(params32->hReadDC), - .hglrc = ULongToPtr(params32->hglrc), - }; - NTSTATUS status; - if (!(status = ext_wglMakeContextCurrentARB( ¶ms ))) update_teb32_context( params.teb ); - params32->ret = params.ret; - return status; -} - NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 17 ++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 19 ------------------- 4 files changed, 16 insertions(+), 23 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index cbb7e4c0bc8..753639982a6 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -241,7 +241,6 @@ my %manual_wow64_thunks = "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, - "wglDeleteContext" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, "wglGetPbufferDCARB" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index cb8cfe2dc0d..d7e0a9301a0 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -43,7 +43,7 @@ NTSTATUS wgl_wglCreateContext( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wgl_wglDeleteContext( void *args ) +static NTSTATUS wgl_wglDeleteContext( void *args ) { struct wglDeleteContext_params *params = args; pthread_mutex_lock( &wgl_lock ); @@ -29927,6 +29927,21 @@ static NTSTATUS wow64_wgl_wglCopyContext( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_wgl_wglDeleteContext( void *args ) +{ + struct + { + PTR32 teb; + PTR32 oldContext; + BOOL ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + params->ret = wrap_wglDeleteContext( teb, ULongToPtr(params->oldContext) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_wgl_wglGetPixelFormat( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 2384f6f5cab..dc6174b6516 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -34,8 +34,6 @@ extern BOOL wrap_wglSetPbufferAttribARB( TEB *teb , HPBUFFERARB hPbuffer, const
extern NTSTATUS wgl_wglCreateContext( void *args ); extern NTSTATUS wow64_wgl_wglCreateContext( void *args ); -extern NTSTATUS wgl_wglDeleteContext( void *args ); -extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ); extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); extern NTSTATUS gl_glGetString( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index ea50bac6bab..5b730ea4def 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1509,25 +1509,6 @@ NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wow64_wgl_wglDeleteContext( void *args ) -{ - struct - { - PTR32 teb; - PTR32 oldContext; - BOOL ret; - } *params32 = args; - struct wglDeleteContext_params params = - { - .teb = get_teb64(params32->teb), - .oldContext = ULongToPtr(params32->oldContext), - }; - NTSTATUS status; - if (!(status = wgl_wglDeleteContext( ¶ms ))) update_teb32_context( params.teb ); - params32->ret = params.ret; - return status; -} - NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_thunks.c | 27 --------------------------- dlls/opengl32/unixlib.h | 7 ------- 3 files changed, 1 insertion(+), 35 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 753639982a6..00de6094205 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -158,6 +158,7 @@ my %manual_win_functions = "wglDescribePixelFormat" => 1, "wglGetCurrentContext" => 1, "wglGetCurrentDC" => 1, + "wglGetCurrentReadDCARB" => 1, "wglGetDefaultProcAddress" => 1, "wglGetLayerPaletteEntries" => 1, "wglRealizeLayerPalette" => 1, @@ -184,7 +185,6 @@ my %manual_win_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "wglChoosePixelFormatARB" => 1, - "wglGetCurrentReadDCARB" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, "wglGetPixelFormat" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index d7e0a9301a0..09be3ab465e 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26697,14 +26697,6 @@ static NTSTATUS ext_wglFreeMemoryNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglGetCurrentReadDCARB( void *args ) -{ - struct wglGetCurrentReadDCARB_params *params = args; - const struct opengl_funcs *funcs = params->teb->glTable; - params->ret = funcs->p_wglGetCurrentReadDCARB(); - return STATUS_SUCCESS; -} - NTSTATUS ext_wglGetExtensionsStringARB( void *args ) { struct wglGetExtensionsStringARB_params *params = args; @@ -29880,7 +29872,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] = ext_wglCreatePbufferARB, ext_wglDestroyPbufferARB, ext_wglFreeMemoryNV, - ext_wglGetCurrentReadDCARB, ext_wglGetExtensionsStringARB, ext_wglGetExtensionsStringEXT, ext_wglGetPbufferDCARB, @@ -78242,17 +78233,6 @@ static NTSTATUS wow64_ext_wglFreeMemoryNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS wow64_ext_wglGetCurrentReadDCARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 ret; - } *params = args; - FIXME( "params %p stub!\n", params ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglGetPixelFormatAttribfvARB( void *args ) { struct @@ -81475,7 +81455,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = wow64_ext_wglCreatePbufferARB, wow64_ext_wglDestroyPbufferARB, wow64_ext_wglFreeMemoryNV, - wow64_ext_wglGetCurrentReadDCARB, wow64_ext_wglGetExtensionsStringARB, wow64_ext_wglGetExtensionsStringEXT, wow64_ext_wglGetPbufferDCARB, @@ -93756,11 +93735,6 @@ static void null_wglFreeMemoryNV( void *pointer ) { ERR( "unsupported\n" ); } -static HDC null_wglGetCurrentReadDCARB(void) -{ - ERR( "unsupported\n" ); - return 0; -} static const char * null_wglGetExtensionsStringARB( HDC hdc ) { ERR( "unsupported\n" ); @@ -96871,7 +96845,6 @@ struct opengl_funcs null_opengl_funcs = .p_wglCreatePbufferARB = null_wglCreatePbufferARB, .p_wglDestroyPbufferARB = null_wglDestroyPbufferARB, .p_wglFreeMemoryNV = null_wglFreeMemoryNV, - .p_wglGetCurrentReadDCARB = null_wglGetCurrentReadDCARB, .p_wglGetExtensionsStringARB = null_wglGetExtensionsStringARB, .p_wglGetExtensionsStringEXT = null_wglGetExtensionsStringEXT, .p_wglGetPbufferDCARB = null_wglGetPbufferDCARB, diff --git a/dlls/opengl32/unixlib.h b/dlls/opengl32/unixlib.h index 3eea4745aa1..0bac7adee89 100644 --- a/dlls/opengl32/unixlib.h +++ b/dlls/opengl32/unixlib.h @@ -25180,12 +25180,6 @@ struct wglFreeMemoryNV_params void *pointer; };
-struct wglGetCurrentReadDCARB_params -{ - TEB *teb; - HDC ret; -}; - struct wglGetExtensionsStringARB_params { TEB *teb; @@ -28364,7 +28358,6 @@ enum unix_funcs unix_wglCreatePbufferARB, unix_wglDestroyPbufferARB, unix_wglFreeMemoryNV, - unix_wglGetCurrentReadDCARB, unix_wglGetExtensionsStringARB, unix_wglGetExtensionsStringEXT, unix_wglGetPbufferDCARB,
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_thunks.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 00de6094205..821875a1b8a 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -489,7 +489,6 @@ sub generate_unix_thunk($$$$) $ret .= "params->ret = "; $ret .= "(UINT_PTR)" if $is_wow64 && get_wow64_arg_type( $func->[0] ) =~ /PTR32/; } - $ret .= "($func_ret)" if defined $remap_types{$func_ret}; $call_args =~ s/,$/ /; if ($need_wrap) { @@ -497,6 +496,7 @@ sub generate_unix_thunk($$$$) } else { + $ret .= "($func_ret)" if defined $remap_types{$func_ret}; $ret .= "funcs->p_$name($call_args);\n"; } $ret .= " pthread_mutex_unlock( &wgl_lock );\n" if $need_lock; diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 09be3ab465e..a3ab4c887e9 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -38,7 +38,7 @@ NTSTATUS wgl_wglCreateContext( void *args ) const struct opengl_funcs *funcs = get_dc_funcs( params->hDc ); if (!funcs || !funcs->p_wglCreateContext) return STATUS_NOT_IMPLEMENTED; pthread_mutex_lock( &wgl_lock ); - params->ret = (HGLRC)wrap_wglCreateContext( params->teb, params->hDc ); + params->ret = wrap_wglCreateContext( params->teb, params->hDc ); pthread_mutex_unlock( &wgl_lock ); return STATUS_SUCCESS; } @@ -26664,7 +26664,7 @@ NTSTATUS ext_wglCreateContextAttribsARB( void *args ) const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); if (!funcs || !funcs->p_wglCreateContextAttribsARB) return STATUS_NOT_IMPLEMENTED; pthread_mutex_lock( &wgl_lock ); - params->ret = (HGLRC)wrap_wglCreateContextAttribsARB( params->teb, params->hDC, params->hShareContext, params->attribList ); + params->ret = wrap_wglCreateContextAttribsARB( params->teb, params->hDC, params->hShareContext, params->attribList ); pthread_mutex_unlock( &wgl_lock ); return STATUS_SUCCESS; } @@ -26675,7 +26675,7 @@ NTSTATUS ext_wglCreatePbufferARB( void *args ) const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); if (!funcs || !funcs->p_wglCreatePbufferARB) return STATUS_NOT_IMPLEMENTED; pthread_mutex_lock( &wgl_lock ); - params->ret = (HPBUFFERARB)wrap_wglCreatePbufferARB( params->teb, params->hDC, params->iPixelFormat, params->iWidth, params->iHeight, params->piAttribList ); + params->ret = wrap_wglCreatePbufferARB( params->teb, params->hDC, params->iPixelFormat, params->iWidth, params->iHeight, params->piAttribList ); pthread_mutex_unlock( &wgl_lock ); return STATUS_SUCCESS; }
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 3 +-- dlls/opengl32/unix_thunks.c | 19 ++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 19 ------------------- 4 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 821875a1b8a..3da5e0b5074 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -238,7 +238,6 @@ my %manual_wow64_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "glWaitSync" => 1, - "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglGetExtensionsStringARB" => 1, @@ -444,7 +443,7 @@ sub generate_unix_thunk($$$$) $ret .= " $ptype ret;\n"; } $ret .= " } *params = args;\n"; - if ($need_manual_thunk || get_wow64_arg_type( $func->[0] ) =~ /PTR32/) + if ($need_manual_thunk || $func->[0]->textContent() =~ /(GLsync|PROC|GLintptr|*)/) { $ret .= " FIXME( "params %p stub!\n", params );\n"; $ret .= " return STATUS_NOT_IMPLEMENTED;\n"; diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index a3ab4c887e9..8df8c9eb2f4 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -32,7 +32,7 @@ static NTSTATUS wgl_wglCopyContext( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wgl_wglCreateContext( void *args ) +static NTSTATUS wgl_wglCreateContext( void *args ) { struct wglCreateContext_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hDc ); @@ -29918,6 +29918,23 @@ static NTSTATUS wow64_wgl_wglCopyContext( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_wgl_wglCreateContext( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDc; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->hDc) ); + if (!funcs || !funcs->p_wglCreateContext) return STATUS_NOT_IMPLEMENTED; + pthread_mutex_lock( &wgl_lock ); + params->ret = (UINT_PTR)wrap_wglCreateContext( teb, ULongToPtr(params->hDc) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_wgl_wglDeleteContext( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index dc6174b6516..f83025c2830 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -32,8 +32,6 @@ extern int wrap_wglReleasePbufferDCARB( TEB *teb , HPBUFFERARB hPbuffer, HDC hDC extern BOOL wrap_wglReleaseTexImageARB( TEB *teb , HPBUFFERARB hPbuffer, int iBuffer ); extern BOOL wrap_wglSetPbufferAttribARB( TEB *teb , HPBUFFERARB hPbuffer, const int *piAttribList );
-extern NTSTATUS wgl_wglCreateContext( void *args ); -extern NTSTATUS wow64_wgl_wglCreateContext( void *args ); extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); extern NTSTATUS gl_glGetString( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 5b730ea4def..5809d61ed0b 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1440,25 +1440,6 @@ static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) return wow64_str; }
-NTSTATUS wow64_wgl_wglCreateContext( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDc; - PTR32 ret; - } *params32 = args; - struct wglCreateContext_params params = - { - .teb = get_teb64(params32->teb), - .hDc = ULongToPtr(params32->hDc), - }; - NTSTATUS status; - if ((status = wgl_wglCreateContext( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 21 ++++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 23 ----------------------- 4 files changed, 20 insertions(+), 27 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 3da5e0b5074..204e226922c 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -238,7 +238,6 @@ my %manual_wow64_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "glWaitSync" => 1, - "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 8df8c9eb2f4..f544d723739 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26658,7 +26658,7 @@ static NTSTATUS ext_wglChoosePixelFormatARB( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglCreateContextAttribsARB( void *args ) +static NTSTATUS ext_wglCreateContextAttribsARB( void *args ) { struct wglCreateContextAttribsARB_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); @@ -78222,6 +78222,25 @@ static NTSTATUS wow64_ext_wglChoosePixelFormatARB( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDC; + PTR32 hShareContext; + PTR32 attribList; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->hDC) ); + if (!funcs || !funcs->p_wglCreateContextAttribsARB) return STATUS_NOT_IMPLEMENTED; + pthread_mutex_lock( &wgl_lock ); + params->ret = (UINT_PTR)wrap_wglCreateContextAttribsARB( teb, ULongToPtr(params->hDC), ULongToPtr(params->hShareContext), ULongToPtr(params->attribList) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_wglDestroyPbufferARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index f83025c2830..5b91de1ee20 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -82,8 +82,6 @@ extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS ext_glWaitSync( void *args ); extern NTSTATUS wow64_ext_glWaitSync( void *args ); -extern NTSTATUS ext_wglCreateContextAttribsARB( void *args ); -extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ); extern NTSTATUS ext_wglCreatePbufferARB( void *args ); extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); extern NTSTATUS ext_wglGetExtensionsStringARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 5809d61ed0b..6560b0f3082 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1440,29 +1440,6 @@ static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) return wow64_str; }
-NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDC; - PTR32 hShareContext; - PTR32 attribList; - PTR32 ret; - } *params32 = args; - struct wglCreateContextAttribsARB_params params = - { - .teb = get_teb64(params32->teb), - .hDC = ULongToPtr(params32->hDC), - .hShareContext = ULongToPtr(params32->hShareContext), - .attribList = ULongToPtr(params32->attribList), - }; - NTSTATUS status; - if ((status = ext_wglCreateContextAttribsARB( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) { struct