Commit d1b375f7 authored by Rolf Kalbermatter's avatar Rolf Kalbermatter Committed by Alexandre Julliard

urlmon: Fix a LARGE_INTEGER truncation.

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