There's a few missing thunks for some non-standard extension functions, but that probably doesn't matter.
-- v2: opengl32: Use the +opengl debug channel everywhere. opengl32: Cast wow64 pointers in glGet(VertexAttrib)Pointerv. opengl32: Implement wow64 thunks for glMapBuffer (et al.). opengl32: Use manual win32 thunks for glMapBuffer (et al.). opengl32: Implement wow64 thunk for glGetString (et al.).
From: Rémi Bernon rbernon@codeweavers.com
This is a bit tricky because the strings are supposed to be static, but we also cannot return the unix strings directly either.
So instead we keep track, on the unix side, of known unix / wow64 string associations, and return the known wow64 string if the unix string was already requested before.
If the string wasn't found, the syscall returns STATUS_BUFFER_TOO_SMALL, and the PE side allocates the required memory, calling the syscall once again with the wow64 string pointer to copy the string to.
On concurrent calls, the syscall may return a different wow64 string, in which case the PE side uses it instead and frees the one it allocated.
Lastly, the PE side also keeps record of wow64 strings it had allocated, so that we can free them on process detach. The unix side also does some cleanup of its mapping buffer, as there's no guarantee that it will be completely unloaded. --- dlls/opengl32/make_opengl | 18 ++++ dlls/opengl32/thunks.c | 59 +--------- dlls/opengl32/unix_thunks.c | 112 +++---------------- dlls/opengl32/unix_wgl.c | 207 ++++++++++++++++++++++++++++++++++++ dlls/opengl32/unixlib.h | 1 + dlls/opengl32/wgl.c | 192 ++++++++++++++++++++++++++++++++- 6 files changed, 436 insertions(+), 153 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 6c1ab65fb7b..861fd104c08 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -162,9 +162,15 @@ my %manual_win_functions = ); my %manual_win_thunks = ( + "glGetString" => 1, + "glGetStringi" => 1, "wglGetCurrentReadDCARB" => 1, + "wglGetExtensionsStringARB" => 1, + "wglGetExtensionsStringEXT" => 1, "wglGetPixelFormat" => 1, "wglGetProcAddress" => 1, + "wglQueryCurrentRendererStringWINE" => 1, + "wglQueryRendererStringWINE" => 1, "wglSwapBuffers" => 1, ); my %manual_wow64_thunks = @@ -172,6 +178,8 @@ my %manual_wow64_thunks = "glClientWaitSync" => 1, "glDeleteSync" => 1, "glFenceSync" => 1, + "glGetString" => 1, + "glGetStringi" => 1, "glGetSynciv" => 1, "glIsSync" => 1, "glPathGlyphIndexRangeNV" => 1, @@ -180,10 +188,15 @@ my %manual_wow64_thunks = "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglDeleteContext" => 1, + "wglGetExtensionsStringARB" => 1, + "wglGetExtensionsStringEXT" => 1, "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, + "wglGetProcAddress" => 1, "wglMakeContextCurrentARB" => 1, "wglMakeCurrent" => 1, + "wglQueryCurrentRendererStringWINE" => 1, + "wglQueryRendererStringWINE" => 1, ); my %pointer_array_count = ( @@ -967,6 +980,7 @@ foreach (sort keys %ext_functions) print OUT "enum unix_funcs\n"; print OUT "{\n"; print OUT " unix_thread_attach,\n"; +print OUT " unix_process_detach,\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; @@ -1090,6 +1104,7 @@ print OUT "WINE_DEFAULT_DEBUG_CHANNEL(wgl);\n"; print OUT "#endif\n\n";
print OUT "extern NTSTATUS thread_attach( void *args ) DECLSPEC_HIDDEN;\n"; +print OUT "extern NTSTATUS process_detach( void *args ) DECLSPEC_HIDDEN;\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; @@ -1135,6 +1150,7 @@ foreach (sort keys %ext_functions) print OUT "const unixlib_entry_t __wine_unix_call_funcs[] =\n"; print OUT "{\n"; print OUT " &thread_attach,\n"; +print OUT " &process_detach,\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; @@ -1155,6 +1171,7 @@ print OUT "\n";
print OUT "#ifdef _WIN64\n\n"; print OUT "typedef ULONG PTR32;\n\n"; +print OUT "extern NTSTATUS wow64_process_detach( void *args ) DECLSPEC_HIDDEN;\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; @@ -1196,6 +1213,7 @@ foreach (sort keys %ext_functions) print OUT "\nconst unixlib_entry_t __wine_unix_call_wow64_funcs[] =\n"; print OUT "{\n"; print OUT " &thread_attach,\n"; +print OUT " &wow64_process_detach,\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index 78aef27722f..3f9c68f4f6f 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -1018,15 +1018,6 @@ void WINAPI glGetPolygonStipple( GLubyte *mask ) if ((status = UNIX_CALL( glGetPolygonStipple, &args ))) WARN( "glGetPolygonStipple returned %#lx\n", status ); }
-const GLubyte * WINAPI glGetString( GLenum name ) -{ - struct glGetString_params args = { .name = name, }; - NTSTATUS status; - TRACE( "name %d\n", name ); - if ((status = UNIX_CALL( glGetString, &args ))) WARN( "glGetString returned %#lx\n", status ); - return args.ret; -} - void WINAPI glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) { struct glGetTexEnvfv_params args = { .target = target, .pname = pname, .params = params, }; @@ -9914,15 +9905,6 @@ static GLushort WINAPI glGetStageIndexNV( GLenum shadertype ) return args.ret; }
-static const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) -{ - struct glGetStringi_params args = { .name = name, .index = index, }; - NTSTATUS status; - TRACE( "name %d, index %d\n", name, index ); - if ((status = UNIX_CALL( glGetStringi, &args ))) WARN( "glGetStringi returned %#lx\n", status ); - return args.ret; -} - static GLuint WINAPI glGetSubroutineIndex( GLuint program, GLenum shadertype, const GLchar *name ) { struct glGetSubroutineIndex_params args = { .program = program, .shadertype = shadertype, .name = name, }; @@ -24334,24 +24316,6 @@ static void WINAPI wglFreeMemoryNV( void *pointer ) if ((status = UNIX_CALL( wglFreeMemoryNV, &args ))) WARN( "wglFreeMemoryNV returned %#lx\n", status ); }
-static const char * WINAPI wglGetExtensionsStringARB( HDC hdc ) -{ - struct wglGetExtensionsStringARB_params args = { .hdc = hdc, }; - NTSTATUS status; - TRACE( "hdc %p\n", hdc ); - if ((status = UNIX_CALL( wglGetExtensionsStringARB, &args ))) WARN( "wglGetExtensionsStringARB returned %#lx\n", status ); - return args.ret; -} - -static const char * WINAPI wglGetExtensionsStringEXT(void) -{ - struct wglGetExtensionsStringEXT_params args = {0}; - NTSTATUS status; - TRACE( "\n" ); - if ((status = UNIX_CALL( wglGetExtensionsStringEXT, &args ))) WARN( "wglGetExtensionsStringEXT returned %#lx\n", status ); - return args.ret; -} - static HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB hPbuffer ) { struct wglGetPbufferDCARB_params args = { .hPbuffer = hPbuffer, }; @@ -24406,15 +24370,6 @@ static BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint return args.ret; }
-static const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute ) -{ - struct wglQueryCurrentRendererStringWINE_params args = { .attribute = attribute, }; - NTSTATUS status; - TRACE( "attribute %d\n", attribute ); - if ((status = UNIX_CALL( wglQueryCurrentRendererStringWINE, &args ))) WARN( "wglQueryCurrentRendererStringWINE returned %#lx\n", status ); - return args.ret; -} - static BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB hPbuffer, int iAttribute, int *piValue ) { struct wglQueryPbufferARB_params args = { .hPbuffer = hPbuffer, .iAttribute = iAttribute, .piValue = piValue, }; @@ -24433,15 +24388,6 @@ static BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer, GLenum a return args.ret; }
-static const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ) -{ - struct wglQueryRendererStringWINE_params args = { .dc = dc, .renderer = renderer, .attribute = attribute, }; - NTSTATUS status; - TRACE( "dc %p, renderer %d, attribute %d\n", dc, renderer, attribute ); - if ((status = UNIX_CALL( wglQueryRendererStringWINE, &args ))) WARN( "wglQueryRendererStringWINE returned %#lx\n", status ); - return args.ret; -} - static int WINAPI wglReleasePbufferDCARB( HPBUFFERARB hPbuffer, HDC hDC ) { struct wglReleasePbufferDCARB_params args = { .hPbuffer = hPbuffer, .hDC = hDC, }; @@ -24487,7 +24433,12 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) return args.ret; }
+extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC_HIDDEN; extern HDC WINAPI wglGetCurrentReadDCARB(void) DECLSPEC_HIDDEN; +extern const char * WINAPI wglGetExtensionsStringARB( HDC hdc ) DECLSPEC_HIDDEN; +extern const char * WINAPI wglGetExtensionsStringEXT(void) DECLSPEC_HIDDEN; +extern const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute ) DECLSPEC_HIDDEN; +extern const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ) DECLSPEC_HIDDEN; const void *extension_procs[] = { glAccumxOES, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index c5e4aedbc6a..ea8d7910450 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -23,6 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl); #endif
extern NTSTATUS thread_attach( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS process_detach( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wgl_wglCopyContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wgl_wglCreateContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wgl_wglDeleteContext( void *args ) DECLSPEC_HIDDEN; @@ -24058,7 +24059,7 @@ static NTSTATUS ext_wglGetCurrentReadDCARB( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglGetExtensionsStringARB( void *args ) +NTSTATUS ext_wglGetExtensionsStringARB( void *args ) { struct wglGetExtensionsStringARB_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hdc ); @@ -24067,7 +24068,7 @@ static NTSTATUS ext_wglGetExtensionsStringARB( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) +NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) { struct wglGetExtensionsStringEXT_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -24109,7 +24110,7 @@ static NTSTATUS ext_wglQueryCurrentRendererIntegerWINE( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ) +NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ) { struct wglQueryCurrentRendererStringWINE_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -24126,7 +24127,7 @@ static NTSTATUS ext_wglQueryRendererIntegerWINE( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglQueryRendererStringWINE( void *args ) +NTSTATUS ext_wglQueryRendererStringWINE( void *args ) { struct wglQueryRendererStringWINE_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->dc ); @@ -24155,6 +24156,7 @@ static NTSTATUS ext_wglSwapIntervalEXT( void *args ) const unixlib_entry_t __wine_unix_call_funcs[] = { &thread_attach, + &process_detach, &wgl_wglCopyContext, &wgl_wglCreateContext, &wgl_wglDeleteContext, @@ -27201,6 +27203,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
typedef ULONG PTR32;
+extern NTSTATUS wow64_process_detach( void *args ) DECLSPEC_HIDDEN; static NTSTATUS wow64_wgl_wglCopyContext( void *args ) { struct @@ -28186,21 +28189,6 @@ static NTSTATUS wow64_gl_glGetPolygonStipple( void *args ) return status; }
-static NTSTATUS wow64_gl_glGetString( void *args ) -{ - struct - { - GLenum name; - PTR32 ret; - } *params32 = args; - struct glGetString_params params = - { - .name = params32->name, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_gl_glGetTexEnvfv( void *args ) { struct @@ -41037,23 +41025,6 @@ static NTSTATUS wow64_ext_glGetSharpenTexFuncSGIS( void *args ) return status; }
-static NTSTATUS wow64_ext_glGetStringi( void *args ) -{ - struct - { - GLenum name; - GLuint index; - PTR32 ret; - } *params32 = args; - struct glGetStringi_params params = - { - .name = params32->name, - .index = params32->index, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glGetSubroutineIndex( void *args ) { struct @@ -60631,34 +60602,6 @@ static NTSTATUS wow64_ext_wglGetCurrentReadDCARB( void *args ) return STATUS_NOT_IMPLEMENTED; }
-static NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) -{ - struct - { - PTR32 hdc; - PTR32 ret; - } *params32 = args; - struct wglGetExtensionsStringARB_params params = - { - .hdc = ULongToPtr(params32->hdc), - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) -{ - struct - { - PTR32 ret; - } *params32 = args; - struct wglGetExtensionsStringEXT_params params = - { - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglGetPixelFormatAttribfvARB( void *args ) { struct @@ -60732,21 +60675,6 @@ static NTSTATUS wow64_ext_wglQueryCurrentRendererIntegerWINE( void *args ) return status; }
-static NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) -{ - struct - { - GLenum attribute; - PTR32 ret; - } *params32 = args; - struct wglQueryCurrentRendererStringWINE_params params = - { - .attribute = params32->attribute, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglQueryPbufferARB( void *args ) { struct @@ -60791,25 +60719,6 @@ static NTSTATUS wow64_ext_wglQueryRendererIntegerWINE( void *args ) return status; }
-static NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) -{ - struct - { - PTR32 dc; - GLint renderer; - GLenum attribute; - PTR32 ret; - } *params32 = args; - struct wglQueryRendererStringWINE_params params = - { - .dc = ULongToPtr(params32->dc), - .renderer = params32->renderer, - .attribute = params32->attribute, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglReleasePbufferDCARB( void *args ) { struct @@ -60890,21 +60799,28 @@ extern NTSTATUS wow64_wgl_wglCreateContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_gl_glGetString( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glClientWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glDeleteSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glFenceSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glGetStringi( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glGetSynciv( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glIsSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) DECLSPEC_HIDDEN;
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { &thread_attach, + &wow64_process_detach, &wow64_wgl_wglCopyContext, &wow64_wgl_wglCreateContext, &wow64_wgl_wglDeleteContext, diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index b53c754be50..4c1533fa55e 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1055,6 +1055,11 @@ NTSTATUS WINAPI thread_attach( void *args ) return STATUS_SUCCESS; }
+NTSTATUS WINAPI process_detach( void *args ) +{ + return STATUS_SUCCESS; +} + #ifdef _WIN64
typedef ULONG PTR32; @@ -1066,6 +1071,47 @@ extern NTSTATUS ext_glGetSynciv( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glIsSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glWaitSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglGetExtensionsStringARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglQueryRendererStringWINE( void *args ) DECLSPEC_HIDDEN; + +struct wow64_string_entry +{ + const char *str; + PTR32 wow64_str; +}; +static struct wow64_string_entry *wow64_strings; +static SIZE_T wow64_strings_count; + +static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) +{ + void *tmp; + SIZE_T i; + + pthread_mutex_lock( &wgl_lock ); + + for (i = 0; i < wow64_strings_count; i++) if (wow64_strings[i].str == str) break; + if (i == wow64_strings_count && (tmp = realloc( wow64_strings, (i + 1) * sizeof(*wow64_strings) ))) + { + wow64_strings = tmp; + wow64_strings[i].str = str; + wow64_strings[i].wow64_str = 0; + wow64_strings_count += 1; + } + + if (i == wow64_strings_count) ERR( "Failed to allocate memory for wow64 strings\n" ); + else if (wow64_strings[i].wow64_str) wow64_str = wow64_strings[i].wow64_str; + else if (wow64_str) + { + strcpy( UlongToPtr(wow64_str), (char *)str ); + wow64_strings[i].wow64_str = wow64_str; + } + + pthread_mutex_unlock( &wgl_lock ); + + return wow64_str; +}
static inline void update_teb32_context(void) { @@ -1234,6 +1280,56 @@ NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) return STATUS_SUCCESS; }
+NTSTATUS wow64_gl_glGetString( void *args ) +{ + struct + { + GLenum name; + PTR32 ret; + } *params32 = args; + struct glGetString_params params = + { + .name = params32->name, + }; + NTSTATUS status; + + if ((status = gl_glGetString( ¶ms ))) return status; + + if (!(params32->ret = find_wow64_string( (char *)params.ret, params32->ret ))) + { + params32->ret = strlen( (char *)params.ret ) + 1; + return STATUS_BUFFER_TOO_SMALL; + } + + return STATUS_SUCCESS; +} + +NTSTATUS wow64_ext_glGetStringi( void *args ) +{ + struct + { + GLenum name; + GLuint index; + PTR32 ret; + } *params32 = args; + struct glGetStringi_params params = + { + .name = params32->name, + .index = params32->index, + }; + NTSTATUS status; + + if ((status = ext_glGetStringi( ¶ms ))) return status; + + if (!(params32->ret = find_wow64_string( (char *)params.ret, params32->ret ))) + { + params32->ret = strlen( (char *)params.ret ) + 1; + return STATUS_BUFFER_TOO_SMALL; + } + + return STATUS_SUCCESS; +} + NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) { struct @@ -1261,6 +1357,104 @@ NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) return status; }
+NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) +{ + struct + { + PTR32 hdc; + PTR32 ret; + } *params32 = args; + struct wglGetExtensionsStringARB_params params = + { + .hdc = ULongToPtr(params32->hdc), + }; + NTSTATUS status; + + if ((status = ext_wglGetExtensionsStringARB( ¶ms ))) return status; + + if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) + { + params32->ret = strlen( params.ret ) + 1; + return STATUS_BUFFER_TOO_SMALL; + } + + return STATUS_SUCCESS; +} + +NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) +{ + struct + { + PTR32 ret; + } *params32 = args; + struct wglGetExtensionsStringEXT_params params = + { + }; + NTSTATUS status; + + if ((status = ext_wglGetExtensionsStringEXT( ¶ms ))) return status; + + if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) + { + params32->ret = strlen( params.ret ) + 1; + return STATUS_BUFFER_TOO_SMALL; + } + + return STATUS_SUCCESS; +} + +NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) +{ + struct + { + GLenum attribute; + PTR32 ret; + } *params32 = args; + struct wglQueryCurrentRendererStringWINE_params params = + { + .attribute = params32->attribute, + }; + NTSTATUS status; + + if ((status = ext_wglQueryCurrentRendererStringWINE( ¶ms ))) return status; + + if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) + { + params32->ret = strlen( params.ret ) + 1; + return STATUS_BUFFER_TOO_SMALL; + } + + return STATUS_SUCCESS; +} + +NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) +{ + struct + { + PTR32 dc; + GLint renderer; + GLenum attribute; + PTR32 ret; + } *params32 = args; + struct wglQueryRendererStringWINE_params params = + { + .dc = ULongToPtr(params32->dc), + .renderer = params32->renderer, + .attribute = params32->attribute, + }; + NTSTATUS status; + + if ((status = ext_wglQueryRendererStringWINE( ¶ms ))) return status; + + if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) + { + params32->ret = strlen( params.ret ) + 1; + return STATUS_BUFFER_TOO_SMALL; + } + + return STATUS_SUCCESS; +} + NTSTATUS wow64_ext_glClientWaitSync( void *args ) { struct wgl_handle *handle; @@ -1446,4 +1640,17 @@ NTSTATUS wow64_ext_glWaitSync( void *args ) return status; }
+NTSTATUS WINAPI wow64_process_detach( void *args ) +{ + NTSTATUS status; + + if ((status = process_detach( NULL ))) return status; + + free( wow64_strings ); + wow64_strings = NULL; + wow64_strings_count = 0; + + return STATUS_SUCCESS; +} + #endif diff --git a/dlls/opengl32/unixlib.h b/dlls/opengl32/unixlib.h index b76858a2e13..e7f21383f86 100644 --- a/dlls/opengl32/unixlib.h +++ b/dlls/opengl32/unixlib.h @@ -22294,6 +22294,7 @@ struct wglSwapIntervalEXT_params enum unix_funcs { unix_thread_attach, + unix_process_detach, unix_wglCopyContext, unix_wglCreateContext, unix_wglDeleteContext, diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 617ea8a54a7..6d433659e99 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -38,10 +38,50 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl); WINE_DECLARE_DEBUG_CHANNEL(fps);
-unixlib_handle_t unixlib_handle; +unixlib_handle_t unixlib_handle = 0;
static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} };
+#ifndef _WIN64 + +static char **wow64_strings; +static SIZE_T wow64_strings_count; + +static CRITICAL_SECTION wow64_cs; +static CRITICAL_SECTION_DEBUG wow64_cs_debug = +{ + 0, 0, &wow64_cs, + { &wow64_cs_debug.ProcessLocksList, &wow64_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": wow64_cs") } +}; +static CRITICAL_SECTION wow64_cs = { &wow64_cs_debug, -1, 0, 0, 0, 0 }; + +static void append_wow64_string( char *str ) +{ + char **tmp; + + EnterCriticalSection( &wow64_cs ); + + if (!(tmp = realloc( wow64_strings, (wow64_strings_count + 1) * sizeof(*wow64_strings) ))) + ERR( "Failed to allocate memory for wow64 strings\n" ); + else + { + wow64_strings = tmp; + wow64_strings[wow64_strings_count] = str; + wow64_strings_count += 1; + } + + LeaveCriticalSection( &wow64_cs ); +} + +static void cleanup_wow64_strings(void) +{ + while (wow64_strings_count--) free( wow64_strings[wow64_strings_count] ); + free( wow64_strings ); +} + +#endif + /*********************************************************************** * wglGetCurrentReadDCARB * @@ -858,6 +898,144 @@ GLint WINAPI glDebugEntry( GLint unknown1, GLint unknown2 ) return 0; }
+const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) +{ + struct glGetStringi_params args = + { + .name = name, + .index = index, + }; + NTSTATUS status; +#ifndef _WIN64 + GLubyte *wow64_str = NULL; +#endif + + TRACE( "name %d, index %d\n", name, index ); + +#ifndef _WIN64 + if (UNIX_CALL( glGetStringi, &args ) == STATUS_BUFFER_TOO_SMALL) args.ret = wow64_str = malloc( (size_t)args.ret ); +#endif + if ((status = UNIX_CALL( glGetStringi, &args ))) WARN( "glGetStringi returned %#lx\n", status ); +#ifndef _WIN64 + if (args.ret != wow64_str) free( wow64_str ); + else if (args.ret) append_wow64_string( (char *)args.ret ); +#endif + return args.ret; +} + +/*********************************************************************** + * glGetString (OPENGL32.@) + */ +const GLubyte * WINAPI glGetString( GLenum name ) +{ + struct glGetString_params args = { .name = name, }; + NTSTATUS status; +#ifndef _WIN64 + GLubyte *wow64_str = NULL; +#endif + + TRACE( "name %d\n", name ); + +#ifndef _WIN64 + if (UNIX_CALL( glGetString, &args ) == STATUS_BUFFER_TOO_SMALL) args.ret = wow64_str = malloc( (size_t)args.ret ); +#endif + if ((status = UNIX_CALL( glGetString, &args ))) WARN( "glGetString returned %#lx\n", status ); +#ifndef _WIN64 + if (args.ret != wow64_str) free( wow64_str ); + else if (args.ret) append_wow64_string( (char *)args.ret ); +#endif + return args.ret; +} + +const char * WINAPI wglGetExtensionsStringARB( HDC hdc ) +{ + struct wglGetExtensionsStringARB_params args = { .hdc = hdc, }; + NTSTATUS status; +#ifndef _WIN64 + char *wow64_str = NULL; +#endif + + TRACE( "hdc %p\n", hdc ); + +#ifndef _WIN64 + if (UNIX_CALL( wglGetExtensionsStringARB, &args ) == STATUS_BUFFER_TOO_SMALL) args.ret = wow64_str = malloc( (size_t)args.ret ); +#endif + if ((status = UNIX_CALL( wglGetExtensionsStringARB, &args ))) WARN( "wglGetExtensionsStringARB returned %#lx\n", status ); +#ifndef _WIN64 + if (args.ret != wow64_str) free( wow64_str ); + else if (args.ret) append_wow64_string( wow64_str ); +#endif + return args.ret; +} + +const char * WINAPI wglGetExtensionsStringEXT(void) +{ + struct wglGetExtensionsStringEXT_params args = {0}; + NTSTATUS status; +#ifndef _WIN64 + char *wow64_str = NULL; +#endif + + TRACE( "\n" ); + +#ifndef _WIN64 + if (UNIX_CALL( wglGetExtensionsStringEXT, &args ) == STATUS_BUFFER_TOO_SMALL) args.ret = wow64_str = malloc( (size_t)args.ret ); +#endif + if ((status = UNIX_CALL( wglGetExtensionsStringEXT, &args ))) WARN( "wglGetExtensionsStringEXT returned %#lx\n", status ); +#ifndef _WIN64 + if (args.ret != wow64_str) free( wow64_str ); + else if (args.ret) append_wow64_string( wow64_str ); +#endif + return args.ret; +} + +const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute ) +{ + struct wglQueryCurrentRendererStringWINE_params args = { .attribute = attribute, }; + NTSTATUS status; +#ifndef _WIN64 + char *wow64_str = NULL; +#endif + + TRACE( "attribute %d\n", attribute ); + +#ifndef _WIN64 + if (UNIX_CALL( wglQueryCurrentRendererStringWINE, &args ) == STATUS_BUFFER_TOO_SMALL) args.ret = wow64_str = malloc( (size_t)args.ret ); +#endif + if ((status = UNIX_CALL( wglQueryCurrentRendererStringWINE, &args ))) WARN( "wglQueryCurrentRendererStringWINE returned %#lx\n", status ); +#ifndef _WIN64 + if (args.ret != wow64_str) free( wow64_str ); + else if (args.ret) append_wow64_string( wow64_str ); +#endif + return args.ret; +} + +const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ) +{ + struct wglQueryRendererStringWINE_params args = + { + .dc = dc, + .renderer = renderer, + .attribute = attribute, + }; + NTSTATUS status; +#ifndef _WIN64 + char *wow64_str = NULL; +#endif + + TRACE( "dc %p, renderer %d, attribute %d\n", dc, renderer, attribute ); + +#ifndef _WIN64 + if (UNIX_CALL( wglQueryCurrentRendererStringWINE, &args ) == STATUS_BUFFER_TOO_SMALL) args.ret = wow64_str = malloc( (size_t)args.ret ); +#endif + if ((status = UNIX_CALL( wglQueryRendererStringWINE, &args ))) WARN( "wglQueryRendererStringWINE returned %#lx\n", status ); +#ifndef _WIN64 + if (args.ret != wow64_str) free( wow64_str ); + else if (args.ret) append_wow64_string( wow64_str ); +#endif + return args.ret; +} + static BOOL WINAPI call_opengl_debug_message_callback( struct wine_gl_debug_message_params *params, ULONG size ) { params->user_callback( params->source, params->type, params->id, params->severity, @@ -893,6 +1071,18 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) return FALSE; } break; + + case DLL_PROCESS_DETACH: + if (!unixlib_handle) return TRUE; + if ((status = UNIX_CALL( process_detach, NULL ))) + { + WARN( "Failed to detach opengl32 unixlib, status %#lx\n", status ); + return FALSE; + } +#ifndef _WIN64 + cleanup_wow64_strings(); +#endif + return TRUE; } return TRUE; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 11 ++++ dlls/opengl32/thunks.c | 110 ++++------------------------------ dlls/opengl32/wgl.c | 123 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 99 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 861fd104c08..7bfe0f219a2 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -164,6 +164,17 @@ my %manual_win_thunks = ( "glGetString" => 1, "glGetStringi" => 1, + "glMapBuffer" => 1, + "glMapBufferARB" => 1, + "glMapBufferRange" => 1, + "glMapNamedBuffer" => 1, + "glMapNamedBufferEXT" => 1, + "glMapNamedBufferRange" => 1, + "glMapNamedBufferRangeEXT" => 1, + "glUnmapBuffer" => 1, + "glUnmapBufferARB" => 1, + "glUnmapNamedBuffer" => 1, + "glUnmapNamedBufferEXT" => 1, "wglGetCurrentReadDCARB" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index 3f9c68f4f6f..bf1e961e53c 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -12147,33 +12147,6 @@ static void WINAPI glMap2xOES( GLenum target, GLfixed u1, GLfixed u2, GLint ustr if ((status = UNIX_CALL( glMap2xOES, &args ))) WARN( "glMap2xOES returned %#lx\n", status ); }
-static void * WINAPI glMapBuffer( GLenum target, GLenum access ) -{ - struct glMapBuffer_params args = { .target = target, .access = access, }; - NTSTATUS status; - TRACE( "target %d, access %d\n", target, access ); - if ((status = UNIX_CALL( glMapBuffer, &args ))) WARN( "glMapBuffer returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapBufferARB( GLenum target, GLenum access ) -{ - struct glMapBufferARB_params args = { .target = target, .access = access, }; - NTSTATUS status; - TRACE( "target %d, access %d\n", target, access ); - if ((status = UNIX_CALL( glMapBufferARB, &args ))) WARN( "glMapBufferARB returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) -{ - struct glMapBufferRange_params args = { .target = target, .offset = offset, .length = length, .access = access, }; - NTSTATUS status; - TRACE( "target %d, offset %Id, length %Id, access %d\n", target, offset, length, access ); - if ((status = UNIX_CALL( glMapBufferRange, &args ))) WARN( "glMapBufferRange returned %#lx\n", status ); - return args.ret; -} - static void WINAPI glMapControlPointsNV( GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points ) { struct glMapControlPointsNV_params args = { .target = target, .index = index, .type = type, .ustride = ustride, .vstride = vstride, .uorder = uorder, .vorder = vorder, .packed = packed, .points = points, }; @@ -12198,42 +12171,6 @@ static void WINAPI glMapGrid2xOES( GLint n, GLfixed u1, GLfixed u2, GLfixed v1, if ((status = UNIX_CALL( glMapGrid2xOES, &args ))) WARN( "glMapGrid2xOES returned %#lx\n", status ); }
-static void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) -{ - struct glMapNamedBuffer_params args = { .buffer = buffer, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, access %d\n", buffer, access ); - if ((status = UNIX_CALL( glMapNamedBuffer, &args ))) WARN( "glMapNamedBuffer returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ) -{ - struct glMapNamedBufferEXT_params args = { .buffer = buffer, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, access %d\n", buffer, access ); - if ((status = UNIX_CALL( glMapNamedBufferEXT, &args ))) WARN( "glMapNamedBufferEXT returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) -{ - struct glMapNamedBufferRange_params args = { .buffer = buffer, .offset = offset, .length = length, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access ); - if ((status = UNIX_CALL( glMapNamedBufferRange, &args ))) WARN( "glMapNamedBufferRange returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) -{ - struct glMapNamedBufferRangeEXT_params args = { .buffer = buffer, .offset = offset, .length = length, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access ); - if ((status = UNIX_CALL( glMapNamedBufferRangeEXT, &args ))) WARN( "glMapNamedBufferRangeEXT returned %#lx\n", status ); - return args.ret; -} - static void * WINAPI glMapObjectBufferATI( GLuint buffer ) { struct glMapObjectBufferATI_params args = { .buffer = buffer, }; @@ -20733,42 +20670,6 @@ static void WINAPI glUnlockArraysEXT(void) if ((status = UNIX_CALL( glUnlockArraysEXT, &args ))) WARN( "glUnlockArraysEXT returned %#lx\n", status ); }
-static GLboolean WINAPI glUnmapBuffer( GLenum target ) -{ - struct glUnmapBuffer_params args = { .target = target, }; - NTSTATUS status; - TRACE( "target %d\n", target ); - if ((status = UNIX_CALL( glUnmapBuffer, &args ))) WARN( "glUnmapBuffer returned %#lx\n", status ); - return args.ret; -} - -static GLboolean WINAPI glUnmapBufferARB( GLenum target ) -{ - struct glUnmapBufferARB_params args = { .target = target, }; - NTSTATUS status; - TRACE( "target %d\n", target ); - if ((status = UNIX_CALL( glUnmapBufferARB, &args ))) WARN( "glUnmapBufferARB returned %#lx\n", status ); - return args.ret; -} - -static GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) -{ - struct glUnmapNamedBuffer_params args = { .buffer = buffer, }; - NTSTATUS status; - TRACE( "buffer %d\n", buffer ); - if ((status = UNIX_CALL( glUnmapNamedBuffer, &args ))) WARN( "glUnmapNamedBuffer returned %#lx\n", status ); - return args.ret; -} - -static GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) -{ - struct glUnmapNamedBufferEXT_params args = { .buffer = buffer, }; - NTSTATUS status; - TRACE( "buffer %d\n", buffer ); - if ((status = UNIX_CALL( glUnmapNamedBufferEXT, &args ))) WARN( "glUnmapNamedBufferEXT returned %#lx\n", status ); - return args.ret; -} - static void WINAPI glUnmapObjectBufferATI( GLuint buffer ) { struct glUnmapObjectBufferATI_params args = { .buffer = buffer, }; @@ -24434,6 +24335,17 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) }
extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapBuffer( GLenum target, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapBufferARB( GLenum target, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapBuffer( GLenum target ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapBufferARB( GLenum target ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) DECLSPEC_HIDDEN; extern HDC WINAPI wglGetCurrentReadDCARB(void) DECLSPEC_HIDDEN; extern const char * WINAPI wglGetExtensionsStringARB( HDC hdc ) DECLSPEC_HIDDEN; extern const char * WINAPI wglGetExtensionsStringEXT(void) DECLSPEC_HIDDEN; diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 6d433659e99..ff9e6164c89 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1036,6 +1036,129 @@ const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum return args.ret; }
+void * WINAPI glMapBuffer( GLenum target, GLenum access ) +{ + struct glMapBuffer_params args = + { + .target = target, + .access = access, + }; + NTSTATUS status; + + TRACE( "target %d, access %d\n", target, access ); + + if (!(status = UNIX_CALL( glMapBuffer, &args ))) return args.ret; + WARN( "glMapBuffer returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapBufferARB( GLenum target, GLenum access ) +{ + return glMapBuffer( target, access ); +} + +void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) +{ + struct glMapBufferRange_params args = + { + .target = target, + .offset = offset, + .length = length, + .access = access, + }; + NTSTATUS status; + + TRACE( "target %d, offset %Id, length %Id, access %d\n", target, offset, length, access ); + + if (!(status = UNIX_CALL( glMapBufferRange, &args ))) return args.ret; + WARN( "glMapBufferRange returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) +{ + struct glMapNamedBuffer_params args = + { + .buffer = buffer, + .access = access, + }; + NTSTATUS status; + + TRACE( "(%d, %d)\n", buffer, access ); + + if (!(status = UNIX_CALL( glMapNamedBuffer, &args ))) return args.ret; + WARN( "glMapNamedBuffer returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ) +{ + return glMapNamedBuffer( buffer, access ); +} + +void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) +{ + struct glMapNamedBufferRange_params args = + { + .buffer = buffer, + .offset = offset, + .length = length, + .access = access, + }; + NTSTATUS status; + + TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access ); + + if (!(status = UNIX_CALL( glMapNamedBufferRange, &args ))) return args.ret; + WARN( "glMapNamedBufferRange returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) +{ + return glMapNamedBufferRange( buffer, offset, length, access ); +} + +GLboolean WINAPI glUnmapBuffer( GLenum target ) +{ + struct glUnmapBuffer_params args = + { + .target = target, + }; + NTSTATUS status; + + TRACE( "target %d\n", target ); + + if (!(status = UNIX_CALL( glUnmapBuffer, &args ))) return args.ret; + WARN( "glUnmapBuffer returned %#lx\n", status ); + return args.ret; +} + +GLboolean WINAPI glUnmapBufferARB( GLenum target ) +{ + return glUnmapBuffer( target ); +} + +GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) +{ + struct glUnmapNamedBuffer_params args = + { + .buffer = buffer, + }; + NTSTATUS status; + + TRACE( "buffer %d\n", buffer ); + + if (!(status = UNIX_CALL( glUnmapNamedBuffer, &args ))) return args.ret; + WARN( "glUnmapNamedBuffer returned %#lx\n", status ); + return args.ret; +} + +GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) +{ + return glUnmapNamedBuffer( buffer ); +} + static BOOL WINAPI call_opengl_debug_message_callback( struct wine_gl_debug_message_params *params, ULONG size ) { params->user_callback( params->source, params->type, params->id, params->severity,
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 15 ++ dlls/opengl32/unix_thunks.c | 252 ++++---------------------- dlls/opengl32/unix_wgl.c | 346 ++++++++++++++++++++++++++++++++++++ dlls/opengl32/wgl.c | 79 ++++++++ 4 files changed, 474 insertions(+), 218 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 7bfe0f219a2..43199f56981 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -189,11 +189,26 @@ my %manual_wow64_thunks = "glClientWaitSync" => 1, "glDeleteSync" => 1, "glFenceSync" => 1, + "glGetBufferPointerv" => 1, + "glGetBufferPointervARB" => 1, + "glGetNamedBufferPointerv" => 1, + "glGetNamedBufferPointervEXT" => 1, "glGetString" => 1, "glGetStringi" => 1, "glGetSynciv" => 1, "glIsSync" => 1, + "glMapBuffer" => 1, + "glMapBufferARB" => 1, + "glMapBufferRange" => 1, + "glMapNamedBuffer" => 1, + "glMapNamedBufferEXT" => 1, + "glMapNamedBufferRange" => 1, + "glMapNamedBufferRangeEXT" => 1, "glPathGlyphIndexRangeNV" => 1, + "glUnmapBuffer" => 1, + "glUnmapBufferARB" => 1, + "glUnmapNamedBuffer" => 1, + "glUnmapNamedBufferEXT" => 1, "glWaitSync" => 1, "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index ea8d7910450..1ba8fc3bf2f 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -7748,7 +7748,7 @@ static NTSTATUS ext_glGetBufferParameterui64vNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glGetBufferPointerv( void *args ) +NTSTATUS ext_glGetBufferPointerv( void *args ) { struct glGetBufferPointerv_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -7756,7 +7756,7 @@ static NTSTATUS ext_glGetBufferPointerv( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glGetBufferPointervARB( void *args ) +NTSTATUS ext_glGetBufferPointervARB( void *args ) { struct glGetBufferPointervARB_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -8796,7 +8796,7 @@ static NTSTATUS ext_glGetNamedBufferParameterui64vNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glGetNamedBufferPointerv( void *args ) +NTSTATUS ext_glGetNamedBufferPointerv( void *args ) { struct glGetNamedBufferPointerv_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -8804,7 +8804,7 @@ static NTSTATUS ext_glGetNamedBufferPointerv( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glGetNamedBufferPointervEXT( void *args ) +NTSTATUS ext_glGetNamedBufferPointervEXT( void *args ) { struct glGetNamedBufferPointervEXT_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -11971,7 +11971,7 @@ static NTSTATUS ext_glMap2xOES( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapBuffer( void *args ) +NTSTATUS ext_glMapBuffer( void *args ) { struct glMapBuffer_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -11979,7 +11979,7 @@ static NTSTATUS ext_glMapBuffer( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapBufferARB( void *args ) +NTSTATUS ext_glMapBufferARB( void *args ) { struct glMapBufferARB_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -11987,7 +11987,7 @@ static NTSTATUS ext_glMapBufferARB( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapBufferRange( void *args ) +NTSTATUS ext_glMapBufferRange( void *args ) { struct glMapBufferRange_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -12019,7 +12019,7 @@ static NTSTATUS ext_glMapGrid2xOES( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapNamedBuffer( void *args ) +NTSTATUS ext_glMapNamedBuffer( void *args ) { struct glMapNamedBuffer_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -12027,7 +12027,7 @@ static NTSTATUS ext_glMapNamedBuffer( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapNamedBufferEXT( void *args ) +NTSTATUS ext_glMapNamedBufferEXT( void *args ) { struct glMapNamedBufferEXT_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -12035,7 +12035,7 @@ static NTSTATUS ext_glMapNamedBufferEXT( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapNamedBufferRange( void *args ) +NTSTATUS ext_glMapNamedBufferRange( void *args ) { struct glMapNamedBufferRange_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -12043,7 +12043,7 @@ static NTSTATUS ext_glMapNamedBufferRange( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glMapNamedBufferRangeEXT( void *args ) +NTSTATUS ext_glMapNamedBufferRangeEXT( void *args ) { struct glMapNamedBufferRangeEXT_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -20515,7 +20515,7 @@ static NTSTATUS ext_glUnlockArraysEXT( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glUnmapBuffer( void *args ) +NTSTATUS ext_glUnmapBuffer( void *args ) { struct glUnmapBuffer_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -20523,7 +20523,7 @@ static NTSTATUS ext_glUnmapBuffer( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glUnmapBufferARB( void *args ) +NTSTATUS ext_glUnmapBufferARB( void *args ) { struct glUnmapBufferARB_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -20531,7 +20531,7 @@ static NTSTATUS ext_glUnmapBufferARB( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glUnmapNamedBuffer( void *args ) +NTSTATUS ext_glUnmapNamedBuffer( void *args ) { struct glUnmapNamedBuffer_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -20539,7 +20539,7 @@ static NTSTATUS ext_glUnmapNamedBuffer( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glUnmapNamedBufferEXT( void *args ) +NTSTATUS ext_glUnmapNamedBufferEXT( void *args ) { struct glUnmapNamedBufferEXT_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -36058,40 +36058,6 @@ static NTSTATUS wow64_ext_glGetBufferParameterui64vNV( void *args ) return status; }
-static NTSTATUS wow64_ext_glGetBufferPointerv( void *args ) -{ - struct - { - GLenum target; - GLenum pname; - PTR32 params; - } *params32 = args; - struct glGetBufferPointerv_params params = - { - .target = params32->target, - .pname = params32->pname, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glGetBufferPointervARB( void *args ) -{ - struct - { - GLenum target; - GLenum pname; - PTR32 params; - } *params32 = args; - struct glGetBufferPointervARB_params params = - { - .target = params32->target, - .pname = params32->pname, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glGetBufferSubData( void *args ) { struct @@ -38539,40 +38505,6 @@ static NTSTATUS wow64_ext_glGetNamedBufferParameterui64vNV( void *args ) return status; }
-static NTSTATUS wow64_ext_glGetNamedBufferPointerv( void *args ) -{ - struct - { - GLuint buffer; - GLenum pname; - PTR32 params; - } *params32 = args; - struct glGetNamedBufferPointerv_params params = - { - .buffer = params32->buffer, - .pname = params32->pname, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glGetNamedBufferPointervEXT( void *args ) -{ - struct - { - GLuint buffer; - GLenum pname; - PTR32 params; - } *params32 = args; - struct glGetNamedBufferPointervEXT_params params = - { - .buffer = params32->buffer, - .pname = params32->pname, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glGetNamedBufferSubData( void *args ) { struct @@ -44486,61 +44418,6 @@ static NTSTATUS wow64_ext_glMTexCoord2fvSGIS( void *args ) return status; }
-static NTSTATUS wow64_ext_glMapBuffer( void *args ) -{ - struct - { - GLenum target; - GLenum access; - PTR32 ret; - } *params32 = args; - struct glMapBuffer_params params = - { - .target = params32->target, - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glMapBufferARB( void *args ) -{ - struct - { - GLenum target; - GLenum access; - PTR32 ret; - } *params32 = args; - struct glMapBufferARB_params params = - { - .target = params32->target, - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glMapBufferRange( void *args ) -{ - struct - { - GLenum target; - PTR32 offset; - PTR32 length; - GLbitfield access; - PTR32 ret; - } *params32 = args; - struct glMapBufferRange_params params = - { - .target = params32->target, - .offset = (GLintptr)ULongToPtr(params32->offset), - .length = (GLsizeiptr)ULongToPtr(params32->length), - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glMapControlPointsNV( void *args ) { struct @@ -44572,82 +44449,6 @@ static NTSTATUS wow64_ext_glMapControlPointsNV( void *args ) return status; }
-static NTSTATUS wow64_ext_glMapNamedBuffer( void *args ) -{ - struct - { - GLuint buffer; - GLenum access; - PTR32 ret; - } *params32 = args; - struct glMapNamedBuffer_params params = - { - .buffer = params32->buffer, - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glMapNamedBufferEXT( void *args ) -{ - struct - { - GLuint buffer; - GLenum access; - PTR32 ret; - } *params32 = args; - struct glMapNamedBufferEXT_params params = - { - .buffer = params32->buffer, - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glMapNamedBufferRange( void *args ) -{ - struct - { - GLuint buffer; - PTR32 offset; - PTR32 length; - GLbitfield access; - PTR32 ret; - } *params32 = args; - struct glMapNamedBufferRange_params params = - { - .buffer = params32->buffer, - .offset = (GLintptr)ULongToPtr(params32->offset), - .length = (GLsizeiptr)ULongToPtr(params32->length), - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - -static NTSTATUS wow64_ext_glMapNamedBufferRangeEXT( void *args ) -{ - struct - { - GLuint buffer; - PTR32 offset; - PTR32 length; - GLbitfield access; - PTR32 ret; - } *params32 = args; - struct glMapNamedBufferRangeEXT_params params = - { - .buffer = params32->buffer, - .offset = (GLintptr)ULongToPtr(params32->offset), - .length = (GLsizeiptr)ULongToPtr(params32->length), - .access = params32->access, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glMapObjectBufferATI( void *args ) { struct @@ -60803,10 +60604,25 @@ extern NTSTATUS wow64_gl_glGetString( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glClientWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glDeleteSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glFenceSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glGetBufferPointerv( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glGetBufferPointervARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glGetNamedBufferPointerv( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glGetNamedBufferPointervEXT( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glGetStringi( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glGetSynciv( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glIsSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapBufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapBufferRange( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapNamedBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapNamedBufferEXT( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapNamedBufferRange( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glMapNamedBufferRangeEXT( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glUnmapBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glUnmapBufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glUnmapNamedBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) DECLSPEC_HIDDEN; @@ -63397,10 +63213,10 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = &ext_glUniformui64NV, &wow64_ext_glUniformui64vNV, &ext_glUnlockArraysEXT, - &ext_glUnmapBuffer, - &ext_glUnmapBufferARB, - &ext_glUnmapNamedBuffer, - &ext_glUnmapNamedBufferEXT, + &wow64_ext_glUnmapBuffer, + &wow64_ext_glUnmapBufferARB, + &wow64_ext_glUnmapNamedBuffer, + &wow64_ext_glUnmapNamedBufferEXT, &ext_glUnmapObjectBufferATI, &ext_glUnmapTexture2DINTEL, &wow64_ext_glUpdateObjectBufferATI, diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 4c1533fa55e..cc3c6a47e1d 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1067,8 +1067,25 @@ typedef ULONG PTR32; extern NTSTATUS ext_glClientWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glDeleteSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glFenceSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glGetBufferPointerv( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glGetBufferPointervARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glGetNamedBufferPointerv( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glGetNamedBufferPointervEXT( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glGetSynciv( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glIsSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glMapBuffer( void *args ) DECLSPEC_HIDDEN; + +extern NTSTATUS ext_glUnmapBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glUnmapBufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glUnmapNamedBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ) DECLSPEC_HIDDEN; + +extern NTSTATUS ext_glMapBufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glMapBufferRange( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glMapNamedBuffer( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glMapNamedBufferEXT( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glMapNamedBufferRange( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glMapNamedBufferRangeEXT( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_wglGetExtensionsStringARB( void *args ) DECLSPEC_HIDDEN; @@ -1640,6 +1657,335 @@ NTSTATUS wow64_ext_glWaitSync( void *args ) return status; }
+static GLint get_buffer_param( GLenum target, GLenum param ) +{ + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + typeof(*funcs->ext.p_glGetBufferParameteriv) *func; + GLint size = 0; + if (!(func = funcs->ext.p_glGetBufferParameteriv)) func = (void *)funcs->wgl.p_wglGetProcAddress( "glGetBufferParameteriv" ); + if (func) func( target, param, &size ); + return size; +} + +static void *get_buffer_pointer( GLenum target ) +{ + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + typeof(*funcs->ext.p_glGetBufferPointerv) *func; + void *ptr = NULL; + if (!(func = funcs->ext.p_glGetBufferPointerv)) func = (void *)funcs->wgl.p_wglGetProcAddress( "glGetBufferPointerv" ); + if (func) func( target, GL_BUFFER_MAP_POINTER, &ptr ); + return ptr; +} + +static GLint get_named_buffer_param( GLint buffer, GLenum param ) +{ + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + typeof(*funcs->ext.p_glGetNamedBufferParameteriv) *func; + GLint size = 0; + if (!(func = funcs->ext.p_glGetNamedBufferParameteriv)) func = (void *)funcs->wgl.p_wglGetProcAddress( "glGetNamedBufferParameteriv" ); + if (func) func( buffer, param, &size ); + return size; +} + +static void *get_named_buffer_pointer( GLint buffer ) +{ + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + typeof(*funcs->ext.p_glGetNamedBufferPointerv) *func; + void *ptr = NULL; + if (!(func = funcs->ext.p_glGetNamedBufferPointerv)) func = (void *)funcs->wgl.p_wglGetProcAddress( "glGetNamedBufferPointerv" ); + if (func) func( buffer, GL_BUFFER_MAP_POINTER, &ptr ); + return ptr; +} + +static NTSTATUS wow64_map_buffer( GLint buffer, GLenum target, void *ptr, SIZE_T size, GLbitfield access, PTR32 *ret ) +{ + if (*ret) /* wow64 pointer provided, map buffer to it */ + { + if (access & GL_MAP_READ_BIT) + { + TRACE( "Copying %#zx from buffer at %p to wow64 buffer %p\n", size, ptr, UlongToPtr(*ret) ); + memcpy( UlongToPtr(*ret), ptr, size ); + } + + /* save the wow64 pointer in the buffer data, we'll overwrite it on unmap */ + *(PTR32 *)ptr = (UINT_PTR)*ret; + return STATUS_SUCCESS; + } + + if (ULongToPtr(*ret = PtrToUlong(ptr)) == ptr) return STATUS_SUCCESS; /* we're lucky */ + if (access & GL_MAP_PERSISTENT_BIT) + { + FIXME( "GL_MAP_PERSISTENT_BIT not supported!\n" ); + return STATUS_NOT_SUPPORTED; + } + + if (!size) size = buffer ? get_named_buffer_param( buffer, GL_BUFFER_SIZE ) : get_buffer_param( target, GL_BUFFER_SIZE ); + if ((PTR32)size != size) return STATUS_NO_MEMORY; /* overflow */ + if (size < sizeof(PTR32)) + { + FIXME( "Buffer too small for metadata!\n" ); + return STATUS_BUFFER_TOO_SMALL; + } + + *ret = size; + return STATUS_INVALID_ADDRESS; +} + +static NTSTATUS wow64_unmap_buffer( void *ptr, SIZE_T size, GLbitfield access ) +{ + void *wow_ptr; + + if (ULongToPtr(PtrToUlong(ptr)) == ptr) return STATUS_SUCCESS; /* we're lucky */ + + wow_ptr = UlongToPtr(*(PTR32 *)ptr); + if (access & GL_MAP_WRITE_BIT) + { + TRACE( "Copying %#zx from wow64 buffer %p to buffer %p\n", size, wow_ptr, ptr ); + memcpy( ptr, wow_ptr, size ); + } + + return STATUS_INVALID_ADDRESS; +} + +NTSTATUS wow64_ext_glGetBufferPointerv( void *args ) +{ + PTR32 *ptr; /* pointer to the buffer data, where we saved the wow64 pointer */ + struct + { + GLenum target; + GLenum pname; + PTR32 params; + } *params32 = args; + struct glGetBufferPointerv_params params = + { + .target = params32->target, + .pname = params32->pname, + .params = (void **)&ptr, + }; + PTR32 *wow_ptr = UlongToPtr(params32->params); + NTSTATUS status; + + if ((status = ext_glGetBufferPointerv( ¶ms ))) return status; + if (params.pname != GL_BUFFER_MAP_POINTER) return STATUS_NOT_IMPLEMENTED; + if (ULongToPtr(*wow_ptr = PtrToUlong(ptr)) == ptr) return STATUS_SUCCESS; /* we're lucky */ + *wow_ptr = ptr[0]; + return STATUS_SUCCESS; +} + +NTSTATUS wow64_ext_glGetBufferPointervARB( void *args ) +{ + return wow64_ext_glGetBufferPointerv( args ); +} + +NTSTATUS wow64_ext_glGetNamedBufferPointerv( void *args ) +{ + PTR32 *ptr; /* pointer to the buffer data, where we saved the wow64 pointer */ + struct + { + GLuint buffer; + GLenum pname; + PTR32 params; + } *params32 = args; + struct glGetNamedBufferPointerv_params params = + { + .buffer = params32->buffer, + .pname = params32->pname, + .params = (void **)&ptr, + }; + PTR32 *wow_ptr = UlongToPtr(params32->params); + NTSTATUS status; + + if ((status = ext_glGetNamedBufferPointerv( ¶ms ))) return status; + if (params.pname != GL_BUFFER_MAP_POINTER) return STATUS_NOT_IMPLEMENTED; + if (ULongToPtr(*wow_ptr = PtrToUlong(ptr)) == ptr) return STATUS_SUCCESS; /* we're lucky */ + *wow_ptr = ptr[0]; + return STATUS_SUCCESS; +} + +NTSTATUS wow64_ext_glGetNamedBufferPointervEXT( void *args ) +{ + return wow64_ext_glGetNamedBufferPointerv( args ); +} + +NTSTATUS wow64_ext_glMapBuffer( void *args ) +{ + struct + { + GLenum target; + GLenum access; + PTR32 ret; + } *params32 = args; + struct glMapBuffer_params params = + { + .target = params32->target, + .access = params32->access, + }; + struct glUnmapBuffer_params unmap_params = { .target = params.target }; + NTSTATUS status; + + /* already mapped, we're being called again with a wow64 pointer */ + if (params32->ret) params.ret = get_buffer_pointer( params.target ); + else if ((status = ext_glMapBuffer( ¶ms ))) return status; + + status = wow64_map_buffer( 0, params.target, params.ret, 0, params.access, ¶ms32->ret ); + if (!status || status == STATUS_INVALID_ADDRESS) return status; + + ext_glUnmapBuffer( &unmap_params ); + return status; +} + +NTSTATUS wow64_ext_glMapBufferARB( void *args ) +{ + return wow64_ext_glMapBuffer( args ); +} + +NTSTATUS wow64_ext_glMapBufferRange( void *args ) +{ + struct + { + GLenum target; + PTR32 offset; + PTR32 length; + GLbitfield access; + PTR32 ret; + } *params32 = args; + struct glMapBufferRange_params params = + { + .target = params32->target, + .offset = (GLintptr)ULongToPtr(params32->offset), + .length = (GLsizeiptr)ULongToPtr(params32->length), + .access = params32->access, + }; + struct glUnmapBuffer_params unmap_params = { .target = params.target }; + NTSTATUS status; + + /* already mapped, we're being called again with a wow64 pointer */ + if (params32->ret) params.ret = (char *)get_buffer_pointer( params.target ); + else if ((status = ext_glMapBufferRange( ¶ms ))) return status; + + status = wow64_map_buffer( 0, params.target, params.ret, params.length, params.access, ¶ms32->ret ); + if (!status || status == STATUS_INVALID_ADDRESS) return status; + + ext_glUnmapBuffer( &unmap_params ); + return status; +} + +NTSTATUS wow64_ext_glMapNamedBuffer( void *args ) +{ + struct + { + GLuint buffer; + GLenum access; + PTR32 ret; + } *params32 = args; + struct glMapNamedBuffer_params params = + { + .buffer = params32->buffer, + .access = params32->access, + }; + struct glUnmapNamedBuffer_params unmap_params = { .buffer = params.buffer }; + NTSTATUS status; + + /* already mapped, we're being called again with a wow64 pointer */ + if (params32->ret) params.ret = get_named_buffer_pointer( params.buffer ); + else if ((status = ext_glMapNamedBuffer( ¶ms ))) return status; + + status = wow64_map_buffer( params.buffer, 0, params.ret, 0, params.access, ¶ms32->ret ); + if (!status || status == STATUS_INVALID_ADDRESS) return status; + + ext_glUnmapNamedBuffer( &unmap_params ); + return status; +} + +NTSTATUS wow64_ext_glMapNamedBufferEXT( void *args ) +{ + return wow64_ext_glMapNamedBuffer( args ); +} + +NTSTATUS wow64_ext_glMapNamedBufferRange( void *args ) +{ + struct + { + GLuint buffer; + PTR32 offset; + PTR32 length; + GLbitfield access; + PTR32 ret; + } *params32 = args; + struct glMapNamedBufferRange_params params = + { + .buffer = params32->buffer, + .offset = (GLintptr)ULongToPtr(params32->offset), + .length = (GLsizeiptr)ULongToPtr(params32->length), + .access = params32->access, + }; + struct glUnmapNamedBuffer_params unmap_params = { .buffer = params.buffer }; + NTSTATUS status; + + /* already mapped, we're being called again with a wow64 pointer */ + if (params32->ret) params.ret = get_named_buffer_pointer( params.buffer ); + else if ((status = ext_glMapNamedBufferRange( ¶ms ))) return status; + + status = wow64_map_buffer( params.buffer, 0, params.ret, params.length, params.access, ¶ms32->ret ); + if (!status || status == STATUS_INVALID_ADDRESS) return status; + + ext_glUnmapNamedBuffer( &unmap_params ); + return status; +} + +NTSTATUS wow64_ext_glMapNamedBufferRangeEXT( void *args ) +{ + return wow64_ext_glMapNamedBufferRange( args ); +} + +NTSTATUS wow64_ext_glUnmapBuffer( void *args ) +{ + PTR32 *ptr; + struct + { + GLenum target; + GLboolean ret; + } *params32 = args; + NTSTATUS status; + + if (!(ptr = get_buffer_pointer( params32->target ))) return STATUS_SUCCESS; + + status = wow64_unmap_buffer( ptr, get_buffer_param( params32->target, GL_BUFFER_MAP_LENGTH ), + get_buffer_param( params32->target, GL_BUFFER_ACCESS_FLAGS ) ); + ext_glUnmapBuffer( args ); + + return status; +} + +NTSTATUS wow64_ext_glUnmapBufferARB( void *args ) +{ + return wow64_ext_glUnmapBuffer( args ); +} + +NTSTATUS wow64_ext_glUnmapNamedBuffer( void *args ) +{ + PTR32 *ptr; + struct + { + GLint buffer; + GLboolean ret; + } *params32 = args; + NTSTATUS status; + + if (!(ptr = get_named_buffer_pointer( params32->buffer ))) return STATUS_SUCCESS; + + status = wow64_unmap_buffer( ptr, get_named_buffer_param( params32->buffer, GL_BUFFER_MAP_LENGTH ), + get_named_buffer_param( params32->buffer, GL_BUFFER_ACCESS_FLAGS ) ); + ext_glUnmapNamedBuffer( args ); + + return status; +} + +NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ) +{ + return wow64_ext_glUnmapNamedBuffer( args ); +} + NTSTATUS WINAPI wow64_process_detach( void *args ) { NTSTATUS status; diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index ff9e6164c89..2ffdc20c057 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -28,6 +28,7 @@ #include "winbase.h" #include "winreg.h" #include "ntuser.h" +#include "malloc.h"
#include "unixlib.h" #include "private.h" @@ -1036,6 +1037,26 @@ const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum return args.ret; }
+#ifndef _WIN64 +static void *get_buffer_pointer( GLenum target ) +{ + void (WINAPI *p_glGetBufferPointerv)( GLenum target, GLenum pname, void **params ); + void *ptr; + if (!(p_glGetBufferPointerv = (void *)wglGetProcAddress( "glGetBufferPointerv" ))) return 0; + p_glGetBufferPointerv( target, GL_BUFFER_MAP_POINTER, &ptr ); + return ptr; +} + +static void *get_named_buffer_pointer( GLint buffer ) +{ + void (WINAPI *p_glGetNamedBufferPointerv)( GLuint buffer, GLenum pname, void **params ); + void *ptr; + if (!(p_glGetNamedBufferPointerv = (void *)wglGetProcAddress( "glGetNamedBufferPointerv" ))) return 0; + p_glGetNamedBufferPointerv( buffer, GL_BUFFER_MAP_POINTER, &ptr ); + return ptr; +} +#endif + void * WINAPI glMapBuffer( GLenum target, GLenum access ) { struct glMapBuffer_params args = @@ -1048,6 +1069,15 @@ void * WINAPI glMapBuffer( GLenum target, GLenum access ) TRACE( "target %d, access %d\n", target, access );
if (!(status = UNIX_CALL( glMapBuffer, &args ))) return args.ret; +#ifndef _WIN64 + if (status == STATUS_INVALID_ADDRESS) + { + TRACE( "Unable to map wow64 buffer directly, using copy buffer!\n" ); + if (!(args.ret = _aligned_malloc( (size_t)args.ret, 16 ))) status = STATUS_NO_MEMORY; + else if (!(status = UNIX_CALL( glMapBuffer, &args ))) return args.ret; + _aligned_free( args.ret ); + } +#endif WARN( "glMapBuffer returned %#lx\n", status ); return args.ret; } @@ -1071,6 +1101,15 @@ void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr lengt TRACE( "target %d, offset %Id, length %Id, access %d\n", target, offset, length, access );
if (!(status = UNIX_CALL( glMapBufferRange, &args ))) return args.ret; +#ifndef _WIN64 + if (status == STATUS_INVALID_ADDRESS) + { + TRACE( "Unable to map wow64 buffer directly, using copy buffer!\n" ); + if (!(args.ret = _aligned_malloc( length, 16 ))) status = STATUS_NO_MEMORY; + else if (!(status = UNIX_CALL( glMapBufferRange, &args ))) return args.ret; + _aligned_free( args.ret ); + } +#endif WARN( "glMapBufferRange returned %#lx\n", status ); return args.ret; } @@ -1087,6 +1126,15 @@ void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) TRACE( "(%d, %d)\n", buffer, access );
if (!(status = UNIX_CALL( glMapNamedBuffer, &args ))) return args.ret; +#ifndef _WIN64 + if (status == STATUS_INVALID_ADDRESS) + { + TRACE( "Unable to map wow64 buffer directly, using copy buffer!\n" ); + if (!(args.ret = _aligned_malloc( (size_t)args.ret, 16 ))) status = STATUS_NO_MEMORY; + else if (!(status = UNIX_CALL( glMapNamedBuffer, &args ))) return args.ret; + _aligned_free( args.ret ); + } +#endif WARN( "glMapNamedBuffer returned %#lx\n", status ); return args.ret; } @@ -1110,6 +1158,15 @@ void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access );
if (!(status = UNIX_CALL( glMapNamedBufferRange, &args ))) return args.ret; +#ifndef _WIN64 + if (status == STATUS_INVALID_ADDRESS) + { + TRACE( "Unable to map wow64 buffer directly, using copy buffer!\n" ); + if (!(args.ret = _aligned_malloc( length, 16 ))) status = STATUS_NO_MEMORY; + else if (!(status = UNIX_CALL( glMapNamedBufferRange, &args ))) return args.ret; + _aligned_free( args.ret ); + } +#endif WARN( "glMapNamedBufferRange returned %#lx\n", status ); return args.ret; } @@ -1126,10 +1183,21 @@ GLboolean WINAPI glUnmapBuffer( GLenum target ) .target = target, }; NTSTATUS status; +#ifndef _WIN64 + void *ptr = get_buffer_pointer( target ); +#endif
TRACE( "target %d\n", target );
if (!(status = UNIX_CALL( glUnmapBuffer, &args ))) return args.ret; +#ifndef _WIN64 + if (status == STATUS_INVALID_ADDRESS) + { + TRACE( "Releasing wow64 copy buffer %p\n", ptr ); + _aligned_free( ptr ); + return args.ret; + } +#endif WARN( "glUnmapBuffer returned %#lx\n", status ); return args.ret; } @@ -1146,10 +1214,21 @@ GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) .buffer = buffer, }; NTSTATUS status; +#ifndef _WIN64 + void *ptr = get_named_buffer_pointer( buffer ); +#endif
TRACE( "buffer %d\n", buffer );
if (!(status = UNIX_CALL( glUnmapNamedBuffer, &args ))) return args.ret; +#ifndef _WIN64 + if (status == STATUS_INVALID_ADDRESS) + { + TRACE( "Releasing wow64 copy buffer %p\n", ptr ); + _aligned_free( ptr ); + return args.ret; + } +#endif WARN( "glUnmapNamedBuffer returned %#lx\n", status ); return args.ret; }
From: Rémi Bernon rbernon@codeweavers.com
They are byte offsets in the buffers data. --- dlls/opengl32/make_opengl | 20 ++++++++++++++++++-- dlls/opengl32/unix_thunks.c | 24 ++++++++++++++++-------- 2 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 43199f56981..bc1a2422185 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -244,6 +244,13 @@ my %pointer_array_count = "glDrawCommandsStatesNV" => "count", "glListDrawCommandsStatesClientNV" => "count", ); +my %pointer_is_offset = + ( + "glGetPointerv" => "params", + "glGetPointervEXT" => "params", + "glGetVertexAttribPointerv" => "pointer", + "glGetVertexAttribPointervARB" => "pointer", + );
# # Used to convert some types @@ -429,7 +436,8 @@ sub generate_wow64_thunk($$$) my $ptype = get_wow64_arg_type( $arg ); my $pname = get_arg_name( $arg ); $ret .= " $ptype $pname;\n"; - $need_manual_thunk = 1 if ($arg->textContent() =~ /(*.**|[)/ || $arg->textContent() =~ /(sizei|int)ptr.**/) && !defined $pointer_array_count{$_}; + $need_manual_thunk = 1 if $arg->textContent() =~ /(*.**|[|(sizei|int)ptr.**)/ && + !defined $pointer_array_count{$_} && !defined $pointer_is_offset{$_}; } if (!is_void_func($func)) { @@ -441,7 +449,7 @@ sub generate_wow64_thunk($$$) $ret .= " {\n"; foreach my $arg (@{$func->[1]}) { - next if $arg->textContent() =~ /(*.**|[)/ || $arg->textContent() =~ /(sizei|int)ptr.**/; + next if $arg->textContent() =~ /(*.**|[|(sizei|int)ptr.**)/; my $ptype = get_arg_type( $arg ); my $pname = get_arg_name( $arg ); if ($arg->textContent() =~ /(sizei|int)ptr/) @@ -493,6 +501,14 @@ sub generate_wow64_thunk($$$) $ret .= " free( (void *)params.$pname );\n"; }
+ foreach my $arg (@{$func->[1]}) + { + next unless defined $pointer_is_offset{$_}; + my $pname = get_arg_name( $arg ); + next unless $pname =~ $pointer_is_offset{$_}; + $ret .= " params32->$pname = PtrToUlong( params.$pname );\n"; + } + $ret .= " return status;\n"; $ret .= "}\n\n";
diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 1ba8fc3bf2f..820b6e3415d 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -28170,8 +28170,10 @@ static NTSTATUS wow64_gl_glGetPointerv( void *args ) { .pname = params32->pname, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + status = gl_glGetPointerv( ¶ms ); + params32->params = PtrToUlong( params.params ); + return status; }
static NTSTATUS wow64_gl_glGetPolygonStipple( void *args ) @@ -39693,8 +39695,10 @@ static NTSTATUS wow64_ext_glGetPointervEXT( void *args ) { .pname = params32->pname, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + status = ext_glGetPointervEXT( ¶ms ); + params32->params = PtrToUlong( params.params ); + return status; }
static NTSTATUS wow64_ext_glGetProgramBinary( void *args ) @@ -42563,8 +42567,10 @@ static NTSTATUS wow64_ext_glGetVertexAttribPointerv( void *args ) .index = params32->index, .pname = params32->pname, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + status = ext_glGetVertexAttribPointerv( ¶ms ); + params32->pointer = PtrToUlong( params.pointer ); + return status; }
static NTSTATUS wow64_ext_glGetVertexAttribPointervARB( void *args ) @@ -42580,8 +42586,10 @@ static NTSTATUS wow64_ext_glGetVertexAttribPointervARB( void *args ) .index = params32->index, .pname = params32->pname, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + status = ext_glGetVertexAttribPointervARB( ¶ms ); + params32->pointer = PtrToUlong( params.pointer ); + return status; }
static NTSTATUS wow64_ext_glGetVertexAttribPointervNV( void *args )
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_thunks.c | 2 +- dlls/opengl32/unix_wgl.c | 2 +- dlls/opengl32/wgl.c | 15 ++++++++------- 4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index bc1a2422185..5654ddfa824 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -1142,7 +1142,7 @@ print OUT "#include "unix_private.h"\n\n"; print OUT "#include "wine/debug.h"\n\n";
print OUT "#ifdef _WIN64\n"; -print OUT "WINE_DEFAULT_DEBUG_CHANNEL(wgl);\n"; +print OUT "WINE_DEFAULT_DEBUG_CHANNEL(opengl);\n"; print OUT "#endif\n\n";
print OUT "extern NTSTATUS thread_attach( void *args ) DECLSPEC_HIDDEN;\n"; diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 820b6e3415d..f07b0c2f775 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -19,7 +19,7 @@ #include "wine/debug.h"
#ifdef _WIN64 -WINE_DEFAULT_DEBUG_CHANNEL(wgl); +WINE_DEFAULT_DEBUG_CHANNEL(opengl); #endif
extern NTSTATUS thread_attach( void *args ) DECLSPEC_HIDDEN; diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index cc3c6a47e1d..b0874af546e 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -41,7 +41,7 @@
#include "wine/debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(wgl); +WINE_DEFAULT_DEBUG_CHANNEL(opengl);
static pthread_mutex_t wgl_lock = PTHREAD_MUTEX_INITIALIZER;
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 2ffdc20c057..27efa6df745 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -36,7 +36,7 @@ #include "wine/glu.h" #include "wine/debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(wgl); +WINE_DEFAULT_DEBUG_CHANNEL(opengl); WINE_DECLARE_DEBUG_CHANNEL(fps);
unixlib_handle_t unixlib_handle = 0; @@ -120,11 +120,11 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) int i, count, best_format; int bestDBuffer = -1, bestStereo = -1;
- TRACE_(wgl)( "%p %p: size %u version %u flags %lu type %u color %u %u,%u,%u,%u " - "accum %u depth %u stencil %u aux %u\n", - hdc, ppfd, ppfd->nSize, ppfd->nVersion, ppfd->dwFlags, ppfd->iPixelType, - ppfd->cColorBits, ppfd->cRedBits, ppfd->cGreenBits, ppfd->cBlueBits, ppfd->cAlphaBits, - ppfd->cAccumBits, ppfd->cDepthBits, ppfd->cStencilBits, ppfd->cAuxBuffers ); + TRACE( "%p %p: size %u version %u flags %lu type %u color %u %u,%u,%u,%u " + "accum %u depth %u stencil %u aux %u\n", + hdc, ppfd, ppfd->nSize, ppfd->nVersion, ppfd->dwFlags, ppfd->iPixelType, + ppfd->cColorBits, ppfd->cRedBits, ppfd->cGreenBits, ppfd->cBlueBits, ppfd->cAlphaBits, + ppfd->cAccumBits, ppfd->cDepthBits, ppfd->cStencilBits, ppfd->cAuxBuffers );
count = wglDescribePixelFormat( hdc, 0, 0, NULL ); if (!count) return 0; @@ -486,7 +486,8 @@ static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD l if (!ret) break; }
- if (TRACE_ON(wgl)) { + if (TRACE_ON(opengl)) + { unsigned int bitmask; unsigned char *bitmap_ = bitmap;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126542
Your paranoid android.
=== debian11 (32 bit report) ===
d3d8: stateblock: Timeout visual: Timeout
d3d9: d3d9ex: Timeout device: Timeout stateblock: Timeout visual: Timeout
d3dcompiler_43: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3dcompiler_46: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3dcompiler_47: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3drm: d3drm: Timeout vector: Timeout
d3dx10_34: d3dx10: Timeout
d3dx10_35: d3dx10: Timeout
d3dx10_36: d3dx10: Timeout
d3dx10_37: d3dx10: Timeout
d3dx10_38: d3dx10: Timeout
d3dx10_39: d3dx10: Timeout
d3dx10_40: d3dx10: Timeout
d3dx10_41: d3dx10: Timeout
d3dx10_42: d3dx10: Timeout
d3dx10_43: d3dx10: Timeout
Report validation errors: d3dx11: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
v2: Don't drop wglGetCurrentReadDCARB, it causes an offset in the registry map vs the function pointer table. It never reaches the unix side anyway.