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