Commit 3db8e19d authored by Guy Albertelli's avatar Guy Albertelli Committed by Alexandre Julliard

Fixed GlobalSize return value for zero size block.

parent 3dbc7881
......@@ -1370,6 +1370,8 @@ DWORD WINAPI GlobalSize32(
if(pintern->Magic==MAGIC_GLOBAL_USED)
{
if (!pintern->Pointer) /* handle case of GlobalAlloc( ??,0) */
return 0;
retval=HeapSize(GetProcessHeap(), 0,
(char *)(pintern->Pointer)-sizeof(HGLOBAL32))-4;
}
......@@ -1380,6 +1382,8 @@ DWORD WINAPI GlobalSize32(
}
/* HeapUnlock(GetProcessHeap()); */
}
/* HeapSize returns 0xffffffff on failure */
if (retval == 0xffffffff) retval = 0;
return retval;
}
......
......@@ -1204,7 +1204,7 @@ BOOL32 WINAPI HeapUnlock(
* HeapSize (KERNEL32.341)
* RETURNS
* Size in bytes of allocated memory
* 0: Failure
* 0xffffffff: Failure
*/
DWORD WINAPI HeapSize(
HANDLE32 heap, /* [in] Handle of heap */
......
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