Commit 0500d490 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

windowscodecs: Implement DdsEncoder_Initialize.

parent b719f00a
......@@ -1754,10 +1754,35 @@ static ULONG WINAPI DdsEncoder_Release(IWICBitmapEncoder *iface)
}
static HRESULT WINAPI DdsEncoder_Initialize(IWICBitmapEncoder *iface,
IStream *pIStream, WICBitmapEncoderCacheOption cacheOption)
IStream *stream, WICBitmapEncoderCacheOption cacheOption)
{
FIXME("(%p,%p,%u): stub\n", iface, pIStream, cacheOption);
return E_NOTIMPL;
DdsEncoder *This = impl_from_IWICBitmapEncoder(iface);
HRESULT hr;
TRACE("(%p,%p,%u)\n", iface, stream, cacheOption);
if (cacheOption != WICBitmapEncoderNoCache)
FIXME("Cache option %#x is not supported.\n", cacheOption);
if (!stream) return E_INVALIDARG;
EnterCriticalSection(&This->lock);
if (This->stream)
{
hr = WINCODEC_ERR_WRONGSTATE;
goto end;
}
This->stream = stream;
IStream_AddRef(stream);
hr = S_OK;
end:
LeaveCriticalSection(&This->lock);
return hr;
}
static HRESULT WINAPI DdsEncoder_GetContainerFormat(IWICBitmapEncoder *iface, GUID *format)
......
......@@ -1287,11 +1287,9 @@ static void test_dds_encoder_initialize(void)
if (!encoder) goto end;
hr = IWICBitmapEncoder_Initialize(encoder, NULL, WICBitmapEncoderNoCache);
todo_wine
ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#x\n", hr);
hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
todo_wine
ok(hr == S_OK, "Initialize failed, hr %#x\n", hr);
IWICBitmapEncoder_Release(encoder);
......@@ -1302,11 +1300,9 @@ static void test_dds_encoder_initialize(void)
if (!encoder) goto end;
hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
todo_wine
ok(hr == S_OK, "Initialize failed, hr %#x\n", hr);
hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
todo_wine
ok(hr == WINCODEC_ERR_WRONGSTATE, "Initialize got unexpected hr %#x\n", hr);
end:
......
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