decoder_info2 = NULL;
hr = IWICBitmapDecoder_GetDecoderInfo(decoder, &decoder_info2);
ok(hr == S_OK, "Failed to get decoder info, hr %#x.\n", hr);
- todo_wine
ok(decoder_info == decoder_info2, "Unexpected decoder info instance.\n");
hr = IWICBitmapDecoderInfo_QueryInterface(decoder_info, &IID_IWICBitmapDecoder, (void **)&decoder2);
IWICComponentInfo_Release(info);
}
+static DWORD WINAPI cache_across_threads_test(void *arg)
+{
+ IWICComponentInfo *info;
+ HRESULT hr;
+
+ CoInitialize(NULL);
+
+ hr = get_component_info(&CLSID_WICUnknownMetadataReader, &info);
+ ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+ ok(info == arg, "unexpected info pointer %p\n", info);
+ IWICComponentInfo_Release(info);
+
+ CoUninitialize();
+ return 0;
+}
+
static void test_reader_info(void)
{
IWICImagingFactory *factory;
- IWICComponentInfo *info;
+ IWICComponentInfo *info, *info2;
IWICMetadataReaderInfo *reader_info;
HRESULT hr;
CLSID clsid;
GUID container_formats[10];
- UINT count, size;
+ UINT count, size, tid;
+ HANDLE thread;
WICMetadataPattern *patterns;
+ hr = get_component_info(&CLSID_WICUnknownMetadataReader, &info2);
+ ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+ IWICComponentInfo_Release(info2);
+
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory, (void**)&factory);
ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
hr = IWICImagingFactory_CreateComponentInfo(factory, &CLSID_WICUnknownMetadataReader, &info);
ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+ ok(info == info2, "info != info2\n");
+
+ thread = CreateThread(NULL, 0, cache_across_threads_test, info, 0, &tid);
+ WaitForSingleObject(thread, INFINITE);
+ CloseHandle(thread);
hr = IWICComponentInfo_QueryInterface(info, &IID_IWICMetadataReaderInfo, (void**)&reader_info);
ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);