ole32: Fix CoGetApartmentType() return value for implicit MTA case.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-02-14 13:01:08 +03:00 committed by Alexandre Julliard
parent c18d2d1c0d
commit 90a6c9bd53
2 changed files with 3 additions and 1 deletions

View File

@ -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;

View File

@ -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);