Get rid of the ICOM_MSVTABLE_COMPAT support, g++ no longer requires
[wine/multimedia.git] / include / objbase.h
blob53f0e70572aaf31a92946e73368d3a104d7a4b84
1 /*
2 * Copyright (C) 1998-1999 François Gouget
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <rpc.h>
20 #include <rpcndr.h>
22 #ifndef _OBJBASE_H_
23 #define _OBJBASE_H_
25 /*****************************************************************************
26 * Macros to define a COM interface
29 * The goal of the following set of definitions is to provide a way to use the same
30 * header file definitions to provide both a C interface and a C++ object oriented
31 * interface to COM interfaces. The type of interface is selected automatically
32 * depending on the language but it is always possible to get the C interface in C++
33 * by defining CINTERFACE.
35 * It is based on the following assumptions:
36 * - all COM interfaces derive from IUnknown, this should not be a problem.
37 * - the header file only defines the interface, the actual fields are defined
38 * separately in the C file implementing the interface.
40 * The natural approach to this problem would be to make sure we get a C++ class and
41 * virtual methods in C++ and a structure with a table of pointer to functions in C.
42 * Unfortunately the layout of the virtual table is compiler specific, the layout of
43 * g++ virtual tables is not the same as that of an egcs virtual table which is not the
44 * same as that generated by Visual C+. There are workarounds to make the virtual tables
45 * compatible via padding but unfortunately the one which is imposed to the WINE emulator
46 * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
48 * So the solution I finally adopted does not use virtual tables. Instead I use inline
49 * non virtual methods that dereference the method pointer themselves and perform the call.
51 * Let's take Direct3D as an example:
53 * #define INTERFACE IDirect3D
54 * #define IDirect3D_METHODS \
55 * IUnknown_METHODS \
56 * STDMETHOD(Initialize)(THIS_ REFIID) PURE; \
57 * STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE; \
58 * STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE; \
59 * STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE; \
60 * STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE; \
61 * STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
62 * DECLARE_INTERFACE_(IDirect3D,IUnknown) { IDirect3D_METHODS };
63 * #undef INTERFACE
65 * #ifdef COBJMACROS
66 * // *** IUnknown methods *** //
67 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
68 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
69 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
70 * // *** IDirect3D methods *** //
71 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
72 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
73 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
74 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
75 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
76 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
77 * #endif
79 * Comments:
80 * - The INTERFACE macro is used in the STDMETHOD macros to define the type of the 'this'
81 * pointer. Defining this macro here saves us the trouble of having to repeat the interface
82 * name everywhere. Note however that because of the way macros work, a macro like STDMETHOD
83 * cannot use 'INTERFACE##_VTABLE' because this would give 'INTERFACE_VTABLE' and not
84 * 'IDirect3D_VTABLE'.
85 * - ICOM_METHODS defines the list of methods that are inheritable from this interface. It must
86 * be written manually (rather than using a macro to generate the equivalent code) to avoid
87 * macro recursion (which compilers don't like). It must start with the METHODS definition
88 * of the parent interface so that method inheritance works properly.
89 * - The DECLARE_INTERFACE finally declares all the structures necessary for the interface. We have
90 * to explicitly use the interface name for macro expansion reasons again.
91 * - The 'undef INTERFACE' is here to remind you that using INTERFACE in the following macros
92 * will not work.
93 * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access
94 * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate
95 * the inherited method definitions there. This time I could have used a trick to use only one
96 * macro whatever the number of parameters but I prefered to have it work the same way as above.
97 * - You probably have noticed that we don't define the fields we need to actually implement this
98 * interface: reference count, pointer to other resources and miscellaneous fields. That's
99 * because these interfaces are just that: interfaces. They may be implemented more than once, in
100 * different contexts and sometimes not even in Wine. Thus it would not make sense to impose
101 * that the interface contains some specific fields.
104 * In C this gives:
105 * typedef struct IDirect3DVtbl IDirect3DVtbl;
106 * struct IDirect3D {
107 * IDirect3DVtbl* lpVtbl;
108 * };
109 * struct IDirect3DVtbl {
110 * HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj);
111 * ULONG (*QueryInterface)(IDirect3D* me);
112 * ULONG (*QueryInterface)(IDirect3D* me);
113 * HRESULT (*Initialize)(IDirect3D* me, REFIID a);
114 * HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
115 * HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
116 * HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
117 * HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
118 * HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
119 * };
121 * #ifdef COBJMACROS
122 * // *** IUnknown methods *** //
123 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
124 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
125 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
126 * // *** IDirect3D methods *** //
127 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
128 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
129 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
130 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
131 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
132 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
133 * #endif
135 * Comments:
136 * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing
137 * the user needs to know to use the interface. Of course the structure we will define to
138 * implement this interface will have more fields but the first one will match this pointer.
139 * - The code generated by DECLARE_INTERFACE defines both the structure representing the interface and
140 * the structure for the jump table. DECLARE_INTERFACE uses the parent's Xxx_METHODS macro to
141 * automatically repeat the prototypes of all the inherited methods and then uses IDirect3D_METHODS
142 * to define the IDirect3D methods.
143 * - Each method is declared as a pointer to function field in the jump table. The implementation
144 * will fill this jump table with appropriate values, probably using a static variable, and
145 * initialize the lpVtbl field to point to this variable.
146 * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
147 * corresponding to the macro name. This emulates the behavior of a virtual table and should be
148 * just as fast.
149 * - This C code should be quite compatible with the Windows headers both for code that uses COM
150 * interfaces and for code implementing a COM interface.
153 * And in C++ (with gcc's g++):
155 * typedef struct IDirect3D: public IUnknown {
156 * virtual HRESULT Initialize(REFIID a) = 0;
157 * virtual HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b) = 0;
158 * virtual HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b) = 0;
159 * virtual HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b) = 0;
160 * virtual HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b) = 0;
161 * virtual HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b) = 0;
162 * };
164 * Comments:
165 * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
166 * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
167 * macro is defined in which case we would not be here.
170 * Implementing a COM interface.
172 * This continues the above example. This example assumes that the implementation is in C.
174 * typedef struct _IDirect3D {
175 * void* lpVtbl;
176 * // ...
178 * } _IDirect3D;
180 * static IDirect3DVtbl d3dvt;
182 * // implement the IDirect3D methods here
184 * int IDirect3D_QueryInterface(IDirect3D* me)
186 * ICOM_THIS(IDirect3D,me);
187 * // ...
190 * // ...
192 * static IDirect3DVtbl d3dvt = {
193 * IDirect3D_QueryInterface,
194 * IDirect3D_Add,
195 * IDirect3D_Add2,
196 * IDirect3D_Initialize,
197 * IDirect3D_SetWidth
198 * };
200 * Comments:
201 * - We first define what the interface really contains. This is th e_IDirect3D structure. The
202 * first field must of course be the virtual table pointer. Everything else is free.
203 * - Then we predeclare our static virtual table variable, we will need its address in some
204 * methods to initialize the virtual table pointer of the returned interface objects.
205 * - Then we implement the interface methods. To match what has been declared in the header file
206 * they must take a pointer to a IDirect3D structure and we must cast it to an _IDirect3D so that
207 * we can manipulate the fields. This is performed by the ICOM_THIS macro.
208 * - Finally we initialize the virtual table.
211 #if defined(__cplusplus) && !defined(CINTERFACE)
213 /* C++ interface */
215 #define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
216 #define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
217 #define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method
218 #define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
220 #define PURE = 0
221 #define THIS_
222 #define THIS void
224 #define interface struct
225 #define DECLARE_INTERFACE(iface) interface iface
226 #define DECLARE_INTERFACE_(iface,ibase) interface iface : public ibase
228 #define BEGIN_INTERFACE
229 #define END_INTERFACE
231 #else /* __cplusplus && !CINTERFACE */
233 /* C interface */
235 #define COBJMACROS
237 #define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)
238 #define STDMETHOD_(type,method) type (STDMETHODCALLTYPE *method)
239 #define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)
240 #define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method)
242 #define PURE
243 #define THIS_ INTERFACE *This,
244 #define THIS INTERFACE *This
246 #define interface struct
248 #ifdef CONST_VTABLE
249 #undef CONST_VTBL
250 #define CONST_VTBL const
251 #define DECLARE_INTERFACE(iface) \
252 /*typedef*/ interface iface { const struct iface##Vtbl *lpVtbl; } /*iface*/; \
253 typedef const struct iface##Vtbl iface##Vtbl; \
254 const struct iface##Vtbl
255 #else
256 #undef CONST_VTBL
257 #define CONST_VTBL
258 #define DECLARE_INTERFACE(iface) \
259 /*typedef*/ interface iface { struct iface##Vtbl *lpVtbl; } /*iface*/; \
260 typedef struct iface##Vtbl iface##Vtbl; \
261 struct iface##Vtbl
262 #endif
263 #define DECLARE_INTERFACE_(iface,ibase) DECLARE_INTERFACE(iface)
265 #define BEGIN_INTERFACE
266 #define END_INTERFACE
268 #endif /* __cplusplus && !CINTERFACE */
270 /* Wine-specific macros */
272 #define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface)
273 #define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /* no longer used */
275 #include <objidl.h>
277 #ifndef RC_INVOKED
278 /* For compatibility only, at least for now */
279 #include <stdlib.h>
280 #endif
282 #ifndef INITGUID
283 #include <cguid.h>
284 #endif
286 #ifdef __cplusplus
287 extern "C" {
288 #endif
290 #ifndef NONAMELESSSTRUCT
291 #define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
292 #define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
293 #else
294 #define LISet32(li, v) ((li).u.HighPart = (v) < 0 ? -1 : 0, (li).u.LowPart = (v))
295 #define ULISet32(li, v) ((li).u.HighPart = 0, (li).u.LowPart = (v))
296 #endif
298 /*****************************************************************************
299 * Standard API
301 DWORD WINAPI CoBuildVersion(void);
303 typedef enum tagCOINIT
305 COINIT_APARTMENTTHREADED = 0x2, /* Apartment model */
306 COINIT_MULTITHREADED = 0x0, /* OLE calls objects on any thread */
307 COINIT_DISABLE_OLE1DDE = 0x4, /* Don't use DDE for Ole1 support */
308 COINIT_SPEED_OVER_MEMORY = 0x8 /* Trade memory for speed */
309 } COINIT;
311 HRESULT WINAPI CoInitialize(LPVOID lpReserved);
312 HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
313 void WINAPI CoUninitialize(void);
314 DWORD WINAPI CoGetCurrentProcess(void);
316 HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
317 void WINAPI CoFreeAllLibraries(void);
318 void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
319 void WINAPI CoFreeUnusedLibraries(void);
321 HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
322 HRESULT WINAPI CoCreateInstanceEx(REFCLSID rclsid,
323 LPUNKNOWN pUnkOuter,
324 DWORD dwClsContext,
325 COSERVERINFO* pServerInfo,
326 ULONG cmq,
327 MULTI_QI* pResults);
329 HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, DWORD grfMode, OLECHAR* pwszName, DWORD dwCount, MULTI_QI* pResults);
330 HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults);
332 HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* lpMalloc);
333 LPVOID WINAPI CoTaskMemAlloc(ULONG size);
334 void WINAPI CoTaskMemFree(LPVOID ptr);
335 LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size);
337 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
338 HRESULT WINAPI CoRevokeMallocSpy(void);
340 /* class registration flags; passed to CoRegisterClassObject */
341 typedef enum tagREGCLS
343 REGCLS_SINGLEUSE = 0,
344 REGCLS_MULTIPLEUSE = 1,
345 REGCLS_MULTI_SEPARATE = 2,
346 REGCLS_SUSPENDED = 4
347 } REGCLS;
349 HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv);
350 HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags,LPDWORD lpdwRegister);
351 HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister);
352 HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid);
353 HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid);
354 HRESULT WINAPI CoSuspendClassObjects(void);
355 HRESULT WINAPI CoResumeClassObjects(void);
356 ULONG WINAPI CoAddRefServerProcess(void);
357 HRESULT WINAPI CoReleaseServerProcess(void);
359 /* marshalling */
360 HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
361 HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
362 HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
363 HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
364 HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
365 HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
366 HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
367 HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
368 HRESULT WINAPI CoDisconnectObject(LPUNKNOWN lpUnk, DWORD reserved);
369 HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
370 HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
371 HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
372 BOOL WINAPI CoIsHandlerConnected(LPUNKNOWN pUnk);
374 /* security */
375 HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE* asAuthSvc, void* pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void* pReserved2, DWORD dwCapabilities, void* pReserved3);
376 HRESULT WINAPI CoGetCallContext(REFIID riid, void** ppInterface);
377 HRESULT WINAPI CoQueryAuthenticationServices(DWORD* pcAuthSvc, SOLE_AUTHENTICATION_SERVICE** asAuthSvc);
379 HRESULT WINAPI CoQueryProxyBlanket(IUnknown* pProxy, DWORD* pwAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTH_IDENTITY_HANDLE* pAuthInfo, DWORD* pCapabilites);
380 HRESULT WINAPI CoSetProxyBlanket(IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc, OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel, RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities);
381 HRESULT WINAPI CoCopyProxy(IUnknown* pProxy, IUnknown** ppCopy);
383 HRESULT WINAPI CoImpersonateClient(void);
384 HRESULT WINAPI CoQueryClientBlanket(DWORD* pAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTHZ_HANDLE* pPrivs, DWORD* pCapabilities);
385 HRESULT WINAPI CoRevertToSelf(void);
387 /* misc */
388 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
389 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
391 HRESULT WINAPI CoCreateGuid(GUID* pguid);
392 BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
394 BOOL WINAPI CoDosDateTimeToFileTime(WORD nDosDate, WORD nDosTime, FILETIME* lpFileTime);
395 BOOL WINAPI CoFileTimeToDosDateTime(FILETIME* lpFileTime, WORD* lpDosDate, WORD* lpDosTime);
396 HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
397 HRESULT WINAPI CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter,LPMESSAGEFILTER *lplpMessageFilter);
399 /*****************************************************************************
400 * GUID API
402 HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
403 HRESULT WINAPI CLSIDFromString(LPOLESTR, CLSID *);
404 HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
405 HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
407 INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
409 /*****************************************************************************
410 * COM Server dll - exports
412 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
413 HRESULT WINAPI DllCanUnloadNow(void);
415 /*****************************************************************************
416 * Data Object
418 HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
419 HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
421 /*****************************************************************************
422 * Moniker API
424 HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid);
426 HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc);
428 HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk);
430 HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk);
432 HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk);
434 HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite);
436 HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult);
438 HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk);
440 HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER* ppmk);
442 HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon);
444 HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
446 /*****************************************************************************
447 * Storage API
449 #define STGM_DIRECT 0x00000000
450 #define STGM_TRANSACTED 0x00010000
451 #define STGM_SIMPLE 0x08000000
452 #define STGM_READ 0x00000000
453 #define STGM_WRITE 0x00000001
454 #define STGM_READWRITE 0x00000002
455 #define STGM_SHARE_DENY_NONE 0x00000040
456 #define STGM_SHARE_DENY_READ 0x00000030
457 #define STGM_SHARE_DENY_WRITE 0x00000020
458 #define STGM_SHARE_EXCLUSIVE 0x00000010
459 #define STGM_PRIORITY 0x00040000
460 #define STGM_DELETEONRELEASE 0x04000000
461 #define STGM_CREATE 0x00001000
462 #define STGM_CONVERT 0x00020000
463 #define STGM_FAILIFTHERE 0x00000000
464 #define STGM_NOSCRATCH 0x00100000
465 #define STGM_NOSNAPSHOT 0x00200000
467 typedef struct tagSTGOPTIONS
469 USHORT usVersion;
470 USHORT reserved;
471 ULONG ulSectorSize;
472 const WCHAR* pwcsTemplateFile;
473 } STGOPTIONS;
475 HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName,DWORD grfMode,DWORD reserved,IStorage **ppstgOpen);
476 HRESULT WINAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
477 HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn);
478 HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt);
479 HRESULT WINAPI StgOpenStorage(const OLECHAR* pwcsName,IStorage* pstgPriority,DWORD grfMode,SNB snbExclude,DWORD reserved,IStorage**ppstgOpen);
481 HRESULT WINAPI WriteClassStg(IStorage* pStg, REFCLSID rclsid);
482 HRESULT WINAPI ReadClassStg(IStorage *pstg,CLSID *pclsid);
484 HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt,DWORD grfMode, DWORD reserved, IStorage** ppstgOpen);
485 HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen);
487 #ifdef __cplusplus
489 #endif
492 #ifndef __WINESRC__
494 #define FARSTRUCT
495 #define HUGEP
497 #define WINOLEAPI STDAPI
498 #define WINOLEAPI_(type) STDAPI_(type)
500 #endif /* __WINESRC__ */
502 #endif /* _OBJBASE_H_ */