Rémi Bernon : windows.gaming.input: Return correct error from DllGetActivationFactory.

Alexandre Julliard julliard at winehq.org
Fri Mar 11 14:49:11 CST 2022


Module: wine
Branch: master
Commit: 6ebdf1bab9eafb039078916bbc244b674423d6f1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6ebdf1bab9eafb039078916bbc244b674423d6f1

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Mar 11 09:43:47 2022 +0100

windows.gaming.input: Return correct error from DllGetActivationFactory.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windows.gaming.input/main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c
index c5b7f19c987..1ddd3a8fd23 100644
--- a/dlls/windows.gaming.input/main.c
+++ b/dlls/windows.gaming.input/main.c
@@ -169,7 +169,6 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory **
 {
     static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
     const WCHAR *buffer = WindowsGetStringRawBuffer( class_str, NULL );
-    HRESULT hr = REGDB_E_CLASSNOTREG;
 
     TRACE( "class %s, factory %p.\n", debugstr_w(buffer), factory );
 
@@ -178,13 +177,14 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory **
     *factory = NULL;
 
     if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_RawGameController ))
-        hr = ICustomGameControllerFactory_QueryInterface( controller_factory, &IID_IActivationFactory, (void **)factory );
+        ICustomGameControllerFactory_QueryInterface( controller_factory, &IID_IActivationFactory, (void **)factory );
     if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_Gamepad ))
-        hr = ICustomGameControllerFactory_QueryInterface( gamepad_factory, &IID_IActivationFactory, (void **)factory );
+        ICustomGameControllerFactory_QueryInterface( gamepad_factory, &IID_IActivationFactory, (void **)factory );
     if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_Custom_GameControllerFactoryManager ))
-        hr = IGameControllerFactoryManagerStatics2_QueryInterface( manager_factory, &IID_IActivationFactory, (void **)factory );
+        IGameControllerFactoryManagerStatics2_QueryInterface( manager_factory, &IID_IActivationFactory, (void **)factory );
 
-    return hr;
+    if (*factory) return S_OK;
+    return CLASS_E_CLASSNOTAVAILABLE;
 }
 
 BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )




More information about the wine-cvs mailing list