Reordered the CALLBACK and WINAPI directives so that it compiles with
[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 #ifdef __cplusplus
14 extern "C" {
15 #endif /* defined(__cplusplus) */
16
17 /*****************************************************************************
18  * Predeclare the interfaces
19  */
20 DEFINE_OLEGUID(IID_IEnumString,         0x00000101L, 0, 0);
21 typedef struct IEnumString IEnumString,*LPENUMSTRING;
22
23 DEFINE_OLEGUID(IID_IEnumUnknown,        0x00000100L, 0, 0);
24 typedef struct IEnumUnknown IEnumUnknown,*LPENUMUNKNOWN;
25
26 DEFINE_OLEGUID(IID_IMallocSpy,          0x0000001dL, 0, 0);
27 typedef struct IMallocSpy IMallocSpy,*LPMALLOCSPY;
28
29 DEFINE_OLEGUID(IID_IMultiQI,            0x00000020L, 0, 0);
30 typedef struct IMultiQI IMultiQI,*LPMULTIQI;
31
32
33 /*****************************************************************************
34  * IEnumString interface
35  */
36 #define ICOM_INTERFACE IEnumString
37 #define IEnumString_METHODS \
38     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, LPOLESTR*,rgelt, ULONG*,pceltFethed) \
39     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
40     ICOM_METHOD (HRESULT,Reset) \
41     ICOM_METHOD1(HRESULT, Clone, IEnumString**, ppenum)
42 #define IEnumString_IMETHODS \
43     IUnknown_IMETHODS \
44     IEnumString_METHODS
45 ICOM_DEFINE(IEnumString,IUnknown)
46 #undef ICOM_INTERFACE
47
48 /*** IUnknown methods ***/
49 #define IEnumString_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
50 #define IEnumString_AddRef(p)             ICOM_CALL (AddRef,p)
51 #define IEnumString_Release(p)            ICOM_CALL (Release,p)
52 /*** IEnumString methods ***/
53 #define IEnumString_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
54 #define IEnumString_Skip(p,a)     ICOM_CALL1(Skip,p,a)
55 #define IEnumString_Reset(p)      ICOM_CALL (Reset,p)
56 #define IEnumString_Clone(p,a)    ICOM_CALL1(Clone,p,a)
57
58
59
60 /*****************************************************************************
61  * IEnumUnknown interface
62  */
63 #define ICOM_INTERFACE IEnumUnknown
64 #define IEnumUnknown_METHODS \
65     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, IUnknown**,rgelt, ULONG*,pceltFethed) \
66     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
67     ICOM_METHOD (HRESULT,Reset) \
68     ICOM_METHOD1(HRESULT,Clone, IEnumUnknown**,ppenum)
69 #define IEnumUnknown_IMETHODS \
70     IUnknown_IMETHODS \
71     IEnumUnknown_METHODS
72 ICOM_DEFINE(IEnumUnknown,IUnknown)
73 #undef ICOM_INTERFACE
74
75 /*** IUnknown methods ***/
76 #define IEnumUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
77 #define IEnumUnknown_AddRef(p)             ICOM_CALL (AddRef,p)
78 #define IEnumUnknown_Release(p)            ICOM_CALL (Release,p)
79 /*** IEnumUnknown methods ***/
80 #define IEnumUnknown_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
81 #define IEnumUnknown_Skip(p,a)     ICOM_CALL1(Skip,p,a)
82 #define IEnumUnknown_Reset(p)      ICOM_CALL (Reset,p)
83 #define IEnumUnknown_Clone(p,a)    ICOM_CALL1(Clone,p,a)
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 (PVOID,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 (PVOID,PostRealloc,     void*,pActual, BOOL,fSpyed) \
97     ICOM_METHOD2 (PVOID,PreGetSize,      void*,pRequest, BOOL,fSpyed) \
98     ICOM_METHOD2 (ULONG,PostGetSize,     ULONG,cbActual, BOOL,fSpyed) \
99     ICOM_METHOD2 (PVOID,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 /*** IUnknown methods ***/
110 #define IMallocSpy_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
111 #define IMallocSpy_AddRef(p)             ICOM_CALL (AddRef,p)
112 #define IMallocSpy_Release(p)            ICOM_CALL (Release,p)
113 /*** IMallocSpy methods ***/
114 #define IMallocSpy_PreAlloc(p,a)         ICOM_CALL1(PreAlloc,p,a)
115 #define IMallocSpy_PostAlloc(p,a)        ICOM_CALL1(PostAlloc,p,a)
116 #define IMallocSpy_PreFree(p,a,b)        ICOM_CALL2(PreFree,p,a,b)
117 #define IMallocSpy_PostFree(p,a)         ICOM_CALL1(PostFree,p,a)
118 #define IMallocSpy_PreRealloc(p,a,b,c,d) ICOM_CALL4(PreRealloc,p,a,b,c,d)
119 #define IMallocSpy_PostRealloc(p,a,b)    ICOM_CALL2(PostRealloc,p,a,b)
120 #define IMallocSpy_PreGetSize(p,a,b)     ICOM_CALL2(PreGetSize,p,a,b)
121 #define IMallocSpy_PostGetSize(p,a,b)    ICOM_CALL2(PostGetSize,p,a,b)
122 #define IMallocSpy_PreDidAlloc(p,a,b)    ICOM_CALL2(PreDidAlloc,p,a,b)
123 #define IMallocSpy_PostDidAlloc(p,a,b,c) ICOM_CALL3(PostDidAlloc,p,a,b,c)
124 #define IMallocSpy_PreHeapMinimize(p)    ICOM_CALL (PreHeapMinimize,p)
125 #define IMallocSpy_PostHeapMinimize(p)   ICOM_CALL (PostHeapMinimize,p)
126
127 /* FIXME: not implemented */
128 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
129
130 /* FIXME: not implemented */
131 HRESULT WINAPI CoRevokeMallocSpy(void);
132
133 HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
134
135
136 /*****************************************************************************
137  * IMultiQI interface
138  */
139 typedef struct tagMULTI_QI
140 {
141     const IID* pIID;
142     IUnknown* pItf;
143     HRESULT hr;
144 } MULTI_QI;
145
146 #define ICOM_INTERFACE IMultiQI
147 #define IMultiQI_METHODS \
148     ICOM_METHOD2(HRESULT,QueryMultipleInterfaces, ULONG,cMQIs, MULTI_QI*,pMQIs)
149 #define IMultiQI_IMETHODS \
150     IUnknown_IMETHODS \
151     IMultiQI_METHODS
152 ICOM_DEFINE(IMultiQI,IUnknown)
153 #undef ICOM_INTERFACE
154
155 /*** IUnknown methods ***/
156 #define IMultiQI_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
157 #define IMultiQI_AddRef(p)             ICOM_CALL (AddRef,p)
158 #define IMultiQI_Release(p)            ICOM_CALL (Release,p)
159 /*** IMultiQI methods ***/
160 #define IMultiQI_QueryMultipleInterfaces(p,a,b) ICOM_CALL2(QueryMultipleInterfaces,p,a,b)
161
162
163 /*****************************************************************************
164  * Additional API
165  */
166
167 DWORD WINAPI CoBuildVersion(void);
168
169 DWORD WINAPI CoGetCurrentProcess(void);
170
171 /* FIXME: unimplemented */
172 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
173
174 /* FIXME: unimplemented */
175 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
176
177 HRESULT WINAPI CoCreateInstanceEx(REFCLSID      rclsid, 
178                                   LPUNKNOWN     pUnkOuter,
179                                   DWORD         dwClsContext, 
180                                   COSERVERINFO* pServerInfo,
181                                   ULONG         cmq,
182                                   MULTI_QI*     pResults);
183 #ifdef __cplusplus
184 } /*  extern "C" */
185 #endif /* defined(__cplusplus) */
186
187 #endif /* __WINE_WINE_OBJ_MISC_H */