After a while Visio 4.1 Tehnical with wine-980822 bombs out of wine with: Backtrace: =>0 0x080e5f93 (HeapSize+0x63 [heap.c:1200]) 1 0x080e42a6 (GlobalReAlloc32+0x36(hmem=0x0, size=0x0, flags=0x82) [global.c:1193]) 2 0x549a58e8 (VISLIB32.DLL.9+0x1498) 3 0x00000344 (curr_frame+0x344 [stack.c]) The diff which solves this little problem is below. Known problems: * open and save don't work (out of memory error) * keyboard shortcuts don't work (ctrl+letters) * object moves a little after releasing of mouse button * strange mouse pointers in places This is a second version of this diff. This one returns the right LastError code. diff -urN wine-980822.orig/include/winerror.h wine-980822/include/winerror.h --- wine-980822.orig/include/winerror.h Sat Aug 22 18:05:09 1998 +++ wine-980822/include/winerror.h Mon Aug 31 15:45:23 1998 @@ -59,6 +59,7 @@ #define ERROR_NOT_OWNER 288 #define ERROR_TOO_MANY_POSTS 298 #define ERROR_INVALID_ADDRESS 487 +#define ERROR_INVALID_ACCESS_TO_MEM 998 #define ERROR_CAN_NOT_COMPLETE 1003 #define ERROR_BADKEY 1010 /* Config reg key invalid */ #define ERROR_CANTREAD 1012 /* Config reg key couldn't be read */ diff -urN wine-980822.orig/memory/global.c wine-980822/memory/global.c --- wine-980822.orig/memory/global.c Sat Aug 8 14:16:49 1998 +++ wine-980822/memory/global.c Mon Aug 31 15:45:56 1998 @@ -1190,6 +1190,13 @@ /* make a fixed block moveable * actually only NT is able to do this. But it's soo simple */ + if ( hmem == 0 ) { + ERR(global, "GlobalReAlloc32 with null handle!\n"); + SetLastError( ERROR_INVALID_ACCESS_TO_MEM ); + return 0; + } else { + WARN(global, "GlobalReAlloc32(0x%04x,0x%04x,0x%04x)\n",hmem,size,flags); + } size=HeapSize(GetProcessHeap(), 0, (LPVOID) hmem); hnew=GlobalAlloc32( flags, size); palloc=GlobalLock32(hnew);