Commit 82c82e8c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wincodecs: Add IWICImagingFactory2 stub.

parent 062411d6
...@@ -43,7 +43,8 @@ typedef struct { ...@@ -43,7 +43,8 @@ typedef struct {
} classinfo; } classinfo;
static const classinfo wic_classes[] = { static const classinfo wic_classes[] = {
{&CLSID_WICImagingFactory, ComponentFactory_CreateInstance}, {&CLSID_WICImagingFactory, ImagingFactory_CreateInstance},
{&CLSID_WICImagingFactory2, ImagingFactory_CreateInstance},
{&CLSID_WICBmpDecoder, BmpDecoder_CreateInstance}, {&CLSID_WICBmpDecoder, BmpDecoder_CreateInstance},
{&CLSID_WICPngDecoder, PngDecoder_CreateInstance}, {&CLSID_WICPngDecoder, PngDecoder_CreateInstance},
{&CLSID_WICPngEncoder, PngEncoder_CreateInstance}, {&CLSID_WICPngEncoder, PngEncoder_CreateInstance},
......
...@@ -1240,7 +1240,7 @@ static HRESULT WINAPI PngDecoder_Block_GetReaderByIndex(IWICMetadataBlockReader ...@@ -1240,7 +1240,7 @@ static HRESULT WINAPI PngDecoder_Block_GetReaderByIndex(IWICMetadataBlockReader
This->metadata_blocks[nIndex].ofs, This->metadata_blocks[nIndex].len); This->metadata_blocks[nIndex].ofs, This->metadata_blocks[nIndex].len);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = ComponentFactory_CreateInstance(&IID_IWICComponentFactory, (void**)&factory); hr = ImagingFactory_CreateInstance(&IID_IWICComponentFactory, (void**)&factory);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
......
...@@ -637,7 +637,7 @@ HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT SDKVersion, IWICImagingFactory ...@@ -637,7 +637,7 @@ HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT SDKVersion, IWICImagingFactory
{ {
TRACE("%x, %p\n", SDKVersion, ppIImagingFactory); TRACE("%x, %p\n", SDKVersion, ppIImagingFactory);
return ComponentFactory_CreateInstance(&IID_IWICImagingFactory, (void**)ppIImagingFactory); return ImagingFactory_CreateInstance(&IID_IWICImagingFactory, (void**)ppIImagingFactory);
} }
HRESULT WINAPI WICSetEncoderFormat_Proxy(IWICBitmapSource *pSourceIn, HRESULT WINAPI WICSetEncoderFormat_Proxy(IWICBitmapSource *pSourceIn,
......
...@@ -637,6 +637,38 @@ todo_wine ...@@ -637,6 +637,38 @@ todo_wine
IWICImagingFactory_Release(factory); IWICImagingFactory_Release(factory);
} }
static void test_imagingfactory_interfaces(void)
{
IWICComponentFactory *component_factory;
IWICImagingFactory2 *factory2;
IWICImagingFactory *factory;
HRESULT hr;
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory2, (void **)&factory2);
if (FAILED(hr))
{
win_skip("IWICImagingFactory2 is not supported.\n");
return;
}
hr = IWICImagingFactory2_QueryInterface(factory2, &IID_IWICComponentFactory, (void **)&component_factory);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IWICComponentFactory_QueryInterface(component_factory, &IID_IWICImagingFactory, (void **)&factory);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(factory == (IWICImagingFactory *)component_factory, "Unexpected factory pointer.\n");
IWICImagingFactory_Release(factory);
hr = IWICImagingFactory2_QueryInterface(factory2, &IID_IWICImagingFactory, (void **)&factory);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(factory == (IWICImagingFactory *)component_factory, "Unexpected factory pointer.\n");
IWICComponentFactory_Release(component_factory);
IWICImagingFactory2_Release(factory2);
IWICImagingFactory_Release(factory);
}
START_TEST(info) START_TEST(info)
{ {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
...@@ -644,6 +676,7 @@ START_TEST(info) ...@@ -644,6 +676,7 @@ START_TEST(info)
test_decoder_info(); test_decoder_info();
test_reader_info(); test_reader_info();
test_pixelformat_info(); test_pixelformat_info();
test_imagingfactory_interfaces();
CoUninitialize(); CoUninitialize();
} }
...@@ -75,7 +75,7 @@ HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDE ...@@ -75,7 +75,7 @@ HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDE
typedef HRESULT(*class_constructor)(REFIID,void**); typedef HRESULT(*class_constructor)(REFIID,void**);
extern HRESULT FormatConverter_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT FormatConverter_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
extern HRESULT ComponentFactory_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT ImagingFactory_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
extern HRESULT BmpDecoder_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT BmpDecoder_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
extern HRESULT PngDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT PngDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
extern HRESULT PngEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT PngEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
......
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