From 984d9de828b81e551e6c4913a52e3ddbcb181753 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Sat, 29 May 2021 08:26:55 +0800 Subject: [PATCH] windowscodecs: Implement DdsFrameEncode_Initialize. Signed-off-by: Ziqing Hui Signed-off-by: Esme Povirk Signed-off-by: Alexandre Julliard --- dlls/windowscodecs/ddsformat.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c index 6dd7a01ff42..eea5235faba 100644 --- a/dlls/windowscodecs/ddsformat.c +++ b/dlls/windowscodecs/ddsformat.c @@ -1573,8 +1573,27 @@ static ULONG WINAPI DdsFrameEncode_Release(IWICBitmapFrameEncode *iface) static HRESULT WINAPI DdsFrameEncode_Initialize(IWICBitmapFrameEncode *iface, IPropertyBag2 *encoderOptions) { - FIXME("(%p,%p): stub\n", iface, encoderOptions); - return E_NOTIMPL; + DdsFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); + HRESULT hr; + + TRACE("(%p,%p)\n", iface, encoderOptions); + if (encoderOptions) FIXME("encoder options are not supported for DDS.\n"); + + EnterCriticalSection(&This->parent->lock); + + if (This->initialized) + { + hr = WINCODEC_ERR_WRONGSTATE; + } + else + { + This->initialized = TRUE; + hr = S_OK; + } + + LeaveCriticalSection(&This->parent->lock); + + return hr; } static HRESULT WINAPI DdsFrameEncode_SetSize(IWICBitmapFrameEncode *iface,