VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objbase.h

Last change on this file was 53206, checked in by vboxsync, 10 years ago

Devices/vmsvga: header fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.5 KB
Line 
1/*
2 * Copyright (C) 1998-1999 Francois 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19/*
20 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
21 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
22 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
23 * a choice of LGPL license versions is made available with the language indicating
24 * that LGPLv2 or any later version may be used, or where a choice of which version
25 * of the LGPL is applied is otherwise unspecified.
26 */
27
28#include <rpc.h>
29#include <rpcndr.h>
30
31#ifndef _OBJBASE_H_
32#define _OBJBASE_H_
33
34/*****************************************************************************
35 * Macros to define a COM interface
36 */
37/*
38 * The goal of the following set of definitions is to provide a way to use the same
39 * header file definitions to provide both a C interface and a C++ object oriented
40 * interface to COM interfaces. The type of interface is selected automatically
41 * depending on the language but it is always possible to get the C interface in C++
42 * by defining CINTERFACE.
43 *
44 * It is based on the following assumptions:
45 * - all COM interfaces derive from IUnknown, this should not be a problem.
46 * - the header file only defines the interface, the actual fields are defined
47 * separately in the C file implementing the interface.
48 *
49 * The natural approach to this problem would be to make sure we get a C++ class and
50 * virtual methods in C++ and a structure with a table of pointer to functions in C.
51 * Unfortunately the layout of the virtual table is compiler specific, the layout of
52 * g++ virtual tables is not the same as that of an egcs virtual table which is not the
53 * same as that generated by Visual C++. There are workarounds to make the virtual tables
54 * compatible via padding but unfortunately the one which is imposed to the WINE emulator
55 * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
56 *
57 * So the solution I finally adopted does not use virtual tables. Instead I use inline
58 * non virtual methods that dereference the method pointer themselves and perform the call.
59 *
60 * Let's take Direct3D as an example:
61 *
62 * #define INTERFACE IDirect3D
63 * DECLARE_INTERFACE_(IDirect3D,IUnknown)
64 * {
65 * // *** IUnknown methods *** //
66 * STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, void**) PURE;
67 * STDMETHOD_(ULONG,AddRef)(THIS) PURE;
68 * STDMETHOD_(ULONG,Release)(THIS) PURE;
69 * // *** IDirect3D methods *** //
70 * STDMETHOD(Initialize)(THIS_ REFIID) PURE;
71 * STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
72 * STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT *, IUnknown *) PURE;
73 * STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL *, IUnknown *) PURE;
74 * STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT *, IUnknown *) PURE;
75 * STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
76 * };
77 * #undef INTERFACE
78 *
79 * #ifdef COBJMACROS
80 * // *** IUnknown methods *** //
81 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
82 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
83 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
84 * // *** IDirect3D methods *** //
85 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
86 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
87 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
88 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
89 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
90 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
91 * #endif
92 *
93 * Comments:
94 * - The INTERFACE macro is used in the STDMETHOD macros to define the type of the 'this'
95 * pointer. Defining this macro here saves us the trouble of having to repeat the interface
96 * name everywhere. Note however that because of the way macros work, a macro like STDMETHOD
97 * cannot use 'INTERFACE##_VTABLE' because this would give 'INTERFACE_VTABLE' and not
98 * 'IDirect3D_VTABLE'.
99 * - The DECLARE_INTERFACE declares all the structures necessary for the interface. We have to
100 * explicitly use the interface name for macro expansion reasons again. It defines the list of
101 * methods that are inheritable from this interface. It must be written manually (rather than
102 * using a macro to generate the equivalent code) to avoid macro recursion (which compilers
103 * don't like). It must start with the methods definition of the parent interface so that
104 * method inheritance works properly.
105 * - The 'undef INTERFACE' is here to remind you that using INTERFACE in the following macros
106 * will not work.
107 * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access
108 * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate
109 * the inherited method definitions there. This time I could have used a trick to use only one
110 * macro whatever the number of parameters but I preferred to have it work the same way as above.
111 * - You probably have noticed that we don't define the fields we need to actually implement this
112 * interface: reference count, pointer to other resources and miscellaneous fields. That's
113 * because these interfaces are just that: interfaces. They may be implemented more than once, in
114 * different contexts and sometimes not even in Wine. Thus it would not make sense to impose
115 * that the interface contains some specific fields.
116 *
117 *
118 * In C this gives:
119 * typedef struct IDirect3DVtbl IDirect3DVtbl;
120 * struct IDirect3D {
121 * IDirect3DVtbl* lpVtbl;
122 * };
123 * struct IDirect3DVtbl {
124 * HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj);
125 * ULONG (*AddRef)(IDirect3D* me);
126 * ULONG (*Release)(IDirect3D* me);
127 * HRESULT (*Initialize)(IDirect3D* me, REFIID a);
128 * HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
129 * HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
130 * HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
131 * HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
132 * HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
133 * };
134 *
135 * #ifdef COBJMACROS
136 * // *** IUnknown methods *** //
137 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
138 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
139 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
140 * // *** IDirect3D methods *** //
141 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
142 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
143 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
144 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
145 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
146 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
147 * #endif
148 *
149 * Comments:
150 * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing
151 * the user needs to know to use the interface. Of course the structure we will define to
152 * implement this interface will have more fields but the first one will match this pointer.
153 * - The code generated by DECLARE_INTERFACE defines both the structure representing the interface and
154 * the structure for the jump table.
155 * - Each method is declared as a pointer to function field in the jump table. The implementation
156 * will fill this jump table with appropriate values, probably using a static variable, and
157 * initialize the lpVtbl field to point to this variable.
158 * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
159 * corresponding to the macro name. This emulates the behavior of a virtual table and should be
160 * just as fast.
161 * - This C code should be quite compatible with the Windows headers both for code that uses COM
162 * interfaces and for code implementing a COM interface.
163 *
164 *
165 * And in C++ (with gcc's g++):
166 *
167 * typedef struct IDirect3D: public IUnknown {
168 * virtual HRESULT Initialize(REFIID a) = 0;
169 * virtual HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b) = 0;
170 * virtual HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b) = 0;
171 * virtual HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b) = 0;
172 * virtual HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b) = 0;
173 * virtual HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b) = 0;
174 * };
175 *
176 * Comments:
177 * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
178 * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
179 * macro is defined in which case we would not be here.
180 */
181
182#if defined(__cplusplus) && !defined(CINTERFACE)
183
184/* C++ interface */
185
186#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
187#define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
188#define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method
189#define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
190
191#define PURE = 0
192#define THIS_
193#define THIS void
194
195#define interface struct
196#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
197#define DECLARE_INTERFACE_(iface,ibase) interface DECLSPEC_NOVTABLE iface : public ibase
198#define DECLARE_INTERFACE_IID_(iface, ibase, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface : public ibase
199
200#define BEGIN_INTERFACE
201#define END_INTERFACE
202
203#else /* __cplusplus && !CINTERFACE */
204
205/* C interface */
206
207#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)
208#define STDMETHOD_(type,method) type (STDMETHODCALLTYPE *method)
209#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)
210#define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method)
211
212#define PURE
213#define THIS_ INTERFACE *This,
214#define THIS INTERFACE *This
215
216#define interface struct
217
218#ifdef __WINESRC__
219#define CONST_VTABLE
220#endif
221
222#ifdef CONST_VTABLE
223#undef CONST_VTBL
224#define CONST_VTBL const
225#define DECLARE_INTERFACE(iface) \
226 typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; \
227 typedef struct iface##Vtbl iface##Vtbl; \
228 struct iface##Vtbl
229#else
230#undef CONST_VTBL
231#define CONST_VTBL
232#define DECLARE_INTERFACE(iface) \
233 typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; \
234 typedef struct iface##Vtbl iface##Vtbl; \
235 struct iface##Vtbl
236#endif
237#define DECLARE_INTERFACE_(iface,ibase) DECLARE_INTERFACE(iface)
238#define DECLARE_INTERFACE_IID_(iface, ibase, iid) DECLARE_INTERFACE_(iface, ibase)
239
240#define BEGIN_INTERFACE
241#define END_INTERFACE
242
243#endif /* __cplusplus && !CINTERFACE */
244
245#ifndef __IRpcStubBuffer_FWD_DEFINED__
246#define __IRpcStubBuffer_FWD_DEFINED__
247typedef interface IRpcStubBuffer IRpcStubBuffer;
248#endif
249#ifndef __IRpcChannelBuffer_FWD_DEFINED__
250#define __IRpcChannelBuffer_FWD_DEFINED__
251typedef interface IRpcChannelBuffer IRpcChannelBuffer;
252#endif
253
254#ifndef RC_INVOKED
255/* For compatibility only, at least for now */
256#include <stdlib.h>
257#endif
258
259#include <wtypes.h>
260#include <unknwn.h>
261#include <objidl.h>
262
263#include <guiddef.h>
264#ifndef INITGUID
265#include <cguid.h>
266#endif
267
268#ifdef __cplusplus
269extern "C" {
270#endif
271
272#ifndef NONAMELESSSTRUCT
273#define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
274#define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
275#else
276#define LISet32(li, v) ((li).u.HighPart = (v) < 0 ? -1 : 0, (li).u.LowPart = (v))
277#define ULISet32(li, v) ((li).u.HighPart = 0, (li).u.LowPart = (v))
278#endif
279
280/*****************************************************************************
281 * Standard API
282 */
283DWORD WINAPI CoBuildVersion(void);
284
285typedef enum tagCOINIT
286{
287 COINIT_APARTMENTTHREADED = 0x2, /* Apartment model */
288 COINIT_MULTITHREADED = 0x0, /* OLE calls objects on any thread */
289 COINIT_DISABLE_OLE1DDE = 0x4, /* Don't use DDE for Ole1 support */
290 COINIT_SPEED_OVER_MEMORY = 0x8 /* Trade memory for speed */
291} COINIT;
292
293HRESULT WINAPI CoInitialize(LPVOID lpReserved);
294HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
295void WINAPI CoUninitialize(void);
296DWORD WINAPI CoGetCurrentProcess(void);
297
298HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
299void WINAPI CoFreeAllLibraries(void);
300void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
301void WINAPI CoFreeUnusedLibraries(void);
302void WINAPI CoFreeUnusedLibrariesEx(DWORD dwUnloadDelay, DWORD dwReserved);
303
304HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
305HRESULT WINAPI CoCreateInstanceEx(REFCLSID rclsid,
306 LPUNKNOWN pUnkOuter,
307 DWORD dwClsContext,
308 COSERVERINFO* pServerInfo,
309 ULONG cmq,
310 MULTI_QI* pResults);
311
312HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, DWORD grfMode, OLECHAR* pwszName, DWORD dwCount, MULTI_QI* pResults);
313HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults);
314
315HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* lpMalloc);
316LPVOID WINAPI CoTaskMemAlloc(ULONG size) __WINE_ALLOC_SIZE(1);
317void WINAPI CoTaskMemFree(LPVOID ptr);
318LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size);
319
320HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
321HRESULT WINAPI CoRevokeMallocSpy(void);
322
323HRESULT WINAPI CoGetContextToken( ULONG_PTR *token );
324
325/* class registration flags; passed to CoRegisterClassObject */
326typedef enum tagREGCLS
327{
328 REGCLS_SINGLEUSE = 0,
329 REGCLS_MULTIPLEUSE = 1,
330 REGCLS_MULTI_SEPARATE = 2,
331 REGCLS_SUSPENDED = 4,
332 REGCLS_SURROGATE = 8
333} REGCLS;
334
335HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv);
336HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags,LPDWORD lpdwRegister);
337HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister);
338HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid);
339HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid);
340HRESULT WINAPI CoRegisterSurrogate(LPSURROGATE pSurrogate);
341HRESULT WINAPI CoSuspendClassObjects(void);
342HRESULT WINAPI CoResumeClassObjects(void);
343ULONG WINAPI CoAddRefServerProcess(void);
344ULONG WINAPI CoReleaseServerProcess(void);
345
346/* marshalling */
347HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
348HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
349HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
350HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
351HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
352HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
353HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
354HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
355HRESULT WINAPI CoDisconnectObject(LPUNKNOWN lpUnk, DWORD reserved);
356HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
357HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
358HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
359BOOL WINAPI CoIsHandlerConnected(LPUNKNOWN pUnk);
360
361/* security */
362HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE* asAuthSvc, void* pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void* pReserved2, DWORD dwCapabilities, void* pReserved3);
363HRESULT WINAPI CoGetCallContext(REFIID riid, void** ppInterface);
364HRESULT WINAPI CoSwitchCallContext(IUnknown *pContext, IUnknown **ppOldContext);
365HRESULT WINAPI CoQueryAuthenticationServices(DWORD* pcAuthSvc, SOLE_AUTHENTICATION_SERVICE** asAuthSvc);
366
367HRESULT WINAPI CoQueryProxyBlanket(IUnknown* pProxy, DWORD* pwAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTH_IDENTITY_HANDLE* pAuthInfo, DWORD* pCapabilities);
368HRESULT WINAPI CoSetProxyBlanket(IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc, OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel, RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities);
369HRESULT WINAPI CoCopyProxy(IUnknown* pProxy, IUnknown** ppCopy);
370
371HRESULT WINAPI CoImpersonateClient(void);
372HRESULT WINAPI CoQueryClientBlanket(DWORD* pAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTHZ_HANDLE* pPrivs, DWORD* pCapabilities);
373HRESULT WINAPI CoRevertToSelf(void);
374
375/* misc */
376HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
377HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
378HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, LPVOID lpvReserved);
379HRESULT WINAPI CoGetObjectContext(REFIID riid, LPVOID *ppv);
380
381HRESULT WINAPI CoCreateGuid(GUID* pguid);
382BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
383
384BOOL WINAPI CoDosDateTimeToFileTime(WORD nDosDate, WORD nDosTime, FILETIME* lpFileTime);
385BOOL WINAPI CoFileTimeToDosDateTime(FILETIME* lpFileTime, WORD* lpDosDate, WORD* lpDosTime);
386HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
387HRESULT WINAPI CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter,LPMESSAGEFILTER *lplpMessageFilter);
388HRESULT WINAPI CoRegisterChannelHook(REFGUID ExtensionGuid, IChannelHook *pChannelHook);
389
390typedef enum tagCOWAIT_FLAGS
391{
392 COWAIT_WAITALL = 0x00000001,
393 COWAIT_ALERTABLE = 0x00000002
394} COWAIT_FLAGS;
395
396HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags,DWORD dwTimeout,ULONG cHandles,LPHANDLE pHandles,LPDWORD lpdwindex);
397
398/*****************************************************************************
399 * GUID API
400 */
401HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
402HRESULT WINAPI CLSIDFromString(LPCOLESTR, LPCLSID);
403HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
404HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
405
406INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
407
408/*****************************************************************************
409 * COM Server dll - exports
410 */
411HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN;
412HRESULT WINAPI DllCanUnloadNow(void) DECLSPEC_HIDDEN;
413
414/* shouldn't be here, but is nice for type checking */
415#ifdef __WINESRC__
416HRESULT WINAPI DllRegisterServer(void) DECLSPEC_HIDDEN;
417HRESULT WINAPI DllUnregisterServer(void) DECLSPEC_HIDDEN;
418#endif
419
420
421/*****************************************************************************
422 * Data Object
423 */
424HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
425HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
426
427/*****************************************************************************
428 * Moniker API
429 */
430HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult);
431HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions, REFIID riid, void **ppv);
432HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk);
433HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc);
434HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk);
435HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk);
436HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite);
437HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk);
438HRESULT WINAPI CreateObjrefMoniker(LPUNKNOWN punk, LPMONIKER * ppmk);
439HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER * ppmk);
440HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid);
441HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
442HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szUserName, ULONG * pchEaten, LPMONIKER * ppmk);
443HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon);
444HRESULT WINAPI MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONIKER * ppmkRelPath, BOOL dwReserved);
445
446/*****************************************************************************
447 * Storage API
448 */
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
466#define STGM_DIRECT_SWMR 0x00400000
467
468#define STGFMT_STORAGE 0
469#define STGFMT_FILE 3
470#define STGFMT_ANY 4
471#define STGFMT_DOCFILE 5
472
473typedef struct tagSTGOPTIONS
474{
475 USHORT usVersion;
476 USHORT reserved;
477 ULONG ulSectorSize;
478 const WCHAR* pwcsTemplateFile;
479} STGOPTIONS;
480
481HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName,DWORD grfMode,DWORD reserved,IStorage **ppstgOpen);
482HRESULT WINAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
483HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn);
484HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt);
485HRESULT WINAPI StgOpenStorage(const OLECHAR* pwcsName,IStorage* pstgPriority,DWORD grfMode,SNB snbExclude,DWORD reserved,IStorage**ppstgOpen);
486HRESULT WINAPI StgOpenStorageEx(const WCHAR* pwcwName,DWORD grfMode,DWORD stgfmt,DWORD grfAttrs,STGOPTIONS *pStgOptions, void *reserved, REFIID riid, void **ppObjectOpen);
487
488HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt,DWORD grfMode, DWORD reserved, IStorage** ppstgOpen);
489HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen);
490HRESULT WINAPI StgSetTimes( OLECHAR const *lpszName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime);
491
492#ifdef __cplusplus
493}
494#endif
495
496#ifndef __WINESRC__
497# include <urlmon.h>
498#endif
499#include <propidl.h>
500
501#ifndef __WINESRC__
502
503#define FARSTRUCT
504#define HUGEP
505
506#define WINOLEAPI STDAPI
507#define WINOLEAPI_(type) STDAPI_(type)
508
509#endif /* __WINESRC__ */
510
511#endif /* _OBJBASE_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette