From: Vibhav Pant vibhavp@gmail.com
--- dlls/vccorlib140/tests/vccorlib.c | 14 +++++++------- dlls/vccorlib140/vccorlib.c | 13 +++++++++++-- 2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/dlls/vccorlib140/tests/vccorlib.c b/dlls/vccorlib140/tests/vccorlib.c index aa9ec3ae842..f967e7facfc 100644 --- a/dlls/vccorlib140/tests/vccorlib.c +++ b/dlls/vccorlib140/tests/vccorlib.c @@ -235,24 +235,24 @@ static void test_GetActivationFactoryByPCWSTR(void) void *out;
hr = pGetActivationFactoryByPCWSTR(L"Wine.Nonexistent.RuntimeClass", &IID_IActivationFactory, &out); - todo_wine ok(hr == CO_E_NOTINITIALIZED, "got hr %#lx\n", hr); + ok(hr == CO_E_NOTINITIALIZED, "got hr %#lx\n", hr);
hr = pInitializeData(1); ok(hr == S_OK, "got hr %#lx\n", hr);
hr = pGetActivationFactoryByPCWSTR(L"Wine.Nonexistent.RuntimeClass", &IID_IActivationFactory, &out); - todo_wine ok(hr == REGDB_E_CLASSNOTREG, "got hr %#lx\n", hr); + ok(hr == REGDB_E_CLASSNOTREG, "got hr %#lx\n", hr);
hr = pGetActivationFactoryByPCWSTR(L"Windows.Foundation.Metadata.ApiInformation", &IID_IActivationFactory, &out); - todo_wine ok(hr == S_OK, "got hr %#lx\n", hr); - if (SUCCEEDED(hr)) IActivationFactory_Release(out); + ok(hr == S_OK, "got hr %#lx\n", hr); + IActivationFactory_Release(out);
hr = pGetActivationFactoryByPCWSTR(L"Windows.Foundation.Metadata.ApiInformation", &IID_IInspectable, &out); - todo_wine ok(hr == S_OK, "got hr %#lx\n", hr); - if (SUCCEEDED(hr)) IActivationFactory_Release(out); + ok(hr == S_OK, "got hr %#lx\n", hr); + IActivationFactory_Release(out);
hr = pGetActivationFactoryByPCWSTR(L"Windows.Foundation.Metadata.ApiInformation", &guid_null, &out); - todo_wine ok(hr == E_NOINTERFACE, "got hr %#lx\n", hr); + ok(hr == E_NOINTERFACE, "got hr %#lx\n", hr);
pUninitializeData(1); } diff --git a/dlls/vccorlib140/vccorlib.c b/dlls/vccorlib140/vccorlib.c index 96b2b7d5b0e..c6ffd854e96 100644 --- a/dlls/vccorlib140/vccorlib.c +++ b/dlls/vccorlib140/vccorlib.c @@ -17,6 +17,7 @@ */
#include "roapi.h" +#include "winstring.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(vccorlib); @@ -43,7 +44,15 @@ void __cdecl UninitializeData(int type)
HRESULT WINAPI GetActivationFactoryByPCWSTR(const WCHAR *name, REFIID iid, void **out) { - FIXME("(%s, %s, %p) stub\n", debugstr_w(name), debugstr_guid(iid), out); + HSTRING_HEADER hdr; + HSTRING str; + HRESULT hr;
- return E_NOTIMPL; + TRACE("(%s, %s, %p)\n", debugstr_w(name), debugstr_guid(iid), out); + + /* Use a fast-pass string to avoid an allocation. */ + hr = WindowsCreateStringReference(name, wcslen(name), &hdr, &str); + if (FAILED(hr)) return hr; + + return RoGetActivationFactory(str, iid, out); }