Removed more code at Hidenori's request.
[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  * Copyright (C) the Wine project
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  */
23
24 #ifndef __WINE_WINE_OBJ_MISC_H
25 #define __WINE_WINE_OBJ_MISC_H
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* defined(__cplusplus) */
30
31 /*****************************************************************************
32  * Predeclare the interfaces
33  */
34 DEFINE_OLEGUID(IID_IEnumString,         0x00000101L, 0, 0);
35 typedef struct IEnumString IEnumString,*LPENUMSTRING;
36
37 DEFINE_OLEGUID(IID_IEnumUnknown,        0x00000100L, 0, 0);
38 typedef struct IEnumUnknown IEnumUnknown,*LPENUMUNKNOWN;
39
40 DEFINE_OLEGUID(IID_IMallocSpy,          0x0000001dL, 0, 0);
41 typedef struct IMallocSpy IMallocSpy,*LPMALLOCSPY;
42
43 DEFINE_OLEGUID(IID_IMultiQI,            0x00000020L, 0, 0);
44 typedef struct IMultiQI IMultiQI,*LPMULTIQI;
45
46
47 /*****************************************************************************
48  * IEnumString interface
49  */
50 #define ICOM_INTERFACE IEnumString
51 #define IEnumString_METHODS \
52     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, LPOLESTR*,rgelt, ULONG*,pceltFethed) \
53     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
54     ICOM_METHOD (HRESULT,Reset) \
55     ICOM_METHOD1(HRESULT, Clone, IEnumString**, ppenum)
56 #define IEnumString_IMETHODS \
57     IUnknown_IMETHODS \
58     IEnumString_METHODS
59 ICOM_DEFINE(IEnumString,IUnknown)
60 #undef ICOM_INTERFACE
61
62 /*** IUnknown methods ***/
63 #define IEnumString_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
64 #define IEnumString_AddRef(p)             ICOM_CALL (AddRef,p)
65 #define IEnumString_Release(p)            ICOM_CALL (Release,p)
66 /*** IEnumString methods ***/
67 #define IEnumString_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
68 #define IEnumString_Skip(p,a)     ICOM_CALL1(Skip,p,a)
69 #define IEnumString_Reset(p)      ICOM_CALL (Reset,p)
70 #define IEnumString_Clone(p,a)    ICOM_CALL1(Clone,p,a)
71
72
73
74 /*****************************************************************************
75  * IEnumUnknown interface
76  */
77 #define ICOM_INTERFACE IEnumUnknown
78 #define IEnumUnknown_METHODS \
79     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, IUnknown**,rgelt, ULONG*,pceltFethed) \
80     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
81     ICOM_METHOD (HRESULT,Reset) \
82     ICOM_METHOD1(HRESULT,Clone, IEnumUnknown**,ppenum)
83 #define IEnumUnknown_IMETHODS \
84     IUnknown_IMETHODS \
85     IEnumUnknown_METHODS
86 ICOM_DEFINE(IEnumUnknown,IUnknown)
87 #undef ICOM_INTERFACE
88
89 /*** IUnknown methods ***/
90 #define IEnumUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
91 #define IEnumUnknown_AddRef(p)             ICOM_CALL (AddRef,p)
92 #define IEnumUnknown_Release(p)            ICOM_CALL (Release,p)
93 /*** IEnumUnknown methods ***/
94 #define IEnumUnknown_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
95 #define IEnumUnknown_Skip(p,a)     ICOM_CALL1(Skip,p,a)
96 #define IEnumUnknown_Reset(p)      ICOM_CALL (Reset,p)
97 #define IEnumUnknown_Clone(p,a)    ICOM_CALL1(Clone,p,a)
98
99
100 /*****************************************************************************
101  * IMallocSpy interface
102  */
103 #define ICOM_INTERFACE IMallocSpy
104 #define IMallocSpy_METHODS \
105     ICOM_METHOD1 (ULONG,PreAlloc,        ULONG,cbRequest) \
106     ICOM_VMETHOD1(      PostAlloc,       void*,pActual) \
107     ICOM_METHOD2 (PVOID,PreFree,         void*,pRequest, BOOL,fSpyed) \
108     ICOM_VMETHOD1(      PostFree,        BOOL,fSpyed) \
109     ICOM_METHOD4 (ULONG,PreRealloc,      void*,pRequest, ULONG,cbRequest, void**,ppNewRequest, BOOL,fSpyed) \
110     ICOM_METHOD2 (PVOID,PostRealloc,     void*,pActual, BOOL,fSpyed) \
111     ICOM_METHOD2 (PVOID,PreGetSize,      void*,pRequest, BOOL,fSpyed) \
112     ICOM_METHOD2 (ULONG,PostGetSize,     ULONG,cbActual, BOOL,fSpyed) \
113     ICOM_METHOD2 (PVOID,PreDidAlloc,     void*,pRequest, BOOL,fSpyed) \
114     ICOM_METHOD3 (int,  PostDidAlloc,    void*,pRequest, BOOL,fSpyed, int,fActual) \
115     ICOM_METHOD  (int,  PreHeapMinimize) \
116     ICOM_METHOD  (int,  PostHeapMinimize)
117 #define IMallocSpy_IMETHODS \
118     IUnknown_IMETHODS \
119     IMallocSpy_METHODS
120 ICOM_DEFINE(IMallocSpy,IUnknown)
121 #undef ICOM_INTERFACE
122
123 /*** IUnknown methods ***/
124 #define IMallocSpy_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
125 #define IMallocSpy_AddRef(p)             ICOM_CALL (AddRef,p)
126 #define IMallocSpy_Release(p)            ICOM_CALL (Release,p)
127 /*** IMallocSpy methods ***/
128 #define IMallocSpy_PreAlloc(p,a)         ICOM_CALL1(PreAlloc,p,a)
129 #define IMallocSpy_PostAlloc(p,a)        ICOM_CALL1(PostAlloc,p,a)
130 #define IMallocSpy_PreFree(p,a,b)        ICOM_CALL2(PreFree,p,a,b)
131 #define IMallocSpy_PostFree(p,a)         ICOM_CALL1(PostFree,p,a)
132 #define IMallocSpy_PreRealloc(p,a,b,c,d) ICOM_CALL4(PreRealloc,p,a,b,c,d)
133 #define IMallocSpy_PostRealloc(p,a,b)    ICOM_CALL2(PostRealloc,p,a,b)
134 #define IMallocSpy_PreGetSize(p,a,b)     ICOM_CALL2(PreGetSize,p,a,b)
135 #define IMallocSpy_PostGetSize(p,a,b)    ICOM_CALL2(PostGetSize,p,a,b)
136 #define IMallocSpy_PreDidAlloc(p,a,b)    ICOM_CALL2(PreDidAlloc,p,a,b)
137 #define IMallocSpy_PostDidAlloc(p,a,b,c) ICOM_CALL3(PostDidAlloc,p,a,b,c)
138 #define IMallocSpy_PreHeapMinimize(p)    ICOM_CALL (PreHeapMinimize,p)
139 #define IMallocSpy_PostHeapMinimize(p)   ICOM_CALL (PostHeapMinimize,p)
140
141 /* FIXME: not implemented */
142 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
143
144 /* FIXME: not implemented */
145 HRESULT WINAPI CoRevokeMallocSpy(void);
146
147 HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
148
149
150 /*****************************************************************************
151  * IMultiQI interface
152  */
153 typedef struct tagMULTI_QI
154 {
155     const IID* pIID;
156     IUnknown* pItf;
157     HRESULT hr;
158 } MULTI_QI;
159
160 #define ICOM_INTERFACE IMultiQI
161 #define IMultiQI_METHODS \
162     ICOM_METHOD2(HRESULT,QueryMultipleInterfaces, ULONG,cMQIs, MULTI_QI*,pMQIs)
163 #define IMultiQI_IMETHODS \
164     IUnknown_IMETHODS \
165     IMultiQI_METHODS
166 ICOM_DEFINE(IMultiQI,IUnknown)
167 #undef ICOM_INTERFACE
168
169 /*** IUnknown methods ***/
170 #define IMultiQI_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
171 #define IMultiQI_AddRef(p)             ICOM_CALL (AddRef,p)
172 #define IMultiQI_Release(p)            ICOM_CALL (Release,p)
173 /*** IMultiQI methods ***/
174 #define IMultiQI_QueryMultipleInterfaces(p,a,b) ICOM_CALL2(QueryMultipleInterfaces,p,a,b)
175
176
177 /*****************************************************************************
178  * Additional API
179  */
180
181 DWORD WINAPI CoBuildVersion(void);
182
183 DWORD WINAPI CoGetCurrentProcess(void);
184
185 /* FIXME: unimplemented */
186 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
187
188 /* FIXME: unimplemented */
189 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
190
191 HRESULT WINAPI CoCreateInstanceEx(REFCLSID      rclsid, 
192                                   LPUNKNOWN     pUnkOuter,
193                                   DWORD         dwClsContext, 
194                                   COSERVERINFO* pServerInfo,
195                                   ULONG         cmq,
196                                   MULTI_QI*     pResults);
197 #ifdef __cplusplus
198 } /*  extern "C" */
199 #endif /* defined(__cplusplus) */
200
201 #endif /* __WINE_WINE_OBJ_MISC_H */