gdi32: Allow user32 to specify the display driver to use.

This commit is contained in:
Alexandre Julliard 2013-10-29 12:39:46 +01:00
parent 010769249c
commit 9675aa173a
4 changed files with 20 additions and 0 deletions

View File

@ -223,6 +223,23 @@ HMODULE CDECL __wine_get_driver_module( HDC hdc )
} }
/***********************************************************************
* __wine_set_display_driver_module (GDI32.@)
*/
void CDECL __wine_set_display_driver( HMODULE module )
{
struct graphics_driver *driver;
if (!(driver = create_driver( module )))
{
ERR( "Could not create graphics driver\n" );
ExitProcess(1);
}
if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
HeapFree( GetProcessHeap(), 0, driver );
}
static INT nulldrv_AbortDoc( PHYSDEV dev ) static INT nulldrv_AbortDoc( PHYSDEV dev )
{ {
return 0; return 0;

View File

@ -515,6 +515,7 @@
# Graphics drivers # Graphics drivers
@ cdecl __wine_get_driver_module(long) @ cdecl __wine_get_driver_module(long)
@ cdecl __wine_set_display_driver(long)
# OpenGL # OpenGL
@ cdecl __wine_get_wgl_driver(long long) @ cdecl __wine_get_wgl_driver(long long)

View File

@ -158,6 +158,7 @@ static const USER_DRIVER *load_driver(void)
} }
else LdrAddRefDll( 0, graphics_driver ); else LdrAddRefDll( 0, graphics_driver );
__wine_set_display_driver( graphics_driver );
register_builtin_classes(); register_builtin_classes();
return driver; return driver;

View File

@ -277,6 +277,7 @@ extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set );
extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect,
const RECT *device_rect, struct window_surface *surface ); const RECT *device_rect, struct window_surface *surface );
extern HMODULE CDECL __wine_get_driver_module( HDC hdc ); extern HMODULE CDECL __wine_get_driver_module( HDC hdc );
extern void CDECL __wine_set_display_driver( HMODULE module );
extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version ); extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version );
#endif /* __WINE_WINE_GDI_DRIVER_H */ #endif /* __WINE_WINE_GDI_DRIVER_H */