windowscodecs: Implement IWICStream_Commit.

Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vincent Povirk 2019-10-21 13:43:50 -05:00 committed by Alexandre Julliard
parent f704c36568
commit 98c2c9a9c9
2 changed files with 20 additions and 20 deletions

View File

@ -189,12 +189,11 @@ static HRESULT WINAPI StreamOnMemory_CopyTo(IStream *iface,
return E_NOTIMPL; return E_NOTIMPL;
} }
/* Commit isn't implemented in the native windowscodecs DLL either */
static HRESULT WINAPI StreamOnMemory_Commit(IStream *iface, static HRESULT WINAPI StreamOnMemory_Commit(IStream *iface,
DWORD grfCommitFlags) DWORD grfCommitFlags)
{ {
TRACE("(%p, %#x)\n", iface, grfCommitFlags); TRACE("(%p, %#x)\n", iface, grfCommitFlags);
return E_NOTIMPL; return S_OK;
} }
/* Revert isn't implemented in the native windowscodecs DLL either */ /* Revert isn't implemented in the native windowscodecs DLL either */
@ -375,7 +374,7 @@ static HRESULT WINAPI StreamOnFileHandle_Commit(IStream *iface,
DWORD grfCommitFlags) DWORD grfCommitFlags)
{ {
TRACE("(%p, %#x)\n", iface, grfCommitFlags); TRACE("(%p, %#x)\n", iface, grfCommitFlags);
return E_NOTIMPL; return S_OK;
} }
static HRESULT WINAPI StreamOnFileHandle_Revert(IStream *iface) static HRESULT WINAPI StreamOnFileHandle_Revert(IStream *iface)
@ -655,8 +654,9 @@ static HRESULT WINAPI StreamOnStreamRange_CopyTo(IStream *iface,
static HRESULT WINAPI StreamOnStreamRange_Commit(IStream *iface, static HRESULT WINAPI StreamOnStreamRange_Commit(IStream *iface,
DWORD grfCommitFlags) DWORD grfCommitFlags)
{ {
TRACE("(%p, %#x)\n", iface, grfCommitFlags); StreamOnStreamRange *This = StreamOnStreamRange_from_IStream(iface);
return E_NOTIMPL; TRACE("(%p, %#x)\n", This, grfCommitFlags);
return IStream_Commit(This->stream, grfCommitFlags);
} }
/* Revert isn't implemented in the native windowscodecs DLL either */ /* Revert isn't implemented in the native windowscodecs DLL either */

View File

@ -326,19 +326,19 @@ static void test_StreamOnMemory(void)
/* Commit */ /* Commit */
hr = IWICStream_Commit(pStream, STGC_DEFAULT); hr = IWICStream_Commit(pStream, STGC_DEFAULT);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pStream, STGC_OVERWRITE); hr = IWICStream_Commit(pStream, STGC_OVERWRITE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pStream, STGC_ONLYIFCURRENT); hr = IWICStream_Commit(pStream, STGC_ONLYIFCURRENT);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pStream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE); hr = IWICStream_Commit(pStream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pStream, STGC_CONSOLIDATE); hr = IWICStream_Commit(pStream, STGC_CONSOLIDATE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
/* Revert */ /* Revert */
@ -643,19 +643,19 @@ static void test_StreamOnStreamRange(void)
/* Commit */ /* Commit */
hr = IWICStream_Commit(pSubStream, STGC_DEFAULT); hr = IWICStream_Commit(pSubStream, STGC_DEFAULT);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pSubStream, STGC_OVERWRITE); hr = IWICStream_Commit(pSubStream, STGC_OVERWRITE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pSubStream, STGC_ONLYIFCURRENT); hr = IWICStream_Commit(pSubStream, STGC_ONLYIFCURRENT);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pSubStream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE); hr = IWICStream_Commit(pSubStream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(pSubStream, STGC_CONSOLIDATE); hr = IWICStream_Commit(pSubStream, STGC_CONSOLIDATE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
/* Revert */ /* Revert */
@ -953,19 +953,19 @@ static void test_StreamOnIStream(void)
/* Commit */ /* Commit */
hr = IWICStream_Commit(substream, STGC_DEFAULT); hr = IWICStream_Commit(substream, STGC_DEFAULT);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(substream, STGC_OVERWRITE); hr = IWICStream_Commit(substream, STGC_OVERWRITE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(substream, STGC_ONLYIFCURRENT); hr = IWICStream_Commit(substream, STGC_ONLYIFCURRENT);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(substream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE); hr = IWICStream_Commit(substream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
hr = IWICStream_Commit(substream, STGC_CONSOLIDATE); hr = IWICStream_Commit(substream, STGC_CONSOLIDATE);
todo_wine ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr); ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
/* Revert */ /* Revert */
IWICStream_Write(substream, buff + 5, 6, NULL); IWICStream_Write(substream, buff + 5, 6, NULL);