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
25 /*****************************************************************************
26 * define ICOM_MSVTABLE_COMPAT
27 * to implement the microsoft com vtable compatibility workaround for g++.
29 * NOTE: Turning this option on will produce a winelib that is incompatible
30 * with the binary emulator.
32 * If the compiler supports the com_interface attribute, leave this off, and
33 * define the ICOM_USE_COM_INTERFACE_ATTRIBUTE macro below. This may also
34 * require the addition of the -vtable-thunks option for g++.
36 * If you aren't interested in Winelib C++ compatibility at all, leave both
39 * The preferable method for using ICOM_USE_COM_INTERFACE_ATTRIBUTE macro
40 * would be to define it only for your Winelib application. This allows you
41 * to have both binary and Winelib compatibility for C and C++ at the same
44 /* #define ICOM_MSVTABLE_COMPAT 1 */
45 /* #define ICOM_USE_COM_INTERFACE_ATTRIBUTE 1 */
48 /*****************************************************************************
49 * Macros to define a COM interface
52 * The goal of the following set of definitions is to provide a way to use the same
53 * header file definitions to provide both a C interface and a C++ object oriented
54 * interface to COM interfaces. The type of interface is selected automatically
55 * depending on the language but it is always possible to get the C interface in C++
56 * by defining CINTERFACE.
58 * It is based on the following assumptions:
59 * - all COM interfaces derive from IUnknown, this should not be a problem.
60 * - the header file only defines the interface, the actual fields are defined
61 * separately in the C file implementing the interface.
63 * The natural approach to this problem would be to make sure we get a C++ class and
64 * virtual methods in C++ and a structure with a table of pointer to functions in C.
65 * Unfortunately the layout of the virtual table is compiler specific, the layout of
66 * g++ virtual tables is not the same as that of an egcs virtual table which is not the
67 * same as that generated by Visual C+. There are workarounds to make the virtual tables
68 * compatible via padding but unfortunately the one which is imposed to the WINE emulator
69 * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
71 * So the solution I finally adopted does not use virtual tables. Instead I use inline
72 * non virtual methods that dereference the method pointer themselves and perform the call.
74 * Let's take Direct3D as an example:
76 * #define INTERFACE IDirect3D
77 * #define IDirect3D_METHODS \
79 * STDMETHOD(Initialize)(THIS_ REFIID) PURE; \
80 * STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE; \
81 * STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE; \
82 * STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE; \
83 * STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE; \
84 * STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
85 * ICOM_DEFINE(IDirect3D,IUnknown)
89 * // *** IUnknown methods *** //
90 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
91 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
92 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
93 * // *** IDirect3D methods *** //
94 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
95 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
96 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
97 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
98 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
99 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
103 * - The INTERFACE macro is used in the STDMETHOD macros to define the type of the 'this'
104 * pointer. Defining this macro here saves us the trouble of having to repeat the interface
105 * name everywhere. Note however that because of the way macros work, a macro like STDMETHOD
106 * cannot use 'INTERFACE##_VTABLE' because this would give 'INTERFACE_VTABLE' and not
107 * 'IDirect3D_VTABLE'.
108 * - ICOM_METHODS defines the list of methods that are inheritable from this interface. It must
109 * be written manually (rather than using a macro to generate the equivalent code) to avoid
110 * macro recursion (which compilers don't like). It must start with the METHODS definition
111 * of the parent interface so that method inheritance works properly.
112 * - The ICOM_DEFINE finally declares all the structures necessary for the interface. We have to
113 * explicitly use the interface name for macro expansion reasons again.
114 * - The 'undef INTERFACE' is here to remind you that using INTERFACE in the following macros
116 * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access
117 * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate
118 * the inherited method definitions there. This time I could have used a trick to use only one
119 * macro whatever the number of parameters but I prefered to have it work the same way as above.
120 * - You probably have noticed that we don't define the fields we need to actually implement this
121 * interface: reference count, pointer to other resources and miscellaneous fields. That's
122 * because these interfaces are just that: interfaces. They may be implemented more than once, in
123 * different contexts and sometimes not even in Wine. Thus it would not make sense to impose
124 * that the interface contains some specific fields.
128 * typedef struct IDirect3DVtbl IDirect3DVtbl;
130 * IDirect3DVtbl* lpVtbl;
132 * struct IDirect3DVtbl {
133 * HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj);
134 * ULONG (*QueryInterface)(IDirect3D* me);
135 * ULONG (*QueryInterface)(IDirect3D* me);
136 * HRESULT (*Initialize)(IDirect3D* me, REFIID a);
137 * HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
138 * HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
139 * HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
140 * HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
141 * HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
145 * // *** IUnknown methods *** //
146 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
147 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
148 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
149 * // *** IDirect3D methods *** //
150 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
151 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
152 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
153 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
154 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
155 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
159 * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing
160 * the user needs to know to use the interface. Of course the structure we will define to
161 * implement this interface will have more fields but the first one will match this pointer.
162 * - The code generated by ICOM_DEFINE defines both the structure representing the interface and
163 * the structure for the jump table. ICOM_DEFINE uses the parent's Xxx_METHODS macro to
164 * automatically repeat the prototypes of all the inherited methods and then uses IDirect3D_METHODS
165 * to define the IDirect3D methods.
166 * - Each method is declared as a pointer to function field in the jump table. The implementation
167 * will fill this jump table with appropriate values, probably using a static variable, and
168 * initialize the lpVtbl field to point to this variable.
169 * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
170 * corresponding to the macro name. This emulates the behavior of a virtual table and should be
172 * - This C code should be quite compatible with the Windows headers both for code that uses COM
173 * interfaces and for code implementing a COM interface.
176 * And in C++ (with gcc's g++):
178 * typedef struct IDirect3D: public IUnknown {
179 * virtual HRESULT Initialize(REFIID a) = 0;
180 * virtual HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b) = 0;
181 * virtual HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b) = 0;
182 * virtual HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b) = 0;
183 * virtual HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b) = 0;
184 * virtual HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b) = 0;
188 * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
189 * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
190 * macro is defined in which case we would not be here.
193 * Implementing a COM interface.
195 * This continues the above example. This example assumes that the implementation is in C.
197 * typedef struct _IDirect3D {
203 * static ICOM_VTABLE(IDirect3D) d3dvt;
205 * // implement the IDirect3D methods here
207 * int IDirect3D_QueryInterface(IDirect3D* me)
209 * ICOM_THIS(IDirect3D,me);
215 * static ICOM_VTABLE(IDirect3D) d3dvt = {
216 * ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
217 * IDirect3D_QueryInterface,
220 * IDirect3D_Initialize,
225 * - We first define what the interface really contains. This is th e_IDirect3D structure. The
226 * first field must of course be the virtual table pointer. Everything else is free.
227 * - Then we predeclare our static virtual table variable, we will need its address in some
228 * methods to initialize the virtual table pointer of the returned interface objects.
229 * - Then we implement the interface methods. To match what has been declared in the header file
230 * they must take a pointer to a IDirect3D structure and we must cast it to an _IDirect3D so that
231 * we can manipulate the fields. This is performed by the ICOM_THIS macro.
232 * - Finally we initialize the virtual table.
235 #if defined(__cplusplus) && !defined(CINTERFACE)
239 #define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
240 #define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
241 #define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method
242 #define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
248 #define interface struct
249 #ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE
250 #define DECLARE_INTERFACE(iface) interface __attribute__((com_interface)) iface
252 #define DECLARE_INTERFACE(iface) interface iface
254 #define DECLARE_INTERFACE_(iface,ibase) interface iface : public ibase
256 #define BEGIN_INTERFACE
257 #define END_INTERFACE
259 #else /* __cplusplus && !CINTERFACE */
265 #define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)
266 #define STDMETHOD_(type,method) type (STDMETHODCALLTYPE *method)
267 #define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)
268 #define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method)
271 #define THIS_ INTERFACE *This,
272 #define THIS INTERFACE *This
274 #define interface struct
278 #define CONST_VTBL const
279 #define DECLARE_INTERFACE(iface) \
280 /*typedef*/ interface iface { const struct iface##Vtbl *lpVtbl; } /*iface*/; \
281 typedef const struct iface##Vtbl iface##Vtbl; \
282 const struct iface##Vtbl
286 #define DECLARE_INTERFACE(iface) \
287 /*typedef*/ interface iface { struct iface##Vtbl *lpVtbl; } /*iface*/; \
288 typedef struct iface##Vtbl iface##Vtbl; \
291 #define DECLARE_INTERFACE_(iface,ibase) DECLARE_INTERFACE(iface)
293 #define BEGIN_INTERFACE
294 #define END_INTERFACE
296 #endif /* __cplusplus && !CINTERFACE */
298 /* Wine-specific macros */
300 #define ICOM_DEFINE(iface,ibase) DECLARE_INTERFACE_(iface,ibase) { iface##_METHODS };
301 #define ICOM_VTABLE(iface) iface##Vtbl
302 #define ICOM_VFIELD(iface) ICOM_VTABLE(iface)* lpVtbl
303 #define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface)
304 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
309 /* For compatibility only, at least for now */
321 #ifndef NONAMELESSSTRUCT
322 #define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
323 #define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
325 #define LISet32(li, v) ((li).s.HighPart = (v) < 0 ? -1 : 0, (li).s.LowPart = (v))
326 #define ULISet32(li, v) ((li).s.HighPart = 0, (li).s.LowPart = (v))
329 /*****************************************************************************
332 DWORD WINAPI
CoBuildVersion(void);
334 typedef enum tagCOINIT
336 COINIT_APARTMENTTHREADED
= 0x2, /* Apartment model */
337 COINIT_MULTITHREADED
= 0x0, /* OLE calls objects on any thread */
338 COINIT_DISABLE_OLE1DDE
= 0x4, /* Don't use DDE for Ole1 support */
339 COINIT_SPEED_OVER_MEMORY
= 0x8 /* Trade memory for speed */
342 HRESULT WINAPI
CoInitialize(LPVOID lpReserved
);
343 HRESULT WINAPI
CoInitializeEx(LPVOID lpReserved
, DWORD dwCoInit
);
344 void WINAPI
CoUninitialize(void);
345 DWORD WINAPI
CoGetCurrentProcess(void);
347 HINSTANCE WINAPI
CoLoadLibrary(LPOLESTR lpszLibName
, BOOL bAutoFree
);
348 void WINAPI
CoFreeAllLibraries(void);
349 void WINAPI
CoFreeLibrary(HINSTANCE hLibrary
);
350 void WINAPI
CoFreeUnusedLibraries(void);
352 HRESULT WINAPI
CoCreateInstance(REFCLSID rclsid
, LPUNKNOWN pUnkOuter
, DWORD dwClsContext
, REFIID iid
, LPVOID
*ppv
);
353 HRESULT WINAPI
CoCreateInstanceEx(REFCLSID rclsid
,
356 COSERVERINFO
* pServerInfo
,
360 HRESULT WINAPI
CoGetInstanceFromFile(COSERVERINFO
* pServerInfo
, CLSID
* pClsid
, IUnknown
* punkOuter
, DWORD dwClsCtx
, DWORD grfMode
, OLECHAR
* pwszName
, DWORD dwCount
, MULTI_QI
* pResults
);
361 HRESULT WINAPI
CoGetInstanceFromIStorage(COSERVERINFO
* pServerInfo
, CLSID
* pClsid
, IUnknown
* punkOuter
, DWORD dwClsCtx
, IStorage
* pstg
, DWORD dwCount
, MULTI_QI
* pResults
);
363 HRESULT WINAPI
CoGetMalloc(DWORD dwMemContext
, LPMALLOC
* lpMalloc
);
364 LPVOID WINAPI
CoTaskMemAlloc(ULONG size
);
365 void WINAPI
CoTaskMemFree(LPVOID ptr
);
366 LPVOID WINAPI
CoTaskMemRealloc(LPVOID ptr
, ULONG size
);
368 HRESULT WINAPI
CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy
);
369 HRESULT WINAPI
CoRevokeMallocSpy(void);
371 /* class registration flags; passed to CoRegisterClassObject */
372 typedef enum tagREGCLS
374 REGCLS_SINGLEUSE
= 0,
375 REGCLS_MULTIPLEUSE
= 1,
376 REGCLS_MULTI_SEPARATE
= 2,
380 HRESULT WINAPI
CoGetClassObject(REFCLSID rclsid
, DWORD dwClsContext
, COSERVERINFO
*pServerInfo
, REFIID iid
, LPVOID
*ppv
);
381 HRESULT WINAPI
CoRegisterClassObject(REFCLSID rclsid
,LPUNKNOWN pUnk
,DWORD dwClsContext
,DWORD flags
,LPDWORD lpdwRegister
);
382 HRESULT WINAPI
CoRevokeClassObject(DWORD dwRegister
);
383 HRESULT WINAPI
CoGetPSClsid(REFIID riid
,CLSID
*pclsid
);
384 HRESULT WINAPI
CoRegisterPSClsid(REFIID riid
, REFCLSID rclsid
);
385 HRESULT WINAPI
CoSuspendClassObjects(void);
386 HRESULT WINAPI
CoResumeClassObjects(void);
387 ULONG WINAPI
CoAddRefServerProcess(void);
388 HRESULT WINAPI
CoReleaseServerProcess(void);
391 HRESULT WINAPI
CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter
, LPUNKNOWN
* ppunkMarshal
);
392 HRESULT WINAPI
CoGetInterfaceAndReleaseStream(LPSTREAM pStm
, REFIID iid
, LPVOID
* ppv
);
393 HRESULT WINAPI
CoGetMarshalSizeMax(ULONG
* pulSize
, REFIID riid
, LPUNKNOWN pUnk
, DWORD dwDestContext
, LPVOID pvDestContext
, DWORD mshlflags
);
394 HRESULT WINAPI
CoGetStandardMarshal(REFIID riid
, LPUNKNOWN pUnk
, DWORD dwDestContext
, LPVOID pvDestContext
, DWORD mshlflags
, LPMARSHAL
* ppMarshal
);
395 HRESULT WINAPI
CoMarshalHresult(LPSTREAM pstm
, HRESULT hresult
);
396 HRESULT WINAPI
CoMarshalInterface(LPSTREAM pStm
, REFIID riid
, LPUNKNOWN pUnk
, DWORD dwDestContext
, LPVOID pvDestContext
, DWORD mshlflags
);
397 HRESULT WINAPI
CoMarshalInterThreadInterfaceInStream(REFIID riid
, LPUNKNOWN pUnk
, LPSTREAM
* ppStm
);
398 HRESULT WINAPI
CoReleaseMarshalData(LPSTREAM pStm
);
399 HRESULT WINAPI
CoDisconnectObject(LPUNKNOWN lpUnk
, DWORD reserved
);
400 HRESULT WINAPI
CoUnmarshalHresult(LPSTREAM pstm
, HRESULT
* phresult
);
401 HRESULT WINAPI
CoUnmarshalInterface(LPSTREAM pStm
, REFIID riid
, LPVOID
* ppv
);
402 HRESULT WINAPI
CoLockObjectExternal(LPUNKNOWN pUnk
, BOOL fLock
, BOOL fLastUnlockReleases
);
403 BOOL WINAPI
CoIsHandlerConnected(LPUNKNOWN pUnk
);
406 HRESULT WINAPI
CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc
, LONG cAuthSvc
, SOLE_AUTHENTICATION_SERVICE
* asAuthSvc
, void* pReserved1
, DWORD dwAuthnLevel
, DWORD dwImpLevel
, void* pReserved2
, DWORD dwCapabilities
, void* pReserved3
);
407 HRESULT WINAPI
CoGetCallContext(REFIID riid
, void** ppInterface
);
408 HRESULT WINAPI
CoQueryAuthenticationServices(DWORD
* pcAuthSvc
, SOLE_AUTHENTICATION_SERVICE
** asAuthSvc
);
410 HRESULT WINAPI
CoQueryProxyBlanket(IUnknown
* pProxy
, DWORD
* pwAuthnSvc
, DWORD
* pAuthzSvc
, OLECHAR
** pServerPrincName
, DWORD
* pAuthnLevel
, DWORD
* pImpLevel
, RPC_AUTH_IDENTITY_HANDLE
* pAuthInfo
, DWORD
* pCapabilites
);
411 HRESULT WINAPI
CoSetProxyBlanket(IUnknown
* pProxy
, DWORD dwAuthnSvc
, DWORD dwAuthzSvc
, OLECHAR
* pServerPrincName
, DWORD dwAuthnLevel
, DWORD dwImpLevel
, RPC_AUTH_IDENTITY_HANDLE pAuthInfo
, DWORD dwCapabilities
);
412 HRESULT WINAPI
CoCopyProxy(IUnknown
* pProxy
, IUnknown
** ppCopy
);
414 HRESULT WINAPI
CoImpersonateClient(void);
415 HRESULT WINAPI
CoQueryClientBlanket(DWORD
* pAuthnSvc
, DWORD
* pAuthzSvc
, OLECHAR16
** pServerPrincName
, DWORD
* pAuthnLevel
, DWORD
* pImpLevel
, RPC_AUTHZ_HANDLE
* pPrivs
, DWORD
* pCapabilities
);
416 HRESULT WINAPI
CoRevertToSelf(void);
419 HRESULT WINAPI
CoGetTreatAsClass(REFCLSID clsidOld
, LPCLSID pClsidNew
);
420 HRESULT WINAPI
CoTreatAsClass(REFCLSID clsidOld
, REFCLSID clsidNew
);
422 HRESULT WINAPI
CoCreateGuid(GUID
* pguid
);
423 BOOL WINAPI
CoIsOle1Class(REFCLSID rclsid
);
425 BOOL WINAPI
CoDosDateTimeToFileTime(WORD nDosDate
, WORD nDosTime
, FILETIME
* lpFileTime
);
426 BOOL WINAPI
CoFileTimeToDosDateTime(FILETIME
* lpFileTime
, WORD
* lpDosDate
, WORD
* lpDosTime
);
427 HRESULT WINAPI
CoFileTimeNow(FILETIME
* lpFileTime
);
428 HRESULT WINAPI
CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter
,LPMESSAGEFILTER
*lplpMessageFilter
);
430 /*****************************************************************************
433 HRESULT WINAPI
StringFromCLSID16(REFCLSID id
, LPOLESTR16
*);
434 HRESULT WINAPI
StringFromCLSID(REFCLSID id
, LPOLESTR
*);
436 HRESULT WINAPI
CLSIDFromString16(LPCOLESTR16
, CLSID
*);
437 HRESULT WINAPI
CLSIDFromString(LPCOLESTR
, CLSID
*);
439 HRESULT WINAPI
CLSIDFromProgID16(LPCOLESTR16 progid
, LPCLSID riid
);
440 HRESULT WINAPI
CLSIDFromProgID(LPCOLESTR progid
, LPCLSID riid
);
442 HRESULT WINAPI
ProgIDFromCLSID(REFCLSID clsid
, LPOLESTR
*lplpszProgID
);
444 INT WINAPI
StringFromGUID2(REFGUID id
, LPOLESTR str
, INT cmax
);
446 /*****************************************************************************
447 * COM Server dll - exports
449 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
* ppv
);
450 HRESULT WINAPI
DllCanUnloadNow(void);
452 /*****************************************************************************
455 HRESULT WINAPI
CreateDataAdviseHolder(LPDATAADVISEHOLDER
* ppDAHolder
);
456 HRESULT WINAPI
CreateDataCache(LPUNKNOWN pUnkOuter
, REFCLSID rclsid
, REFIID iid
, LPVOID
* ppv
);
458 /*****************************************************************************
461 HRESULT WINAPI
GetClassFile(LPCOLESTR filePathName
,CLSID
*pclsid
);
463 HRESULT WINAPI
CreateBindCtx16(DWORD reserved
, LPBC
* ppbc
);
464 HRESULT WINAPI
CreateBindCtx(DWORD reserved
, LPBC
* ppbc
);
466 HRESULT WINAPI
CreateFileMoniker16(LPCOLESTR16 lpszPathName
, LPMONIKER
* ppmk
);
467 HRESULT WINAPI
CreateFileMoniker(LPCOLESTR lpszPathName
, LPMONIKER
* ppmk
);
469 HRESULT WINAPI
CreateItemMoniker16(LPCOLESTR16 lpszDelim
, LPCOLESTR lpszItem
, LPMONIKER
* ppmk
);
470 HRESULT WINAPI
CreateItemMoniker(LPCOLESTR lpszDelim
, LPCOLESTR lpszItem
, LPMONIKER
* ppmk
);
472 HRESULT WINAPI
CreateAntiMoniker(LPMONIKER
* ppmk
);
474 HRESULT WINAPI
CreateGenericComposite(LPMONIKER pmkFirst
, LPMONIKER pmkRest
, LPMONIKER
* ppmkComposite
);
476 HRESULT WINAPI
BindMoniker(LPMONIKER pmk
, DWORD grfOpt
, REFIID iidResult
, LPVOID
* ppvResult
);
478 HRESULT WINAPI
CreateClassMoniker(REFCLSID rclsid
, LPMONIKER
* ppmk
);
480 HRESULT WINAPI
CreatePointerMoniker(LPUNKNOWN punk
, LPMONIKER
* ppmk
);
482 HRESULT WINAPI
MonikerCommonPrefixWith(IMoniker
* pmkThis
,IMoniker
* pmkOther
,IMoniker
** ppmkCommon
);
484 HRESULT WINAPI
GetRunningObjectTable(DWORD reserved
, LPRUNNINGOBJECTTABLE
*pprot
);
485 HRESULT WINAPI
GetRunningObjectTable16(DWORD reserved
, LPRUNNINGOBJECTTABLE
*pprot
);
487 /*****************************************************************************
490 #define STGM_DIRECT 0x00000000
491 #define STGM_TRANSACTED 0x00010000
492 #define STGM_SIMPLE 0x08000000
493 #define STGM_READ 0x00000000
494 #define STGM_WRITE 0x00000001
495 #define STGM_READWRITE 0x00000002
496 #define STGM_SHARE_DENY_NONE 0x00000040
497 #define STGM_SHARE_DENY_READ 0x00000030
498 #define STGM_SHARE_DENY_WRITE 0x00000020
499 #define STGM_SHARE_EXCLUSIVE 0x00000010
500 #define STGM_PRIORITY 0x00040000
501 #define STGM_DELETEONRELEASE 0x04000000
502 #define STGM_CREATE 0x00001000
503 #define STGM_CONVERT 0x00020000
504 #define STGM_FAILIFTHERE 0x00000000
505 #define STGM_NOSCRATCH 0x00100000
506 #define STGM_NOSNAPSHOT 0x00200000
508 HRESULT WINAPI
StgCreateDocFile16(LPCOLESTR16 pwcsName
,DWORD grfMode
,DWORD reserved
,IStorage16
**ppstgOpen
);
509 HRESULT WINAPI
StgCreateDocfile(LPCOLESTR pwcsName
,DWORD grfMode
,DWORD reserved
,IStorage
**ppstgOpen
);
511 HRESULT WINAPI
StgIsStorageFile16(LPCOLESTR16 fn
);
512 HRESULT WINAPI
StgIsStorageFile(LPCOLESTR fn
);
513 HRESULT WINAPI
StgIsStorageILockBytes(ILockBytes
*plkbyt
);
515 HRESULT WINAPI
StgOpenStorage16(const OLECHAR16
* pwcsName
,IStorage16
* pstgPriority
,DWORD grfMode
,SNB16 snbExclude
,DWORD reserved
,IStorage16
**ppstgOpen
);
516 HRESULT WINAPI
StgOpenStorage(const OLECHAR
* pwcsName
,IStorage
* pstgPriority
,DWORD grfMode
,SNB snbExclude
,DWORD reserved
,IStorage
**ppstgOpen
);
518 HRESULT WINAPI
WriteClassStg(IStorage
* pStg
, REFCLSID rclsid
);
519 HRESULT WINAPI
ReadClassStg(IStorage
*pstg
,CLSID
*pclsid
);
521 HRESULT WINAPI
StgCreateDocfileOnILockBytes(ILockBytes
*plkbyt
,DWORD grfMode
, DWORD reserved
, IStorage
** ppstgOpen
);
522 HRESULT WINAPI
StgOpenStorageOnILockBytes(ILockBytes
*plkbyt
, IStorage
*pstgPriority
, DWORD grfMode
, SNB snbExclude
, DWORD reserved
, IStorage
**ppstgOpen
);
534 #define WINOLEAPI STDAPI
535 #define WINOLEAPI_(type) STDAPI_(type)
537 #endif /* __WINESRC__ */
539 #endif /* _OBJBASE_H_ */