From cd631b7912deacc77a802a7c816faa2c76781aef Mon Sep 17 00:00:00 2001 From: winesync Date: Sat, 12 Mar 2022 15:11:51 +0100 Subject: [PATCH] [WINESYNC] msi/tests: Improve COM test. Test for a class that Wine actually supports, and also make sure our apartment is uninitialized. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard wine commit id fdb9bdc88b27ffdaea5ad31256f250b66bdf6b78 by Zebediah Figura --- modules/rostests/winetests/msi/custom.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 9cf90dc25ad..8d3234876ce 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -24,8 +24,7 @@ #include #include #define COBJMACROS -#include -#include +#include #include #include @@ -248,14 +247,19 @@ UINT WINAPI main_test(MSIHANDLE hinst) { UINT res; IUnknown *unk = NULL; - HRESULT hres; + HRESULT hr; /* Test for an MTA apartment */ - hres = CoCreateInstance(&CLSID_Picture_Metafile, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk); - todo_wine_ok(hinst, hres == S_OK, "CoCreateInstance failed with %08x\n", hres); + hr = CoCreateInstance(&CLSID_XMLDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk); + todo_wine_ok(hinst, hr == S_OK, "CoCreateInstance failed with %08x\n", hr); if (unk) IUnknown_Release(unk); + /* but ours is uninitialized */ + hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hinst, hr == S_OK, "got %#x\n", hr); + CoUninitialize(); + /* Test MsiGetDatabaseState() */ res = MsiGetDatabaseState(hinst); todo_wine_ok(hinst, res == MSIDBSTATE_ERROR, "expected MSIDBSTATE_ERROR, got %u\n", res);