/* AntiMoniker data structure */
typedef struct AntiMonikerImpl{
- IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
+ const IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
*/
- IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
+ const IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
- ULONG ref; /* reference counter for this object */
+ LONG ref; /* reference counter for this object */
} AntiMonikerImpl;
+static inline IMoniker *impl_from_IROTData( IROTData *iface )
+{
+ return (IMoniker *)((char*)iface - FIELD_OFFSET(AntiMonikerImpl, lpvtbl2));
+}
+
/*******************************************************************************
* AntiMoniker_QueryInterface
static HRESULT WINAPI
AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
{
- ICOM_THIS_From_IROTData(IMoniker, iface);
+ IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
*/
static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
{
- ICOM_THIS_From_IROTData(IMoniker, iface);
+ IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
*/
static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
{
- ICOM_THIS_From_IROTData(IMoniker, iface);
+ IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
/********************************************************************************/
/* Virtual function table for the AntiMonikerImpl class which include IPersist,*/
/* IPersistStream and IMoniker functions. */
-static IMonikerVtbl VT_AntiMonikerImpl =
+static const IMonikerVtbl VT_AntiMonikerImpl =
{
AntiMonikerImpl_QueryInterface,
AntiMonikerImpl_AddRef,
/********************************************************************************/
/* Virtual function table for the IROTData class. */
-static IROTDataVtbl VT_ROTDataImpl =
+static const IROTDataVtbl VT_ROTDataImpl =
{
AntiMonikerROTDataImpl_QueryInterface,
AntiMonikerROTDataImpl_AddRef,