gdi32: Don't bother returning the driver module from DRIVER_load_driver.
This commit is contained in:
parent
754e621613
commit
7c3bb6070a
|
@ -625,7 +625,6 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
DC * dc;
|
DC * dc;
|
||||||
const struct gdi_dc_funcs *funcs;
|
const struct gdi_dc_funcs *funcs;
|
||||||
HMODULE module;
|
|
||||||
WCHAR buf[300];
|
WCHAR buf[300];
|
||||||
|
|
||||||
GDI_CheckNotLock();
|
GDI_CheckNotLock();
|
||||||
|
@ -640,7 +639,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
|
||||||
strcpyW(buf, driver);
|
strcpyW(buf, driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(funcs = DRIVER_load_driver( buf, &module )))
|
if (!(funcs = DRIVER_load_driver( buf )))
|
||||||
{
|
{
|
||||||
ERR( "no driver found for %s\n", debugstr_w(buf) );
|
ERR( "no driver found for %s\n", debugstr_w(buf) );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -91,7 +91,7 @@ static struct graphics_driver *create_driver( HMODULE module )
|
||||||
*
|
*
|
||||||
* Special case for loading the display driver: get the name from the config file
|
* Special case for loading the display driver: get the name from the config file
|
||||||
*/
|
*/
|
||||||
static const struct gdi_dc_funcs *get_display_driver( HMODULE *module_ret )
|
static const struct gdi_dc_funcs *get_display_driver(void)
|
||||||
{
|
{
|
||||||
if (!display_driver)
|
if (!display_driver)
|
||||||
{
|
{
|
||||||
|
@ -104,8 +104,6 @@ static const struct gdi_dc_funcs *get_display_driver( HMODULE *module_ret )
|
||||||
__wine_set_display_driver( 0 );
|
__wine_set_display_driver( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*module_ret = display_driver->module;
|
|
||||||
return display_driver->funcs;
|
return display_driver->funcs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +111,7 @@ static const struct gdi_dc_funcs *get_display_driver( HMODULE *module_ret )
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* DRIVER_load_driver
|
* DRIVER_load_driver
|
||||||
*/
|
*/
|
||||||
const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name, HMODULE *module_ret )
|
const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name )
|
||||||
{
|
{
|
||||||
HMODULE module;
|
HMODULE module;
|
||||||
struct graphics_driver *driver, *new_driver;
|
struct graphics_driver *driver, *new_driver;
|
||||||
|
@ -121,16 +119,12 @@ const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name, HMODULE *module_ret
|
||||||
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
|
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
|
||||||
|
|
||||||
/* display driver is a special case */
|
/* display driver is a special case */
|
||||||
if (!strcmpiW( name, displayW ) || !strcmpiW( name, display1W ))
|
if (!strcmpiW( name, displayW ) || !strcmpiW( name, display1W )) return get_display_driver();
|
||||||
return get_display_driver( module_ret );
|
|
||||||
|
|
||||||
if ((module = GetModuleHandleW( name )))
|
if ((module = GetModuleHandleW( name )))
|
||||||
{
|
{
|
||||||
if (display_driver && display_driver->module == module)
|
if (display_driver && display_driver->module == module) return display_driver->funcs;
|
||||||
{
|
|
||||||
*module_ret = module;
|
|
||||||
return display_driver->funcs;
|
|
||||||
}
|
|
||||||
EnterCriticalSection( &driver_section );
|
EnterCriticalSection( &driver_section );
|
||||||
LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
|
LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
|
||||||
{
|
{
|
||||||
|
@ -160,7 +154,6 @@ const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name, HMODULE *module_ret
|
||||||
list_add_head( &drivers, &driver->entry );
|
list_add_head( &drivers, &driver->entry );
|
||||||
TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
|
TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
|
||||||
done:
|
done:
|
||||||
*module_ret = driver->module;
|
|
||||||
LeaveCriticalSection( &driver_section );
|
LeaveCriticalSection( &driver_section );
|
||||||
return driver->funcs;
|
return driver->funcs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,7 +268,7 @@ extern const struct gdi_dc_funcs null_driver DECLSPEC_HIDDEN;
|
||||||
extern const struct gdi_dc_funcs dib_driver DECLSPEC_HIDDEN;
|
extern const struct gdi_dc_funcs dib_driver DECLSPEC_HIDDEN;
|
||||||
extern const struct gdi_dc_funcs path_driver DECLSPEC_HIDDEN;
|
extern const struct gdi_dc_funcs path_driver DECLSPEC_HIDDEN;
|
||||||
extern const struct gdi_dc_funcs *font_driver DECLSPEC_HIDDEN;
|
extern const struct gdi_dc_funcs *font_driver DECLSPEC_HIDDEN;
|
||||||
extern const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name, HMODULE *module ) DECLSPEC_HIDDEN;
|
extern const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DECLSPEC_HIDDEN;
|
extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* enhmetafile.c */
|
/* enhmetafile.c */
|
||||||
|
|
Loading…
Reference in New Issue