From 31c6ac2aac9855c50ecab0a94ac6ddb3d25ea8eb Mon Sep 17 00:00:00 2001 From: Francois Jacques Date: Tue, 19 Dec 2000 23:29:58 +0000 Subject: [PATCH] Implementation of Dispatch API. --- dlls/oleaut32/Makefile.in | 1 + dlls/oleaut32/dispatch.c | 125 ++++++++++++++++++++++++++++++++++++ dlls/oleaut32/oleaut32.spec | 6 +- 3 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 dlls/oleaut32/dispatch.c diff --git a/dlls/oleaut32/Makefile.in b/dlls/oleaut32/Makefile.in index ca43a2de57..ab8666cdcf 100644 --- a/dlls/oleaut32/Makefile.in +++ b/dlls/oleaut32/Makefile.in @@ -11,6 +11,7 @@ SYMBOLFILE = $(MODULE).tmp.o C_SRCS = \ connpt.c \ + dispatch.c \ ole2disp.c \ oleaut.c \ olefont.c \ diff --git a/dlls/oleaut32/dispatch.c b/dlls/oleaut32/dispatch.c new file mode 100644 index 0000000000..0192046a1a --- /dev/null +++ b/dlls/oleaut32/dispatch.c @@ -0,0 +1,125 @@ +/** + * Dispatch API functions + * + * Copyright 2000 Francois Jacques, Macadamian Technologies Inc. + * + * --- + * + * TODO: Type coercion is implemented in variant.c but not called yet. + */ + +#include +#include +#include +#include +#include "winerror.h" +#include "winreg.h" /* for HKEY_LOCAL_MACHINE */ +#include "winnls.h" /* for PRIMARYLANGID */ +#include "ole.h" +#include "heap.h" +#include "wine/obj_oleaut.h" +#include "debugtools.h" + +DEFAULT_DEBUG_CHANNEL(ole); +DECLARE_DEBUG_CHANNEL(typelib); + + +/****************************************************************************** + * DispInvoke (OLEAUT32.30) + * + * + * Calls method of an object through its IDispatch interface. + * + * NOTES + * - Defer method invocation to ITypeInfo::Invoke() + * + * RETURNS + * + * S_OK on success. + */ +HRESULT WINAPI +DispInvoke(VOID* _this, /* object instance */ + ITypeInfo* ptinfo, /* object's type info */ + DISPID dispidMember, /* member id */ + USHORT wFlags, /* kind of method call */ + DISPPARAMS* pparams, /* array of arguments */ + VARIANT* pvarResult, /* result of method call */ + EXCEPINFO* pexcepinfo, /* information about exception */ + UINT* puArgErr /* index of bad argument(if any) */ + ) +{ + HRESULT hr = E_FAIL; + + /** + * TODO: + * For each param, call DispGetParam to perform type coercion + */ + FIXME("Coercion of arguments not implemented\n"); + + hr = ICOM_CALL7(Invoke, + ptinfo, + _this, + dispidMember, + wFlags, + pparams, pvarResult, pexcepinfo, puArgErr); + + return (hr); +} + + +/****************************************************************************** + * DispGetIDsOfNames (OLEAUT32.29) + * + * Convert a set of names to dispids, based on information + * contained in object's type library. + * + * NOTES + * - Defers to ITypeInfo::GetIDsOfNames() + * + * RETURNS + * + * S_OK on success. + */ +HRESULT WINAPI +DispGetIDsOfNames(ITypeInfo* ptinfo, + OLECHAR** rgszNames, + UINT cNames, + DISPID* rgdispid) +{ + HRESULT hr = E_FAIL; + + hr = ICOM_CALL3(GetIDsOfNames, + ptinfo, + rgszNames, + cNames, + rgdispid); + return (hr); +} + +/****************************************************************************** + * DispGetParam (OLEAUT32.30) + * + * Retrive a parameter from a DISPPARAMS structures and coerce it to + * specified variant type + * + * NOTES + * Coercion is done using system (0) locale. + * + * RETURNS + * + * S_OK on success. + */ +HRESULT WINAPI +DispGetParam(DISPPARAMS* pdispparams, + UINT position, + VARTYPE vtTarg) +{ + HRESULT hr = E_FAIL; + + /** + * TODO : Call VariantChangeTypeEx with LCID 0 (system) + */ + + FIXME("Coercion of arguments not implemented\n"); + return (hr); +} diff --git a/dlls/oleaut32/oleaut32.spec b/dlls/oleaut32/oleaut32.spec index e9b475c724..4c44c32860 100644 --- a/dlls/oleaut32/oleaut32.spec +++ b/dlls/oleaut32/oleaut32.spec @@ -37,9 +37,9 @@ debug_channels (ole typelib) 25 stdcall SafeArrayGetElement(ptr ptr ptr) SafeArrayGetElement 26 stdcall SafeArrayPutElement(ptr ptr ptr) SafeArrayPutElement 27 stdcall SafeArrayCopy(ptr ptr) SafeArrayCopy -28 stub DispGetParam -29 stub DispGetIDsOfNames -30 stub DispInvoke +28 stdcall DispGetParam(ptr long long ptr ptr) DispGetParam +29 stdcall DispGetIDsOfNames(ptr ptr long ptr) DispGetIDsOfNames +30 stdcall DispInvoke(ptr ptr long long ptr ptr ptr ptr) DispInvoke 31 stdcall CreateDispTypeInfo(ptr long ptr) CreateDispTypeInfo 32 stdcall CreateStdDispatch(ptr ptr ptr ptr) CreateStdDispatch 33 stdcall RegisterActiveObject(ptr ptr long ptr) RegisterActiveObject -- 2.32.0.93.g670b81a890