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 : wbemprox: Use an iface instead of a vtbl pointer in wbem_locator.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: e75635a7385d4740c6cdbe7ba4ffe3871065a5df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e75635a7385d4740c6cdbe7ba…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:15:04 2010 +0100 wbemprox: Use an iface instead of a vtbl pointer in wbem_locator. --- dlls/wbemprox/wbemlocator.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/wbemprox/wbemlocator.c b/dlls/wbemprox/wbemlocator.c index ad6a75d..a1dd5a1 100644 --- a/dlls/wbemprox/wbemlocator.c +++ b/dlls/wbemprox/wbemlocator.c @@ -35,13 +35,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); typedef struct { - const IWbemLocatorVtbl *vtbl; + IWbemLocator IWbemLocator_iface; LONG refs; } wbem_locator; static inline wbem_locator *impl_from_IWbemLocator( IWbemLocator *iface ) { - return (wbem_locator *)((char *)iface - FIELD_OFFSET( wbem_locator, vtbl )); + return CONTAINING_RECORD(iface, wbem_locator, IWbemLocator_iface); } static ULONG WINAPI wbem_locator_AddRef( @@ -120,10 +120,10 @@ HRESULT WbemLocator_create( IUnknown *pUnkOuter, LPVOID *ppObj ) wl = HeapAlloc( GetProcessHeap(), 0, sizeof(*wl) ); if (!wl) return E_OUTOFMEMORY; - wl->vtbl = &wbem_locator_vtbl; + wl->IWbemLocator_iface.lpVtbl = &wbem_locator_vtbl; wl->refs = 1; - *ppObj = &wl->vtbl; + *ppObj = &wl->IWbemLocator_iface; TRACE("returning iface %p\n", *ppObj); return S_OK;
1
0
0
0
Michael Stefaniuc : dsound: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: d2e90cddfdbbdf46e64c7c2bf66902025885fbae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2e90cddfdbbdf46e64c7c2bf…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:16:07 2010 +0100 dsound: Use an iface instead of a vtbl pointer in IClassFactoryImpl. --- dlls/dsound/dsound_main.c | 29 +++++++++++++++++------------ 1 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 8d02e7f..5d4fb24 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -506,15 +506,20 @@ DirectSoundCaptureEnumerateW( typedef HRESULT (*FnCreateInstance)(REFIID riid, LPVOID *ppobj); typedef struct { - const IClassFactoryVtbl *lpVtbl; + IClassFactory IClassFactory_iface; REFCLSID rclsid; FnCreateInstance pfnCreateInstance; } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI DSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj); if (ppobj == NULL) return E_POINTER; @@ -546,7 +551,7 @@ static HRESULT WINAPI DSCF_CreateInstance( REFIID riid, LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p, %p, %s, %p)\n", This, pOuter, debugstr_guid(riid), ppobj); if (pOuter) @@ -562,7 +567,7 @@ static HRESULT WINAPI DSCF_CreateInstance( static HRESULT WINAPI DSCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p, %d) stub!\n", This, dolock); return S_OK; } @@ -576,13 +581,13 @@ static const IClassFactoryVtbl DSCF_Vtbl = { }; static IClassFactoryImpl DSOUND_CF[] = { - { &DSCF_Vtbl, &CLSID_DirectSound, (FnCreateInstance)DSOUND_Create }, - { &DSCF_Vtbl, &CLSID_DirectSound8, (FnCreateInstance)DSOUND_Create8 }, - { &DSCF_Vtbl, &CLSID_DirectSoundCapture, (FnCreateInstance)DSOUND_CaptureCreate }, - { &DSCF_Vtbl, &CLSID_DirectSoundCapture8, (FnCreateInstance)DSOUND_CaptureCreate8 }, - { &DSCF_Vtbl, &CLSID_DirectSoundFullDuplex, (FnCreateInstance)DSOUND_FullDuplexCreate }, - { &DSCF_Vtbl, &CLSID_DirectSoundPrivate, (FnCreateInstance)IKsPrivatePropertySetImpl_Create }, - { NULL, NULL, NULL } + { { &DSCF_Vtbl }, &CLSID_DirectSound, (FnCreateInstance)DSOUND_Create }, + { { &DSCF_Vtbl }, &CLSID_DirectSound8, (FnCreateInstance)DSOUND_Create8 }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundCapture, (FnCreateInstance)DSOUND_CaptureCreate }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundCapture8, (FnCreateInstance)DSOUND_CaptureCreate8 }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundFullDuplex, (FnCreateInstance)DSOUND_FullDuplexCreate }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundPrivate, (FnCreateInstance)IKsPrivatePropertySetImpl_Create }, + { { NULL }, NULL, NULL } }; /******************************************************************************* @@ -622,7 +627,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) while (NULL != DSOUND_CF[i].rclsid) { if (IsEqualGUID(rclsid, DSOUND_CF[i].rclsid)) { - DSCF_AddRef((IClassFactory*) &DSOUND_CF[i]); + DSCF_AddRef(&DSOUND_CF[i].IClassFactory_iface); *ppv = &DSOUND_CF[i]; return S_OK; }
1
0
0
0
Michael Stefaniuc : infosoft: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: 751a4fe945843edd0e257a1181a4d2fa2ce45a52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=751a4fe945843edd0e257a118…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:16:17 2010 +0100 infosoft: Use an iface instead of a vtbl pointer in IClassFactoryImpl. --- dlls/infosoft/infosoft_main.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/infosoft/infosoft_main.c b/dlls/infosoft/infosoft_main.c index 78c097e..a177dfd 100644 --- a/dlls/infosoft/infosoft_main.c +++ b/dlls/infosoft/infosoft_main.c @@ -60,14 +60,19 @@ typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown*, REFIID, LPVOID*); typedef struct { - const IClassFactoryVtbl *lpVtbl; - LPFNCREATEINSTANCE lpfnCI; + IClassFactory IClassFactory_iface; + LPFNCREATEINSTANCE lpfnCI; } CFImpl; +static inline CFImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, CFImpl, IClassFactory_iface); +} + static HRESULT WINAPI infosoftcf_fnQueryInterface ( LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj) { - CFImpl *This = (CFImpl *)iface; + CFImpl *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%s)\n",This,debugstr_guid(riid)); @@ -97,7 +102,7 @@ static ULONG WINAPI infosoftcf_fnRelease(LPCLASSFACTORY iface) static HRESULT WINAPI infosoftcf_fnCreateInstance( LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject) { - CFImpl *This = (CFImpl *)iface; + CFImpl *This = impl_from_IClassFactory(iface); TRACE("%p->(%p,%s,%p)\n", This, pUnkOuter, debugstr_guid(riid), ppvObject); @@ -121,7 +126,7 @@ static const IClassFactoryVtbl infosoft_cfvt = infosoftcf_fnLockServer }; -static CFImpl wb_cf = { &infosoft_cfvt, wb_Constructor }; +static CFImpl wb_cf = { { &infosoft_cfvt }, wb_Constructor }; /*********************************************************************** * DllGetClassObject (INFOSOFT.@) @@ -137,7 +142,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) *ppv = NULL; if (IsEqualIID(rclsid, &CLSID_wb_Neutral)) - pcf = (IClassFactory*) &wb_cf; + pcf = &wb_cf.IClassFactory_iface; else return CLASS_E_CLASSNOTAVAILABLE;
1
0
0
0
Michael Stefaniuc : dplayx: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: 3ef0a523464c4f25b4d10c8b3a5569aed41f548e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ef0a523464c4f25b4d10c8b3…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:15:26 2010 +0100 dplayx: Use an iface instead of a vtbl pointer in IClassFactoryImpl. --- dlls/dplayx/dpclassfactory.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/dplayx/dpclassfactory.c b/dlls/dplayx/dpclassfactory.c index 3da134d..d14169d 100644 --- a/dlls/dplayx/dpclassfactory.c +++ b/dlls/dplayx/dpclassfactory.c @@ -43,13 +43,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay); typedef struct { /* IUnknown fields */ - const IClassFactoryVtbl *lpVtbl; - LONG ref; + IClassFactory IClassFactory_iface; + LONG ref; } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); @@ -58,12 +63,12 @@ DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { static ULONG WINAPI DP_and_DPL_AddRef(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); /* static class (reference starts @ 1), won't ever be freed */ return InterlockedDecrement(&This->ref); } @@ -71,7 +76,7 @@ static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) { static HRESULT WINAPI DP_and_DPL_CreateInstance( LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj ) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); @@ -88,7 +93,7 @@ static HRESULT WINAPI DP_and_DPL_CreateInstance( } static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%d),stub!\n",This,dolock); return S_OK; } @@ -101,7 +106,7 @@ static const IClassFactoryVtbl DP_and_DPL_Vtbl = { DP_and_DPL_LockServer }; -static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 }; +static IClassFactoryImpl DP_and_DPL_CF = {{&DP_and_DPL_Vtbl}, 1 }; /*******************************************************************************
1
0
0
0
Michael Stefaniuc : oleaut32: Use an iface instead of a vtbl pointer in TMarshalDispatchChannel.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: f4f05ff9aca515487165cb675e520d3796b84202 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4f05ff9aca515487165cb675…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:14:58 2010 +0100 oleaut32: Use an iface instead of a vtbl pointer in TMarshalDispatchChannel. --- dlls/oleaut32/tmarshal.c | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 9f0145d..440319f 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -1526,13 +1526,18 @@ static HRESULT WINAPI ProxyIDispatch_Invoke(LPDISPATCH iface, DISPID dispIdMembe typedef struct { - const IRpcChannelBufferVtbl *lpVtbl; + IRpcChannelBuffer IRpcChannelBuffer_iface; LONG refs; /* the IDispatch-derived interface we are handling */ - IID tmarshal_iid; + IID tmarshal_iid; IRpcChannelBuffer *pDelegateChannel; } TMarshalDispatchChannel; +static inline TMarshalDispatchChannel *impl_from_IRpcChannelBuffer(IRpcChannelBuffer *iface) +{ + return CONTAINING_RECORD(iface, TMarshalDispatchChannel, IRpcChannelBuffer_iface); +} + static HRESULT WINAPI TMarshalDispatchChannel_QueryInterface(LPRPCCHANNELBUFFER iface, REFIID riid, LPVOID *ppv) { *ppv = NULL; @@ -1547,13 +1552,13 @@ static HRESULT WINAPI TMarshalDispatchChannel_QueryInterface(LPRPCCHANNELBUFFER static ULONG WINAPI TMarshalDispatchChannel_AddRef(LPRPCCHANNELBUFFER iface) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); return InterlockedIncrement(&This->refs); } static ULONG WINAPI TMarshalDispatchChannel_Release(LPRPCCHANNELBUFFER iface) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); ULONG ref; ref = InterlockedDecrement(&This->refs); @@ -1567,7 +1572,7 @@ static ULONG WINAPI TMarshalDispatchChannel_Release(LPRPCCHANNELBUFFER iface) static HRESULT WINAPI TMarshalDispatchChannel_GetBuffer(LPRPCCHANNELBUFFER iface, RPCOLEMESSAGE* olemsg, REFIID riid) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); TRACE("(%p, %s)\n", olemsg, debugstr_guid(riid)); /* Note: we are pretending to invoke a method on the interface identified * by tmarshal_iid so that we can re-use the IDispatch proxy/stub code @@ -1577,28 +1582,28 @@ static HRESULT WINAPI TMarshalDispatchChannel_GetBuffer(LPRPCCHANNELBUFFER iface static HRESULT WINAPI TMarshalDispatchChannel_SendReceive(LPRPCCHANNELBUFFER iface, RPCOLEMESSAGE *olemsg, ULONG *pstatus) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); TRACE("(%p, %p)\n", olemsg, pstatus); return IRpcChannelBuffer_SendReceive(This->pDelegateChannel, olemsg, pstatus); } static HRESULT WINAPI TMarshalDispatchChannel_FreeBuffer(LPRPCCHANNELBUFFER iface, RPCOLEMESSAGE* olemsg) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); TRACE("(%p)\n", olemsg); return IRpcChannelBuffer_FreeBuffer(This->pDelegateChannel, olemsg); } static HRESULT WINAPI TMarshalDispatchChannel_GetDestCtx(LPRPCCHANNELBUFFER iface, DWORD* pdwDestContext, void** ppvDestContext) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); TRACE("(%p,%p)\n", pdwDestContext, ppvDestContext); return IRpcChannelBuffer_GetDestCtx(This->pDelegateChannel, pdwDestContext, ppvDestContext); } static HRESULT WINAPI TMarshalDispatchChannel_IsConnected(LPRPCCHANNELBUFFER iface) { - TMarshalDispatchChannel *This = (TMarshalDispatchChannel *)iface; + TMarshalDispatchChannel *This = impl_from_IRpcChannelBuffer(iface); TRACE("()\n"); return IRpcChannelBuffer_IsConnected(This->pDelegateChannel); } @@ -1623,13 +1628,13 @@ static HRESULT TMarshalDispatchChannel_Create( if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &TMarshalDispatchChannelVtbl; + This->IRpcChannelBuffer_iface.lpVtbl = &TMarshalDispatchChannelVtbl; This->refs = 1; IRpcChannelBuffer_AddRef(pDelegateChannel); This->pDelegateChannel = pDelegateChannel; This->tmarshal_iid = *tmarshal_riid; - *ppChannel = (IRpcChannelBuffer *)&This->lpVtbl; + *ppChannel = &This->IRpcChannelBuffer_iface; return S_OK; }
1
0
0
0
Michael Stefaniuc : oleaut32: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: e4094231a40f679b2317547b25d56eab7d48141d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e4094231a40f679b2317547b2…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:16:55 2010 +0100 oleaut32: Use an iface instead of a vtbl pointer in IClassFactoryImpl. --- dlls/oleaut32/olefont.c | 19 ++++++++++++------- dlls/oleaut32/olepicture.c | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 31575ee..29ebb58 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -2444,13 +2444,18 @@ static void OLEFontImpl_Destroy(OLEFontImpl* fontDesc) typedef struct { /* IUnknown fields */ - const IClassFactoryVtbl *lpVtbl; - LONG ref; + IClassFactory IClassFactory_iface; + LONG ref; } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); return E_NOINTERFACE; @@ -2458,12 +2463,12 @@ SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { static ULONG WINAPI SFCF_AddRef(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); /* static class, won't be freed */ return InterlockedDecrement(&This->ref); } @@ -2476,7 +2481,7 @@ static HRESULT WINAPI SFCF_CreateInstance( } static HRESULT WINAPI SFCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%d),stub!\n",This,dolock); return S_OK; } @@ -2488,6 +2493,6 @@ static const IClassFactoryVtbl SFCF_Vtbl = { SFCF_CreateInstance, SFCF_LockServer }; -static IClassFactoryImpl STDFONT_CF = {&SFCF_Vtbl, 1 }; +static IClassFactoryImpl STDFONT_CF = {{&SFCF_Vtbl}, 1 }; void _get_STDFONT_CF(LPVOID *ppv) { *ppv = &STDFONT_CF; } diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 62845ed..fbec73d 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -2379,13 +2379,18 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, typedef struct { /* IUnknown fields */ - const IClassFactoryVtbl *lpVtbl; - LONG ref; + IClassFactory IClassFactory_iface; + LONG ref; } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI SPCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); return E_NOINTERFACE; @@ -2393,12 +2398,12 @@ SPCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { static ULONG WINAPI SPCF_AddRef(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI SPCF_Release(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); /* static class, won't be freed */ return InterlockedDecrement(&This->ref); } @@ -2412,7 +2417,7 @@ static HRESULT WINAPI SPCF_CreateInstance( } static HRESULT WINAPI SPCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%d),stub!\n",This,dolock); return S_OK; } @@ -2424,6 +2429,6 @@ static const IClassFactoryVtbl SPCF_Vtbl = { SPCF_CreateInstance, SPCF_LockServer }; -static IClassFactoryImpl STDPIC_CF = {&SPCF_Vtbl, 1 }; +static IClassFactoryImpl STDPIC_CF = {{&SPCF_Vtbl}, 1 }; void _get_STDPIC_CF(LPVOID *ppv) { *ppv = &STDPIC_CF; }
1
0
0
0
Michael Stefaniuc : itss: Standardize the COM usage in itss.c.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: 8333eaa9b782a59a73b4e6a2f19ebd427208e55d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8333eaa9b782a59a73b4e6a2f…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:16:28 2010 +0100 itss: Standardize the COM usage in itss.c. --- dlls/itss/itss.c | 52 +++++++++++++++++++++++++++++++--------------------- 1 files changed, 31 insertions(+), 21 deletions(-) diff --git a/dlls/itss/itss.c b/dlls/itss/itss.c index 3ecab25..d21e6d2 100644 --- a/dlls/itss/itss.c +++ b/dlls/itss/itss.c @@ -67,14 +67,19 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) * ITSS ClassFactory */ typedef struct { - const IClassFactoryVtbl *lpVtbl; + IClassFactory IClassFactory_iface; HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI ITSSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) @@ -104,7 +109,7 @@ static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface) static HRESULT WINAPI ITSSCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); HRESULT hres; LPUNKNOWN punk; @@ -140,9 +145,9 @@ static const IClassFactoryVtbl ITSSCF_Vtbl = ITSSCF_LockServer }; -static const IClassFactoryImpl ITStorage_factory = { &ITSSCF_Vtbl, ITSS_create }; -static const IClassFactoryImpl MSITStore_factory = { &ITSSCF_Vtbl, ITS_IParseDisplayName_create }; -static const IClassFactoryImpl ITSProtocol_factory = { &ITSSCF_Vtbl, ITSProtocol_create }; +static const IClassFactoryImpl ITStorage_factory = { { &ITSSCF_Vtbl }, ITSS_create }; +static const IClassFactoryImpl MSITStore_factory = { { &ITSSCF_Vtbl }, ITS_IParseDisplayName_create }; +static const IClassFactoryImpl ITSProtocol_factory = { { &ITSSCF_Vtbl }, ITSProtocol_create }; /*********************************************************************** * DllGetClassObject (ITSS.@) @@ -171,17 +176,22 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) /*****************************************************************************/ typedef struct { - const IITStorageVtbl *vtbl_IITStorage; + IITStorage IITStorage_iface; LONG ref; } ITStorageImpl; +static inline ITStorageImpl *impl_from_IITStorage(IITStorage *iface) +{ + return CONTAINING_RECORD(iface, ITStorageImpl, IITStorage_iface); +} + static HRESULT WINAPI ITStorageImpl_QueryInterface( IITStorage* iface, REFIID riid, void** ppvObject) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IITStorage)) { @@ -197,7 +207,7 @@ static HRESULT WINAPI ITStorageImpl_QueryInterface( static ULONG WINAPI ITStorageImpl_AddRef( IITStorage* iface) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); } @@ -205,7 +215,7 @@ static ULONG WINAPI ITStorageImpl_AddRef( static ULONG WINAPI ITStorageImpl_Release( IITStorage* iface) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { @@ -223,7 +233,7 @@ static HRESULT WINAPI ITStorageImpl_StgCreateDocfile( DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); TRACE("%p %s %u %u %p\n", This, debugstr_w(pwcsName), grfMode, reserved, ppstgOpen ); @@ -239,7 +249,7 @@ static HRESULT WINAPI ITStorageImpl_StgCreateDocfileOnILockBytes( DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -248,7 +258,7 @@ static HRESULT WINAPI ITStorageImpl_StgIsStorageFile( IITStorage* iface, const WCHAR* pwcsName) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -257,7 +267,7 @@ static HRESULT WINAPI ITStorageImpl_StgIsStorageILockBytes( IITStorage* iface, ILockBytes* plkbyt) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -271,7 +281,7 @@ static HRESULT WINAPI ITStorageImpl_StgOpenStorage( DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); TRACE("%p %s %p %d %p\n", This, debugstr_w( pwcsName ), pstgPriority, grfMode, snbExclude ); @@ -289,7 +299,7 @@ static HRESULT WINAPI ITStorageImpl_StgOpenStorageOnILockBytes( DWORD reserved, IStorage** ppstgOpen) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -301,7 +311,7 @@ static HRESULT WINAPI ITStorageImpl_StgSetTimes( const FILETIME* patime, const FILETIME* pmtime) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -310,7 +320,7 @@ static HRESULT WINAPI ITStorageImpl_SetControlData( IITStorage* iface, PITS_Control_Data pControlData) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -319,7 +329,7 @@ static HRESULT WINAPI ITStorageImpl_DefaultControlData( IITStorage* iface, PITS_Control_Data* ppControlData) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -329,7 +339,7 @@ static HRESULT WINAPI ITStorageImpl_Compact( const WCHAR* pwcsName, ECompactionLev iLev) { - ITStorageImpl *This = (ITStorageImpl *)iface; + ITStorageImpl *This = impl_from_IITStorage(iface); FIXME("%p\n", This); return E_NOTIMPL; } @@ -359,7 +369,7 @@ static HRESULT ITSS_create(IUnknown *pUnkOuter, LPVOID *ppObj) return CLASS_E_NOAGGREGATION; its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITStorageImpl) ); - its->vtbl_IITStorage = &ITStorageImpl_Vtbl; + its->IITStorage_iface.lpVtbl = &ITStorageImpl_Vtbl; its->ref = 1; TRACE("-> %p\n", its);
1
0
0
0
Michael Stefaniuc : dpnet: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: dcef7c3bb5ec23aa4b4466fce15f251d04275b96 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dcef7c3bb5ec23aa4b4466fce…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:15:50 2010 +0100 dpnet: Use an iface instead of a vtbl pointer in IClassFactoryImpl. --- dlls/dpnet/dpnet_main.c | 43 ++++++++++++++++++++++++------------------- 1 files changed, 24 insertions(+), 19 deletions(-) diff --git a/dlls/dpnet/dpnet_main.c b/dlls/dpnet/dpnet_main.c index 34429ac..b08d9d3 100644 --- a/dlls/dpnet/dpnet_main.c +++ b/dlls/dpnet/dpnet_main.c @@ -64,39 +64,44 @@ HRESULT WINAPI DirectPlay8Create(REFGUID lpGUID, LPVOID *ppvInt, LPUNKNOWN punkO typedef struct { /* IUnknown fields */ - const IClassFactoryVtbl *lpVtbl; - LONG ref; - REFCLSID rclsid; - HRESULT (*pfnCreateInstanceFactory)(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj); + IClassFactory IClassFactory_iface; + LONG ref; + REFCLSID rclsid; + HRESULT (*pfnCreateInstanceFactory)(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj); } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI DICF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - + IClassFactoryImpl *This = impl_from_IClassFactory(iface); + FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } static ULONG WINAPI DICF_AddRef(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI DICF_Release(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); /* static class, won't be freed */ return InterlockedDecrement(&This->ref); } static HRESULT WINAPI DICF_CreateInstance(LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - + IClassFactoryImpl *This = impl_from_IClassFactory(iface); + TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); return This->pfnCreateInstanceFactory(iface, pOuter, riid, ppobj); } static HRESULT WINAPI DICF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%d),stub!\n",This,dolock); return S_OK; } @@ -110,13 +115,13 @@ static const IClassFactoryVtbl DICF_Vtbl = { }; static IClassFactoryImpl DPNET_CFS[] = { - { &DICF_Vtbl, 1, &CLSID_DirectPlay8Client, DPNET_CreateDirectPlay8Client }, - { &DICF_Vtbl, 1, &CLSID_DirectPlay8Server, DPNET_CreateDirectPlay8Server }, - { &DICF_Vtbl, 1, &CLSID_DirectPlay8Peer, DPNET_CreateDirectPlay8Peer }, - { &DICF_Vtbl, 1, &CLSID_DirectPlay8Address, DPNET_CreateDirectPlay8Address }, - { &DICF_Vtbl, 1, &CLSID_DirectPlay8LobbiedApplication, DPNET_CreateDirectPlay8LobbiedApp }, - { &DICF_Vtbl, 1, &CLSID_DirectPlay8ThreadPool, DPNET_CreateDirectPlay8ThreadPool}, - { NULL, 0, NULL, NULL } + { { &DICF_Vtbl }, 1, &CLSID_DirectPlay8Client, DPNET_CreateDirectPlay8Client }, + { { &DICF_Vtbl }, 1, &CLSID_DirectPlay8Server, DPNET_CreateDirectPlay8Server }, + { { &DICF_Vtbl }, 1, &CLSID_DirectPlay8Peer, DPNET_CreateDirectPlay8Peer }, + { { &DICF_Vtbl }, 1, &CLSID_DirectPlay8Address, DPNET_CreateDirectPlay8Address }, + { { &DICF_Vtbl }, 1, &CLSID_DirectPlay8LobbiedApplication, DPNET_CreateDirectPlay8LobbiedApp }, + { { &DICF_Vtbl }, 1, &CLSID_DirectPlay8ThreadPool, DPNET_CreateDirectPlay8ThreadPool}, + { { NULL }, 0, NULL, NULL } }; /*********************************************************************** @@ -144,7 +149,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) */ while (NULL != DPNET_CFS[i].rclsid) { if (IsEqualGUID(rclsid, DPNET_CFS[i].rclsid)) { - DICF_AddRef((IClassFactory*) &DPNET_CFS[i]); + DICF_AddRef(&DPNET_CFS[i].IClassFactory_iface); *ppv = &DPNET_CFS[i]; return S_OK; }
1
0
0
0
Michael Stefaniuc : dinput: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: 6d7d1b5850576a0ed87ee4cde2f2dd1ec4c630d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d7d1b5850576a0ed87ee4cde…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:15:18 2010 +0100 dinput: Use an iface instead of a vtbl pointer in IClassFactoryImpl. --- dlls/dinput/dinput_main.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 06971db..c672077 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -794,24 +794,29 @@ static const IDirectInput8WVtbl ddi8wvt = { typedef struct { /* IUnknown fields */ - const IClassFactoryVtbl *lpVtbl; - LONG ref; + IClassFactory IClassFactory_iface; + LONG ref; } IClassFactoryImpl; +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI DICF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } static ULONG WINAPI DICF_AddRef(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&(This->ref)); } static ULONG WINAPI DICF_Release(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); /* static class, won't be freed */ return InterlockedDecrement(&(This->ref)); } @@ -819,7 +824,7 @@ static ULONG WINAPI DICF_Release(LPCLASSFACTORY iface) { static HRESULT WINAPI DICF_CreateInstance( LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj ) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); if ( IsEqualGUID( &IID_IUnknown, riid ) || @@ -840,7 +845,7 @@ static HRESULT WINAPI DICF_CreateInstance( } static HRESULT WINAPI DICF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); FIXME("(%p)->(%d),stub!\n",This,dolock); return S_OK; } @@ -852,7 +857,7 @@ static const IClassFactoryVtbl DICF_Vtbl = { DICF_CreateInstance, DICF_LockServer }; -static IClassFactoryImpl DINPUT_CF = {&DICF_Vtbl, 1 }; +static IClassFactoryImpl DINPUT_CF = {{&DICF_Vtbl}, 1 }; /*********************************************************************** * DllCanUnloadNow (DINPUT.@)
1
0
0
0
Michael Stefaniuc : itss: Standardize the COM usage in moniker.c.
by Alexandre Julliard
05 Dec '10
05 Dec '10
Module: wine Branch: master Commit: 72f3765a5bea13c28d0b60f527c030bc0b824b32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72f3765a5bea13c28d0b60f52…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Dec 5 15:14:46 2010 +0100 itss: Standardize the COM usage in moniker.c. --- dlls/itss/moniker.c | 40 +++++++++++++++++++++++++--------------- 1 files changed, 25 insertions(+), 15 deletions(-) diff --git a/dlls/itss/moniker.c b/dlls/itss/moniker.c index 76630cd..72d356b 100644 --- a/dlls/itss/moniker.c +++ b/dlls/itss/moniker.c @@ -43,19 +43,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(itss); /*****************************************************************************/ typedef struct { - const IMonikerVtbl *vtbl_ITS_IMoniker; + IMoniker IMoniker_iface; LONG ref; LPWSTR szHtml; WCHAR szFile[1]; } ITS_IMonikerImpl; +static inline ITS_IMonikerImpl *impl_from_IMoniker(IMoniker *iface) +{ + return CONTAINING_RECORD(iface, ITS_IMonikerImpl, IMoniker_iface); +} + /*** IUnknown methods ***/ static HRESULT WINAPI ITS_IMonikerImpl_QueryInterface( IMoniker* iface, REFIID riid, void** ppvObject) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IParseDisplayName)) @@ -72,7 +77,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_QueryInterface( static ULONG WINAPI ITS_IMonikerImpl_AddRef( IMoniker* iface) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); } @@ -80,7 +85,7 @@ static ULONG WINAPI ITS_IMonikerImpl_AddRef( static ULONG WINAPI ITS_IMonikerImpl_Release( IMoniker* iface) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { @@ -96,7 +101,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_GetClassID( IMoniker* iface, CLSID* pClassID) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); TRACE("%p %p\n", This, pClassID); *pClassID = CLSID_ITStorage; @@ -155,7 +160,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_BindToStorage( REFIID riid, void** ppvObj) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); DWORD grfMode = STGM_SIMPLE | STGM_READ | STGM_SHARE_EXCLUSIVE; HRESULT r; IStorage *stg = NULL; @@ -279,7 +284,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_GetDisplayName( IMoniker* pmkToLeft, LPOLESTR* ppszDisplayName) { - ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface; + ITS_IMonikerImpl *This = impl_from_IMoniker(iface); static const WCHAR szFormat[] = { 'm','s','-','i','t','s',':','%','s',':',':','%','s',0 }; DWORD len = sizeof szFormat / sizeof(WCHAR); @@ -352,7 +357,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n ) sz = sizeof(ITS_IMonikerImpl) + strlenW( name )*sizeof(WCHAR); itsmon = HeapAlloc( GetProcessHeap(), 0, sz ); - itsmon->vtbl_ITS_IMoniker = &ITS_IMonikerImpl_Vtbl; + itsmon->IMoniker_iface.lpVtbl = &ITS_IMonikerImpl_Vtbl; itsmon->ref = 1; strcpyW( itsmon->szFile, name ); itsmon->szHtml = &itsmon->szFile[n]; @@ -362,7 +367,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n ) TRACE("-> %p %s %s\n", itsmon, debugstr_w(itsmon->szFile), debugstr_w(itsmon->szHtml) ); - *ppObj = (IMoniker*) itsmon; + *ppObj = &itsmon->IMoniker_iface; ITSS_LockModule(); return S_OK; @@ -371,16 +376,21 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n ) /*****************************************************************************/ typedef struct { - const IParseDisplayNameVtbl *vtbl_ITS_IParseDisplayName; + IParseDisplayName IParseDisplayName_iface; LONG ref; } ITS_IParseDisplayNameImpl; +static inline ITS_IParseDisplayNameImpl *impl_from_IParseDisplayName(IParseDisplayName *iface) +{ + return CONTAINING_RECORD(iface, ITS_IParseDisplayNameImpl, IParseDisplayName_iface); +} + static HRESULT WINAPI ITS_IParseDisplayNameImpl_QueryInterface( IParseDisplayName* iface, REFIID riid, void** ppvObject) { - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IParseDisplayName)) @@ -397,7 +407,7 @@ static HRESULT WINAPI ITS_IParseDisplayNameImpl_QueryInterface( static ULONG WINAPI ITS_IParseDisplayNameImpl_AddRef( IParseDisplayName* iface) { - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); } @@ -405,7 +415,7 @@ static ULONG WINAPI ITS_IParseDisplayNameImpl_AddRef( static ULONG WINAPI ITS_IParseDisplayNameImpl_Release( IParseDisplayName* iface) { - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { @@ -428,7 +438,7 @@ static HRESULT WINAPI ITS_IParseDisplayNameImpl_ParseDisplayName( const DWORD prefix_len = (sizeof szPrefix/sizeof szPrefix[0])-1; DWORD n; - ITS_IParseDisplayNameImpl *This = (ITS_IParseDisplayNameImpl *)iface; + ITS_IParseDisplayNameImpl *This = impl_from_IParseDisplayName(iface); TRACE("%p %s %p %p\n", This, debugstr_w( pszDisplayName ), pchEaten, ppmkOut ); @@ -469,7 +479,7 @@ HRESULT ITS_IParseDisplayName_create(IUnknown *pUnkOuter, LPVOID *ppObj) return CLASS_E_NOAGGREGATION; its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITS_IParseDisplayNameImpl) ); - its->vtbl_ITS_IParseDisplayName = &ITS_IParseDisplayNameImpl_Vtbl; + its->IParseDisplayName_iface.lpVtbl = &ITS_IParseDisplayNameImpl_Vtbl; its->ref = 1; TRACE("-> %p\n", its);
1
0
0
0
← Newer
1
...
75
76
77
78
79
80
81
...
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