Sergio Gómez Del Real sdelreal@codeweavers.com wrote:
DWORD size_bits;
ULONG read;
Why not have them both assign same type ULONG?
hr = IStream_Stat( stm, &stat, STATFLAG_NONAME );
if (SUCCEEDED( hr ))
{
data = HeapAlloc( GetProcessHeap(), 0, stat.cbSize.u.LowPart );
if (!data) return E_OUTOFMEMORY;
hr = IStream_Read( stm, data, stat.cbSize.u.LowPart, &read );
if (hr != S_OK || read != stat.cbSize.u.LowPart)
{
IStream_Read() never returns S_OK for short reads.
HeapFree( GetProcessHeap(), 0, data );
return E_FAIL;
}
size_bits = read - sizeof(DWORD) - sizeof(ENHMETAHEADER);
if (size_bits <= 0)
{
size_bits is an unsigned, so the condition above is not correct.