Nikolay Sivov : wbemdisp: Partially implement ExecMethod().
Alexandre Julliard
julliard at winehq.org
Mon Mar 1 15:54:04 CST 2021
Module: wine
Branch: master
Commit: 33e123db37d4ca7ad834f9a96990123189184ec8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=33e123db37d4ca7ad834f9a96990123189184ec8
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Mar 1 10:18:32 2021 +0300
wbemdisp: Partially implement ExecMethod().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wbemdisp/locator.c | 50 +++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 42 insertions(+), 8 deletions(-)
diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c
index 926a4e88e63..867a19c1ab2 100644
--- a/dlls/wbemdisp/locator.c
+++ b/dlls/wbemdisp/locator.c
@@ -1590,6 +1590,18 @@ static const ISWbemObjectVtbl object_vtbl =
object_get_Security_
};
+static struct object *unsafe_object_impl_from_IDispatch(IDispatch *iface)
+{
+ if (!iface)
+ return NULL;
+ if (iface->lpVtbl != (IDispatchVtbl *)&object_vtbl)
+ {
+ FIXME( "External implementations are not supported.\n" );
+ return NULL;
+ }
+ return CONTAINING_RECORD(iface, struct object, ISWbemObject_iface);
+}
+
static HRESULT SWbemObject_create( struct services *services, IWbemClassObject *wbem_object,
ISWbemObject **obj )
{
@@ -2412,15 +2424,37 @@ static HRESULT WINAPI services_ExecNotificationQueryAsync(
static HRESULT WINAPI services_ExecMethod(
ISWbemServices *iface,
- BSTR strObjectPath,
- BSTR strMethodName,
- IDispatch *objWbemInParameters,
- LONG iFlags,
- IDispatch *objWbemNamedValueSet,
- ISWbemObject **objWbemOutParameters )
+ BSTR path,
+ BSTR method,
+ IDispatch *in_sparams,
+ LONG flags,
+ IDispatch *valueset,
+ ISWbemObject **out_sparams )
{
- FIXME( "\n" );
- return E_NOTIMPL;
+ struct services *services = impl_from_ISWbemServices( iface );
+ IWbemClassObject *out_params = NULL;
+ struct object *in_params;
+ HRESULT hr;
+
+ TRACE( "%p, %s, %s, %p, %#x, %p, %p\n", services, debugstr_w(path), debugstr_w(method), in_sparams,
+ flags, valueset, out_sparams );
+
+ in_params = unsafe_object_impl_from_IDispatch( in_sparams );
+ out_params = NULL;
+
+ if (valueset)
+ FIXME("Named value set is unused\n");
+
+ hr = IWbemServices_ExecMethod( services->services, path, method, flags, NULL, in_params ? in_params->object : NULL,
+ out_sparams ? &out_params : NULL, NULL );
+
+ if (SUCCEEDED(hr) && out_params)
+ {
+ hr = SWbemObject_create( services, out_params, out_sparams );
+ IWbemClassObject_Release( out_params );
+ }
+
+ return hr;
}
static HRESULT WINAPI services_ExecMethodAsync(
More information about the wine-cvs
mailing list