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

comcsup.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 /*
00004  ******************************************************************************
00005  * This header is for easier generation of IUnknown interfaces for inherited  *
00006  * classes and for casts from the interface to the implementation and vice    *
00007  * versa.                                                                     *
00008  ******************************************************************************
00009  */
00010 
00011 /* Generates a Iiface::AddRef() method that forwards to Iimpl::AddRef() */
00012 #define METHOD_IUNKNOWN_INHERITED_ADDREF_NAME(iface,impl) impl##Impl_##iface##_AddRef
00013 #define METHOD_IUNKNOWN_INHERITED_ADDREF(iface,impl) \
00014 static ULONG STDMETHODCALLTYPE \
00015 impl##Impl_##iface##_AddRef(IN OUT iface *ifc) { \
00016     impl##Impl *This = impl##Impl_from_##iface (ifc); \
00017     impl *baseiface = impl##_from_##impl##Impl(This); \
00018     return impl##Impl_AddRef(baseiface); \
00019 }
00020 
00021 /* Generates a Iiface::Release() method that forwards to Iimpl::Release() */
00022 #define METHOD_IUNKNOWN_INHERITED_RELEASE_NAME(iface,impl) impl##Impl_##iface##_Release
00023 #define METHOD_IUNKNOWN_INHERITED_RELEASE(iface,impl) \
00024 static ULONG STDMETHODCALLTYPE \
00025 impl##Impl_##iface##_Release(IN OUT iface *ifc) { \
00026     impl##Impl *This = impl##Impl_from_##iface (ifc); \
00027     impl *baseiface = impl##_from_##impl##Impl(This); \
00028     return impl##Impl_AddRef(baseiface); \
00029 }
00030 
00031 /* Generates a Iiface::QueryInterface() method that forwards to Iimpl::QueryInterface() */
00032 #define METHOD_IUNKNOWN_INHERITED_QUERYINTERFACE_NAME(iface,impl) impl##Impl_##iface##_QueryInterface
00033 #define METHOD_IUNKNOWN_INHERITED_QUERYINTERFACE(iface,impl) \
00034 static HRESULT STDMETHODCALLTYPE \
00035 impl##Impl_##iface##_QueryInterface(IN OUT iface *ifc, IN REFIID riid, OUT VOID **ppvObject) { \
00036     impl##Impl *This = impl##Impl_from_##iface (ifc); \
00037     impl *baseiface = impl##_from_##impl##Impl(This); \
00038     return impl##Impl_QueryInterface(baseiface, riid, ppvObject); \
00039 }
00040 
00041 /* Generates a Ixxx_from_IxxxImpl() and a IxxxImpl_from_Ixxx() inline function */
00042 #define IMPL_CASTS(iface,impl,vtbl) \
00043 static __inline iface * \
00044 iface##_from_##impl##Impl (impl##Impl *This) { \
00045     return (iface *)&This->vtbl; \
00046 } \
00047 static __inline impl##Impl * \
00048 impl##Impl_from_##iface (iface *ifc) { \
00049     return (impl##Impl *)((ULONG_PTR)ifc - FIELD_OFFSET(impl##Impl, vtbl)); \
00050 }

Generated on Sun May 27 2012 04:18:25 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.