[PATCH] gdi32: Remove useless calls to CreateICA.

Jiajin Cui cuijiajin at uniontech.com
Thu Sep 2 04:00:08 CDT 2021


We can get funcs without calling CreateICA.

Signed-off-by: Jiajin Cui <cuijiajin at uniontech.com>
---
 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






More information about the wine-devel mailing list