From: Jiajin Cui Subject: [PATCH] gdi32: Remove useless calls to CreateICA. Message-Id: <20210902090008.29333-1-cuijiajin@uniontech.com> Date: Thu, 2 Sep 2021 17:00:08 +0800 We can get funcs without calling CreateICA. Signed-off-by: Jiajin Cui --- dlls/gdi32/driver.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 340476bca10..2c8feee25e7 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -1057,16 +1057,13 @@ INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd, if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1; - if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1; - - if ((dc = get_dc_ptr( hdc ))) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtDeviceMode ); - ret = physdev->funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort, + const struct gdi_dc_funcs *funcs = NULL; + funcs = DRIVER_load_driver(bufW); + if (funcs) { + ret = funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile, fwMode ); - release_dc_ptr( dc ); } - DeleteDC( hdc ); + return ret; } -- 2.20.1