ole32/ifs.c
Ge van Geldorp
ge at gse.nl
Fri Jan 16 20:31:52 CST 2004
Changelog:
Swap arguments of LocalAlloc and only update Malloc32 block on
successful
allocation.
Index: dlls/ole32/ifs.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/ifs.c,v
retrieving revision 1.34
diff -u -r1.34 ifs.c
--- dlls/ole32/ifs.c 8 Dec 2003 22:46:08 -0000 1.34
+++ dlls/ole32/ifs.c 17 Jan 2004 02:30:40 -0000
@@ -73,10 +73,16 @@
/* resize the old table */
static int SetSpyedBlockTableLength ( int NewLength )
{
- if (!Malloc32.SpyedBlocks) Malloc32.SpyedBlocks =
(LPVOID*)LocalAlloc(NewLength, GMEM_ZEROINIT);
- else Malloc32.SpyedBlocks =
(LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength,
GMEM_ZEROINIT);
- Malloc32.SpyedBlockTableLength = NewLength;
- return Malloc32.SpyedBlocks ? 1 : 0;
+ LPVOID *NewSpyedBlocks;
+
+ if (!Malloc32.SpyedBlocks) NewSpyedBlocks =
(LPVOID*)LocalAlloc(GMEM_ZEROINIT, NewLength);
+ else NewSpyedBlocks =
(LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength,
GMEM_ZEROINIT);
+ if (NewSpyedBlocks) {
+ Malloc32.SpyedBlocks = NewSpyedBlocks;
+ Malloc32.SpyedBlockTableLength = NewLength;
+ }
+
+ return NewSpyedBlocks ? 1 : 0;
}
/* add a location to the table */
More information about the wine-patches
mailing list