ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

objbase.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1998-1999 Francois Gouget
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #include <rpc.h>
00020 #include <rpcndr.h>
00021 
00022 #ifndef _OBJBASE_H_
00023 #define _OBJBASE_H_
00024 
00025 /*****************************************************************************
00026  * Macros to define a COM interface
00027  */
00028 /*
00029  * The goal of the following set of definitions is to provide a way to use the same
00030  * header file definitions to provide both a C interface and a C++ object oriented
00031  * interface to COM interfaces. The type of interface is selected automatically
00032  * depending on the language but it is always possible to get the C interface in C++
00033  * by defining CINTERFACE.
00034  *
00035  * It is based on the following assumptions:
00036  *  - all COM interfaces derive from IUnknown, this should not be a problem.
00037  *  - the header file only defines the interface, the actual fields are defined
00038  *    separately in the C file implementing the interface.
00039  *
00040  * The natural approach to this problem would be to make sure we get a C++ class and
00041  * virtual methods in C++ and a structure with a table of pointer to functions in C.
00042  * Unfortunately the layout of the virtual table is compiler specific, the layout of
00043  * g++ virtual tables is not the same as that of an egcs virtual table which is not the
00044  * same as that generated by Visual C+. There are workarounds to make the virtual tables
00045  * compatible via padding but unfortunately the one which is imposed to the WINE emulator
00046  * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
00047  *
00048  * So the solution I finally adopted does not use virtual tables. Instead I use inline
00049  * non virtual methods that dereference the method pointer themselves and perform the call.
00050  *
00051  * Let's take Direct3D as an example:
00052  *
00053  *    #define INTERFACE IDirect3D
00054  *    DECLARE_INTERFACE_(IDirect3D,IUnknown)
00055  *    {
00056  *        // *** IUnknown methods *** //
00057  *        STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, void**) PURE;
00058  *        STDMETHOD_(ULONG,AddRef)(THIS) PURE;
00059  *        STDMETHOD_(ULONG,Release)(THIS) PURE;
00060  *        // *** IDirect3D methods *** //
00061  *        STDMETHOD(Initialize)(THIS_ REFIID) PURE;
00062  *        STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
00063  *        STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT *, IUnknown *) PURE;
00064  *        STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL *, IUnknown *) PURE;
00065  *        STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT *, IUnknown *) PURE;
00066  *        STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
00067  *    };
00068  *    #undef INTERFACE
00069  *
00070  *    #ifdef COBJMACROS
00071  *    // *** IUnknown methods *** //
00072  *    #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
00073  *    #define IDirect3D_AddRef(p)             (p)->lpVtbl->AddRef(p)
00074  *    #define IDirect3D_Release(p)            (p)->lpVtbl->Release(p)
00075  *    // *** IDirect3D methods *** //
00076  *    #define IDirect3D_Initialize(p,a)       (p)->lpVtbl->Initialize(p,a)
00077  *    #define IDirect3D_EnumDevices(p,a,b)    (p)->lpVtbl->EnumDevice(p,a,b)
00078  *    #define IDirect3D_CreateLight(p,a,b)    (p)->lpVtbl->CreateLight(p,a,b)
00079  *    #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
00080  *    #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
00081  *    #define IDirect3D_FindDevice(p,a,b)     (p)->lpVtbl->FindDevice(p,a,b)
00082  *    #endif
00083  *
00084  * Comments:
00085  *  - The INTERFACE macro is used in the STDMETHOD macros to define the type of the 'this'
00086  *    pointer. Defining this macro here saves us the trouble of having to repeat the interface
00087  *    name everywhere. Note however that because of the way macros work, a macro like STDMETHOD
00088  *    cannot use 'INTERFACE##_VTABLE' because this would give 'INTERFACE_VTABLE' and not
00089  *    'IDirect3D_VTABLE'.
00090  *  - The DECLARE_INTERFACE declares all the structures necessary for the interface. We have to
00091  *    explicitly use the interface name for macro expansion reasons again. It defines the list of
00092  *    methods that are inheritable from this interface. It must be written manually (rather than
00093  *    using a macro to generate the equivalent code) to avoid macro recursion (which compilers
00094  *    don't like). It must start with the methods definition of the parent interface so that
00095  *    method inheritance works properly.
00096  *  - The 'undef INTERFACE' is here to remind you that using INTERFACE in the following macros
00097  *    will not work.
00098  *  - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access
00099  *    to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate
00100  *    the inherited method definitions there. This time I could have used a trick to use only one
00101  *    macro whatever the number of parameters but I preferred to have it work the same way as above.
00102  *  - You probably have noticed that we don't define the fields we need to actually implement this
00103  *    interface: reference count, pointer to other resources and miscellaneous fields. That's
00104  *    because these interfaces are just that: interfaces. They may be implemented more than once, in
00105  *    different contexts and sometimes not even in Wine. Thus it would not make sense to impose
00106  *    that the interface contains some specific fields.
00107  *
00108  *
00109  * In C this gives:
00110  *    typedef struct IDirect3DVtbl IDirect3DVtbl;
00111  *    struct IDirect3D {
00112  *        IDirect3DVtbl* lpVtbl;
00113  *    };
00114  *    struct IDirect3DVtbl {
00115  *        HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj);
00116  *        ULONG (*AddRef)(IDirect3D* me);
00117  *        ULONG (*Release)(IDirect3D* me);
00118  *        HRESULT (*Initialize)(IDirect3D* me, REFIID a);
00119  *        HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
00120  *        HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
00121  *        HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
00122  *        HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
00123  *        HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
00124  *    };
00125  *
00126  *    #ifdef COBJMACROS
00127  *    // *** IUnknown methods *** //
00128  *    #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
00129  *    #define IDirect3D_AddRef(p)             (p)->lpVtbl->AddRef(p)
00130  *    #define IDirect3D_Release(p)            (p)->lpVtbl->Release(p)
00131  *    // *** IDirect3D methods *** //
00132  *    #define IDirect3D_Initialize(p,a)       (p)->lpVtbl->Initialize(p,a)
00133  *    #define IDirect3D_EnumDevices(p,a,b)    (p)->lpVtbl->EnumDevice(p,a,b)
00134  *    #define IDirect3D_CreateLight(p,a,b)    (p)->lpVtbl->CreateLight(p,a,b)
00135  *    #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
00136  *    #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
00137  *    #define IDirect3D_FindDevice(p,a,b)     (p)->lpVtbl->FindDevice(p,a,b)
00138  *    #endif
00139  *
00140  * Comments:
00141  *  - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing
00142  *    the user needs to know to use the interface. Of course the structure we will define to
00143  *    implement this interface will have more fields but the first one will match this pointer.
00144  *  - The code generated by DECLARE_INTERFACE defines both the structure representing the interface and
00145  *    the structure for the jump table.
00146  *  - Each method is declared as a pointer to function field in the jump table. The implementation
00147  *    will fill this jump table with appropriate values, probably using a static variable, and
00148  *    initialize the lpVtbl field to point to this variable.
00149  *  - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
00150  *    corresponding to the macro name. This emulates the behavior of a virtual table and should be
00151  *    just as fast.
00152  *  - This C code should be quite compatible with the Windows headers both for code that uses COM
00153  *    interfaces and for code implementing a COM interface.
00154  *
00155  *
00156  * And in C++ (with gcc's g++):
00157  *
00158  *    typedef struct IDirect3D: public IUnknown {
00159  *        virtual HRESULT Initialize(REFIID a) = 0;
00160  *        virtual HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b) = 0;
00161  *        virtual HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b) = 0;
00162  *        virtual HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b) = 0;
00163  *        virtual HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b) = 0;
00164  *        virtual HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b) = 0;
00165  *    };
00166  *
00167  * Comments:
00168  *  - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
00169  *  - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
00170  *    macro is defined in which case we would not be here.
00171  *
00172  *
00173  * Implementing a COM interface.
00174  *
00175  * This continues the above example. This example assumes that the implementation is in C.
00176  *
00177  *    typedef struct IDirect3DImpl {
00178  *        void* lpVtbl;
00179  *        // ...
00180  *
00181  *    } IDirect3DImpl;
00182  *
00183  *    static IDirect3DVtbl d3dvt;
00184  *
00185  *    // implement the IDirect3D methods here
00186  *
00187  *    int IDirect3D_QueryInterface(IDirect3D* me)
00188  *    {
00189  *        IDirect3DImpl *This = (IDirect3DImpl *)me;
00190  *        // ...
00191  *    }
00192  *
00193  *    // ...
00194  *
00195  *    static IDirect3DVtbl d3dvt = {
00196  *        IDirect3D_QueryInterface,
00197  *        IDirect3D_Add,
00198  *        IDirect3D_Add2,
00199  *        IDirect3D_Initialize,
00200  *        IDirect3D_SetWidth
00201  *    };
00202  *
00203  * Comments:
00204  *  - We first define what the interface really contains. This is the IDirect3DImpl structure. The
00205  *    first field must of course be the virtual table pointer. Everything else is free.
00206  *  - Then we predeclare our static virtual table variable, we will need its address in some
00207  *    methods to initialize the virtual table pointer of the returned interface objects.
00208  *  - Then we implement the interface methods. To match what has been declared in the header file
00209  *    they must take a pointer to an IDirect3D structure and we must cast it to an IDirect3DImpl so
00210  *    that we can manipulate the fields.
00211  *  - Finally we initialize the virtual table.
00212  */
00213 
00214 #if defined(__cplusplus) && !defined(CINTERFACE)
00215 
00216 /* C++ interface */
00217 
00218 #define STDMETHOD(method)        virtual HRESULT STDMETHODCALLTYPE method
00219 #define STDMETHOD_(type,method)  virtual type STDMETHODCALLTYPE method
00220 #define STDMETHODV(method)       virtual HRESULT STDMETHODVCALLTYPE method
00221 #define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
00222 
00223 #define PURE   = 0
00224 #define THIS_
00225 #define THIS   void
00226 
00227 #define interface struct
00228 #define DECLARE_INTERFACE(iface)        interface DECLSPEC_NOVTABLE iface
00229 #define DECLARE_INTERFACE_(iface,ibase) interface DECLSPEC_NOVTABLE iface : public ibase
00230 #define DECLARE_INTERFACE_IID_(iface, ibase, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface : public ibase
00231 
00232 #define BEGIN_INTERFACE
00233 #define END_INTERFACE
00234 
00235 #else  /* __cplusplus && !CINTERFACE */
00236 
00237 /* C interface */
00238 
00239 #define STDMETHOD(method)        HRESULT (STDMETHODCALLTYPE *method)
00240 #define STDMETHOD_(type,method)  type (STDMETHODCALLTYPE *method)
00241 #define STDMETHODV(method)       HRESULT (STDMETHODVCALLTYPE *method)
00242 #define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method)
00243 
00244 #define PURE
00245 #define THIS_ INTERFACE *This,
00246 #define THIS  INTERFACE *This
00247 
00248 #define interface struct
00249 
00250 #ifdef __WINESRC__
00251 #define CONST_VTABLE
00252 #endif
00253 
00254 #ifdef CONST_VTABLE
00255 #undef CONST_VTBL
00256 #define CONST_VTBL const
00257 #define DECLARE_INTERFACE(iface) \
00258          typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; \
00259          typedef struct iface##Vtbl iface##Vtbl; \
00260          struct iface##Vtbl
00261 #else
00262 #undef CONST_VTBL
00263 #define CONST_VTBL
00264 #define DECLARE_INTERFACE(iface) \
00265          typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; \
00266          typedef struct iface##Vtbl iface##Vtbl; \
00267          struct iface##Vtbl
00268 #endif
00269 #define DECLARE_INTERFACE_(iface,ibase) DECLARE_INTERFACE(iface)
00270 #define DECLARE_INTERFACE_IID_(iface, ibase, iid) DECLARE_INTERFACE_(iface, ibase)
00271 
00272 #define BEGIN_INTERFACE
00273 #define END_INTERFACE
00274 
00275 #endif  /* __cplusplus && !CINTERFACE */
00276 
00277 #ifndef __IRpcStubBuffer_FWD_DEFINED__
00278 #define __IRpcStubBuffer_FWD_DEFINED__
00279 typedef interface IRpcStubBuffer IRpcStubBuffer;
00280 #endif
00281 #ifndef __IRpcChannelBuffer_FWD_DEFINED__
00282 #define __IRpcChannelBuffer_FWD_DEFINED__
00283 typedef interface IRpcChannelBuffer IRpcChannelBuffer;
00284 #endif
00285 
00286 #ifndef RC_INVOKED
00287 /* For compatibility only, at least for now */
00288 #include <stdlib.h>
00289 #endif
00290 
00291 #include <wtypes.h>
00292 #include <unknwn.h>
00293 #include <objidl.h>
00294 
00295 #include <guiddef.h>
00296 #ifndef INITGUID
00297 #include <cguid.h>
00298 #endif
00299 
00300 #ifdef __cplusplus
00301 extern "C" {
00302 #endif
00303 
00304 #ifndef NONAMELESSSTRUCT
00305 #define LISet32(li, v)   ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
00306 #define ULISet32(li, v)  ((li).HighPart = 0, (li).LowPart = (v))
00307 #else
00308 #define LISet32(li, v)   ((li).u.HighPart = (v) < 0 ? -1 : 0, (li).u.LowPart = (v))
00309 #define ULISet32(li, v)  ((li).u.HighPart = 0, (li).u.LowPart = (v))
00310 #endif
00311 
00312 /*****************************************************************************
00313  *  Standard API
00314  */
00315 DWORD WINAPI CoBuildVersion(void);
00316 
00317 typedef enum tagCOINIT
00318 {
00319     COINIT_APARTMENTTHREADED  = 0x2, /* Apartment model */
00320     COINIT_MULTITHREADED      = 0x0, /* OLE calls objects on any thread */
00321     COINIT_DISABLE_OLE1DDE    = 0x4, /* Don't use DDE for Ole1 support */
00322     COINIT_SPEED_OVER_MEMORY  = 0x8  /* Trade memory for speed */
00323 } COINIT;
00324 
00325 HRESULT WINAPI CoInitialize(LPVOID lpReserved);
00326 HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
00327 void WINAPI CoUninitialize(void);
00328 DWORD WINAPI CoGetCurrentProcess(void);
00329 
00330 HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
00331 void WINAPI CoFreeAllLibraries(void);
00332 void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
00333 void WINAPI CoFreeUnusedLibraries(void);
00334 void WINAPI CoFreeUnusedLibrariesEx(DWORD dwUnloadDelay, DWORD dwReserved);
00335 
00336 HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
00337 HRESULT WINAPI CoCreateInstanceEx(REFCLSID      rclsid,
00338                   LPUNKNOWN     pUnkOuter,
00339                   DWORD         dwClsContext,
00340                   COSERVERINFO* pServerInfo,
00341                   ULONG         cmq,
00342                   MULTI_QI*     pResults);
00343 
00344 HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, DWORD grfMode, OLECHAR* pwszName, DWORD dwCount, MULTI_QI* pResults);
00345 HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults);
00346 
00347 HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* lpMalloc);
00348 LPVOID WINAPI CoTaskMemAlloc(ULONG size) __WINE_ALLOC_SIZE(1);
00349 void WINAPI CoTaskMemFree(LPVOID ptr);
00350 LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size);
00351 
00352 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
00353 HRESULT WINAPI CoRevokeMallocSpy(void);
00354 
00355 HRESULT WINAPI CoGetContextToken( ULONG_PTR *token );
00356 
00357 /* class registration flags; passed to CoRegisterClassObject */
00358 typedef enum tagREGCLS
00359 {
00360     REGCLS_SINGLEUSE = 0,
00361     REGCLS_MULTIPLEUSE = 1,
00362     REGCLS_MULTI_SEPARATE = 2,
00363     REGCLS_SUSPENDED = 4,
00364     REGCLS_SURROGATE = 8
00365 } REGCLS;
00366 
00367 HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv);
00368 HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags,LPDWORD lpdwRegister);
00369 HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister);
00370 HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid);
00371 HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid);
00372 HRESULT WINAPI CoRegisterSurrogate(LPSURROGATE pSurrogate);
00373 HRESULT WINAPI CoSuspendClassObjects(void);
00374 HRESULT WINAPI CoResumeClassObjects(void);
00375 ULONG WINAPI CoAddRefServerProcess(void);
00376 ULONG WINAPI CoReleaseServerProcess(void);
00377 
00378 /* marshalling */
00379 HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
00380 HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
00381 HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
00382 HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
00383 HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
00384 HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
00385 HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
00386 HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
00387 HRESULT WINAPI CoDisconnectObject(LPUNKNOWN lpUnk, DWORD reserved);
00388 HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
00389 HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
00390 HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
00391 BOOL WINAPI CoIsHandlerConnected(LPUNKNOWN pUnk);
00392 
00393 /* security */
00394 HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE* asAuthSvc, void* pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void* pReserved2, DWORD dwCapabilities, void* pReserved3);
00395 HRESULT WINAPI CoGetCallContext(REFIID riid, void** ppInterface);
00396 HRESULT WINAPI CoSwitchCallContext(IUnknown *pContext, IUnknown **ppOldContext);
00397 HRESULT WINAPI CoQueryAuthenticationServices(DWORD* pcAuthSvc, SOLE_AUTHENTICATION_SERVICE** asAuthSvc);
00398 
00399 HRESULT WINAPI CoQueryProxyBlanket(IUnknown* pProxy, DWORD* pwAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTH_IDENTITY_HANDLE* pAuthInfo, DWORD* pCapabilities);
00400 HRESULT WINAPI CoSetProxyBlanket(IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc, OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel, RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities);
00401 HRESULT WINAPI CoCopyProxy(IUnknown* pProxy, IUnknown** ppCopy);
00402 
00403 HRESULT WINAPI CoImpersonateClient(void);
00404 HRESULT WINAPI CoQueryClientBlanket(DWORD* pAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTHZ_HANDLE* pPrivs, DWORD* pCapabilities);
00405 HRESULT WINAPI CoRevertToSelf(void);
00406 
00407 /* misc */
00408 HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
00409 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
00410 HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, LPVOID lpvReserved);
00411 HRESULT WINAPI CoGetObjectContext(REFIID riid, LPVOID *ppv);
00412 
00413 HRESULT WINAPI CoCreateGuid(GUID* pguid);
00414 BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
00415 
00416 BOOL WINAPI CoDosDateTimeToFileTime(WORD nDosDate, WORD nDosTime, FILETIME* lpFileTime);
00417 BOOL WINAPI CoFileTimeToDosDateTime(FILETIME* lpFileTime, WORD* lpDosDate, WORD* lpDosTime);
00418 HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
00419 HRESULT WINAPI CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter,LPMESSAGEFILTER *lplpMessageFilter);
00420 HRESULT WINAPI CoRegisterChannelHook(REFGUID ExtensionGuid, IChannelHook *pChannelHook);
00421 
00422 typedef enum tagCOWAIT_FLAGS
00423 {
00424     COWAIT_WAITALL   = 0x00000001,
00425     COWAIT_ALERTABLE = 0x00000002
00426 } COWAIT_FLAGS;
00427 
00428 HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags,DWORD dwTimeout,ULONG cHandles,LPHANDLE pHandles,LPDWORD lpdwindex);
00429 
00430 /*****************************************************************************
00431  *  GUID API
00432  */
00433 HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
00434 HRESULT WINAPI CLSIDFromString(LPCOLESTR, LPCLSID);
00435 HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
00436 HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
00437 
00438 INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
00439 
00440 /*****************************************************************************
00441  *  COM Server dll - exports
00442  */
00443 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN;
00444 HRESULT WINAPI DllCanUnloadNow(void) DECLSPEC_HIDDEN;
00445 
00446 /* shouldn't be here, but is nice for type checking */
00447 #ifdef __WINESRC__
00448 HRESULT WINAPI DllRegisterServer(void) DECLSPEC_HIDDEN;
00449 HRESULT WINAPI DllUnregisterServer(void) DECLSPEC_HIDDEN;
00450 #endif
00451 
00452 
00453 /*****************************************************************************
00454  *  Data Object
00455  */
00456 HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
00457 HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
00458 
00459 /*****************************************************************************
00460  *  Moniker API
00461  */
00462 HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult);
00463 HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions, REFIID riid, void **ppv);
00464 HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk);
00465 HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc);
00466 HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk);
00467 HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk);
00468 HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite);
00469 HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR  lpszItem, LPMONIKER* ppmk);
00470 HRESULT WINAPI CreateObjrefMoniker(LPUNKNOWN punk, LPMONIKER * ppmk);
00471 HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER * ppmk);
00472 HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid);
00473 HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
00474 HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szUserName, ULONG * pchEaten, LPMONIKER * ppmk);
00475 HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon);
00476 HRESULT WINAPI MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONIKER * ppmkRelPath, BOOL dwReserved);
00477 
00478 /*****************************************************************************
00479  *  Storage API
00480  */
00481 #define STGM_DIRECT     0x00000000
00482 #define STGM_TRANSACTED     0x00010000
00483 #define STGM_SIMPLE     0x08000000
00484 #define STGM_READ       0x00000000
00485 #define STGM_WRITE      0x00000001
00486 #define STGM_READWRITE      0x00000002
00487 #define STGM_SHARE_DENY_NONE    0x00000040
00488 #define STGM_SHARE_DENY_READ    0x00000030
00489 #define STGM_SHARE_DENY_WRITE   0x00000020
00490 #define STGM_SHARE_EXCLUSIVE    0x00000010
00491 #define STGM_PRIORITY       0x00040000
00492 #define STGM_DELETEONRELEASE    0x04000000
00493 #define STGM_CREATE     0x00001000
00494 #define STGM_CONVERT        0x00020000
00495 #define STGM_FAILIFTHERE    0x00000000
00496 #define STGM_NOSCRATCH      0x00100000
00497 #define STGM_NOSNAPSHOT     0x00200000
00498 #define STGM_DIRECT_SWMR    0x00400000
00499 
00500 #define STGFMT_STORAGE      0
00501 #define STGFMT_FILE         3
00502 #define STGFMT_ANY      4
00503 #define STGFMT_DOCFILE  5
00504 
00505 typedef struct tagSTGOPTIONS
00506 {
00507     USHORT usVersion;
00508     USHORT reserved;
00509     ULONG ulSectorSize;
00510     const WCHAR* pwcsTemplateFile;
00511 } STGOPTIONS;
00512 
00513 HRESULT WINAPI StringFromIID(REFIID rclsid, LPOLESTR *lplpsz);
00514 HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName,DWORD grfMode,DWORD reserved,IStorage **ppstgOpen);
00515 HRESULT WINAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
00516 HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn);
00517 HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt);
00518 HRESULT WINAPI StgOpenStorage(const OLECHAR* pwcsName,IStorage* pstgPriority,DWORD grfMode,SNB snbExclude,DWORD reserved,IStorage**ppstgOpen);
00519 HRESULT WINAPI StgOpenStorageEx(const WCHAR* pwcwName,DWORD grfMode,DWORD stgfmt,DWORD grfAttrs,STGOPTIONS *pStgOptions, void *reserved, REFIID riid, void **ppObjectOpen);
00520 
00521 HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt,DWORD grfMode, DWORD reserved, IStorage** ppstgOpen);
00522 HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen);
00523 HRESULT WINAPI StgSetTimes( OLECHAR const *lpszName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime);
00524 
00525 #ifdef __cplusplus
00526 }
00527 #endif
00528 
00529 #ifndef __WINESRC__
00530 # include <urlmon.h>
00531 #endif
00532 #include <propidl.h>
00533 
00534 #ifndef __WINESRC__
00535 
00536 #define FARSTRUCT
00537 #define HUGEP
00538 
00539 #define WINOLEAPI        STDAPI
00540 #define WINOLEAPI_(type) STDAPI_(type)
00541 
00542 #endif /* __WINESRC__ */
00543 
00544 #endif /* _OBJBASE_H_ */

Generated on Wed May 23 2012 04:30:06 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.