GlobalReAlloc returns 0 on failure.
This commit is contained in:
parent
e529d36010
commit
c43fdb75b3
|
@ -1251,14 +1251,17 @@ HGLOBAL WINAPI GlobalReAlloc(
|
||||||
hnew=hmem;
|
hnew=hmem;
|
||||||
if(pintern->Pointer)
|
if(pintern->Pointer)
|
||||||
{
|
{
|
||||||
palloc=HeapReAlloc(heap, heap_flags,
|
if((palloc = HeapReAlloc(heap, heap_flags,
|
||||||
(char *) pintern->Pointer-sizeof(HGLOBAL),
|
(char *) pintern->Pointer-sizeof(HGLOBAL),
|
||||||
size+sizeof(HGLOBAL) );
|
size+sizeof(HGLOBAL))) == NULL)
|
||||||
|
return 0; /* Block still valid */
|
||||||
pintern->Pointer=(char *) palloc+sizeof(HGLOBAL);
|
pintern->Pointer=(char *) palloc+sizeof(HGLOBAL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
palloc=HeapAlloc(heap, heap_flags, size+sizeof(HGLOBAL));
|
if((palloc=HeapAlloc(heap, heap_flags, size+sizeof(HGLOBAL)))
|
||||||
|
== NULL)
|
||||||
|
return 0;
|
||||||
*(HGLOBAL *)palloc=hmem;
|
*(HGLOBAL *)palloc=hmem;
|
||||||
pintern->Pointer=(char *) palloc+sizeof(HGLOBAL);
|
pintern->Pointer=(char *) palloc+sizeof(HGLOBAL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue