create more window data structures before calling WH_CBT hooks.

Rein Klazes rklazes at xs4all.nl
Sun Dec 16 09:05:33 CST 2001


hi,

My application, girotel v 2.1, crashes during the creating of its
first windows when calling the CBT hooks in CreateWindow(). Reasons
for crashes are the dereferencing winptr->pDriverData and various
unexpected DC and invalid region errors. 
Clearly wine violates the statement on MSDN that during the calling of
these hooks all esential windows datastructures are in place, but
maybe uninitialized. Same source specifies that these hooks are called
before any other normal window-creation message is sent.

The attached patch reorganises things a little: x11drv.CreateWindow is
getting called twice. The first time just to create the data
structures, the second time it will send the windows-creation
messsages. Within WIN_CreateWindowEx calling the CBT hooks is
postponed as much as possible. With this, girotel happily starts up.

I know the implementation is not very beautifull. I will be glad to
throw it into something better (split x11drv.CreateWindow in two
funcs?) if there aren't any other, more fundamental, objections.

Rein.
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- ./wine/windows/win.c	Wed Sep 29 17:14:39 1999
+++ ./mywine/windows/win.c	Tue Oct 12 20:24:27 1999
@@ -1091,6 +1091,9 @@
     ATOM classAtom;
     CREATESTRUCTA cs;
 
+    if(!instance)
+        instance=GetModuleHandleA(NULL);
+
     if(exStyle & WS_EX_MDICHILD)
         return MDI_CreateMDIWindowA(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data);
     /* Find the class atom */
@@ -1132,6 +1135,9 @@
 {
     ATOM classAtom;
     CREATESTRUCTW cs;
+
+    if(!instance)
+        instance=GetModuleHandleA(NULL);
 
     if(exStyle & WS_EX_MDICHILD)
         return MDI_CreateMDIWindowW(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data);


More information about the wine-patches mailing list