Something went wrong. Try again.
Reactos
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060/* * Copyright (C) 1998-1999 Francois Gouget * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
#include <rpc.h>#include <rpcndr.h>
#ifndef _OBJBASE_H_#define _OBJBASE_H_
/***************************************************************************** * Macros to define a COM interface *//* * The goal of the following set of definitions is to provide a way to use the same * header file definitions to provide both a C interface and a C++ object oriented * interface to COM interfaces. The type of interface is selected automatically * depending on the language but it is always possible to get the C interface in C++ * by defining CINTERFACE. * * It is based on the following assumptions: * - all COM interfaces derive from IUnknown, this should not be a problem. * - the header file only defines the interface, the actual fields are defined * separately in the C file implementing the interface. * * The natural approach to this problem would be to make sure we get a C++ class and * virtual methods in C++ and a structure with a table of pointer to functions in C. * Unfortunately the layout of the virtual table is compiler specific, the layout of * g++ virtual tables is not the same as that of an egcs virtual table which is not the * same as that generated by Visual C++. There are workarounds to make the virtual tables * compatible via padding but unfortunately the one which is imposed to the WINE emulator * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all. * * So the solution I finally adopted does not use virtual tables. Instead I use inline * non virtual methods that dereference the method pointer themselves and perform the call. * * Let's take Direct3D as an example: * * #define INTERFACE IDirect3D * DECLARE_INTERFACE_(IDirect3D,IUnknown) * { * // *** IUnknown methods *** // * STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, void**) PURE; * STDMETHOD_(ULONG,AddRef)(THIS) PURE; * STDMETHOD_(ULONG,Release)(THIS) PURE; * // *** IDirect3D methods *** // * STDMETHOD(Initialize)(THIS_ REFIID) PURE; * STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE; * STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT *, IUnknown *) PURE; * STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL *, IUnknown *) PURE; * STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT *, IUnknown *) PURE; * STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE; * }; * #undef INTERFACE * * #ifdef COBJMACROS * // *** IUnknown methods *** // * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p) * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p) * // *** IDirect3D methods *** // * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b) * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) * #endif * * Comments: * - The INTERFACE macro is used in the STDMETHOD macros to define the type of the 'this' * pointer. Defining this macro here saves us the trouble of having to repeat the interface * name everywhere. Note however that because of the way macros work, a macro like STDMETHOD * cannot use 'INTERFACE##_VTABLE' because this would give 'INTERFACE_VTABLE' and not * 'IDirect3D_VTABLE'. * - The DECLARE_INTERFACE declares all the structures necessary for the interface. We have to * explicitly use the interface name for macro expansion reasons again. It defines the list of * methods that are inheritable from this interface. It must be written manually (rather than * using a macro to generate the equivalent code) to avoid macro recursion (which compilers * don't like). It must start with the methods definition of the parent interface so that * method inheritance works properly. * - The 'undef INTERFACE' is here to remind you that using INTERFACE in the following macros * will not work. * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate * the inherited method definitions there. This time I could have used a trick to use only one * macro whatever the number of parameters but I preferred to have it work the same way as above. * - You probably have noticed that we don't define the fields we need to actually implement this * interface: reference count, pointer to other resources and miscellaneous fields. That's * because these interfaces are just that: interfaces. They may be implemented more than once, in * different contexts and sometimes not even in Wine. Thus it would not make sense to impose * that the interface contains some specific fields. * * * In C this gives: * typedef struct IDirect3DVtbl IDirect3DVtbl; * struct IDirect3D { * IDirect3DVtbl* lpVtbl; * }; * struct IDirect3DVtbl { * HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj); * ULONG (*AddRef)(IDirect3D* me); * ULONG (*Release)(IDirect3D* me); * HRESULT (*Initialize)(IDirect3D* me, REFIID a); * HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b); * HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b); * HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b); * HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b); * HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b); * }; * * #ifdef COBJMACROS * // *** IUnknown methods *** // * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p) * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p) * // *** IDirect3D methods *** // * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b) * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) * #endif * * Comments: * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing * the user needs to know to use the interface. Of course the structure we will define to * implement this interface will have more fields but the first one will match this pointer. * - The code generated by DECLARE_INTERFACE defines both the structure representing the interface and * the structure for the jump table. * - Each method is declared as a pointer to function field in the jump table. The implementation * will fill this jump table with appropriate values, probably using a static variable, and * initialize the lpVtbl field to point to this variable. * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer * corresponding to the macro name. This emulates the behavior of a virtual table and should be * just as fast. * - This C code should be quite compatible with the Windows headers both for code that uses COM * interfaces and for code implementing a COM interface. * * * And in C++ (with gcc's g++): * * typedef struct IDirect3D: public IUnknown { * virtual HRESULT Initialize(REFIID a) = 0; * virtual HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b) = 0; * virtual HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b) = 0; * virtual HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b) = 0; * virtual HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b) = 0; * virtual HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b) = 0; * }; * * Comments: * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions. * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE * macro is defined in which case we would not be here. */
#if defined(__cplusplus) && !defined(CINTERFACE)
/* C++ interface */
#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method#define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method#define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method#define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
#define PURE = 0#define THIS_#define THIS void
#define interface struct#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface#define DECLARE_INTERFACE_(iface,ibase) interface DECLSPEC_NOVTABLE iface : public ibase#define DECLARE_INTERFACE_IID_(iface, ibase, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface : public ibase
#define BEGIN_INTERFACE#define END_INTERFACE
#else /* __cplusplus && !CINTERFACE */
/* C interface */
#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)#define STDMETHOD_(type,method) type (STDMETHODCALLTYPE *method)#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)#define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method)
#define PURE#define THIS_ INTERFACE *This,#define THIS INTERFACE *This
#define interface struct
#ifdef __WINESRC__#define CONST_VTABLE#endif
#ifdef CONST_VTABLE#undef CONST_VTBL#define CONST_VTBL const#define DECLARE_INTERFACE(iface) \ typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; \ typedef struct iface##Vtbl iface##Vtbl; \ struct iface##Vtbl#else#undef CONST_VTBL#define CONST_VTBL#define DECLARE_INTERFACE(iface) \ typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; \ typedef struct iface##Vtbl iface##Vtbl; \ struct iface##Vtbl#endif#define DECLARE_INTERFACE_(iface,ibase) DECLARE_INTERFACE(iface)#define DECLARE_INTERFACE_IID_(iface, ibase, iid) DECLARE_INTERFACE_(iface, ibase)
#define BEGIN_INTERFACE#define END_INTERFACE
#endif /* __cplusplus && !CINTERFACE */
#ifndef __IRpcStubBuffer_FWD_DEFINED__#define __IRpcStubBuffer_FWD_DEFINED__typedef interface IRpcStubBuffer IRpcStubBuffer;#endif#ifndef __IRpcChannelBuffer_FWD_DEFINED__#define __IRpcChannelBuffer_FWD_DEFINED__typedef interface IRpcChannelBuffer IRpcChannelBuffer;#endif
#ifndef RC_INVOKED/* For compatibility only, at least for now */#include <stdlib.h>#endif
#include <wtypes.h>#include <unknwn.h>#include <objidl.h>
#include <guiddef.h>#ifndef INITGUID#include <cguid.h>#endif
#ifdef __cplusplusextern "C" {#endif
#ifndef NONAMELESSSTRUCT#define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))#define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))#else#define LISet32(li, v) ((li).u.HighPart = (v) < 0 ? -1 : 0, (li).u.LowPart = (v))#define ULISet32(li, v) ((li).u.HighPart = 0, (li).u.LowPart = (v))#endif
/***************************************************************************** * Standard API */DWORD WINAPI CoBuildVersion(void);
typedef enum tagCOINIT{ COINIT_APARTMENTTHREADED = 0x2, /* Apartment model */ COINIT_MULTITHREADED = 0x0, /* OLE calls objects on any thread */ COINIT_DISABLE_OLE1DDE = 0x4, /* Don't use DDE for Ole1 support */ COINIT_SPEED_OVER_MEMORY = 0x8 /* Trade memory for speed */} COINIT;
_Check_return_ HRESULT WINAPI CoInitialize(_In_opt_ LPVOID lpReserved);
_Check_return_HRESULTWINAPICoInitializeEx( _In_opt_ LPVOID lpReserved, _In_ DWORD dwCoInit);
void WINAPI CoUninitialize(void);DWORD WINAPI CoGetCurrentProcess(void);HRESULT WINAPI CoGetCurrentLogicalThreadId(_Out_ GUID *id);HRESULT WINAPI CoGetApartmentType(_Out_ APTTYPE *type, _Out_ APTTYPEQUALIFIER *qualifier);
HINSTANCE WINAPI CoLoadLibrary(_In_ LPOLESTR lpszLibName, _In_ BOOL bAutoFree);void WINAPI CoFreeAllLibraries(void);void WINAPI CoFreeLibrary(_In_ HINSTANCE hLibrary);void WINAPI CoFreeUnusedLibraries(void);
voidWINAPICoFreeUnusedLibrariesEx( _In_ DWORD dwUnloadDelay, _In_ DWORD dwReserved);
_Check_return_HRESULTWINAPICoCreateInstance( _In_ REFCLSID rclsid, _In_opt_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Outptr_ _At_(*ppv, _Post_readable_size_(_Inexpressible_(varies))) LPVOID *ppv);
_Check_return_HRESULTWINAPICoCreateInstanceEx( _In_ REFCLSID rclsid, _In_opt_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_opt_ COSERVERINFO *pServerInfo, _In_ ULONG cmq, _Inout_updates_(cmq) MULTI_QI *pResults);
_Check_return_HRESULTWINAPICoGetInstanceFromFile( _In_opt_ COSERVERINFO *pServerInfo, _In_opt_ CLSID *pClsid, _In_opt_ IUnknown *punkOuter, _In_ DWORD dwClsCtx, _In_ DWORD grfMode, _In_ _Null_terminated_ OLECHAR *pwszName, _In_ DWORD dwCount, _Inout_updates_(dwCount) MULTI_QI *pResults);
_Check_return_HRESULTWINAPICoGetInstanceFromIStorage( _In_opt_ COSERVERINFO *pServerInfo, _In_opt_ CLSID *pClsid, _In_opt_ IUnknown *punkOuter, _In_ DWORD dwClsCtx, _In_ IStorage *pstg, _In_ DWORD dwCount, _Inout_updates_(dwCount) MULTI_QI *pResults);
_Check_return_HRESULTWINAPICoGetMalloc( _In_ DWORD dwMemContext, _Outptr_ LPMALLOC *lpMalloc);
_Ret_opt__Post_writable_byte_size_(size)__drv_allocatesMem(Mem)_Check_return_LPVOIDWINAPICoTaskMemAlloc(_In_ SIZE_T size) __WINE_ALLOC_SIZE(1);
voidWINAPICoTaskMemFree( _In_opt_ __drv_freesMem(Mem) _Post_invalid_ LPVOID ptr);
_Ret_opt__Post_writable_byte_size_(size)_When_(size > 0, __drv_allocatesMem(Mem) _Check_return_)LPVOIDWINAPICoTaskMemRealloc( _In_opt_ __drv_freesMem(Mem) _Post_invalid_ LPVOID ptr, _In_ SIZE_T size);
HRESULT WINAPI CoRegisterMallocSpy(_In_ LPMALLOCSPY pMallocSpy);HRESULT WINAPI CoRevokeMallocSpy(void);
_Check_return_ HRESULT WINAPI CoGetContextToken(_Out_ ULONG_PTR *token);
/* class registration flags; passed to CoRegisterClassObject */typedef enum tagREGCLS{ REGCLS_SINGLEUSE = 0, REGCLS_MULTIPLEUSE = 1, REGCLS_MULTI_SEPARATE = 2, REGCLS_SUSPENDED = 4, REGCLS_SURROGATE = 8} REGCLS;
_Check_return_HRESULTWINAPICoGetClassObject( _In_ REFCLSID rclsid, _In_ DWORD dwClsContext, _In_opt_ COSERVERINFO *pServerInfo, _In_ REFIID iid, _Outptr_ LPVOID *ppv);
_Check_return_HRESULTWINAPICoRegisterClassObject( _In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnk, _In_ DWORD dwClsContext, _In_ DWORD flags, _Out_ LPDWORD lpdwRegister);
_Check_return_HRESULTWINAPICoRevokeClassObject( _In_ DWORD dwRegister);
_Check_return_HRESULTWINAPICoGetPSClsid( _In_ REFIID riid, _Out_ CLSID *pclsid);
_Check_return_HRESULTWINAPICoRegisterPSClsid( _In_ REFIID riid, _In_ REFCLSID rclsid);
_Check_return_ HRESULT WINAPI CoRegisterSurrogate(_In_ LPSURROGATE pSurrogate);_Check_return_ HRESULT WINAPI CoSuspendClassObjects(void);_Check_return_ HRESULT WINAPI CoResumeClassObjects(void);ULONG WINAPI CoAddRefServerProcess(void);ULONG WINAPI CoReleaseServerProcess(void);
/* marshalling */
_Check_return_HRESULTWINAPICoCreateFreeThreadedMarshaler( _In_opt_ LPUNKNOWN punkOuter, _Outptr_ LPUNKNOWN *ppunkMarshal);
_Check_return_HRESULTWINAPICoGetInterfaceAndReleaseStream( _In_ LPSTREAM pStm, _In_ REFIID iid, _Outptr_ LPVOID *ppv);
_Check_return_HRESULTWINAPICoGetMarshalSizeMax( _Out_ ULONG *pulSize, _In_ REFIID riid, _In_ LPUNKNOWN pUnk, _In_ DWORD dwDestContext, _In_opt_ LPVOID pvDestContext, _In_ DWORD mshlflags);
_Check_return_HRESULTWINAPICoGetStandardMarshal( _In_ REFIID riid, _In_ LPUNKNOWN pUnk, _In_ DWORD dwDestContext, _In_opt_ LPVOID pvDestContext, _In_ DWORD mshlflags, _Outptr_ LPMARSHAL *ppMarshal);
HRESULT WINAPI CoMarshalHresult(_In_ LPSTREAM pstm, _In_ HRESULT hresult);
_Check_return_HRESULTWINAPICoMarshalInterface( _In_ LPSTREAM pStm, _In_ REFIID riid, _In_ LPUNKNOWN pUnk, _In_ DWORD dwDestContext, _In_opt_ LPVOID pvDestContext, _In_ DWORD mshlflags);
_Check_return_HRESULTWINAPICoMarshalInterThreadInterfaceInStream( _In_ REFIID riid, _In_ LPUNKNOWN pUnk, _Outptr_ LPSTREAM *ppStm);
_Check_return_ HRESULT WINAPI CoReleaseMarshalData(_In_ LPSTREAM pStm);
_Check_return_HRESULTWINAPICoDisconnectObject( _In_ LPUNKNOWN lpUnk, _In_ DWORD reserved);
HRESULT WINAPI CoUnmarshalHresult(_In_ LPSTREAM pstm, _Out_ HRESULT *phresult);
_Check_return_HRESULTWINAPICoUnmarshalInterface( _In_ LPSTREAM pStm, _In_ REFIID riid, _Outptr_ LPVOID *ppv);
_Check_return_HRESULTWINAPICoLockObjectExternal( _In_ LPUNKNOWN pUnk, _In_ BOOL fLock, _In_ BOOL fLastUnlockReleases);
BOOL WINAPI CoIsHandlerConnected(_In_ LPUNKNOWN pUnk);
/* security */
_Check_return_HRESULTWINAPICoInitializeSecurity( _In_opt_ PSECURITY_DESCRIPTOR pSecDesc, _In_ LONG cAuthSvc, _In_reads_opt_(cAuthSvc) SOLE_AUTHENTICATION_SERVICE *asAuthSvc, _In_opt_ void *pReserved1, _In_ DWORD dwAuthnLevel, _In_ DWORD dwImpLevel, _In_opt_ void *pReserved2, _In_ DWORD dwCapabilities, _In_opt_ void *pReserved3);
_Check_return_HRESULTWINAPICoGetCallContext( _In_ REFIID riid, _Outptr_ void **ppInterface);
_Check_return_HRESULTWINAPICoSwitchCallContext( _In_opt_ IUnknown *pContext, _Outptr_ IUnknown **ppOldContext);
_Check_return_HRESULTWINAPICoQueryAuthenticationServices( _Out_ DWORD *pcAuthSvc, _Outptr_result_buffer_(*pcAuthSvc) SOLE_AUTHENTICATION_SERVICE **asAuthSvc);
_Check_return_HRESULTWINAPICoQueryProxyBlanket( _In_ IUnknown *pProxy, _Out_opt_ DWORD *pwAuthnSvc, _Out_opt_ DWORD *pAuthzSvc, _Outptr_opt_ OLECHAR **pServerPrincName, _Out_opt_ DWORD *pAuthnLevel, _Out_opt_ DWORD *pImpLevel, _Out_opt_ RPC_AUTH_IDENTITY_HANDLE *pAuthInfo, _Out_opt_ DWORD *pCapabilities);
_Check_return_HRESULTWINAPICoSetProxyBlanket( _In_ IUnknown *pProxy, _In_ DWORD dwAuthnSvc, _In_ DWORD dwAuthzSvc, _In_opt_ OLECHAR *pServerPrincName, _In_ DWORD dwAuthnLevel, _In_ DWORD dwImpLevel, _In_opt_ RPC_AUTH_IDENTITY_HANDLE pAuthInfo, _In_ DWORD dwCapabilities);
_Check_return_HRESULTWINAPI CoCopyProxy( _In_ IUnknown *pProxy, _Outptr_ IUnknown **ppCopy);
_Check_return_ HRESULT WINAPI CoImpersonateClient(void);
_Check_return_HRESULTWINAPICoQueryClientBlanket( _Out_opt_ DWORD *pAuthnSvc, _Out_opt_ DWORD *pAuthzSvc, _Outptr_opt_ OLECHAR **pServerPrincName, _Out_opt_ DWORD *pAuthnLevel, _Out_opt_ DWORD *pImpLevel, _Outptr_opt_ RPC_AUTHZ_HANDLE *pPrivs, _Inout_opt_ DWORD *pCapabilities);
_Check_return_ HRESULT WINAPI CoRevertToSelf(void);
/* misc */
_Check_return_HRESULTWINAPICoGetTreatAsClass( _In_ REFCLSID clsidOld, _Out_ LPCLSID pClsidNew);
_Check_return_HRESULTWINAPICoTreatAsClass( _In_ REFCLSID clsidOld, _In_ REFCLSID clsidNew);
HRESULTWINAPICoAllowSetForegroundWindow( _In_ IUnknown *pUnk, _In_opt_ LPVOID lpvReserved);
_Check_return_HRESULTWINAPICoGetObjectContext( _In_ REFIID riid, _Outptr_ LPVOID *ppv);
_Check_return_HRESULTWINAPICoRegisterInitializeSpy( _In_ IInitializeSpy *spy, _Out_ ULARGE_INTEGER *cookie);
_Check_return_HRESULTWINAPICoRevokeInitializeSpy( _In_ ULARGE_INTEGER cookie);
_Check_return_ HRESULT WINAPI CoCreateGuid(_Out_ GUID *pguid);BOOL WINAPI CoIsOle1Class(_In_ REFCLSID rclsid);
BOOLWINAPICoDosDateTimeToFileTime( _In_ WORD nDosDate, _In_ WORD nDosTime, _Out_ FILETIME *lpFileTime);
BOOLWINAPICoFileTimeToDosDateTime( _In_ FILETIME *lpFileTime, _Out_ WORD *lpDosDate, _Out_ WORD *lpDosTime);
HRESULT WINAPI CoFileTimeNow(_Out_ FILETIME *lpFileTime);
_Check_return_HRESULTWINAPICoRegisterMessageFilter( _In_opt_ LPMESSAGEFILTER lpMessageFilter, _Outptr_opt_result_maybenull_ LPMESSAGEFILTER *lplpMessageFilter);
HRESULTWINAPICoRegisterChannelHook( _In_ REFGUID ExtensionGuid, _In_ IChannelHook *pChannelHook);
typedef enum tagCOWAIT_FLAGS{ COWAIT_DEFAULT = 0x00000000, COWAIT_WAITALL = 0x00000001, COWAIT_ALERTABLE = 0x00000002, COWAIT_INPUTAVAILABLE = 0x00000004} COWAIT_FLAGS;
_Check_return_HRESULTWINAPICoWaitForMultipleHandles( _In_ DWORD dwFlags, _In_ DWORD dwTimeout, _In_ ULONG cHandles, _In_reads_(cHandles) LPHANDLE pHandles, _Out_ LPDWORD lpdwindex);
/***************************************************************************** * GUID API */
_Check_return_HRESULTWINAPIStringFromCLSID( _In_ REFCLSID id, _Outptr_ LPOLESTR*);
_Check_return_HRESULTWINAPICLSIDFromString( _In_ LPCOLESTR, _Out_ LPCLSID);
_Check_return_HRESULTWINAPICLSIDFromProgID( _In_ LPCOLESTR progid, _Out_ LPCLSID riid);
_Check_return_HRESULTWINAPIProgIDFromCLSID( _In_ REFCLSID clsid, _Outptr_ LPOLESTR *lplpszProgID);
_Check_return_INTWINAPIStringFromGUID2( _In_ REFGUID id, _Out_writes_to_(cmax, return) LPOLESTR str, _In_ INT cmax);
_Check_return_HRESULTWINAPIIIDFromString( _In_ LPCOLESTR lpsz, _Out_ LPIID lpiid);
/***************************************************************************** * COM Server dll - exports */
_Check_return_HRESULTWINAPIDllGetClassObject( _In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID *ppv) DECLSPEC_HIDDEN;
HRESULT WINAPI DllCanUnloadNow(void) DECLSPEC_HIDDEN;
/* shouldn't be here, but is nice for type checking */#ifdef __WINESRC__HRESULT WINAPI DllRegisterServer(void) DECLSPEC_HIDDEN;HRESULT WINAPI DllUnregisterServer(void) DECLSPEC_HIDDEN;#endif
/***************************************************************************** * Data Object */
HRESULTWINAPICreateDataAdviseHolder( _Outptr_ LPDATAADVISEHOLDER *ppDAHolder);
HRESULTWINAPICreateDataCache( _In_opt_ LPUNKNOWN pUnkOuter, _In_ REFCLSID rclsid, _In_ REFIID iid, _Out_ LPVOID *ppv);
/***************************************************************************** * Moniker API */
_Check_return_HRESULTWINAPIBindMoniker( _In_ LPMONIKER pmk, _In_ DWORD grfOpt, _In_ REFIID iidResult, _Outptr_ LPVOID *ppvResult);
_Check_return_HRESULTWINAPICoGetObject( _In_ LPCWSTR pszName, _In_opt_ BIND_OPTS *pBindOptions, _In_ REFIID riid, _Outptr_ void **ppv);
_Check_return_ HRESULT WINAPI CreateAntiMoniker(_Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPICreateBindCtx( _In_ DWORD reserved, _Outptr_ LPBC *ppbc);
_Check_return_HRESULTWINAPICreateClassMoniker( _In_ REFCLSID rclsid, _Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPICreateFileMoniker( _In_ LPCOLESTR lpszPathName, _Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPICreateGenericComposite( _In_opt_ LPMONIKER pmkFirst, _In_opt_ LPMONIKER pmkRest, _Outptr_ LPMONIKER *ppmkComposite);
_Check_return_HRESULTWINAPICreateItemMoniker( _In_ LPCOLESTR lpszDelim, _In_ LPCOLESTR lpszItem, _Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPICreateObjrefMoniker( _In_opt_ LPUNKNOWN punk, _Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPICreatePointerMoniker( _In_opt_ LPUNKNOWN punk, _Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPIGetClassFile( _In_ LPCOLESTR filePathName, _Out_ CLSID *pclsid);
_Check_return_HRESULTWINAPIGetRunningObjectTable( _In_ DWORD reserved, _Outptr_ LPRUNNINGOBJECTTABLE *pprot);
_Check_return_HRESULTWINAPIMkParseDisplayName( _In_ LPBC pbc, _In_ LPCOLESTR szUserName, _Out_ ULONG *pchEaten, _Outptr_ LPMONIKER *ppmk);
_Check_return_HRESULTWINAPIMonikerCommonPrefixWith( _In_ IMoniker *pmkThis, _In_ IMoniker *pmkOther, _Outptr_ IMoniker **ppmkCommon);
_Check_return_HRESULTWINAPIMonikerRelativePathTo( _In_ LPMONIKER pmkSrc, _In_ LPMONIKER pmkDest, _Outptr_ LPMONIKER *ppmkRelPath, _In_ BOOL dwReserved);
/***************************************************************************** * Storage API */#define STGM_DIRECT 0x00000000#define STGM_TRANSACTED 0x00010000#define STGM_SIMPLE 0x08000000#define STGM_READ 0x00000000#define STGM_WRITE 0x00000001#define STGM_READWRITE 0x00000002#define STGM_SHARE_DENY_NONE 0x00000040#define STGM_SHARE_DENY_READ 0x00000030#define STGM_SHARE_DENY_WRITE 0x00000020#define STGM_SHARE_EXCLUSIVE 0x00000010#define STGM_PRIORITY 0x00040000#define STGM_DELETEONRELEASE 0x04000000#define STGM_CREATE 0x00001000#define STGM_CONVERT 0x00020000#define STGM_FAILIFTHERE 0x00000000#define STGM_NOSCRATCH 0x00100000#define STGM_NOSNAPSHOT 0x00200000#define STGM_DIRECT_SWMR 0x00400000
#define STGFMT_STORAGE 0#define STGFMT_FILE 3#define STGFMT_ANY 4#define STGFMT_DOCFILE 5
typedef struct tagSTGOPTIONS{ USHORT usVersion; USHORT reserved; ULONG ulSectorSize; const WCHAR* pwcsTemplateFile;} STGOPTIONS;
_Check_return_HRESULTWINAPIStringFromIID( _In_ REFIID rclsid, _Outptr_ LPOLESTR *lplpsz);
_Check_return_HRESULTWINAPIStgCreateDocfile( _In_opt_ _Null_terminated_ LPCOLESTR pwcsName, _In_ DWORD grfMode, _Reserved_ DWORD reserved, _Outptr_ IStorage **ppstgOpen);
_Check_return_HRESULTWINAPIStgCreateStorageEx( _In_opt_ _Null_terminated_ const WCHAR*, _In_ DWORD, _In_ DWORD, _In_ DWORD, _Inout_opt_ STGOPTIONS*, _In_opt_ void*, _In_ REFIID, _Outptr_ void**);
_Check_return_HRESULTWINAPIStgIsStorageFile( _In_ _Null_terminated_ LPCOLESTR fn);
_Check_return_HRESULTWINAPIStgIsStorageILockBytes( _In_ ILockBytes *plkbyt);
_Check_return_HRESULTWINAPIStgOpenStorage( _In_opt_ _Null_terminated_ const OLECHAR *pwcsName, _In_opt_ IStorage *pstgPriority, _In_ DWORD grfMode, _In_opt_z_ SNB snbExclude, _In_ DWORD reserved, _Outptr_ IStorage **ppstgOpen);
_Check_return_HRESULTWINAPIStgOpenStorageEx( _In_ _Null_terminated_ const WCHAR *pwcwName, _In_ DWORD grfMode, _In_ DWORD stgfmt, _In_ DWORD grfAttrs, _Inout_opt_ STGOPTIONS *pStgOptions, _In_opt_ void *reserved, _In_ REFIID riid, _Outptr_ void **ppObjectOpen);
_Check_return_HRESULTWINAPIStgCreateDocfileOnILockBytes( _In_ ILockBytes *plkbyt, _In_ DWORD grfMode, _In_ DWORD reserved, _Outptr_ IStorage **ppstgOpen);
_Check_return_HRESULTWINAPIStgOpenStorageOnILockBytes( _In_ ILockBytes *plkbyt, _In_opt_ IStorage *pstgPriority, _In_ DWORD grfMode, _In_opt_z_ SNB snbExclude, _Reserved_ DWORD reserved, _Outptr_ IStorage **ppstgOpen);
_Check_return_HRESULTWINAPIStgSetTimes( _In_ _Null_terminated_ OLECHAR const *lpszName, _In_opt_ FILETIME const *pctime, _In_opt_ FILETIME const *patime, _In_opt_ FILETIME const *pmtime);
#ifdef __cplusplus}#endif
#ifndef __WINESRC__# include <urlmon.h>#endif#include <propidl.h>
#ifndef __WINESRC__
#define FARSTRUCT#define HUGEP
#define WINOLEAPI STDAPI#define WINOLEAPI_(type) STDAPI_(type)
#endif /* __WINESRC__ */
#endif /* _OBJBASE_H_ */