Author: tfaber Date: Sat Jul 13 08:01:51 2013 New Revision: 59465
URL: http://svn.reactos.org/svn/reactos?rev=59465&view=rev Log: [COM_APITEST] - Add support for classes with ThreadingModel values other than Apartment
Modified: trunk/rostests/apitests/com/com_apitest.c trunk/rostests/apitests/com/com_apitest.h
Modified: trunk/rostests/apitests/com/com_apitest.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/com_apitest.c... ============================================================================== --- trunk/rostests/apitests/com/com_apitest.c [iso-8859-1] (original) +++ trunk/rostests/apitests/com/com_apitest.c [iso-8859-1] Sat Jul 13 08:01:51 2013 @@ -346,8 +346,9 @@ NTSTATUS status; UNICODE_STRING clsid; DWORD type; - WCHAR dllName[100]; - DWORD dllNameSize; + WCHAR data[100]; + DWORD dataSize; + PCWSTR expectedThreadingModel;
class = &ExpectedInterfaces[iClass]; status = RtlStringFromGUID(class->clsid, &clsid); @@ -367,31 +368,34 @@ if (myskip(result == NO_ERROR, "No key\n")) continue;
- dllNameSize = sizeof(dllName); - result = RegQueryValueEx(hKeyServer, NULL, NULL, &type, (PBYTE)dllName, &dllNameSize); + dataSize = sizeof(data); + result = RegQueryValueEx(hKeyServer, NULL, NULL, &type, (PBYTE)data, &dataSize); ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", class->name, result); if (!myskip(result == NO_ERROR, "No module name\n")) { ok(type == REG_SZ || type == REG_EXPAND_SZ, "type %lu for %s\n", type, class->name); - ok(dllNameSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dllNameSize, class->name); - ok(dllNameSize <= sizeof(dllName), "size %lu for %s\n", dllNameSize, class->name); - ok(dllName[dllNameSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name); + ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, class->name); + ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, class->name); + ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name); // TODO: Use SearchPath (or assume everything's in system32) and do a proper full path compare - PathStripPathW(dllName); - PathRemoveExtensionW(dllName); - ok(!wcsicmp(dllName, ModuleName), "Server is %ls, expected %ls for %s\n", dllName, ModuleName, class->name); + PathStripPathW(data); + PathRemoveExtensionW(data); + ok(!wcsicmp(data, ModuleName), "Server is %ls, expected %ls for %s\n", data, ModuleName, class->name); }
- dllNameSize = sizeof(dllName); - result = RegQueryValueEx(hKeyServer, L"ThreadingModel", NULL, &type, (PBYTE)dllName, &dllNameSize); + dataSize = sizeof(data); + result = RegQueryValueEx(hKeyServer, L"ThreadingModel", NULL, &type, (PBYTE)data, &dataSize); ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", class->name, result); if (!myskip(result == NO_ERROR, "No ThreadingModel\n")) { ok(type == REG_SZ || type == REG_EXPAND_SZ, "type %lu for %s\n", type, class->name); - ok(dllNameSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dllNameSize, class->name); - ok(dllNameSize <= sizeof(dllName), "size %lu for %s\n", dllNameSize, class->name); - ok(dllName[dllNameSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name); - ok(!wcsicmp(dllName, L"Apartment"), "Server is %ls, expected %ls for %s\n", dllName, L"Apartment", class->name); + ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, class->name); + ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, class->name); + ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name); + expectedThreadingModel = class->ThreadingModel; + if (!expectedThreadingModel) + expectedThreadingModel = L"Apartment"; + ok(!wcsicmp(data, expectedThreadingModel), "Server is %ls, expected %ls for %s\n", data, expectedThreadingModel, class->name); }
RegCloseKey(hKeyServer); @@ -428,7 +432,7 @@ IClassFactory *pCF = pv; hr = IClassFactory_CreateInstance(pCF, NULL, &IID_IUnknown, &pv); ok(hr == S_OK, "IClassFactory::CreateInstance failed for %s, hr = 0x%lx\n", class->name, hr); - if (SUCCEEDED(hr)) + if (!myskip(SUCCEEDED(hr), "No instance\n")) { IUnknown *pUnk = pv; IUnknown_Release(pUnk);
Modified: trunk/rostests/apitests/com/com_apitest.h URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/com_apitest.h... ============================================================================== --- trunk/rostests/apitests/com/com_apitest.h [iso-8859-1] (original) +++ trunk/rostests/apitests/com/com_apitest.h [iso-8859-1] Sat Jul 13 08:01:51 2013 @@ -48,6 +48,7 @@ LONG offset; const IID *iid; } ifaces[80]; + PCWSTR ThreadingModel; } CLASS_AND_INTERFACES; typedef const CLASS_AND_INTERFACES *PCCLASS_AND_INTERFACES;