Commit 3e54350d authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

{Global,Local}ReAlloc() does not allocate memory.

parent 77b8c0a4
...@@ -73,7 +73,8 @@ static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 }; ...@@ -73,7 +73,8 @@ static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
/* resize the old table */ /* resize the old table */
static int SetSpyedBlockTableLength ( int NewLength ) static int SetSpyedBlockTableLength ( int NewLength )
{ {
Malloc32.SpyedBlocks = (LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT); if (!Malloc32.SpyedBlocks) Malloc32.SpyedBlocks = (LPVOID*)LocalAlloc(NewLength, GMEM_ZEROINIT);
else Malloc32.SpyedBlocks = (LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT);
Malloc32.SpyedBlockTableLength = NewLength; Malloc32.SpyedBlockTableLength = NewLength;
return Malloc32.SpyedBlocks ? 1 : 0; return Malloc32.SpyedBlocks ? 1 : 0;
} }
......
...@@ -92,15 +92,15 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) ...@@ -92,15 +92,15 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
if (*lpCmdline==0) { if (*lpCmdline==0) {
/* Return the path to the executable */ /* Return the path to the executable */
DWORD size; DWORD size=16;
hargv=0; hargv=GlobalAlloc(size, 0);
size=16; argv=GlobalLock(hargv);
do { while (GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR)) == 0) {
size*=2; size*=2;
hargv=GlobalReAlloc(hargv, size, 0); hargv=GlobalReAlloc(hargv, size, 0);
argv=GlobalLock(hargv); argv=GlobalLock(hargv);
} while (GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR)) == 0); }
argv[0]=(LPWSTR)(argv+1); argv[0]=(LPWSTR)(argv+1);
if (numargs) if (numargs)
*numargs=2; *numargs=2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment