2 * Defines the COM interfaces and APIs related to the moniker functionality.
4 #ifndef __WINE_WINE_OBJ_MONIKER_H
5 #define __WINE_WINE_OBJ_MONIKER_H
7 #include "wine/obj_base.h"
8 #include "wine/obj_storage.h"
9 #include "wine/obj_misc.h"
13 #endif /* defined(__cplusplus) */
15 /*****************************************************************************
16 * Predeclare the interfaces
18 DEFINE_OLEGUID(IID_IBindCtx,0xe,0,0);
19 typedef struct IBindCtx IBindCtx,*LPBINDCTX;
20 typedef LPBINDCTX LPBC;
22 DEFINE_OLEGUID(IID_IClassActivator, 0x00000140L, 0, 0);
23 typedef struct IClassActivator IClassActivator,*LPCLASSACTIVATOR;
25 DEFINE_OLEGUID(IID_IEnumMoniker, 0x00000102L, 0, 0);
26 typedef struct IEnumMoniker IEnumMoniker,*LPENUMMONIKER;
28 DEFINE_OLEGUID(IID_IMoniker, 0x0000000fL, 0, 0);
29 typedef struct IMoniker IMoniker,*LPMONIKER;
31 DEFINE_GUID (IID_IROTData, 0xf29f6bc0L, 0x5021, 0x11ce, 0xaa, 0x15, 0x00, 0x00, 0x69, 0x01, 0x29, 0x3f);
32 typedef struct IROTData IROTData,*LPROTDATA;
34 DEFINE_OLEGUID(IID_IRunnableObject, 0x00000126L, 0, 0);
35 typedef struct IRunnableObject IRunnableObject,*LPRUNNABLEOBJECT;
37 DEFINE_OLEGUID(IID_IRunningObjectTable, 0x00000010L, 0, 0);
38 typedef struct IRunningObjectTable IRunningObjectTable,*LPRUNNINGOBJECTTABLE;
40 DEFINE_GUID( CLSID_FileMoniker,0x00000303,0,0,0xc0,0,0,0,0,0,0,0x46);
42 DEFINE_GUID( CLSID_ItemMoniker,0x00000304,0,0,0xc0,0,0,0,0,0,0,0x46);
44 DEFINE_GUID( CLSID_AntiMoniker,0x00000305,0,0,0xc0,0,0,0,0,0,0,0x46);
46 DEFINE_GUID( CLSID_CompositeMoniker,0x00000309,0,0,0xc0,0,0,0,0,0,0,0x46);
48 /*********************************************************************************
49 * BIND_OPTS and BIND_OPTS2 structures definition
50 * These structures contain parameters used during a moniker-binding operation.
51 *********************************************************************************/
52 typedef struct tagBIND_OPTS
57 DWORD dwTickCountDeadline;
58 } BIND_OPTS, * LPBIND_OPTS;
60 typedef struct tagBIND_OPTS2
65 DWORD dwTickCountDeadline;
69 COSERVERINFO* pServerInfo;
70 } BIND_OPTS2, * LPBIND_OPTS2;
72 /*****************************************************************************
75 #define ICOM_INTERFACE IBindCtx
76 #define IBindCtx_METHODS \
77 ICOM_METHOD1 (HRESULT, RegisterObjectBound, IUnknown*,punk) \
78 ICOM_METHOD1 (HRESULT, RevokeObjectBound, IUnknown*,punk) \
79 ICOM_METHOD (HRESULT, ReleaseBoundObjects) \
80 ICOM_METHOD1 (HRESULT, SetBindOptions, LPBIND_OPTS2,pbindopts) \
81 ICOM_METHOD1 (HRESULT, GetBindOptions, LPBIND_OPTS2,pbindopts) \
82 ICOM_METHOD1 (HRESULT, GetRunningObjectTable,IRunningObjectTable**,pprot) \
83 ICOM_METHOD2 (HRESULT, RegisterObjectParam, LPOLESTR,pszkey, IUnknown*,punk) \
84 ICOM_METHOD2 (HRESULT, GetObjectParam, LPOLESTR,pszkey, IUnknown**,punk) \
85 ICOM_METHOD1 (HRESULT, EnumObjectParam, IEnumString**,ppenum) \
86 ICOM_METHOD1 (HRESULT, RevokeObjectParam, LPOLESTR,pszkey)
87 #define IBindCtx_IMETHODS \
90 ICOM_DEFINE(IBindCtx,IUnknown)
93 #ifdef ICOM_CINTERFACE
94 /*** IUnknown methods ***/
95 #define IBindCtx_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
96 #define IBindCtxr_AddRef(p) ICOM_CALL (AddRef,p)
97 #define IBindCtx_Release(p) ICOM_CALL (Release,p)
99 #define IBindCtx_RegisterObjectBound(p,a) ICOM_CALL1(RegisterObjectBound,p,a)
100 #define IBindCtx_RevokeObjectBound(p,a) ICOM_CALL1(RevokeObjectBound,p,a)
101 #define IBindCtx_ReleaseBoundObjects(p) ICOM_CALL (ReleaseBoundObjects,p)
102 #define IBindCtx_SetBindOptions(p,a) ICOM_CALL1(SetBindOptions,p,a)
103 #define IBindCtx_GetBindOptions(p,a) ICOM_CALL1(GetBindOptions,p,a)
104 #define IBindCtx_GetRunningObjectTable(p,a) ICOM_CALL1(GetRunningObjectTable,p,a)
105 #define IBindCtx_RegisterObjectParam(p,a,b) ICOM_CALL2(RegisterObjectParam,p,a,b)
106 #define IBindCtx_GetObjectParam(p,a,b) ICOM_CALL2(GetObjectParam,p,a,b)
107 #define IBindCtx_EnumObjectParam(p,a) ICOM_CALL1(EnumObjectParam,p,a)
108 #define IBindCtx_RevokeObjectParam(p,a) ICOM_CALL1(RevokeObjectParam,p,a)
111 HRESULT WINAPI CreateBindCtx16(DWORD reserved, LPBC* ppbc);
112 HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc);
114 /*****************************************************************************
115 * IClassActivator interface
117 #define ICOM_INTERFACE IClassActivator
118 #define IClassActivator_METHODS \
119 ICOM_METHOD5(HRESULT,GetClassObject, REFCLSID,rclsid, DWORD,dwClassContext, LCID,locale, REFIID,riid, void**,ppv)
120 #define IClassActivator_IMETHODS \
122 IClassActivator_METHODS
123 ICOM_DEFINE(IClassActivator,IUnknown)
124 #undef ICOM_INTERFACE
126 #ifdef ICOM_CINTERFACE
127 /*** IUnknown methods ***/
128 #define IClassActivator_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
129 #define IClassActivator_AddRef(p) ICOM_CALL (AddRef,p)
130 #define IClassActivator_Release(p) ICOM_CALL (Release,p)
131 /*** IClassActivator methods ***/
132 #define IClassActivator_GetClassObject(p,a,b,c,d,e) ICOM_CALL5(GetClassObject,p,a,b,c,d,e)
136 /*****************************************************************************
137 * IEnumMoniker interface
139 #define ICOM_INTERFACE IEnumMoniker
140 #define IEnumMoniker_METHODS \
141 ICOM_METHOD3(HRESULT,Next, ULONG,celt, IMoniker**,rgelt, ULONG*,pceltFethed) \
142 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
143 ICOM_METHOD (HRESULT,Reset) \
144 ICOM_METHOD1(HRESULT,Clone, IEnumMoniker**,ppenum)
145 #define IEnumMoniker_IMETHODS \
148 ICOM_DEFINE(IEnumMoniker,IUnknown)
149 #undef ICOM_INTERFACE
151 #ifdef ICOM_CINTERFACE
152 /*** IUnknown methods ***/
153 #define IEnumMoniker_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
154 #define IEnumMoniker_AddRef(p) ICOM_CALL (AddRef,p)
155 #define IEnumMoniker_Release(p) ICOM_CALL (Release,p)
156 /*** IEnumMoniker methods ***/
157 #define IEnumMoniker_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
158 #define IEnumMoniker_Skip(p,a) ICOM_CALL1(Skip,p,a)
159 #define IEnumMoniker_Reset(p) ICOM_CALL (Reset,p)
160 #define IEnumMoniker_Clone(p,a) ICOM_CALL1(Clone,p,a)
163 /*****************************************************************************
167 typedef enum tagMKSYS
170 MKSYS_GENERICCOMPOSITE = 1,
171 MKSYS_FILEMONIKER = 2,
172 MKSYS_ANTIMONIKER = 3,
173 MKSYS_ITEMMONIKER = 4,
174 MKSYS_POINTERMONIKER = 5,
175 MKSYS_CLASSMONIKER = 7
178 typedef enum tagMKREDUCE
180 MKRREDUCE_ONE = 3 << 16,
181 MKRREDUCE_TOUSER = 2 << 16,
182 MKRREDUCE_THROUGHUSER = 1 << 16,
186 #define ICOM_INTERFACE IMoniker
187 #define IMoniker_METHODS \
188 ICOM_METHOD4(HRESULT,BindToObject, IBindCtx*,pbc, IMoniker*,pmkToLeft, REFIID,riidResult, void**,ppvResult) \
189 ICOM_METHOD4(HRESULT,BindToStorage, IBindCtx*,pbc, IMoniker*,pmkToLeft, REFIID,riid, void**,ppvObj) \
190 ICOM_METHOD4(HRESULT,Reduce, IBindCtx*,pbc, DWORD,dwReduceHowFar, IMoniker**,ppmkToLeft, IMoniker**,ppmkReduced) \
191 ICOM_METHOD3(HRESULT,ComposeWith, IMoniker*,pmkRight, BOOL,fOnlyIfNotGeneric, IMoniker**,ppmkComposite) \
192 ICOM_METHOD2(HRESULT,Enum, BOOL,fForward, IEnumMoniker**,ppenumMoniker) \
193 ICOM_METHOD1(HRESULT,IsEqual, IMoniker*,pmkOtherMoniker) \
194 ICOM_METHOD1(HRESULT,Hash, DWORD*,pdwHash) \
195 ICOM_METHOD3(HRESULT,IsRunning, IBindCtx*,pbc, IMoniker*,pmkToLeft, IMoniker*,pmkNewlyRunning) \
196 ICOM_METHOD3(HRESULT,GetTimeOfLastChange, IBindCtx*,pbc, IMoniker*,pmkToLeft, FILETIME*,pFileTime) \
197 ICOM_METHOD1(HRESULT,Inverse, IMoniker**,ppmk) \
198 ICOM_METHOD2(HRESULT,CommonPrefixWith, IMoniker*,pmkOtherMoniker, IMoniker**,ppmkPrefix) \
199 ICOM_METHOD2(HRESULT,RelativePathTo, IMoniker*,pmkOther, IMoniker**,ppmkRelPath) \
200 ICOM_METHOD3(HRESULT,GetDisplayName, IBindCtx*,pbc, IMoniker*,pmkToLeft, LPOLESTR*,ppszDisplayName) \
201 ICOM_METHOD5(HRESULT,ParseDisplayName, IBindCtx*,pbc, IMoniker*,pmkToLeft, LPOLESTR,pszDisplayName, ULONG*,pchEaten, IMoniker**,ppmkOut) \
202 ICOM_METHOD1(HRESULT,IsSystemMoniker, DWORD*,pdwMksys)
203 #define IMoniker_IMETHODS \
204 IPersistStream_IMETHODS \
206 ICOM_DEFINE(IMoniker,IPersistStream)
207 #undef ICOM_INTERFACE
209 #ifdef ICOM_CINTERFACE
210 /*** IUnknown methods ***/
211 #define IMoniker_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
212 #define IMoniker_AddRef(p) ICOM_CALL (AddRef,p)
213 #define IMoniker_Release(p) ICOM_CALL (Release,p)
215 /*** IPersist methods ***/
216 #define IMoniker_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
217 /*** IPersistStream methods ***/
218 #define IMoniker_IsDirty(p) ICOM_CALL (IsDirty,p)
219 #define IMoniker_Load(p,a) ICOM_CALL1(Load,p,a)
220 #define IMoniker_Save(p,a,b) ICOM_CALL2(Save,p,a,b)
221 #define IMoniker_GetSizeMax(p,a) ICOM_CALL1(GetSizeMax,p,a)
222 /*** IMoniker methods ***/
223 #define IMoniker_BindToObject(p,a,b,c,d) ICOM_CALL4(BindToObject,p,a,b,c,d)
224 #define IMoniker_BindToStorage(p,a,b,c,d) ICOM_CALL4(BindToStorage,p,a,b,c,d)
225 #define IMoniker_Reduce(p,a,b,c,d) ICOM_CALL4(Reduce,p,a,b,c,d)
226 #define IMoniker_ComposeWith(p,a,b,c) ICOM_CALL3(ComposeWith,p,a,b,c)
227 #define IMoniker_Enum(p,a,b) ICOM_CALL2(Enum,p,a,b)
228 #define IMoniker_IsEqual(p,a) ICOM_CALL1(IsEqual,p,a)
229 #define IMoniker_Hash(p,a) ICOM_CALL1(Hash,p,a)
230 #define IMoniker_IsRunning(p,a,b,c) ICOM_CALL3(IsRunning,p,a,b,c)
231 #define IMoniker_GetTimeOfLastChange(p,a,b,c) ICOM_CALL3(GetTimeOfLastChange,p,a,b,c)
232 #define IMoniker_Inverse(p,a) ICOM_CALL1(Inverse,p,a)
233 #define IMoniker_CommonPrefixWith(p,a,b) ICOM_CALL2(CommonPrefixWith,p,a,b)
234 #define IMoniker_RelativePathTo(p,a,b) ICOM_CALL2(RelativePathTo,p,a,b)
235 #define IMoniker_GetDisplayName(p,a,b,c) ICOM_CALL3(GetDisplayName,p,a,b,c)
236 #define IMoniker_ParseDisplayName(p,a,b,c,d,e) ICOM_CALL5(ParseDisplayName,p,a,b,c,d,e)
237 #define IMoniker_IsSystemMoniker(p,a) ICOM_CALL1(IsSystemMoniker,p,a)
240 HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName, LPMONIKER* ppmk);
241 HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk);
243 HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk);
244 HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk);
246 HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk);
248 HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite);
250 /* FIXME: not implemented */
251 HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult);
253 /* FIXME: not implemented */
254 HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk);
256 /* FIXME: not implemented */
257 HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER* ppmk);
259 /* FIXME: not implemented */
260 HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon);
261 /*****************************************************************************
264 #define ICOM_INTERFACE IROTData
265 #define IROTData_METHODS \
266 ICOM_METHOD3(HRESULT,GetComparisonData, byte*,pbData, ULONG,cbMax, ULONG*,pcbData)
267 #define IROTData_IMETHODS \
270 ICOM_DEFINE(IROTData,IUnknown)
271 #undef ICOM_INTERFACE
273 #ifdef ICOM_CINTERFACE
274 /*** IUnknown methods ***/
275 #define IROTData_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
276 #define IROTData_AddRef(p) ICOM_CALL (AddRef,p)
277 #define IROTData_Release(p) ICOM_CALL (Release,p)
278 /*** IROTData methods ***/
279 #define IROTData_GetComparisonData(p,a,b,c) ICOM_CALL3(GetComparisonData,p,a,b,c)
282 #define ICOM_THIS_From_IROTData(class, name) class* This = (class*)(((char*)name)-sizeof(void*))
284 /*****************************************************************************
285 * IRunnableObject interface
287 #define ICOM_INTERFACE IRunnableObject
288 #define IRunnableObject_METHODS \
289 ICOM_METHOD1(HRESULT,GetRunningClass, LPCLSID,lpClsid) \
290 ICOM_METHOD1(HRESULT,Run, IBindCtx*,pbc) \
291 ICOM_METHOD (BOOL,IsRunning) \
292 ICOM_METHOD2(HRESULT,LockRunning, BOOL,fLock, BOOL,fLastUnlockCloses) \
293 ICOM_METHOD1(HRESULT,SetContainedObject, BOOL,fContained)
294 #define IRunnableObject_IMETHODS \
296 IRunnableObject_METHODS
297 ICOM_DEFINE(IRunnableObject,IUnknown)
298 #undef ICOM_INTERFACE
300 #ifdef ICOM_CINTERFACE
301 /*** IUnknown methods ***/
302 #define IRunnableObject_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
303 #define IRunnableObject_AddRef(p) ICOM_CALL (AddRef,p)
304 #define IRunnableObject_Release(p) ICOM_CALL (Release,p)
305 /*** IRunnableObject methods ***/
306 #define IRunnableObject_GetRunningClass(p,a) ICOM_CALL1(GetRunningClass,p,a)
307 #define IRunnableObject_Run(p,a) ICOM_CALL1(Run,p,a)
308 #define IRunnableObject_IsRunning(p) ICOM_CALL (IsRunning,p)
309 #define IRunnableObject_LockRunning(p,a,b) ICOM_CALL2(LockRunning,p,a,b)
310 #define IRunnableObject_SetContainedObject(p,a) ICOM_CALL1(SetContainedObject,p,a)
314 /*****************************************************************************
315 * IRunningObjectTable interface
317 #define ICOM_INTERFACE IRunningObjectTable
318 #define IRunningObjectTable_METHODS \
319 ICOM_METHOD4(HRESULT,Register, DWORD,grfFlags, IUnknown*,punkObject, IMoniker*,pmkObjectName, DWORD*,pdwRegister) \
320 ICOM_METHOD1(HRESULT,Revoke, DWORD,dwRegister) \
321 ICOM_METHOD1(HRESULT,IsRunning, IMoniker*,pmkObjectName) \
322 ICOM_METHOD2(HRESULT,GetObject, IMoniker*,pmkObjectName, IUnknown**,ppunkObject) \
323 ICOM_METHOD2(HRESULT,NoteChangeTime, DWORD,dwRegister, FILETIME*,pfiletime) \
324 ICOM_METHOD2(HRESULT,GetTimeOfLastChange, IMoniker*,pmkObjectName, FILETIME*,pfiletime) \
325 ICOM_METHOD1(HRESULT,EnumRunning, IEnumMoniker**,ppenumMoniker)
326 #define IRunningObjectTable_IMETHODS \
328 IRunningObjectTable_METHODS
329 ICOM_DEFINE(IRunningObjectTable,IUnknown)
330 #undef ICOM_INTERFACE
332 #ifdef ICOM_CINTERFACE
333 /*** IUnknown methods ***/
334 #define IRunningObjectTable_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
335 #define IRunningObjectTable_AddRef(p) ICOM_CALL (AddRef,p)
336 #define IRunningObjectTable_Release(p) ICOM_CALL (Release,p)
337 /*** IRunningObjectTable methods ***/
338 #define IRunningObjectTable_Register(p,a,b,c,d) ICOM_CALL4(Register,p,a,b,c,d)
339 #define IRunningObjectTable_Revoke(p,a) ICOM_CALL1(Revoke,p,a)
340 #define IRunningObjectTable_IsRunning(p,a) ICOM_CALL1(IsRunning,p,a)
341 #define IRunningObjectTable_GetObject(p,a,b) ICOM_CALL2(GetObject,p,a,b)
342 #define IRunningObjectTable_NoteChangeTime(p,a,b) ICOM_CALL2(NoteChangeTime,p,a,b)
343 #define IRunningObjectTable_GetTimeOfLastChange(p,a,b) ICOM_CALL2(GetTimeOfLastChange,p,a,b)
344 #define IRunningObjectTable_EnumRunning(p,a) ICOM_CALL1(EnumRunning,p,a)
347 HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
348 HRESULT WINAPI GetRunningObjectTable16(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
350 /*****************************************************************************
354 /* FIXME: not implemented */
355 HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, DWORD grfMode, OLECHAR* pwszName, DWORD dwCount, MULTI_QI* pResults);
357 /* FIXME: not implemented */
358 HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults);
362 #endif /* defined(__cplusplus) */
364 #endif /* __WINE_WINE_OBJ_MONIKER_H */