winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1099 discussions
Start a n
N
ew thread
Michael Stefaniuc : ole32: Use ifaces instead of vtbl pointers in Context.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 32fe620c88c2a0c23c7e7ee145e925c5e4299217 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32fe620c88c2a0c23c7e7ee14…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:44 2010 +0100 ole32: Use ifaces instead of vtbl pointers in Context. --- dlls/ole32/compobj.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index fae4c8f..ad338bd 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -3742,26 +3742,26 @@ HRESULT WINAPI CoRegisterChannelHook(REFGUID guidExtension, IChannelHook *pChann typedef struct Context { - const IComThreadingInfoVtbl *lpVtbl; - const IContextCallbackVtbl *lpCallbackVtbl; - const IObjContextVtbl *lpContextVtbl; + IComThreadingInfo IComThreadingInfo_iface; + IContextCallback IContextCallback_iface; + IObjContext IObjContext_iface; LONG refs; APTTYPE apttype; } Context; static inline Context *impl_from_IComThreadingInfo( IComThreadingInfo *iface ) { - return (Context *)((char*)iface - FIELD_OFFSET(Context, lpVtbl)); + return CONTAINING_RECORD(iface, Context, IComThreadingInfo_iface); } static inline Context *impl_from_IContextCallback( IContextCallback *iface ) { - return (Context *)((char*)iface - FIELD_OFFSET(Context, lpCallbackVtbl)); + return CONTAINING_RECORD(iface, Context, IContextCallback_iface); } static inline Context *impl_from_IObjContext( IObjContext *iface ) { - return (Context *)((char*)iface - FIELD_OFFSET(Context, lpContextVtbl)); + return CONTAINING_RECORD(iface, Context, IObjContext_iface); } static HRESULT Context_QueryInterface(Context *iface, REFIID riid, LPVOID *ppv) @@ -3771,15 +3771,15 @@ static HRESULT Context_QueryInterface(Context *iface, REFIID riid, LPVOID *ppv) if (IsEqualIID(riid, &IID_IComThreadingInfo) || IsEqualIID(riid, &IID_IUnknown)) { - *ppv = &iface->lpVtbl; + *ppv = &iface->IComThreadingInfo_iface; } else if (IsEqualIID(riid, &IID_IContextCallback)) { - *ppv = &iface->lpCallbackVtbl; + *ppv = &iface->IContextCallback_iface; } else if (IsEqualIID(riid, &IID_IObjContext)) { - *ppv = &iface->lpContextVtbl; + *ppv = &iface->IObjContext_iface; } if (*ppv) @@ -4056,9 +4056,9 @@ HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv) if (!context) return E_OUTOFMEMORY; - context->lpVtbl = &Context_Threading_Vtbl; - context->lpCallbackVtbl = &Context_Callback_Vtbl; - context->lpContextVtbl = &Context_Object_Vtbl; + context->IComThreadingInfo_iface.lpVtbl = &Context_Threading_Vtbl; + context->IContextCallback_iface.lpVtbl = &Context_Callback_Vtbl; + context->IObjContext_iface.lpVtbl = &Context_Object_Vtbl; context->refs = 1; if (apt->multi_threaded) context->apttype = APTTYPE_MTA; @@ -4067,8 +4067,8 @@ HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv) else context->apttype = APTTYPE_STA; - hr = IUnknown_QueryInterface((IUnknown *)&context->lpVtbl, riid, ppv); - IUnknown_Release((IUnknown *)&context->lpVtbl); + hr = IUnknown_QueryInterface((IUnknown *)&context->IComThreadingInfo_iface, riid, ppv); + IUnknown_Release((IUnknown *)&context->IComThreadingInfo_iface); return hr; }
1
0
0
0
Michael Stefaniuc : ole32: Use an iface instead of a vtbl pointer in BindCtxImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: e362c67ad18fc4451d9104b1d31b28e9ee3facf5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e362c67ad18fc4451d9104b1d…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:43 2010 +0100 ole32: Use an iface instead of a vtbl pointer in BindCtxImpl. --- dlls/ole32/bindctx.c | 37 +++++++++++++++++++++---------------- 1 files changed, 21 insertions(+), 16 deletions(-) diff --git a/dlls/ole32/bindctx.c b/dlls/ole32/bindctx.c index 1492393..ed6269d 100644 --- a/dlls/ole32/bindctx.c +++ b/dlls/ole32/bindctx.c @@ -49,7 +49,7 @@ typedef struct BindCtxObject{ /* BindCtx data structure */ typedef struct BindCtxImpl{ - const IBindCtxVtbl *lpVtbl; /* VTable relative to the IBindCtx interface.*/ + IBindCtx IBindCtx_iface; LONG ref; /* reference counter for this object */ @@ -66,13 +66,18 @@ static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx*); static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl*, IUnknown*, LPOLESTR, DWORD *); static HRESULT BindCtxImpl_ExpandTable(BindCtxImpl *); +static inline BindCtxImpl *impl_from_IBindCtx(IBindCtx *iface) +{ +return CONTAINING_RECORD(iface, BindCtxImpl, IBindCtx_iface); +} + /******************************************************************************* * BindCtx_QueryInterface *******************************************************************************/ static HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p %s %p)\n",This, debugstr_guid(riid), ppvObject); @@ -100,7 +105,7 @@ BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject) ******************************************************************************/ static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p)\n",This); @@ -128,7 +133,7 @@ static HRESULT BindCtxImpl_Destroy(BindCtxImpl* This) ******************************************************************************/ static ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); ULONG ref; TRACE("(%p)\n",This); @@ -137,7 +142,7 @@ static ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface) if (ref == 0) { /* release all registered objects */ - BindCtxImpl_ReleaseBoundObjects((IBindCtx*)This); + BindCtxImpl_ReleaseBoundObjects(&This->IBindCtx_iface); BindCtxImpl_Destroy(This); } @@ -151,7 +156,7 @@ static ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface) static HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); DWORD lastIndex=This->bindCtxTableLastIndex; TRACE("(%p,%p)\n",This,punk); @@ -185,7 +190,7 @@ BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk) { DWORD index,j; - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p,%p)\n",This,punk); @@ -217,7 +222,7 @@ BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface) { DWORD i; - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p)\n",This); @@ -239,7 +244,7 @@ BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface) static HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p,%p)\n",This,pbindopts); @@ -261,7 +266,7 @@ BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts) static HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); ULONG cbStruct; TRACE("(%p,%p)\n",This,pbindopts); @@ -285,7 +290,7 @@ BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts) static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot) { - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p,%p)\n",This,pprot); @@ -302,7 +307,7 @@ static HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk) { DWORD index=0; - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p,%s,%p)\n",This,debugstr_w(pszkey),punk); @@ -357,7 +362,7 @@ static HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk) { DWORD index; - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p,%s,%p)\n",This,debugstr_w(pszkey),punk); @@ -384,7 +389,7 @@ BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum) { DWORD index,j; - BindCtxImpl *This = (BindCtxImpl *)iface; + BindCtxImpl *This = impl_from_IBindCtx(iface); TRACE("(%p,%s)\n",This,debugstr_w(ppenum)); @@ -513,7 +518,7 @@ static HRESULT BindCtxImpl_Construct(BindCtxImpl* This) TRACE("(%p)\n",This); /* Initialize the virtual function table.*/ - This->lpVtbl = &VT_BindCtxImpl; + This->IBindCtx_iface.lpVtbl = &VT_BindCtxImpl; This->ref = 0; /* Initialize the BIND_OPTS2 structure */ @@ -577,7 +582,7 @@ HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC * ppbc) return hr; } - return BindCtxImpl_QueryInterface((IBindCtx*)newBindCtx,&IID_IBindCtx,(void**)ppbc); + return BindCtxImpl_QueryInterface(&newBindCtx->IBindCtx_iface,&IID_IBindCtx,(void**)ppbc); } /******************************************************************************
1
0
0
0
Michael Stefaniuc : ole32: Use an iface instead of a vtbl pointer in FileLockBytesImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 2605b76c6ec374af0d932b88e4f5d1a8b86a5522 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2605b76c6ec374af0d932b88e…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:46 2010 +0100 ole32: Use an iface instead of a vtbl pointer in FileLockBytesImpl. --- dlls/ole32/filelockbytes.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/ole32/filelockbytes.c b/dlls/ole32/filelockbytes.c index 29bd1b1..ac0263c 100644 --- a/dlls/ole32/filelockbytes.c +++ b/dlls/ole32/filelockbytes.c @@ -47,7 +47,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage); typedef struct FileLockBytesImpl { - const ILockBytesVtbl *lpVtbl; + ILockBytes ILockBytes_iface; LONG ref; ULARGE_INTEGER filesize; HANDLE hfile; @@ -57,6 +57,11 @@ typedef struct FileLockBytesImpl static const ILockBytesVtbl FileLockBytesImpl_Vtbl; +static inline FileLockBytesImpl *impl_from_ILockBytes(ILockBytes *iface) +{ + return CONTAINING_RECORD(iface, FileLockBytesImpl, ILockBytes_iface); +} + /*********************************************************** * Prototypes for private methods */ @@ -100,7 +105,7 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &FileLockBytesImpl_Vtbl; + This->ILockBytes_iface.lpVtbl = &FileLockBytesImpl_Vtbl; This->ref = 1; This->hfile = hFile; This->filesize.u.LowPart = GetFileSize(This->hfile, @@ -126,7 +131,7 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN TRACE("file len %u\n", This->filesize.u.LowPart); - *pLockBytes = (ILockBytes*)This; + *pLockBytes = &This->ILockBytes_iface; return S_OK; } @@ -151,13 +156,13 @@ static HRESULT WINAPI FileLockBytesImpl_QueryInterface(ILockBytes *iface, REFIID static ULONG WINAPI FileLockBytesImpl_AddRef(ILockBytes *iface) { - FileLockBytesImpl* This = (FileLockBytesImpl*)iface; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI FileLockBytesImpl_Release(ILockBytes *iface) { - FileLockBytesImpl* This = (FileLockBytesImpl*)iface; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); ULONG ref; ref = InterlockedDecrement(&This->ref); @@ -187,7 +192,7 @@ static HRESULT WINAPI FileLockBytesImpl_ReadAt( ULONG cb, /* [in] */ ULONG* pcbRead) /* [out] */ { - FileLockBytesImpl* This = (FileLockBytesImpl*)iface; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); ULONG bytes_left = cb; LPBYTE readPtr = pv; BOOL ret; @@ -242,7 +247,7 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt( ULONG cb, /* [in] */ ULONG* pcbWritten) /* [out] */ { - FileLockBytesImpl* This = (FileLockBytesImpl*)iface; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); ULONG size_needed = ulOffset.u.LowPart + cb; ULONG bytes_left = cb; const BYTE *writePtr = pv; @@ -307,7 +312,7 @@ static HRESULT WINAPI FileLockBytesImpl_Flush(ILockBytes* iface) */ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGER newSize) { - FileLockBytesImpl* This = (FileLockBytesImpl*)iface; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); HRESULT hr = S_OK; LARGE_INTEGER newpos; @@ -343,7 +348,7 @@ static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface, static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface, STATSTG *pstatstg, DWORD grfStatFlag) { - FileLockBytesImpl* This = (FileLockBytesImpl*)iface; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); if (!(STATFLAG_NONAME & grfStatFlag) && This->pwcsName) {
1
0
0
0
Michael Stefaniuc : ole32: Use an iface instead of a vtbl pointer in RemUnknown.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: f27f7544fe1971ee6c7911db348824a405d9cdd6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f27f7544fe1971ee6c7911db3…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:55 2010 +0100 ole32: Use an iface instead of a vtbl pointer in RemUnknown. --- dlls/ole32/stubmanager.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c index f6b8bfa..f5a6ee8 100644 --- a/dlls/ole32/stubmanager.c +++ b/dlls/ole32/stubmanager.c @@ -578,12 +578,17 @@ BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid) typedef struct rem_unknown { - const IRemUnknownVtbl *lpVtbl; + IRemUnknown IRemUnknown_iface; LONG refs; } RemUnknown; static const IRemUnknownVtbl RemUnknown_Vtbl; +static inline RemUnknown *impl_from_IRemUnknown(IRemUnknown *iface) +{ + return CONTAINING_RECORD(iface, RemUnknown, IRemUnknown_iface); +} + /* construct an IRemUnknown object with one outstanding reference */ static HRESULT RemUnknown_Construct(IRemUnknown **ppRemUnknown) @@ -592,10 +597,10 @@ static HRESULT RemUnknown_Construct(IRemUnknown **ppRemUnknown) if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &RemUnknown_Vtbl; + This->IRemUnknown_iface.lpVtbl = &RemUnknown_Vtbl; This->refs = 1; - *ppRemUnknown = (IRemUnknown *)This; + *ppRemUnknown = &This->IRemUnknown_iface; return S_OK; } @@ -620,7 +625,7 @@ static HRESULT WINAPI RemUnknown_QueryInterface(IRemUnknown *iface, REFIID riid, static ULONG WINAPI RemUnknown_AddRef(IRemUnknown *iface) { ULONG refs; - RemUnknown *This = (RemUnknown *)iface; + RemUnknown *This = impl_from_IRemUnknown(iface); refs = InterlockedIncrement(&This->refs); @@ -631,7 +636,7 @@ static ULONG WINAPI RemUnknown_AddRef(IRemUnknown *iface) static ULONG WINAPI RemUnknown_Release(IRemUnknown *iface) { ULONG refs; - RemUnknown *This = (RemUnknown *)iface; + RemUnknown *This = impl_from_IRemUnknown(iface); refs = InterlockedDecrement(&This->refs); if (!refs)
1
0
0
0
Michael Stefaniuc : browseui: Use an iface instead of a vtbl pointer in ProgressDialog.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: f4a0e3491e77a082df0c783fb0e17547d11223aa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4a0e3491e77a082df0c783fb…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:30 2010 +0100 browseui: Use an iface instead of a vtbl pointer in ProgressDialog. --- dlls/browseui/progressdlg.c | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dlls/browseui/progressdlg.c b/dlls/browseui/progressdlg.c index 42e7322..11ebb7b 100644 --- a/dlls/browseui/progressdlg.c +++ b/dlls/browseui/progressdlg.c @@ -59,7 +59,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(browseui); #define WM_DLG_DESTROY (WM_APP+2) /* DestroyWindow must be called from the owning thread */ typedef struct tagProgressDialog { - const IProgressDialogVtbl *vtbl; + IProgressDialog IProgressDialog_iface; LONG refCount; CRITICAL_SECTION cs; HWND hwnd; @@ -74,6 +74,11 @@ typedef struct tagProgressDialog { HWND hwndDisabledParent; /* For modal dialog: the parent that need to be re-enabled when the dialog ends */ } ProgressDialog; +static inline ProgressDialog *impl_from_IProgressDialog(IProgressDialog *iface) +{ + return CONTAINING_RECORD(iface, ProgressDialog, IProgressDialog_iface); +} + static void set_buffer(LPWSTR *buffer, LPCWSTR string) { static const WCHAR empty_string[] = {0}; @@ -260,7 +265,7 @@ static void ProgressDialog_Destructor(ProgressDialog *This) static HRESULT WINAPI ProgressDialog_QueryInterface(IProgressDialog *iface, REFIID iid, LPVOID *ppvOut) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IProgressDialog)) @@ -280,13 +285,13 @@ static HRESULT WINAPI ProgressDialog_QueryInterface(IProgressDialog *iface, REFI static ULONG WINAPI ProgressDialog_AddRef(IProgressDialog *iface) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI ProgressDialog_Release(IProgressDialog *iface) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -297,7 +302,7 @@ static ULONG WINAPI ProgressDialog_Release(IProgressDialog *iface) static HRESULT WINAPI ProgressDialog_StartProgressDialog(IProgressDialog *iface, HWND hwndParent, IUnknown *punkEnableModeless, DWORD dwFlags, LPCVOID reserved) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); struct create_params params; HANDLE hThread; @@ -341,7 +346,7 @@ static HRESULT WINAPI ProgressDialog_StartProgressDialog(IProgressDialog *iface, static HRESULT WINAPI ProgressDialog_StopProgressDialog(IProgressDialog *iface) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); EnterCriticalSection(&This->cs); if (This->hwnd) @@ -353,7 +358,7 @@ static HRESULT WINAPI ProgressDialog_StopProgressDialog(IProgressDialog *iface) static HRESULT WINAPI ProgressDialog_SetTitle(IProgressDialog *iface, LPCWSTR pwzTitle) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); HWND hwnd; TRACE("(%p, %s)\n", This, wine_dbgstr_w(pwzTitle)); @@ -378,13 +383,13 @@ static HRESULT WINAPI ProgressDialog_SetAnimation(IProgressDialog *iface, HINSTA static BOOL WINAPI ProgressDialog_HasUserCancelled(IProgressDialog *iface) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); return This->isCancelled; } static HRESULT WINAPI ProgressDialog_SetProgress64(IProgressDialog *iface, ULONGLONG ullCompleted, ULONGLONG ullTotal) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); HWND hwnd; TRACE("(%p, 0x%s, 0x%s)\n", This, wine_dbgstr_longlong(ullCompleted), wine_dbgstr_longlong(ullTotal)); @@ -409,7 +414,7 @@ static HRESULT WINAPI ProgressDialog_SetProgress(IProgressDialog *iface, DWORD d static HRESULT WINAPI ProgressDialog_SetLine(IProgressDialog *iface, DWORD dwLineNum, LPCWSTR pwzLine, BOOL bPath, LPCVOID reserved) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); HWND hwnd; TRACE("(%p, %d, %s, %d)\n", This, dwLineNum, wine_dbgstr_w(pwzLine), bPath); @@ -435,7 +440,7 @@ static HRESULT WINAPI ProgressDialog_SetLine(IProgressDialog *iface, DWORD dwLin static HRESULT WINAPI ProgressDialog_SetCancelMsg(IProgressDialog *iface, LPCWSTR pwzMsg, LPCVOID reserved) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); HWND hwnd; TRACE("(%p, %s)\n", This, wine_dbgstr_w(pwzMsg)); @@ -457,7 +462,7 @@ static HRESULT WINAPI ProgressDialog_SetCancelMsg(IProgressDialog *iface, LPCWST static HRESULT WINAPI ProgressDialog_Timer(IProgressDialog *iface, DWORD dwTimerAction, LPCVOID reserved) { - ProgressDialog *This = (ProgressDialog *)iface; + ProgressDialog *This = impl_from_IProgressDialog(iface); FIXME("(%p, %d, %p) - stub\n", This, dwTimerAction, reserved); @@ -495,7 +500,7 @@ HRESULT ProgressDialog_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->vtbl = &ProgressDialogVtbl; + This->IProgressDialog_iface.lpVtbl = &ProgressDialogVtbl; This->refCount = 1; InitializeCriticalSection(&This->cs);
1
0
0
0
Michael Stefaniuc : browseui: Use an iface instead of a vtbl pointer in ClassFactory.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 0d61c7ba161dfbd658c60207102e1c974dae0ca6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d61c7ba161dfbd658c602071…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:27 2010 +0100 browseui: Use an iface instead of a vtbl pointer in ClassFactory. --- dlls/browseui/browseui_main.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/browseui/browseui_main.c b/dlls/browseui/browseui_main.c index 52226e4..18af461 100644 --- a/dlls/browseui/browseui_main.c +++ b/dlls/browseui/browseui_main.c @@ -60,11 +60,16 @@ static const struct { typedef struct tagClassFactory { - const IClassFactoryVtbl *vtbl; + IClassFactory IClassFactory_iface; LONG ref; LPFNCONSTRUCTOR ctor; } ClassFactory; +static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface); +} + static void ClassFactory_Destructor(ClassFactory *This) { TRACE("Destroying class factory %p\n", This); @@ -87,13 +92,13 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); ULONG ret = InterlockedDecrement(&This->ref); if (ret == 0) @@ -103,7 +108,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *punkOuter, REFIID iid, LPVOID *ppvOut) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); HRESULT ret; IUnknown *obj; @@ -118,7 +123,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%x)\n", This, fLock); @@ -144,7 +149,7 @@ static const IClassFactoryVtbl ClassFactoryVtbl = { static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut) { ClassFactory *This = heap_alloc(sizeof(ClassFactory)); - This->vtbl = &ClassFactoryVtbl; + This->IClassFactory_iface.lpVtbl = &ClassFactoryVtbl; This->ref = 1; This->ctor = ctor; *ppvOut = This;
1
0
0
0
Michael Stefaniuc : browseui: Use an iface instead of a vtbl pointer in CompCatCacheDaemon.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 3942f4d60db97c907b5d240e661ce0c2387afc3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3942f4d60db97c907b5d240e6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:29 2010 +0100 browseui: Use an iface instead of a vtbl pointer in CompCatCacheDaemon. --- dlls/browseui/compcatcachedaemon.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/browseui/compcatcachedaemon.c b/dlls/browseui/compcatcachedaemon.c index 2cf15e4..f480d35 100644 --- a/dlls/browseui/compcatcachedaemon.c +++ b/dlls/browseui/compcatcachedaemon.c @@ -44,11 +44,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(browseui); typedef struct tagCCCD { - const IRunnableTaskVtbl *vtbl; + IRunnableTask IRunnableTask_iface; LONG refCount; CRITICAL_SECTION cs; } CompCatCacheDaemon; +static inline CompCatCacheDaemon *impl_from_IRunnableTask(IRunnableTask *iface) +{ + return CONTAINING_RECORD(iface, CompCatCacheDaemon, IRunnableTask_iface); +} + static void CompCatCacheDaemon_Destructor(CompCatCacheDaemon *This) { TRACE("destroying %p\n", This); @@ -59,7 +64,7 @@ static void CompCatCacheDaemon_Destructor(CompCatCacheDaemon *This) static HRESULT WINAPI CompCatCacheDaemon_QueryInterface(IRunnableTask *iface, REFIID iid, LPVOID *ppvOut) { - CompCatCacheDaemon *This = (CompCatCacheDaemon *)iface; + CompCatCacheDaemon *This = impl_from_IRunnableTask(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IRunnableTask) || IsEqualIID(iid, &IID_IUnknown)) @@ -79,13 +84,13 @@ static HRESULT WINAPI CompCatCacheDaemon_QueryInterface(IRunnableTask *iface, RE static ULONG WINAPI CompCatCacheDaemon_AddRef(IRunnableTask *iface) { - CompCatCacheDaemon *This = (CompCatCacheDaemon *)iface; + CompCatCacheDaemon *This = impl_from_IRunnableTask(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI CompCatCacheDaemon_Release(IRunnableTask *iface) { - CompCatCacheDaemon *This = (CompCatCacheDaemon *)iface; + CompCatCacheDaemon *This = impl_from_IRunnableTask(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -146,7 +151,7 @@ HRESULT CompCatCacheDaemon_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->vtbl = &CompCatCacheDaemonVtbl; + This->IRunnableTask_iface.lpVtbl = &CompCatCacheDaemonVtbl; This->refCount = 1; InitializeCriticalSection(&This->cs);
1
0
0
0
Michael Stefaniuc : browseui: Use an iface instead of a vtbl pointer in ACLShellSource.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 40213ae2816cb32f41abc5d8f0de59be6ba11956 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40213ae2816cb32f41abc5d8f…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:26 2010 +0100 browseui: Use an iface instead of a vtbl pointer in ACLShellSource. --- dlls/browseui/aclsource.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/browseui/aclsource.c b/dlls/browseui/aclsource.c index 4788ad6..c151878 100644 --- a/dlls/browseui/aclsource.c +++ b/dlls/browseui/aclsource.c @@ -43,11 +43,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(browseui); typedef struct tagACLMulti { - const IACList2Vtbl *acl2Vtbl; + IACList2 IACList2_iface; LONG refCount; DWORD dwOptions; } ACLShellSource; +static inline ACLShellSource *impl_from_IACList2(IACList2 *iface) +{ + return CONTAINING_RECORD(iface, ACLShellSource, IACList2_iface); +} + static void ACLShellSource_Destructor(ACLShellSource *This) { TRACE("destroying %p\n", This); @@ -56,7 +61,7 @@ static void ACLShellSource_Destructor(ACLShellSource *This) static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid, LPVOID *ppvOut) { - ACLShellSource *This = (ACLShellSource *)iface; + ACLShellSource *This = impl_from_IACList2(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IACList2) || @@ -77,13 +82,13 @@ static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid, static ULONG WINAPI ACLShellSource_AddRef(IACList2 *iface) { - ACLShellSource *This = (ACLShellSource *)iface; + ACLShellSource *This = impl_from_IACList2(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI ACLShellSource_Release(IACList2 *iface) { - ACLShellSource *This = (ACLShellSource *)iface; + ACLShellSource *This = impl_from_IACList2(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -94,7 +99,7 @@ static ULONG WINAPI ACLShellSource_Release(IACList2 *iface) static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr) { - ACLShellSource *This = (ACLShellSource *)iface; + ACLShellSource *This = impl_from_IACList2(iface); FIXME("STUB:(%p) %s\n",This,debugstr_w(wstr)); return E_NOTIMPL; } @@ -103,7 +108,7 @@ static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr) static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface, DWORD *pdwFlag) { - ACLShellSource *This = (ACLShellSource *)iface; + ACLShellSource *This = impl_from_IACList2(iface); *pdwFlag = This->dwOptions; return S_OK; } @@ -111,7 +116,7 @@ static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface, static HRESULT WINAPI ACLShellSource_SetOptions(IACList2 *iface, DWORD dwFlag) { - ACLShellSource *This = (ACLShellSource *)iface; + ACLShellSource *This = impl_from_IACList2(iface); This->dwOptions = dwFlag; return S_OK; } @@ -138,7 +143,7 @@ HRESULT ACLShellSource_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->acl2Vtbl = &ACLMulti_ACList2Vtbl; + This->IACList2_iface.lpVtbl = &ACLMulti_ACList2Vtbl; This->refCount = 1; TRACE("returning %p\n", This);
1
0
0
0
Michael Stefaniuc : quartz: Use an iface instead of a vtbl pointer in SystemClockImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 9a0f38e21111821941d02f8416cf71ed37cb51b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a0f38e21111821941d02f841…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:35 2010 +0100 quartz: Use an iface instead of a vtbl pointer in SystemClockImpl. --- dlls/quartz/systemclock.c | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index e48dbe4..842541b 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -37,7 +37,7 @@ struct SystemClockAdviseEntry { }; typedef struct SystemClockImpl { - const IReferenceClockVtbl *lpVtbl; + IReferenceClock IReferenceClock_iface; LONG ref; /** IReferenceClock */ @@ -52,6 +52,11 @@ typedef struct SystemClockImpl { SystemClockAdviseEntry* pPeriodicAdvise; } SystemClockImpl; +static inline SystemClockImpl *impl_from_IReferenceClock(IReferenceClock *iface) +{ + return CONTAINING_RECORD(iface, SystemClockImpl, IReferenceClock_iface); +} + static void QUARTZ_RemoveAviseEntryFromQueue(SystemClockImpl* This, SystemClockAdviseEntry* pEntry) { if (pEntry->prev) pEntry->prev->next = pEntry->next; @@ -104,7 +109,7 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) { EnterCriticalSection(&This->safe); /*timeOut = IReferenceClock_OnTimerUpdated(This); */ - hr = IReferenceClock_GetTime((IReferenceClock*) This, &curTime); + hr = IReferenceClock_GetTime(&This->IReferenceClock_iface, &curTime); if (FAILED(hr)) { timeOut = INFINITE; goto outrefresh; @@ -191,7 +196,7 @@ static BOOL SystemClockPostMessageToAdviseThread(SystemClockImpl* This, UINT iMs } static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock* iface) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p): AddRef from %d\n", This, ref - 1); @@ -200,7 +205,7 @@ static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock* iface) { } static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REFIID riid, void** ppobj) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); TRACE("(%p, %s,%p)\n", This, debugstr_guid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown) || @@ -216,7 +221,7 @@ static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REF } static ULONG WINAPI SystemClockImpl_Release(IReferenceClock* iface) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p): ReleaseRef to %d\n", This, ref); if (ref == 0) { @@ -232,7 +237,7 @@ static ULONG WINAPI SystemClockImpl_Release(IReferenceClock* iface) { } static HRESULT WINAPI SystemClockImpl_GetTime(IReferenceClock* iface, REFERENCE_TIME* pTime) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); DWORD curTimeTickCount; HRESULT hr = S_OK; @@ -254,7 +259,7 @@ static HRESULT WINAPI SystemClockImpl_GetTime(IReferenceClock* iface, REFERENCE_ } static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock* iface, REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, HEVENT hEvent, DWORD_PTR* pdwAdviseCookie) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); SystemClockAdviseEntry* pEntry = NULL; TRACE("(%p, 0x%s, 0x%s, %ld, %p)\n", This, wine_dbgstr_longlong(rtBaseTime), @@ -290,7 +295,7 @@ static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock* iface, REFEREN } static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock* iface, REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, HSEMAPHORE hSemaphore, DWORD_PTR* pdwAdviseCookie) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); SystemClockAdviseEntry* pEntry = NULL; TRACE("(%p, 0x%s, 0x%s, %ld, %p)\n", This, wine_dbgstr_longlong(rtStartTime), @@ -326,7 +331,7 @@ static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock* iface, REF } static HRESULT WINAPI SystemClockImpl_Unadvise(IReferenceClock* iface, DWORD_PTR dwAdviseCookie) { - SystemClockImpl *This = (SystemClockImpl *)iface; + SystemClockImpl *This = impl_from_IReferenceClock(iface); SystemClockAdviseEntry* pEntry = NULL; SystemClockAdviseEntry* it = NULL; HRESULT ret = S_OK; @@ -377,12 +382,12 @@ HRESULT QUARTZ_CreateSystemClock(IUnknown * pUnkOuter, LPVOID * ppv) { } ZeroMemory(obj, sizeof(SystemClockImpl)); - obj->lpVtbl = &SystemClock_Vtbl; + obj->IReferenceClock_iface.lpVtbl = &SystemClock_Vtbl; obj->ref = 0; /* will be inited by QueryInterface */ obj->lastTimeTickCount = GetTickCount(); InitializeCriticalSection(&obj->safe); obj->safe.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SystemClockImpl.safe"); - return SystemClockImpl_QueryInterface((IReferenceClock*) obj, &IID_IReferenceClock, ppv); + return SystemClockImpl_QueryInterface(&obj->IReferenceClock_iface, &IID_IReferenceClock, ppv); }
1
0
0
0
Michael Stefaniuc : quartz: Use an iface instead of a vtbl pointer in IEnumRegFiltersImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: e86dff725f293868d60be26ef83cd9e47e7aea74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e86dff725f293868d60be26ef…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:34 2010 +0100 quartz: Use an iface instead of a vtbl pointer in IEnumRegFiltersImpl. --- dlls/quartz/enumregfilters.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dlls/quartz/enumregfilters.c b/dlls/quartz/enumregfilters.c index cadeba5..a116063 100644 --- a/dlls/quartz/enumregfilters.c +++ b/dlls/quartz/enumregfilters.c @@ -28,13 +28,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); typedef struct IEnumRegFiltersImpl { - const IEnumRegFiltersVtbl * lpVtbl; + IEnumRegFilters IEnumRegFilters_iface; LONG refCount; ULONG size; REGFILTER* RegFilters; ULONG uIndex; } IEnumRegFiltersImpl; +static inline IEnumRegFiltersImpl *impl_from_IEnumRegFilters(IEnumRegFilters *iface) +{ + return CONTAINING_RECORD(iface, IEnumRegFiltersImpl, IEnumRegFilters_iface); +} + static const struct IEnumRegFiltersVtbl IEnumRegFiltersImpl_Vtbl; HRESULT IEnumRegFiltersImpl_Construct(REGFILTER* pInRegFilters, const ULONG size, IEnumRegFilters ** ppEnum) @@ -79,13 +84,13 @@ HRESULT IEnumRegFiltersImpl_Construct(REGFILTER* pInRegFilters, const ULONG size CopyMemory(pRegFilters[i].Name, pInRegFilters[i].Name, (strlenW(pInRegFilters[i].Name)+1)*sizeof(WCHAR)); } - pEnumRegFilters->lpVtbl = &IEnumRegFiltersImpl_Vtbl; + pEnumRegFilters->IEnumRegFilters_iface.lpVtbl = &IEnumRegFiltersImpl_Vtbl; pEnumRegFilters->refCount = 1; pEnumRegFilters->uIndex = 0; pEnumRegFilters->RegFilters = pRegFilters; pEnumRegFilters->size = size; - *ppEnum = (IEnumRegFilters *)(&pEnumRegFilters->lpVtbl); + *ppEnum = &pEnumRegFilters->IEnumRegFilters_iface; return S_OK; } @@ -114,7 +119,7 @@ static HRESULT WINAPI IEnumRegFiltersImpl_QueryInterface(IEnumRegFilters * iface static ULONG WINAPI IEnumRegFiltersImpl_AddRef(IEnumRegFilters * iface) { - IEnumRegFiltersImpl *This = (IEnumRegFiltersImpl *)iface; + IEnumRegFiltersImpl *This = impl_from_IEnumRegFilters(iface); ULONG refCount = InterlockedIncrement(&This->refCount); TRACE("(%p)\n", iface); @@ -124,7 +129,7 @@ static ULONG WINAPI IEnumRegFiltersImpl_AddRef(IEnumRegFilters * iface) static ULONG WINAPI IEnumRegFiltersImpl_Release(IEnumRegFilters * iface) { - IEnumRegFiltersImpl *This = (IEnumRegFiltersImpl *)iface; + IEnumRegFiltersImpl *This = impl_from_IEnumRegFilters(iface); ULONG refCount = InterlockedDecrement(&This->refCount); TRACE("(%p)\n", iface); @@ -147,7 +152,7 @@ static ULONG WINAPI IEnumRegFiltersImpl_Release(IEnumRegFilters * iface) static HRESULT WINAPI IEnumRegFiltersImpl_Next(IEnumRegFilters * iface, ULONG cFilters, REGFILTER ** ppRegFilter, ULONG * pcFetched) { ULONG cFetched; - IEnumRegFiltersImpl *This = (IEnumRegFiltersImpl *)iface; + IEnumRegFiltersImpl *This = impl_from_IEnumRegFilters(iface); unsigned int i; cFetched = min(This->size, This->uIndex + cFilters) - This->uIndex; @@ -193,7 +198,7 @@ static HRESULT WINAPI IEnumRegFiltersImpl_Skip(IEnumRegFilters * iface, ULONG n) static HRESULT WINAPI IEnumRegFiltersImpl_Reset(IEnumRegFilters * iface) { - IEnumRegFiltersImpl *This = (IEnumRegFiltersImpl *)iface; + IEnumRegFiltersImpl *This = impl_from_IEnumRegFilters(iface); TRACE("(%p)\n", iface);
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
110
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200