[1/5] gdiplus: allow non-default GdiplusStartupInput

Evan Stade estade at gmail.com
Fri Aug 3 19:30:17 CDT 2007


Hi,

changelog:
*return dummy notification hook functions (akin to
GdipplusStartup/Shutdown functions, which are mostly unimplemented)

 dlls/gdiplus/gdiplus.c |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c
index 9267b90..92c4e93 100644
--- a/dlls/gdiplus/gdiplus.c
+++ b/dlls/gdiplus/gdiplus.c
@@ -32,6 +32,20 @@ #include "gdiplus_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
 
+Status WINAPI NotificationHook(OUT ULONG_PTR *token)
+{
+    TRACE("%p\n", token);
+    if(!token)
+        return InvalidParameter;
+
+    return Ok;
+}
+
+VOID WINAPI NotificationUnhook(ULONG_PTR token)
+{
+    TRACE("%d\n", (UINT)token);
+}
+
 /*****************************************************
  *      DllMain
  */
@@ -57,20 +71,27 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWO
 Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input,
                              struct GdiplusStartupOutput *output)
 {
-    if(!token)
+    if(!token || !input)
         return InvalidParameter;
 
-    if(input->GdiplusVersion != 1) {
+    TRACE("%p %p %p\n", token, input, output);
+    TRACE("GdiplusStartupInput %d %p %d %d\n", input->GdiplusVersion,
+          input->DebugEventCallback, input->SuppressBackgroundThread,
+          input->SuppressExternalCodecs);
+
+    if(input->GdiplusVersion != 1)
         return UnsupportedGdiplusVersion;
-    } else if ((input->DebugEventCallback) ||
-        (input->SuppressBackgroundThread) || (input->SuppressExternalCodecs)){
-        FIXME("Unimplemented for non-default GdiplusStartupInput\n");
-        return NotImplemented;
-    } else if(output) {
-        FIXME("Unimplemented for non-null GdiplusStartupOutput\n");
-        return NotImplemented;
+
+    if(input->SuppressBackgroundThread){
+        if(!output)
+            return InvalidParameter;
+
+        output->NotificationHook = (ULONG_PTR) NotificationHook;
+        output->NotificationUnhook = (ULONG_PTR) NotificationUnhook;
     }
 
+    /* FIXME: DebugEventCallback ignored */
+
     return Ok;
 }
 
-- 
1.4.1


More information about the wine-patches mailing list