Rémi Bernon : dinput: Canonicalize code style of IDirectInput7WImpl_CreateDeviceEx.

Alexandre Julliard julliard at winehq.org
Tue Oct 26 16:19:18 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Tue Oct 26 09:17:28 2021 +0200

dinput: Canonicalize code style of IDirectInput7WImpl_CreateDeviceEx.

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

---

 dlls/dinput/dinput_main.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 27fd7fa7364..bee919cebff 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -605,38 +605,36 @@ static HRESULT WINAPI IDirectInput2WImpl_FindDevice(LPDIRECTINPUT7W iface, REFGU
     return DI_OK;
 }
 
-static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx( IDirectInput7W *iface, REFGUID rguid, REFIID riid,
-                                                         LPVOID *pvOut, LPUNKNOWN lpUnknownOuter )
+static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx( IDirectInput7W *iface, const GUID *guid,
+                                                         const GUID *iid, void **out, IUnknown *outer )
 {
+    IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
     IDirectInputDevice8W *device;
-    IDirectInputImpl *This = impl_from_IDirectInput7W( iface );
     unsigned int i;
     HRESULT hr;
 
-    TRACE( "(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid( rguid ), debugstr_guid( riid ), pvOut, lpUnknownOuter );
-
-    if (pvOut)
-        *pvOut = NULL;
+    TRACE( "iface %p, guid %s, iid %s, out %p, outer %p\n", iface, debugstr_guid( guid ),
+           debugstr_guid( iid ), out, outer );
 
-    if (!rguid || !pvOut)
-        return E_POINTER;
+    if (!out) return E_POINTER;
+    *out = NULL;
 
-    if (!This->initialized)
-        return DIERR_NOTINITIALIZED;
+    if (!guid) return E_POINTER;
+    if (!impl->initialized) return DIERR_NOTINITIALIZED;
 
     /* Loop on all the devices to see if anyone matches the given GUID */
     for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
     {
         if (!dinput_devices[i]->create_device) continue;
-        if (SUCCEEDED(hr = dinput_devices[i]->create_device( This, rguid, &device )))
+        if (SUCCEEDED(hr = dinput_devices[i]->create_device( impl, guid, &device )))
         {
-            hr = IDirectInputDevice8_QueryInterface( device, riid, pvOut );
+            hr = IDirectInputDevice8_QueryInterface( device, iid, out );
             IDirectInputDevice8_Release( device );
             return hr;
         }
     }
 
-    WARN("invalid device GUID %s\n", debugstr_guid(rguid));
+    WARN( "invalid device GUID %s\n", debugstr_guid( guid ) );
     return DIERR_DEVICENOTREG;
 }
 




More information about the wine-cvs mailing list