Fixed GetActivationFactoryByPCWSTR for GameChat and Services

This commit is contained in:
Rodrigo Todescatto
2026-03-08 20:54:23 -03:00
parent bafafe9c7f
commit bebae516bf

View File

@@ -201,6 +201,8 @@ static void WdRoInitializeLibraries()
if (auto pfn = GetProcAddress(dll, "DllGetActivationFactory"); pfn != nullptr)
{
g_RoEntryPoints.push_back(reinterpret_cast<PFNGETACTIVATIONFACTORY>(pfn));
XWinePatchImport(dll, GetRuntimeModule(), "?GetActivationFactoryByPCWSTR@@YAJPEAXAEAVGuid@Platform@@PEAPEAX@Z", GetActivationFactoryRedirect);
}
}
}
@@ -209,6 +211,8 @@ static void WdRoInitializeLibraries()
if (auto pfn = GetProcAddress(dll, "GetActivationFactory"); pfn != nullptr)
{
g_RoEntryPoints.push_back(reinterpret_cast<PFNGETACTIVATIONFACTORY>(pfn));
XWinePatchImport(dll, GetRuntimeModule(), "?GetActivationFactoryByPCWSTR@@YAJPEAXAEAVGuid@Platform@@PEAPEAX@Z", GetActivationFactoryRedirect);
}
}
}
@@ -306,6 +310,14 @@ HRESULT WINAPI WdRoGetActivationFactoryCore(
for (auto pfn : g_RoEntryPoints)
{
ComPtr<IActivationFactory> temp;
if (wcscmp(rawString, L"Microsoft.Xbox.GameChat.ChatManager") == 0)
{
if (SUCCEEDED(pfn(activatableClassId, temp.GetAddressOf())))
{
HRESULT hr = temp.CopyTo(iid, factory);
return hr;
}
}
if (SUCCEEDED(pfn(activatableClassId, temp.GetAddressOf())))
{
@@ -314,6 +326,11 @@ HRESULT WINAPI WdRoGetActivationFactoryCore(
}
}
if (wcscmp(rawString, L"Windows.Xbox.Chat.ChatSession") == 0)
{
DebugBreak();
}
return g_RoGetActivationFactory(activatableClassId, iid, factory);
}