Added an unknown VxD error code.
[wine] / dlls / oleaut32 / dispatch.c
1 /**
2  * Dispatch API functions
3  *
4  * Copyright 2000  Francois Jacques, Macadamian Technologies Inc.
5  *
6  * ---
7  *
8  * TODO: Type coercion is implemented in variant.c but not called yet.
9  */
10
11 #include <stdlib.h>
12 #include <string.h>
13 #include <stdio.h>
14 #include <ctype.h>
15 #include "winerror.h"
16 #include "winreg.h"         /* for HKEY_LOCAL_MACHINE */
17 #include "winnls.h"         /* for PRIMARYLANGID */
18 #include "ole.h"
19 #include "heap.h"
20 #include "wine/obj_oleaut.h"
21 #include "debugtools.h"
22
23 DEFAULT_DEBUG_CHANNEL(ole);
24 DECLARE_DEBUG_CHANNEL(typelib);
25
26
27 /******************************************************************************
28  *              DispInvoke (OLEAUT32.30)
29  *
30  *
31  * Calls method of an object through its IDispatch interface.
32  *
33  * NOTES
34  *              - Defer method invocation to ITypeInfo::Invoke()
35  *
36  * RETURNS
37  *
38  *              S_OK on success.
39  */
40 HRESULT WINAPI DispInvoke(
41         VOID       *_this,        /* [in] object instance */
42         ITypeInfo  *ptinfo,       /* [in] object's type info */
43         DISPID      dispidMember, /* [in] member id */
44         USHORT      wFlags,       /* [in] kind of method call */
45         DISPPARAMS *pparams,      /* [in] array of arguments */
46         VARIANT    *pvarResult,   /* [out] result of method call */
47         EXCEPINFO  *pexcepinfo,   /* [out] information about exception */
48         UINT       *puArgErr)     /* [out] index of bad argument(if any) */
49 {
50     HRESULT hr = E_FAIL;
51
52     /**
53      * TODO:
54      * For each param, call DispGetParam to perform type coercion
55      */
56     FIXME("Coercion of arguments not implemented\n");
57
58     hr = ICOM_CALL7(Invoke,
59                     ptinfo,
60                     _this,
61                     dispidMember,
62                     wFlags,
63                     pparams, pvarResult, pexcepinfo, puArgErr);
64
65     return (hr);
66 }
67
68
69 /******************************************************************************
70  *              DispGetIDsOfNames (OLEAUT32.29)
71  *
72  * Convert a set of names to dispids, based on information 
73  * contained in object's type library.
74  * 
75  * NOTES
76  *              - Defers to ITypeInfo::GetIDsOfNames()
77  *
78  * RETURNS
79  *
80  *              S_OK on success.
81  */
82 HRESULT WINAPI DispGetIDsOfNames(
83         ITypeInfo  *ptinfo,    /* [in] */
84         OLECHAR   **rgszNames, /* [in] */
85         UINT        cNames,    /* [in] */
86         DISPID     *rgdispid)  /* [out] */
87 {
88     HRESULT hr = E_FAIL;
89
90     hr = ICOM_CALL3(GetIDsOfNames,
91                     ptinfo,
92                     rgszNames,
93                     cNames,
94                     rgdispid);
95     return (hr);
96 }
97
98 /******************************************************************************
99  *              DispGetParam (OLEAUT32.28)
100  *
101  * Retrive a parameter from a DISPPARAMS structures and coerce it to
102  * specified variant type
103  *
104  * NOTES
105  *              Coercion is done using system (0) locale.
106  *
107  * RETURNS
108  *
109  *              S_OK on success.
110  */
111 HRESULT WINAPI DispGetParam(
112         DISPPARAMS *pdispparams, /* [in] */
113         UINT        position,    /* [in] */
114         VARTYPE     vtTarg,      /* [in] */
115         VARIANT    *pvarResult,  /* [out] */
116         UINT       *puArgErr)    /* [out] */
117 {
118     HRESULT hr = E_FAIL;
119
120     /**
121      * TODO : Call VariantChangeTypeEx with LCID 0 (system)
122      */
123
124     FIXME("Coercion of arguments not implemented\n");
125     return (hr);
126 }