Commit 0083d4b0 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Add stub implementations of IWbemServices::ExecNotificationQueryAsync…

wbemprox: Add stub implementations of IWbemServices::ExecNotificationQueryAsync and IWbemServices::CancelAsyncCall.
parent d816192e
......@@ -221,8 +221,10 @@ static HRESULT WINAPI wbem_services_CancelAsyncCall(
IWbemServices *iface,
IWbemObjectSink *pSink )
{
FIXME("\n");
return WBEM_E_FAILED;
FIXME("%p, %p\n", iface, pSink);
IWbemObjectSink_Release( pSink );
return S_OK;
}
static HRESULT WINAPI wbem_services_QueryObjectSink(
......@@ -562,8 +564,11 @@ static HRESULT WINAPI wbem_services_ExecNotificationQueryAsync(
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
FIXME("%p, %s, %s, 0x%08x, %p, %p\n", iface, debugstr_w(strQueryLanguage), debugstr_w(strQuery),
lFlags, pCtx, pResponseHandler);
IWbemObjectSink_AddRef( pResponseHandler );
return S_OK;
}
static HRESULT WINAPI wbem_services_ExecMethod(
......
......@@ -516,6 +516,77 @@ static void test_StdRegProv( IWbemServices *services )
SysFreeString( class );
}
static HRESULT WINAPI sink_QueryInterface(
IWbemObjectSink *iface, REFIID riid, void **ppv )
{
*ppv = NULL;
if (IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IWbemObjectSink, riid ))
{
*ppv = iface;
IWbemObjectSink_AddRef( iface );
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG sink_refs;
static ULONG WINAPI sink_AddRef(
IWbemObjectSink *iface )
{
return ++sink_refs;
}
static ULONG WINAPI sink_Release(
IWbemObjectSink *iface )
{
return --sink_refs;
}
static HRESULT WINAPI sink_Indicate(
IWbemObjectSink *iface, LONG count, IWbemClassObject **objects )
{
trace("%d, %p\n", count, objects);
return S_OK;
}
static HRESULT WINAPI sink_SetStatus(
IWbemObjectSink *iface, LONG flags, HRESULT hresult, BSTR str_param, IWbemClassObject *obj_param )
{
trace("%08x, %08x, %s, %p\n", flags, hresult, wine_dbgstr_w(str_param), obj_param);
return S_OK;
}
static IWbemObjectSinkVtbl sink_vtbl =
{
sink_QueryInterface,
sink_AddRef,
sink_Release,
sink_Indicate,
sink_SetStatus
};
static IWbemObjectSink sink = { &sink_vtbl };
static void test_notification_query_async( IWbemServices *services )
{
static const WCHAR queryW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
'D','e','v','i','c','e','C','h','a','n','g','e','E','v','e','n','t',0};
BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW );
HRESULT hr;
hr = IWbemServices_ExecNotificationQueryAsync( services, wql, query, 0, NULL, &sink );
ok( hr == S_OK || broken(hr == WBEM_E_NOT_FOUND), "got %08x\n", hr );
ok( sink_refs, "got %u\n", sink_refs );
hr = IWbemServices_CancelAsyncCall( services, &sink );
ok( hr == S_OK, "got %08x\n", hr );
SysFreeString( wql );
SysFreeString( query );
}
START_TEST(query)
{
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
......@@ -545,6 +616,7 @@ START_TEST(query)
test_Win32_Process( services );
test_Win32_Service( services );
test_StdRegProv( services );
test_notification_query_async( services );
SysFreeString( path );
IWbemServices_Release( services );
......
......@@ -290,6 +290,24 @@ interface IWbemStatusCodeText : IUnknown
[out] BSTR *MessageText);
};
[
object,
restricted,
uuid(7c857801-7381-11cf-884d-00aa004b2e24)
]
interface IWbemObjectSink : IUnknown
{
HRESULT Indicate(
[in] long lObjectCount,
[in, size_is(lObjectCount)] IWbemClassObject **apObjArray);
HRESULT SetStatus(
[in] long lFlags,
[in] HRESULT hResult,
[in] BSTR strParam,
[in] IWbemClassObject *pObjParam);
};
typedef [v1_enum] enum tag_WBEM_GENERIC_FLAG_TYPE
{
WBEM_FLAG_RETURN_WBEM_COMPLETE = 0,
......
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