From f7bf3876af9d0682cdc9347a4da816bd58e22b6b Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Fri, 11 Jan 2013 17:21:23 +0100
Subject: [PATCH] wbemprox: Both signature parameters are optional in
 IWbemClassObject::GetMethod.

---
 dlls/wbemprox/class.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index 994e76b6f72..4e27c5c70dc 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -847,15 +847,23 @@ static HRESULT WINAPI class_object_GetMethod(
     IWbemClassObject **ppOutSignature )
 {
     struct class_object *co = impl_from_IWbemClassObject( iface );
+    IWbemClassObject *in, *out;
     HRESULT hr;
 
     TRACE("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, ppInSignature, ppOutSignature);
 
-    hr = create_signature( co->name, wszName, PARAM_IN, ppInSignature );
-    if (hr != S_OK || !ppOutSignature) return hr;
+    hr = create_signature( co->name, wszName, PARAM_IN, &in );
+    if (hr != S_OK) return hr;
 
-    hr = create_signature( co->name, wszName, PARAM_OUT, ppOutSignature );
-    if (hr != S_OK) IWbemClassObject_Release( *ppInSignature );
+    hr = create_signature( co->name, wszName, PARAM_OUT, &out );
+    if (hr == S_OK)
+    {
+        if (ppInSignature) *ppInSignature = in;
+        else IWbemClassObject_Release( in );
+        if (ppOutSignature) *ppOutSignature = out;
+        else IWbemClassObject_Release( out );
+    }
+    else IWbemClassObject_Release( in );
     return hr;
 }
 
-- 
GitLab