Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/compobj.c | 1 + dlls/ole32/tests/compobj.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index aeed3b85fa..bd28f42b33 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -5264,6 +5264,7 @@ HRESULT WINAPI CoGetApartmentType(APTTYPE *type, APTTYPEQUALIFIER *qualifier) apartment_release(apt); *type = APTTYPE_MTA; *qualifier = APTTYPEQUALIFIER_IMPLICIT_MTA; + return S_OK; }
return info->apt ? S_OK : CO_E_NOTINITIALIZED; diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 7eb25af9e6..624120890d 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -648,7 +648,8 @@ static void _test_apt_type(APTTYPE expected_type, APTTYPEQUALIFIER expected_qual return;
hr = pCoGetApartmentType(&type, &qualifier); - ok_(__FILE__, line)(hr == S_OK || hr == CO_E_NOTINITIALIZED, "Unexpected return code: 0x%08x\n", hr); + ok_(__FILE__, line)(hr == S_OK || (type == APTTYPE_CURRENT && hr == CO_E_NOTINITIALIZED), + "Unexpected hr %#x.\n", hr); ok_(__FILE__, line)(type == expected_type, "Wrong apartment type %d, expected %d\n", type, expected_type); ok_(__FILE__, line)(qualifier == expected_qualifier, "Wrong apartment qualifier %d, expected %d\n", qualifier, expected_qualifier);