Commit 3987dec9 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shlwapi: Use wrappers to call stream methods internally.

parent 16f83eb4
...@@ -55,9 +55,6 @@ static inline ISHFileStream *impl_from_IStream(IStream *iface) ...@@ -55,9 +55,6 @@ static inline ISHFileStream *impl_from_IStream(IStream *iface)
return CONTAINING_RECORD(iface, ISHFileStream, IStream_iface); return CONTAINING_RECORD(iface, ISHFileStream, IStream_iface);
} }
static HRESULT WINAPI IStream_fnCommit(IStream*,DWORD);
/************************************************************************** /**************************************************************************
* IStream_fnQueryInterface * IStream_fnQueryInterface
*/ */
...@@ -104,7 +101,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) ...@@ -104,7 +101,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface)
if (!refCount) if (!refCount)
{ {
IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ IStream_Commit(iface, 0); /* If ever buffered, this will be needed */
LocalFree(This->lpszPath); LocalFree(This->lpszPath);
CloseHandle(This->hFile); CloseHandle(This->hFile);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
...@@ -171,7 +168,7 @@ static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove, ...@@ -171,7 +168,7 @@ static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove,
TRACE("(%p,%d,%d,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos); TRACE("(%p,%d,%d,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos);
IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ IStream_Commit(iface, 0); /* If ever buffered, this will be needed */
dwPos = SetFilePointer(This->hFile, dlibMove.u.LowPart, NULL, dwOrigin); dwPos = SetFilePointer(This->hFile, dlibMove.u.LowPart, NULL, dwOrigin);
if( dwPos == INVALID_SET_FILE_POINTER ) if( dwPos == INVALID_SET_FILE_POINTER )
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
...@@ -193,7 +190,7 @@ static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSiz ...@@ -193,7 +190,7 @@ static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSiz
TRACE("(%p,%d)\n", This, libNewSize.u.LowPart); TRACE("(%p,%d)\n", This, libNewSize.u.LowPart);
IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ IStream_Commit(iface, 0); /* If ever buffered, this will be needed */
if( ! SetFilePointer( This->hFile, libNewSize.QuadPart, NULL, FILE_BEGIN ) ) if( ! SetFilePointer( This->hFile, libNewSize.QuadPart, NULL, FILE_BEGIN ) )
return E_FAIL; return E_FAIL;
...@@ -224,7 +221,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT ...@@ -224,7 +221,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT
if (!pstm) if (!pstm)
return S_OK; return S_OK;
IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ IStream_Commit(iface, 0); /* If ever buffered, this will be needed */
/* Copy data */ /* Copy data */
ulSize = cb.QuadPart; ulSize = cb.QuadPart;
...@@ -235,7 +232,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT ...@@ -235,7 +232,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT
ulLeft = ulSize > sizeof(copyBuff) ? sizeof(copyBuff) : ulSize; ulLeft = ulSize > sizeof(copyBuff) ? sizeof(copyBuff) : ulSize;
/* Read */ /* Read */
hRet = IStream_fnRead(iface, copyBuff, ulLeft, &ulRead); hRet = IStream_Read(iface, copyBuff, ulLeft, &ulRead);
if (FAILED(hRet) || ulRead == 0) if (FAILED(hRet) || ulRead == 0)
break; break;
if (pcbRead) if (pcbRead)
......
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