Commit 91e4961d authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wbemprox: Return NULL signature when there are no input parameters.

parent e55aca8f
...@@ -839,6 +839,13 @@ HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_di ...@@ -839,6 +839,13 @@ HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_di
heap_free( query ); heap_free( query );
if (hr != S_OK) return hr; if (hr != S_OK) return hr;
if (!count_instances( iter ))
{
*sig = NULL;
IEnumWbemClassObject_Release( iter );
return S_OK;
}
if (!(name = build_signature_table_name( class, method, dir ))) if (!(name = build_signature_table_name( class, method, dir )))
{ {
IEnumWbemClassObject_Release( iter ); IEnumWbemClassObject_Release( iter );
...@@ -873,9 +880,9 @@ static HRESULT WINAPI class_object_GetMethod( ...@@ -873,9 +880,9 @@ static HRESULT WINAPI class_object_GetMethod(
if (hr == S_OK) if (hr == S_OK)
{ {
if (ppInSignature) *ppInSignature = in; if (ppInSignature) *ppInSignature = in;
else IWbemClassObject_Release( in ); else if (in) IWbemClassObject_Release( in );
if (ppOutSignature) *ppOutSignature = out; if (ppOutSignature) *ppOutSignature = out;
else IWbemClassObject_Release( out ); else if (out) IWbemClassObject_Release( out );
} }
else IWbemClassObject_Release( in ); else IWbemClassObject_Release( in );
return hr; return hr;
...@@ -939,6 +946,7 @@ static HRESULT WINAPI class_object_NextMethod( ...@@ -939,6 +946,7 @@ static HRESULT WINAPI class_object_NextMethod(
if (hr != S_OK) if (hr != S_OK)
{ {
SysFreeString( method ); SysFreeString( method );
if (*ppInSignature)
IWbemClassObject_Release( *ppInSignature ); IWbemClassObject_Release( *ppInSignature );
} }
else else
......
...@@ -415,7 +415,7 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) ...@@ -415,7 +415,7 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path )
WBEM_FLAVOR_ORIGIN_PROPAGATED; WBEM_FLAVOR_ORIGIN_PROPAGATED;
WCHAR full_path[MAX_COMPUTERNAME_LENGTH + ARRAY_SIZE(full_path_fmt)]; WCHAR full_path[MAX_COMPUTERNAME_LENGTH + ARRAY_SIZE(full_path_fmt)];
BSTR class, method; BSTR class, method;
IWbemClassObject *process, *out; IWbemClassObject *process, *sig_in, *out;
IWbemQualifierSet *qualifiers; IWbemQualifierSet *qualifiers;
VARIANT user, domain, retval, val; VARIANT user, domain, retval, val;
DWORD full_path_len = 0; DWORD full_path_len = 0;
...@@ -442,8 +442,10 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) ...@@ -442,8 +442,10 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path )
win_skip( "Win32_Process not available\n" ); win_skip( "Win32_Process not available\n" );
return; return;
} }
hr = IWbemClassObject_GetMethod( process, getownerW, 0, NULL, NULL ); sig_in = (void*)0xdeadbeef;
hr = IWbemClassObject_GetMethod( process, getownerW, 0, &sig_in, NULL );
ok( hr == S_OK, "failed to get GetOwner method %08x\n", hr ); ok( hr == S_OK, "failed to get GetOwner method %08x\n", hr );
ok( !sig_in, "sig_in != NULL\n");
IWbemClassObject_Release( process ); IWbemClassObject_Release( process );
out = NULL; out = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment