Abort with error in SetWindowSubclass

György 'Nog' Jeney nog at sdf.lonestar.org
Thu Oct 3 14:16:39 CDT 2002


ChangeLog:
 * dlls/comctl32/commctrl.c
   Abort with error if the app uses our api to subclass and then theirs
then ours again.

nog.

-------------- next part --------------
Index: dlls/comctl32/commctrl.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/commctrl.c,v
retrieving revision 1.56
diff -u -r1.56 commctrl.c
--- dlls/comctl32/commctrl.c	2 Oct 2002 20:01:02 -0000	1.56
+++ dlls/comctl32/commctrl.c	3 Oct 2002 18:56:20 -0000
@@ -1049,6 +1049,17 @@
       else
          stack->origproc = (WNDPROC)SetWindowLongA (hWnd, GWL_WNDPROC,
                                                    (LONG)DefSubclassProc);
+   } else {
+      WNDPROC current;
+      if (IsWindowUnicode (hWnd))
+         current = (WNDPROC)GetWindowLongW (hWnd, GWL_WNDPROC);
+      else
+         current = (WNDPROC)GetWindowLongA (hWnd, GWL_WNDPROC);
+
+      if (current != DefSubclassProc) {
+         ERR ("Application has subclassed with our procedure, then manually, then with us again.  The current implementation can't handle this.\n");
+         return FALSE;
+      }
    }
 
    /* Check to see if we have called this function with the same uIDSubClass



More information about the wine-patches mailing list