Wordviewer 97 (and probably Word97 itself) suffers a new insufficient
memory problem. Of course memory has nothing to do with it; the
recent changes in atom and window creation are the true culprit.
I think that GlobalFindAtomA does not succeed if called with
a *handle* in className,although CreateWindowsEx should
if the className parameter is a handle
.
Call USER32.427: RegisterClassA(40e8f8a4) ret=30712715 fs=0237
trace:atom:ATOM_IsIntAtomA atom=30701b30
trace:atom:GlobalAddAtomA add atom MsoSplash to the server
08065d30: add_atom( name=L"MsoSplash" )
08065d30: add_atom() = 0 { atom=41 }
trace:atom:GlobalAddAtomA "MsoSplash" -> c029
trace:class:CLASS_RegisterClass atom=0xc029 hinst=0x306c0000 style=0x2000 clExtr=0x0
winExtr=0x0 wndProc=0x0x30701b64 ProcType=0x2
trace:class:CLASS_FindClassByAtom 0x0000c029 0x306c0000
trace:class:CLASS_FindClassByAtom -- not found
trace:win:WINPROC_AllocWinProc (30701b64,2): returning 40d70898
trace:win:WINPROC_SetProc (00000000,30701b64,2): res=40d70898
trace:class:RegisterClassA atom=c029 wndproc=30701b64 hinst=306c0000 bg=0000
style=00002000 clsExt=0 winExt=0
class=0x6543d2c0 name='MsoSplash'
Ret USER32.427: RegisterClassA() retval=0000c029 ret=30712715 fs=0237
Call USER32.83:
CreateWindowExA(00000004,0000c029,00000000,80000000,000000c8,000000b0,00000190,000000f7,000001e0,00000000,306c0000,00000000)
ret=3071274d fs=0237
err:win:CreateWindowExA bad class name #c029
The following patch makes Wv97 start again; should I complete it for
the other windows creation cases or is it already a work in progress ?
Gerard
--- windows/win.c 2000/02/13 13:56:14 1.77
+++ windows/win.c 2000/02/15 09:17:40
@@ -1093,13 +1093,24 @@
if(exStyle & WS_EX_MDICHILD)
return MDI_CreateMDIWindowA(className, windowName, style, x, y, width,
height, parent, instance, (LPARAM)data);
/* Find the class atom */
-
- if (!(classAtom = GlobalFindAtomA( className )))
+ if (HIWORD(className))
{
- ERR( "bad class name %s\n", debugres_a(className) );
- return 0;
+ if (!(classAtom = GlobalFindAtomA( className )))
+ {
+ ERR( "bad class name %s\n", debugres_a(className) );
+ return 0;
+ }
}
-
+ else
+ {
+ classAtom = LOWORD(className);
+ if (!GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) ))
+ {
+ ERR( "bad atom %x\n", classAtom);
+ return 0;
+ }
+ className = buffer;
+ }
/* Create the window */
cs.lpCreateParams = data;
@@ -1115,12 +1126,6 @@
cs.lpszClass = className;
cs.dwExStyle = exStyle;
- /* make sure lpszClass is a string */
- if (!HIWORD(cs.lpszClass))
- {
- GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
- cs.lpszClass = buffer;
- }
return WIN_CreateWindowEx( &cs, classAtom, TRUE, FALSE );
}