Taking into account wavemap and midimap there can be up to 8 output
[wine] / include / objbase.h
1 /*
2  * Copyright (C) 1998-1999 François Gouget
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <rpc.h>
20 #include <rpcndr.h>
21
22 #ifndef _OBJBASE_H_
23 #define _OBJBASE_H_
24
25 /*****************************************************************************
26  * define ICOM_MSVTABLE_COMPAT
27  * to implement the microsoft com vtable compatibility workaround for g++.
28  *
29  * NOTE: Turning this option on will produce a winelib that is incompatible
30  * with the binary emulator.
31  *
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++.
35  *
36  * If you aren't interested in Winelib C++ compatibility at all, leave both
37  * options off.
38  *
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
42  * time :)
43  */
44 /* #define ICOM_MSVTABLE_COMPAT 1 */
45 /* #define ICOM_USE_COM_INTERFACE_ATTRIBUTE 1 */
46
47
48 /*****************************************************************************
49  * Macros to define a COM interface
50  */
51 /*
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.
57  *
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.
62  *
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.
70  *
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.
73  *
74  * Let's take Direct3D as an example:
75  *
76  *    #define INTERFACE IDirect3D
77  *    #define IDirect3D_METHODS \
78  *        IUnknown_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)
86  *    #undef INTERFACE
87  *
88  *    #ifdef COBJMACROS
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)
100  *    #endif
101  *
102  * Comments:
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
115  *    will not work.
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.
125  *
126  *
127  * In C this gives:
128  *    typedef struct IDirect3DVtbl IDirect3DVtbl;
129  *    struct IDirect3D {
130  *        IDirect3DVtbl* lpVtbl;
131  *    };
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);
142  *    };
143  *
144  *    #ifdef COBJMACROS
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)
156  *    #endif
157  *
158  * Comments:
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
171  *    just as fast.
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.
174  *
175  *
176  * And in C++ (with gcc's g++):
177  *
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;
185  *    };
186  *
187  * Comments:
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.
191  *
192  *
193  * Implementing a COM interface.
194  *
195  * This continues the above example. This example assumes that the implementation is in C.
196  *
197  *    typedef struct _IDirect3D {
198  *        void* lpVtbl;
199  *        // ...
200  *
201  *    } _IDirect3D;
202  *
203  *    static ICOM_VTABLE(IDirect3D) d3dvt;
204  *
205  *    // implement the IDirect3D methods here
206  *
207  *    int IDirect3D_QueryInterface(IDirect3D* me)
208  *    {
209  *        ICOM_THIS(IDirect3D,me);
210  *        // ...
211  *    }
212  *
213  *    // ...
214  *
215  *    static ICOM_VTABLE(IDirect3D) d3dvt = {
216  *        ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
217  *        IDirect3D_QueryInterface,
218  *        IDirect3D_Add,
219  *        IDirect3D_Add2,
220  *        IDirect3D_Initialize,
221  *        IDirect3D_SetWidth
222  *    };
223  *
224  * Comments:
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.
233  */
234
235 #if defined(__cplusplus) && !defined(CINTERFACE)
236
237 /* C++ interface */
238
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
243
244 #define PURE   = 0
245 #define THIS_
246 #define THIS   void
247
248 #define interface struct
249 #ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE
250 #define DECLARE_INTERFACE(iface)        interface __attribute__((com_interface)) iface
251 #else
252 #define DECLARE_INTERFACE(iface)        interface iface
253 #endif
254 #define DECLARE_INTERFACE_(iface,ibase) interface iface : public ibase
255
256 #define BEGIN_INTERFACE
257 #define END_INTERFACE
258
259 #else  /* __cplusplus && !CINTERFACE */
260
261 /* C interface */
262
263 #define COBJMACROS
264
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)
269
270 #define PURE
271 #define THIS_ INTERFACE *This,
272 #define THIS  INTERFACE *This
273
274 #define interface struct
275
276 #ifdef CONST_VTABLE
277 #undef CONST_VTBL
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
283 #else
284 #undef CONST_VTBL
285 #define CONST_VTBL
286 #define DECLARE_INTERFACE(iface) \
287          /*typedef*/ interface iface { struct iface##Vtbl *lpVtbl; } /*iface*/; \
288          typedef struct iface##Vtbl iface##Vtbl; \
289          struct iface##Vtbl
290 #endif
291 #define DECLARE_INTERFACE_(iface,ibase) DECLARE_INTERFACE(iface)
292
293 #define BEGIN_INTERFACE
294 #define END_INTERFACE
295
296 #endif  /* __cplusplus && !CINTERFACE */
297
298 /* Wine-specific macros */
299
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))
305
306 #include <objidl.h>
307
308 #ifndef RC_INVOKED
309 /* For compatibility only, at least for now */
310 #include <stdlib.h>
311 #endif
312
313 #ifndef INITGUID
314 #include <cguid.h>
315 #endif
316
317 #ifdef __cplusplus
318 extern "C" {
319 #endif
320
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))
324 #else
325 #define LISet32(li, v)   ((li).u.HighPart = (v) < 0 ? -1 : 0, (li).u.LowPart = (v))
326 #define ULISet32(li, v)  ((li).u.HighPart = 0, (li).u.LowPart = (v))
327 #endif
328
329 /*****************************************************************************
330  *      Standard API
331  */
332 DWORD WINAPI CoBuildVersion(void);
333
334 typedef enum tagCOINIT
335 {
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 */
340 } COINIT;
341
342 HRESULT WINAPI CoInitialize(LPVOID lpReserved);
343 HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
344 void WINAPI CoUninitialize(void);
345 DWORD WINAPI CoGetCurrentProcess(void);
346
347 HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
348 void WINAPI CoFreeAllLibraries(void);
349 void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
350 void WINAPI CoFreeUnusedLibraries(void);
351
352 HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
353 HRESULT WINAPI CoCreateInstanceEx(REFCLSID      rclsid,
354                                   LPUNKNOWN     pUnkOuter,
355                                   DWORD         dwClsContext,
356                                   COSERVERINFO* pServerInfo,
357                                   ULONG         cmq,
358                                   MULTI_QI*     pResults);
359
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);
362
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);
367
368 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
369 HRESULT WINAPI CoRevokeMallocSpy(void);
370
371 /* class registration flags; passed to CoRegisterClassObject */
372 typedef enum tagREGCLS
373 {
374     REGCLS_SINGLEUSE = 0,
375     REGCLS_MULTIPLEUSE = 1,
376     REGCLS_MULTI_SEPARATE = 2,
377     REGCLS_SUSPENDED = 4
378 } REGCLS;
379
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);
389
390 /* marshalling */
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);
404
405 /* security */
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);
409
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);
413
414 HRESULT WINAPI CoImpersonateClient(void);
415 HRESULT WINAPI CoQueryClientBlanket(DWORD* pAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTHZ_HANDLE* pPrivs, DWORD* pCapabilities);
416 HRESULT WINAPI CoRevertToSelf(void);
417
418 /* misc */
419 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
420 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
421
422 HRESULT WINAPI CoCreateGuid(GUID* pguid);
423 BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
424
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);
429
430 /*****************************************************************************
431  *      GUID API
432  */
433 HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
434 HRESULT WINAPI CLSIDFromString(LPOLESTR, CLSID *);
435 HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
436 HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
437
438 INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
439
440 /*****************************************************************************
441  *      COM Server dll - exports
442  */
443 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
444 HRESULT WINAPI DllCanUnloadNow(void);
445
446 /*****************************************************************************
447  *      Data Object
448  */
449 HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
450 HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
451
452 /*****************************************************************************
453  *      Moniker API
454  */
455 HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid);
456
457 HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc);
458
459 HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk);
460
461 HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR  lpszItem, LPMONIKER* ppmk);
462
463 HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk);
464
465 HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite);
466
467 HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult);
468
469 HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk);
470
471 HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER* ppmk);
472
473 HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon);
474
475 HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
476
477 /*****************************************************************************
478  *      Storage API
479  */
480 #define STGM_DIRECT             0x00000000
481 #define STGM_TRANSACTED         0x00010000
482 #define STGM_SIMPLE             0x08000000
483 #define STGM_READ               0x00000000
484 #define STGM_WRITE              0x00000001
485 #define STGM_READWRITE          0x00000002
486 #define STGM_SHARE_DENY_NONE    0x00000040
487 #define STGM_SHARE_DENY_READ    0x00000030
488 #define STGM_SHARE_DENY_WRITE   0x00000020
489 #define STGM_SHARE_EXCLUSIVE    0x00000010
490 #define STGM_PRIORITY           0x00040000
491 #define STGM_DELETEONRELEASE    0x04000000
492 #define STGM_CREATE             0x00001000
493 #define STGM_CONVERT            0x00020000
494 #define STGM_FAILIFTHERE        0x00000000
495 #define STGM_NOSCRATCH          0x00100000
496 #define STGM_NOSNAPSHOT         0x00200000
497
498 typedef struct tagSTGOPTIONS
499 {
500     USHORT usVersion;
501     USHORT reserved;
502     ULONG ulSectorSize;
503     const WCHAR* pwcsTemplateFile;
504 } STGOPTIONS;
505
506 HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName,DWORD grfMode,DWORD reserved,IStorage **ppstgOpen);
507 HRESULT WINAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
508 HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn);
509 HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt);
510 HRESULT WINAPI StgOpenStorage(const OLECHAR* pwcsName,IStorage* pstgPriority,DWORD grfMode,SNB snbExclude,DWORD reserved,IStorage**ppstgOpen);
511
512 HRESULT WINAPI WriteClassStg(IStorage* pStg, REFCLSID rclsid);
513 HRESULT WINAPI ReadClassStg(IStorage *pstg,CLSID *pclsid);
514
515 HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt,DWORD grfMode, DWORD reserved, IStorage** ppstgOpen);
516 HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen);
517
518 #ifdef __cplusplus
519 }
520 #endif
521
522
523 #ifndef __WINESRC__
524
525 #define FARSTRUCT
526 #define HUGEP
527
528 #define WINOLEAPI        STDAPI
529 #define WINOLEAPI_(type) STDAPI_(type)
530
531 #endif /* __WINESRC__ */
532
533 #endif /* _OBJBASE_H_ */