:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / include / ole32 / 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 #ifdef __cplusplus
12 extern "C" {
13 #endif /* defined(__cplusplus) */
14
15 /*****************************************************************************
16  * Predeclare the interfaces
17  */
18 DEFINE_OLEGUID(IID_IEnumString,         0x00000101L, 0, 0);
19 typedef struct IEnumString IEnumString,*LPENUMSTRING;
20
21 DEFINE_OLEGUID(IID_IEnumUnknown,        0x00000100L, 0, 0);
22 typedef struct IEnumUnknown IEnumUnknown,*LPENUMUNKNOWN;
23
24 DEFINE_OLEGUID(IID_IMallocSpy,          0x0000001dL, 0, 0);
25 typedef struct IMallocSpy IMallocSpy,*LPMALLOCSPY;
26
27 DEFINE_OLEGUID(IID_IMultiQI,            0x00000020L, 0, 0);
28 typedef struct IMultiQI IMultiQI,*LPMULTIQI;
29
30
31 /*****************************************************************************
32  * IEnumString interface
33  */
34 #define ICOM_INTERFACE IEnumString
35 #define IEnumString_METHODS \
36     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, LPOLESTR*,rgelt, ULONG*,pceltFethed) \
37     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
38     ICOM_METHOD (HRESULT,Reset) \
39     ICOM_METHOD1(HRESULT, Clone, IEnumString**, ppenum)
40 #define IEnumString_IMETHODS \
41     IUnknown_IMETHODS \
42     IEnumString_METHODS
43 ICOM_DEFINE(IEnumString,IUnknown)
44 #undef ICOM_INTERFACE
45
46 /*** IUnknown methods ***/
47 #define IEnumString_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
48 #define IEnumString_AddRef(p)             ICOM_CALL (AddRef,p)
49 #define IEnumString_Release(p)            ICOM_CALL (Release,p)
50 /*** IEnumString methods ***/
51 #define IEnumString_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
52 #define IEnumString_Skip(p,a)     ICOM_CALL1(Skip,p,a)
53 #define IEnumString_Reset(p)      ICOM_CALL (Reset,p)
54 #define IEnumString_Clone(p,a)    ICOM_CALL1(Clone,p,a)
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 /*** IUnknown methods ***/
74 #define IEnumUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
75 #define IEnumUnknown_AddRef(p)             ICOM_CALL (AddRef,p)
76 #define IEnumUnknown_Release(p)            ICOM_CALL (Release,p)
77 /*** IEnumUnknown methods ***/
78 #define IEnumUnknown_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
79 #define IEnumUnknown_Skip(p,a)     ICOM_CALL1(Skip,p,a)
80 #define IEnumUnknown_Reset(p)      ICOM_CALL (Reset,p)
81 #define IEnumUnknown_Clone(p,a)    ICOM_CALL1(Clone,p,a)
82
83
84 /*****************************************************************************
85  * IMallocSpy interface
86  */
87 #define ICOM_INTERFACE IMallocSpy
88 #define IMallocSpy_METHODS \
89     ICOM_METHOD1 (ULONG,PreAlloc,        ULONG,cbRequest) \
90     ICOM_VMETHOD1(      PostAlloc,       void*,pActual) \
91     ICOM_METHOD2 (PVOID,PreFree,         void*,pRequest, BOOL,fSpyed) \
92     ICOM_VMETHOD1(      PostFree,        BOOL,fSpyed) \
93     ICOM_METHOD4 (ULONG,PreRealloc,      void*,pRequest, ULONG,cbRequest, void**,ppNewRequest, BOOL,fSpyed) \
94     ICOM_METHOD2 (PVOID,PostRealloc,     void*,pActual, BOOL,fSpyed) \
95     ICOM_METHOD2 (PVOID,PreGetSize,      void*,pRequest, BOOL,fSpyed) \
96     ICOM_METHOD2 (ULONG,PostGetSize,     ULONG,cbActual, BOOL,fSpyed) \
97     ICOM_METHOD2 (PVOID,PreDidAlloc,     void*,pRequest, BOOL,fSpyed) \
98     ICOM_METHOD3 (int,  PostDidAlloc,    void*,pRequest, BOOL,fSpyed, int,fActual) \
99     ICOM_METHOD  (int,  PreHeapMinimize) \
100     ICOM_METHOD  (int,  PostHeapMinimize)
101 #define IMallocSpy_IMETHODS \
102     IUnknown_IMETHODS \
103     IMallocSpy_METHODS
104 ICOM_DEFINE(IMallocSpy,IUnknown)
105 #undef ICOM_INTERFACE
106
107 /*** IUnknown methods ***/
108 #define IMallocSpy_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
109 #define IMallocSpy_AddRef(p)             ICOM_CALL (AddRef,p)
110 #define IMallocSpy_Release(p)            ICOM_CALL (Release,p)
111 /*** IMallocSpy methods ***/
112 #define IMallocSpy_PreAlloc(p,a)         ICOM_CALL1(PreAlloc,p,a)
113 #define IMallocSpy_PostAlloc(p,a)        ICOM_CALL1(PostAlloc,p,a)
114 #define IMallocSpy_PreFree(p,a,b)        ICOM_CALL2(PreFree,p,a,b)
115 #define IMallocSpy_PostFree(p,a)         ICOM_CALL1(PostFree,p,a)
116 #define IMallocSpy_PreRealloc(p,a,b,c,d) ICOM_CALL4(PreRealloc,p,a,b,c,d)
117 #define IMallocSpy_PostRealloc(p,a,b)    ICOM_CALL2(PostRealloc,p,a,b)
118 #define IMallocSpy_PreGetSize(p,a,b)     ICOM_CALL2(PreGetSize,p,a,b)
119 #define IMallocSpy_PostGetSize(p,a,b)    ICOM_CALL2(PostGetSize,p,a,b)
120 #define IMallocSpy_PreDidAlloc(p,a,b)    ICOM_CALL2(PreDidAlloc,p,a,b)
121 #define IMallocSpy_PostDidAlloc(p,a,b,c) ICOM_CALL3(PostDidAlloc,p,a,b,c)
122 #define IMallocSpy_PreHeapMinimize(p)    ICOM_CALL (PreHeapMinimize,p)
123 #define IMallocSpy_PostHeapMinimize(p)   ICOM_CALL (PostHeapMinimize,p)
124
125 /* FIXME: not implemented */
126 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
127
128 /* FIXME: not implemented */
129 HRESULT WINAPI CoRevokeMallocSpy(void);
130
131 HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
132
133
134 /*****************************************************************************
135  * IMultiQI interface
136  */
137 typedef struct tagMULTI_QI
138 {
139     const IID* pIID;
140     IUnknown* pItf;
141     HRESULT hr;
142 } MULTI_QI;
143
144 #define ICOM_INTERFACE IMultiQI
145 #define IMultiQI_METHODS \
146     ICOM_METHOD2(HRESULT,QueryMultipleInterfaces, ULONG,cMQIs, MULTI_QI*,pMQIs)
147 #define IMultiQI_IMETHODS \
148     IUnknown_IMETHODS \
149     IMultiQI_METHODS
150 ICOM_DEFINE(IMultiQI,IUnknown)
151 #undef ICOM_INTERFACE
152
153 /*** IUnknown methods ***/
154 #define IMultiQI_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
155 #define IMultiQI_AddRef(p)             ICOM_CALL (AddRef,p)
156 #define IMultiQI_Release(p)            ICOM_CALL (Release,p)
157 /*** IMultiQI methods ***/
158 #define IMultiQI_QueryMultipleInterfaces(p,a,b) ICOM_CALL2(QueryMultipleInterfaces,p,a,b)
159
160
161 /*****************************************************************************
162  * Additional API
163  */
164
165 DWORD WINAPI CoBuildVersion(void);
166
167 DWORD WINAPI CoGetCurrentProcess(void);
168
169 /* FIXME: unimplemented */
170 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
171
172 /* FIXME: unimplemented */
173 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
174
175 HRESULT WINAPI CoCreateInstance(
176         REFCLSID rclsid,
177         LPUNKNOWN pUnkOuter,
178         DWORD dwClsContext,
179         REFIID iid,
180         LPVOID *ppv);
181
182 HRESULT WINAPI CoCreateInstanceEx(REFCLSID      rclsid, 
183                                   LPUNKNOWN     pUnkOuter,
184                                   DWORD         dwClsContext, 
185                                   COSERVERINFO* pServerInfo,
186                                   ULONG         cmq,
187                                   MULTI_QI*     pResults);
188 #ifdef __cplusplus
189 } /*  extern "C" */
190 #endif /* defined(__cplusplus) */
191
192 #endif /* __WINE_WINE_OBJ_MISC_H */