mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
{Global,Local}ReAlloc() does not allocate memory.
This commit is contained in:
parent
77b8c0a42f
commit
3e54350dc2
2 changed files with 7 additions and 6 deletions
|
@ -73,7 +73,8 @@ static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
|
|||
/* resize the old table */
|
||||
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;
|
||||
return Malloc32.SpyedBlocks ? 1 : 0;
|
||||
}
|
||||
|
|
|
@ -92,15 +92,15 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
|
||||
if (*lpCmdline==0) {
|
||||
/* Return the path to the executable */
|
||||
DWORD size;
|
||||
DWORD size=16;
|
||||
|
||||
hargv=0;
|
||||
size=16;
|
||||
do {
|
||||
hargv=GlobalAlloc(size, 0);
|
||||
argv=GlobalLock(hargv);
|
||||
while (GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR)) == 0) {
|
||||
size*=2;
|
||||
hargv=GlobalReAlloc(hargv, size, 0);
|
||||
argv=GlobalLock(hargv);
|
||||
} while (GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR)) == 0);
|
||||
}
|
||||
argv[0]=(LPWSTR)(argv+1);
|
||||
if (numargs)
|
||||
*numargs=2;
|
||||
|
|
Loading…
Reference in a new issue