[PATCH 5/5] gdi32: Implement GdiDllInitialize stub.

Rémi Bernon rbernon at codeweavers.com
Mon Jul 6 14:37:25 CDT 2020


This is required by several Call of Duty games that are calling this
directly after loading gdi32.dll from disk. The DLL has to be PE first,
then this stub has to succeed.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/gdi32/gdi32.spec | 2 +-
 dlls/gdi32/gdiobj.c   | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index 610a9a714c0..90200914012 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -182,7 +182,7 @@
 @ stub GdiDeleteLocalObject
 # @ stub GdiDeleteSpoolFileHandle
 @ stdcall GdiDescribePixelFormat(long long long ptr)
-@ stub GdiDllInitialize
+@ stdcall GdiDllInitialize(ptr long ptr)
 @ stdcall GdiDrawStream(long long ptr)
 # @ stub GdiEndDocEMF
 # @ stub GdiEndPageEMF
diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c
index e204079baf7..8f850b09fab 100644
--- a/dlls/gdi32/gdiobj.c
+++ b/dlls/gdi32/gdiobj.c
@@ -734,6 +734,15 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
     return TRUE;
 }
 
+
+/* Stub entry point, some games (CoD: Black Ops 3) call it directly. */
+BOOL WINAPI GdiDllInitialize( HINSTANCE inst, DWORD reason, LPVOID reserved )
+{
+    FIXME("stub\n");
+    return TRUE;
+}
+
+
 static const char *gdi_obj_type( unsigned type )
 {
     switch ( type )
-- 
2.27.0




More information about the wine-devel mailing list