urlmon: Fix a LARGE_INTEGER truncation.

This commit is contained in:
Rolf Kalbermatter 2006-01-06 13:03:50 +01:00 committed by Alexandre Julliard
parent e49a5c22fb
commit d1b375f7e6
1 changed files with 7 additions and 10 deletions

View File

@ -252,26 +252,21 @@ static HRESULT WINAPI IStream_fnWrite (IStream * iface,
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnSeek ( IStream * iface,
static HRESULT WINAPI IStream_fnSeek (IStream * iface,
LARGE_INTEGER dlibMove,
DWORD dwOrigin,
ULARGE_INTEGER* plibNewPosition)
{
DWORD pos, newposlo;
LONG newposhi;
LARGE_INTEGER newpos;
IUMCacheStream *This = (IUMCacheStream *)iface;
TRACE("(%p)\n",This);
pos = dlibMove.QuadPart; /* FIXME: truncates */
newposhi = 0;
newposlo = SetFilePointer( This->handle, pos, &newposhi, dwOrigin );
if( newposlo == INVALID_SET_FILE_POINTER && GetLastError())
if (!SetFilePointerEx( This->handle, dlibMove, &newpos, dwOrigin ))
return E_FAIL;
if (plibNewPosition)
plibNewPosition->QuadPart = newposlo | ( (LONGLONG)newposhi<<32);
plibNewPosition->QuadPart = newpos.QuadPart;
return S_OK;
}
@ -279,11 +274,13 @@ static HRESULT WINAPI IStream_fnSeek ( IStream * iface,
static HRESULT WINAPI IStream_fnSetSize (IStream * iface,
ULARGE_INTEGER libNewSize)
{
LARGE_INTEGER newpos;
IUMCacheStream *This = (IUMCacheStream *)iface;
TRACE("(%p)\n",This);
if( ! SetFilePointer( This->handle, libNewSize.QuadPart, NULL, FILE_BEGIN ) )
newpos.QuadPart = libNewSize.QuadPart;
if( ! SetFilePointerEx( This->handle, newpos, NULL, FILE_BEGIN ) )
return E_FAIL;
if( ! SetEndOfFile( This->handle ) )