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

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2018-10-17 08:47:20 +02:00 committed by Alexandre Julliard
parent e55aca8f49
commit 91e4961d01
2 changed files with 15 additions and 5 deletions

View File

@ -839,6 +839,13 @@ HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_di
heap_free( query );
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 )))
{
IEnumWbemClassObject_Release( iter );
@ -873,9 +880,9 @@ static HRESULT WINAPI class_object_GetMethod(
if (hr == S_OK)
{
if (ppInSignature) *ppInSignature = in;
else IWbemClassObject_Release( in );
else if (in) IWbemClassObject_Release( in );
if (ppOutSignature) *ppOutSignature = out;
else IWbemClassObject_Release( out );
else if (out) IWbemClassObject_Release( out );
}
else IWbemClassObject_Release( in );
return hr;
@ -939,6 +946,7 @@ static HRESULT WINAPI class_object_NextMethod(
if (hr != S_OK)
{
SysFreeString( method );
if (*ppInSignature)
IWbemClassObject_Release( *ppInSignature );
}
else

View File

@ -415,7 +415,7 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path )
WBEM_FLAVOR_ORIGIN_PROPAGATED;
WCHAR full_path[MAX_COMPUTERNAME_LENGTH + ARRAY_SIZE(full_path_fmt)];
BSTR class, method;
IWbemClassObject *process, *out;
IWbemClassObject *process, *sig_in, *out;
IWbemQualifierSet *qualifiers;
VARIANT user, domain, retval, val;
DWORD full_path_len = 0;
@ -442,8 +442,10 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path )
win_skip( "Win32_Process not available\n" );
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( !sig_in, "sig_in != NULL\n");
IWbemClassObject_Release( process );
out = NULL;