Implemented the CoCreateInstanceEx method.
[wine] / include / wine / obj_misc.h
1 /*
2  * Defines miscellaneous COM interfaces and APIs defined in objidl.h.
3  * These did not really fit into the other categories, whould have 
4  * required their own specific category or are too rarely used to be 
5  * put in 'obj_base.h'.
6  */
7
8 #ifndef __WINE_WINE_OBJ_MISC_H
9 #define __WINE_WINE_OBJ_MISC_H
10
11 #include "wine/obj_base.h"
12
13 /*****************************************************************************
14  * Predeclare the interfaces
15  */
16 DEFINE_OLEGUID(IID_IEnumString,         0x00000101L, 0, 0);
17 typedef struct IEnumString IEnumString,*LPENUMSTRING;
18
19 DEFINE_OLEGUID(IID_IEnumUnknown,        0x00000100L, 0, 0);
20 typedef struct IEnumUnknown IEnumUnknown,*LPENUMUNKNOWN;
21
22 DEFINE_OLEGUID(IID_IMallocSpy,          0x0000001dL, 0, 0);
23 typedef struct IMallocSpy IMallocSpy,*LPMALLOCSPY;
24
25 DEFINE_OLEGUID(IID_IMultiQI,            0x00000020L, 0, 0);
26 typedef struct IMultiQI IMultiQI,*LPMULTIQI;
27
28
29 /*****************************************************************************
30  * IEnumString interface
31  */
32 #define ICOM_INTERFACE IEnumString
33 #define IEnumString_METHODS \
34     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, LPOLESTR*,rgelt, ULONG*,pceltFethed); \
35     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt); \
36     ICOM_METHOD (HRESULT,Reset); \
37     ICOM_METHOD1 (HRESULT, Clone, IEnumString**, ppenum);
38 #define IEnumString_IMETHODS \
39     IUnknown_IMETHODS \
40     IEnumString_METHODS
41 ICOM_DEFINE(IEnumString,IUnknown)
42 #undef ICOM_INTERFACE
43
44 #ifdef ICOM_CINTERFACE
45 /*** IUnknown methods ***/
46 #define IEnumString_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
47 #define IEnumString_AddRef(p)             ICOM_CALL (AddRef,p)
48 #define IEnumString_Release(p)            ICOM_CALL (Release,p)
49 /*** IEnumString methods ***/
50 #define IEnumString_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
51 #define IEnumString_Skip(p,a)     ICOM_CALL1(Skip,p,a)
52 #define IEnumString_Reset(p)      ICOM_CALL (Reset,p)
53 #define IEnumString_Clone(p,a)    ICOM_CALL1(Clone,p,a)
54 #endif
55
56
57
58 /*****************************************************************************
59  * IEnumUnknown interface
60  */
61 #define ICOM_INTERFACE IEnumUnknown
62 #define IEnumUnknown_METHODS \
63     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, IUnknown**,rgelt, ULONG*,pceltFethed); \
64     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt); \
65     ICOM_METHOD (HRESULT,Reset); \
66     ICOM_METHOD1(HRESULT,Clone, IEnumUnknown**,ppenum);
67 #define IEnumUnknown_IMETHODS \
68     IUnknown_IMETHODS \
69     IEnumUnknown_METHODS
70 ICOM_DEFINE(IEnumUnknown,IUnknown)
71 #undef ICOM_INTERFACE
72
73 #ifdef ICOM_CINTERFACE
74 /*** IUnknown methods ***/
75 #define IEnumUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
76 #define IEnumUnknown_AddRef(p)             ICOM_CALL (AddRef,p)
77 #define IEnumUnknown_Release(p)            ICOM_CALL (Release,p)
78 /*** IEnumUnknown methods ***/
79 #define IEnumUnknown_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
80 #define IEnumUnknown_Skip(p,a)     ICOM_CALL1(Skip,p,a)
81 #define IEnumUnknown_Reset(p)      ICOM_CALL (Reset,p)
82 #define IEnumUnknown_Clone(p,a)    ICOM_CALL1(Clone,p,a)
83 #endif
84
85
86 /*****************************************************************************
87  * IMallocSpy interface
88  */
89 #define ICOM_INTERFACE IMallocSpy
90 #define IMallocSpy_METHODS \
91     ICOM_METHOD1 (ULONG,PreAlloc,        ULONG,cbRequest); \
92     ICOM_VMETHOD1(      PostAlloc,       void*,pActual); \
93     ICOM_METHOD2 (void*,PreFree,         void*,pRequest, BOOL,fSpyed); \
94     ICOM_VMETHOD1(      PostFree,        BOOL,fSpyed); \
95     ICOM_METHOD4 (ULONG,PreRealloc,      void*,pRequest, ULONG,cbRequest, void**,ppNewRequest, BOOL,fSpyed); \
96     ICOM_METHOD2 (void*,PostRealloc,     void*,pActual, BOOL,fSpyed); \
97     ICOM_METHOD2 (void*,PreGetSize,      void*,pRequest, BOOL,fSpyed); \
98     ICOM_METHOD2 (ULONG,PostGetSize,     ULONG,cbActual, BOOL,fSpyed); \
99     ICOM_METHOD2 (void*,PreDidAlloc,     void*,pRequest, BOOL,fSpyed); \
100     ICOM_METHOD3 (int,  PostDidAlloc,    void*,pRequest, BOOL,fSpyed, int,fActual); \
101     ICOM_METHOD  (int,  PreHeapMinimize); \
102     ICOM_METHOD  (int,  PostHeapMinimize);
103 #define IMallocSpy_IMETHODS \
104     IUnknown_IMETHODS \
105     IMallocSpy_METHODS
106 ICOM_DEFINE(IMallocSpy,IUnknown)
107 #undef ICOM_INTERFACE
108
109 #ifdef ICOM_CINTERFACE
110 /*** IUnknown methods ***/
111 #define IMallocSpy_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
112 #define IMallocSpy_AddRef(p)             ICOM_CALL (AddRef,p)
113 #define IMallocSpy_Release(p)            ICOM_CALL (Release,p)
114 /*** IMallocSpy methods ***/
115 #define IMallocSpy_PreAlloc(p,a)         ICOM_CALL1(PreAlloc,p,a)
116 #define IMallocSpy_PostAlloc(p,a)        ICOM_CALL1(PostAlloc,p,a)
117 #define IMallocSpy_PreFree(p,a,b)        ICOM_CALL2(PreFree,p,a,b)
118 #define IMallocSpy_PostFree(p,a)         ICOM_CALL1(PostFree,p,a)
119 #define IMallocSpy_PreRealloc(p,a,b,c,d) ICOM_CALL4(PreRealloc,p,a,b,c,d)
120 #define IMallocSpy_PostRealloc(p,a,b)    ICOM_CALL2(PostRealloc,p,a,b)
121 #define IMallocSpy_PreGetSize(p,a,b)     ICOM_CALL2(PreGetSize,p,a,b)
122 #define IMallocSpy_PostGetSize(p,a,b)    ICOM_CALL2(PostGetSize,p,a,b)
123 #define IMallocSpy_PreDidAlloc(p,a,b)    ICOM_CALL2(PreDidAlloc,p,a,b)
124 #define IMallocSpy_PostDidAlloc(p,a,b,c) ICOM_CALL3(PostDidAlloc,p,a,b,c)
125 #define IMallocSpy_PreHeapMinimize(p)    ICOM_CALL (PreHeapMinimize,p)
126 #define IMallocSpy_PostHeapMinimize(p)   ICOM_CALL (PostHeapMinimize,p)
127 #endif
128
129 /* FIXME: not implemented */
130 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
131
132 /* FIXME: not implemented */
133 HRESULT WINAPI CoRevokeMallocSpy(void);
134
135 HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
136
137
138 /*****************************************************************************
139  * IMultiQI interface
140  */
141 typedef struct tagMULTI_QI
142 {
143     const IID* pIID;
144     IUnknown* pItf;
145     HRESULT hr;
146 } MULTI_QI;
147
148 #define ICOM_INTERFACE IMultiQI
149 #define IMultiQI_METHODS \
150     ICOM_METHOD2(HRESULT,QueryMultipleInterfaces, ULONG,cMQIs, MULTI_QI*,pMQIs);
151 #define IMultiQI_IMETHODS \
152     IUnknown_IMETHODS \
153     IMultiQI_METHODS
154 ICOM_DEFINE(IMultiQI,IUnknown)
155 #undef ICOM_INTERFACE
156
157 #ifdef ICOM_CINTERFACE
158 /*** IUnknown methods ***/
159 #define IMultiQI_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
160 #define IMultiQI_AddRef(p)             ICOM_CALL (AddRef,p)
161 #define IMultiQI_Release(p)            ICOM_CALL (Release,p)
162 /*** IMultiQI methods ***/
163 #define IMultiQI_QueryMultipleInterfaces(p,a,b) ICOM_CALL2(QueryMultipleInterfaces,p,a,b)
164 #endif
165
166
167 /*****************************************************************************
168  * Additional API
169  */
170
171 DWORD WINAPI CoBuildVersion(void);
172
173 DWORD WINAPI CoGetCurrentProcess(void);
174
175 /* FIXME: unimplemented */
176 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
177
178 /* FIXME: unimplemented */
179 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
180
181 HRESULT WINAPI CoCreateInstanceEx(REFCLSID      rclsid, 
182                                   LPUNKNOWN     pUnkOuter,
183                                   DWORD         dwClsContext, 
184                                   COSERVERINFO* pServerInfo,
185                                   ULONG         cmq,
186                                   MULTI_QI*     pResults);
187
188 #endif /* __WINE_WINE_OBJ_MISC_H */