wbemprox: Implement IWbemServices::ExecMethod.

This commit is contained in:
Hans Leidekker 2012-09-28 13:37:21 +02:00 committed by Alexandre Julliard
parent c36045dbcc
commit 99a3ad0691
3 changed files with 42 additions and 2 deletions

View File

@ -579,8 +579,24 @@ static HRESULT WINAPI wbem_services_ExecMethod(
IWbemClassObject **ppOutParams,
IWbemCallResult **ppCallResult )
{
FIXME("\n");
return WBEM_E_FAILED;
const struct table *table;
class_method *func;
struct path *path;
HRESULT hr;
TRACE("%p, %s, %s, %08x, %p, %p, %p, %p\n", iface, debugstr_w(strObjectPath),
debugstr_w(strMethodName), lFlags, pCtx, pInParams, ppOutParams, ppCallResult);
if (lFlags) FIXME("flags %08x not supported\n", lFlags);
if ((hr = parse_path( strObjectPath, &path )) != S_OK) return hr;
table = get_table( path->class );
free_path( path );
if (!table) return WBEM_E_NOT_FOUND;
if ((hr = get_method( table, strMethodName, &func )) != S_OK) return hr;
return func( pInParams, ppOutParams );
}
static HRESULT WINAPI wbem_services_ExecMethodAsync(

View File

@ -239,6 +239,29 @@ HRESULT set_value( const struct table *table, UINT row, UINT column, LONGLONG va
return S_OK;
}
HRESULT get_method( const struct table *table, const WCHAR *name, class_method **func )
{
UINT i, j;
for (i = 0; i < table->num_rows; i++)
{
for (j = 0; j < table->num_cols; j++)
{
if (table->columns[j].type & COL_FLAG_METHOD && !strcmpW( table->columns[j].name, name ))
{
HRESULT hr;
LONGLONG val;
if ((hr = get_value( table, i, j, &val )) != S_OK) return hr;
*func = (class_method *)(INT_PTR)val;
return S_OK;
}
}
}
return WBEM_E_INVALID_METHOD;
}
static void clear_table( struct table *table )
{
UINT i, j, type;

View File

@ -162,6 +162,7 @@ HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC
HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN;
BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN;
HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN;
HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN;
HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE *, LONG * ) DECLSPEC_HIDDEN;
HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN;