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
March
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
November 2010
----- 2025 -----
March 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
866 discussions
Start a n
N
ew thread
Michael Stefaniuc : windowscodecs: Standardize the COM usage in tgaformat.c .
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 2ff573c99e83b8419643fa13160ee4da11e951bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ff573c99e83b8419643fa131…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:58:38 2010 +0100 windowscodecs: Standardize the COM usage in tgaformat.c. --- dlls/windowscodecs/tgaformat.c | 41 ++++++++++++++++++++++----------------- 1 files changed, 23 insertions(+), 18 deletions(-) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index 7570e06..14510cf 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -101,8 +101,8 @@ typedef struct { #include "poppack.h" typedef struct { - const IWICBitmapDecoderVtbl *lpVtbl; - const IWICBitmapFrameDecodeVtbl *lpFrameVtbl; + IWICBitmapDecoder IWICBitmapDecoder_iface; + IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; LONG ref; BOOL initialized; IStream *stream; @@ -120,15 +120,20 @@ typedef struct { CRITICAL_SECTION lock; } TgaDecoder; -static inline TgaDecoder *decoder_from_frame(IWICBitmapFrameDecode *iface) +static inline TgaDecoder *impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface) { - return CONTAINING_RECORD(iface, TgaDecoder, lpFrameVtbl); + return CONTAINING_RECORD(iface, TgaDecoder, IWICBitmapDecoder_iface); +} + +static inline TgaDecoder *impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface) +{ + return CONTAINING_RECORD(iface, TgaDecoder, IWICBitmapFrameDecode_iface); } static HRESULT WINAPI TgaDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { - TgaDecoder *This = (TgaDecoder*)iface; + TgaDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -149,7 +154,7 @@ static HRESULT WINAPI TgaDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID static ULONG WINAPI TgaDecoder_AddRef(IWICBitmapDecoder *iface) { - TgaDecoder *This = (TgaDecoder*)iface; + TgaDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -159,7 +164,7 @@ static ULONG WINAPI TgaDecoder_AddRef(IWICBitmapDecoder *iface) static ULONG WINAPI TgaDecoder_Release(IWICBitmapDecoder *iface) { - TgaDecoder *This = (TgaDecoder*)iface; + TgaDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -187,7 +192,7 @@ static HRESULT WINAPI TgaDecoder_QueryCapability(IWICBitmapDecoder *iface, IStre static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions) { - TgaDecoder *This = (TgaDecoder*)iface; + TgaDecoder *This = impl_from_IWICBitmapDecoder(iface); HRESULT hr=S_OK; DWORD bytesread; LARGE_INTEGER seek; @@ -388,7 +393,7 @@ static HRESULT WINAPI TgaDecoder_GetFrameCount(IWICBitmapDecoder *iface, static HRESULT WINAPI TgaDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { - TgaDecoder *This = (TgaDecoder*)iface; + TgaDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%p)\n", iface, ppIBitmapFrame); if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; @@ -396,7 +401,7 @@ static HRESULT WINAPI TgaDecoder_GetFrame(IWICBitmapDecoder *iface, if (index != 0) return E_INVALIDARG; IWICBitmapDecoder_AddRef(iface); - *ppIBitmapFrame = (IWICBitmapFrameDecode*)&This->lpFrameVtbl; + *ppIBitmapFrame = &This->IWICBitmapFrameDecode_iface; return S_OK; } @@ -443,20 +448,20 @@ static HRESULT WINAPI TgaDecoder_Frame_QueryInterface(IWICBitmapFrameDecode *ifa static ULONG WINAPI TgaDecoder_Frame_AddRef(IWICBitmapFrameDecode *iface) { - TgaDecoder *This = decoder_from_frame(iface); + TgaDecoder *This = impl_from_IWICBitmapFrameDecode(iface); return IUnknown_AddRef((IUnknown*)This); } static ULONG WINAPI TgaDecoder_Frame_Release(IWICBitmapFrameDecode *iface) { - TgaDecoder *This = decoder_from_frame(iface); + TgaDecoder *This = impl_from_IWICBitmapFrameDecode(iface); return IUnknown_Release((IUnknown*)This); } static HRESULT WINAPI TgaDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - TgaDecoder *This = decoder_from_frame(iface); + TgaDecoder *This = impl_from_IWICBitmapFrameDecode(iface); *puiWidth = This->header.width; *puiHeight = This->header.height; @@ -469,7 +474,7 @@ static HRESULT WINAPI TgaDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface, static HRESULT WINAPI TgaDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat) { - TgaDecoder *This = decoder_from_frame(iface); + TgaDecoder *This = impl_from_IWICBitmapFrameDecode(iface); int attribute_bitcount; byte attribute_type; @@ -576,7 +581,7 @@ static HRESULT WINAPI TgaDecoder_Frame_GetResolution(IWICBitmapFrameDecode *ifac static HRESULT WINAPI TgaDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, IWICPalette *pIPalette) { - TgaDecoder *This = decoder_from_frame(iface); + TgaDecoder *This = impl_from_IWICBitmapFrameDecode(iface); HRESULT hr=S_OK; WICColor colors[256], *color; BYTE *colormap_data; @@ -863,7 +868,7 @@ static HRESULT TgaDecoder_ReadImage(TgaDecoder *This) static HRESULT WINAPI TgaDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - TgaDecoder *This = decoder_from_frame(iface); + TgaDecoder *This = impl_from_IWICBitmapFrameDecode(iface); HRESULT hr; TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); @@ -929,8 +934,8 @@ HRESULT TgaDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This = HeapAlloc(GetProcessHeap(), 0, sizeof(TgaDecoder)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &TgaDecoder_Vtbl; - This->lpFrameVtbl = &TgaDecoder_Frame_Vtbl; + This->IWICBitmapDecoder_iface.lpVtbl = &TgaDecoder_Vtbl; + This->IWICBitmapFrameDecode_iface.lpVtbl = &TgaDecoder_Frame_Vtbl; This->ref = 1; This->initialized = FALSE; This->stream = NULL;
1
0
0
0
Michael Stefaniuc : windowscodecs: Standardize the COM usage in tiffformat. c.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 34fc8902851290d176752bcc31070345a0ec7248 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34fc8902851290d176752bcc3…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:58:20 2010 +0100 windowscodecs: Standardize the COM usage in tiffformat.c. --- dlls/windowscodecs/tiffformat.c | 44 +++++++++++++++++++++++--------------- 1 files changed, 27 insertions(+), 17 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 742d963..9dfd4ba 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -194,7 +194,7 @@ static TIFF* tiff_open_stream(IStream *stream, const char *mode) } typedef struct { - const IWICBitmapDecoderVtbl *lpVtbl; + IWICBitmapDecoder IWICBitmapDecoder_iface; LONG ref; IStream *stream; CRITICAL_SECTION lock; /* Must be held when tiff is used or initiailzed is set */ @@ -218,7 +218,7 @@ typedef struct { } tiff_decode_info; typedef struct { - const IWICBitmapFrameDecodeVtbl *lpVtbl; + IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; LONG ref; TiffDecoder *parent; UINT index; @@ -229,6 +229,16 @@ typedef struct { static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl; +static inline TiffDecoder *impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface) +{ + return CONTAINING_RECORD(iface, TiffDecoder, IWICBitmapDecoder_iface); +} + +static inline TiffFrameDecode *impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface) +{ + return CONTAINING_RECORD(iface, TiffFrameDecode, IWICBitmapFrameDecode_iface); +} + static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) { uint16 photometric, bps, samples, planar; @@ -423,7 +433,7 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) static HRESULT WINAPI TiffDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { - TiffDecoder *This = (TiffDecoder*)iface; + TiffDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -444,7 +454,7 @@ static HRESULT WINAPI TiffDecoder_QueryInterface(IWICBitmapDecoder *iface, REFII static ULONG WINAPI TiffDecoder_AddRef(IWICBitmapDecoder *iface) { - TiffDecoder *This = (TiffDecoder*)iface; + TiffDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -454,7 +464,7 @@ static ULONG WINAPI TiffDecoder_AddRef(IWICBitmapDecoder *iface) static ULONG WINAPI TiffDecoder_Release(IWICBitmapDecoder *iface) { - TiffDecoder *This = (TiffDecoder*)iface; + TiffDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -481,7 +491,7 @@ static HRESULT WINAPI TiffDecoder_QueryCapability(IWICBitmapDecoder *iface, IStr static HRESULT WINAPI TiffDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions) { - TiffDecoder *This = (TiffDecoder*)iface; + TiffDecoder *This = impl_from_IWICBitmapDecoder(iface); TIFF *tiff; HRESULT hr=S_OK; @@ -565,7 +575,7 @@ static HRESULT WINAPI TiffDecoder_GetThumbnail(IWICBitmapDecoder *iface, static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount) { - TiffDecoder *This = (TiffDecoder*)iface; + TiffDecoder *This = impl_from_IWICBitmapDecoder(iface); if (!This->tiff) { @@ -586,7 +596,7 @@ static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface, static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { - TiffDecoder *This = (TiffDecoder*)iface; + TiffDecoder *This = impl_from_IWICBitmapDecoder(iface); TiffFrameDecode *result; int res; tiff_decode_info decode_info; @@ -609,7 +619,7 @@ static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface, if (result) { - result->lpVtbl = &TiffFrameDecode_Vtbl; + result->IWICBitmapFrameDecode_iface.lpVtbl = &TiffFrameDecode_Vtbl; result->ref = 1; result->parent = This; result->index = index; @@ -653,7 +663,7 @@ static const IWICBitmapDecoderVtbl TiffDecoder_Vtbl = { static HRESULT WINAPI TiffFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, void **ppv) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -676,7 +686,7 @@ static HRESULT WINAPI TiffFrameDecode_QueryInterface(IWICBitmapFrameDecode *ifac static ULONG WINAPI TiffFrameDecode_AddRef(IWICBitmapFrameDecode *iface) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -686,7 +696,7 @@ static ULONG WINAPI TiffFrameDecode_AddRef(IWICBitmapFrameDecode *iface) static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -703,7 +713,7 @@ static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface) static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); *puiWidth = This->decode_info.width; *puiHeight = This->decode_info.height; @@ -716,7 +726,7 @@ static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface, static HRESULT WINAPI TiffFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); memcpy(pPixelFormat, This->decode_info.format, sizeof(GUID)); @@ -735,7 +745,7 @@ static HRESULT WINAPI TiffFrameDecode_GetResolution(IWICBitmapFrameDecode *iface static HRESULT WINAPI TiffFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, IWICPalette *pIPalette) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); uint16 *red, *green, *blue; WICColor colors[256]; int color_count, ret, i; @@ -862,7 +872,7 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - TiffFrameDecode *This = (TiffFrameDecode*)iface; + TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); UINT min_tile_x, max_tile_x, min_tile_y, max_tile_y; UINT tile_x, tile_y; WICRect rc; @@ -1015,7 +1025,7 @@ HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This = HeapAlloc(GetProcessHeap(), 0, sizeof(TiffDecoder)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &TiffDecoder_Vtbl; + This->IWICBitmapDecoder_iface.lpVtbl = &TiffDecoder_Vtbl; This->ref = 1; This->stream = NULL; InitializeCriticalSection(&This->lock);
1
0
0
0
Michael Stefaniuc : windowscodecs: Standardize the COM usage in gifformat.c .
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 8d8dd3de54d49faac3a760fe562f45b1bbe31363 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d8dd3de54d49faac3a760fe5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:58:09 2010 +0100 windowscodecs: Standardize the COM usage in gifformat.c. --- dlls/windowscodecs/gifformat.c | 44 ++++++++++++++++++++++++--------------- 1 files changed, 27 insertions(+), 17 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index 5cbdc26..866f006 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); typedef struct { - const IWICBitmapDecoderVtbl *lpVtbl; + IWICBitmapDecoder IWICBitmapDecoder_iface; LONG ref; BOOL initialized; GifFileType *gif; @@ -44,16 +44,26 @@ typedef struct { } GifDecoder; typedef struct { - const IWICBitmapFrameDecodeVtbl *lpVtbl; + IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; LONG ref; SavedImage *frame; GifDecoder *parent; } GifFrameDecode; +static inline GifDecoder *impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface) +{ + return CONTAINING_RECORD(iface, GifDecoder, IWICBitmapDecoder_iface); +} + +static inline GifFrameDecode *impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface) +{ + return CONTAINING_RECORD(iface, GifFrameDecode, IWICBitmapFrameDecode_iface); +} + static HRESULT WINAPI GifFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, void **ppv) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -76,7 +86,7 @@ static HRESULT WINAPI GifFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface static ULONG WINAPI GifFrameDecode_AddRef(IWICBitmapFrameDecode *iface) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -86,7 +96,7 @@ static ULONG WINAPI GifFrameDecode_AddRef(IWICBitmapFrameDecode *iface) static ULONG WINAPI GifFrameDecode_Release(IWICBitmapFrameDecode *iface) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -103,7 +113,7 @@ static ULONG WINAPI GifFrameDecode_Release(IWICBitmapFrameDecode *iface) static HRESULT WINAPI GifFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight); *puiWidth = This->frame->ImageDesc.Width; @@ -123,7 +133,7 @@ static HRESULT WINAPI GifFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface static HRESULT WINAPI GifFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, double *pDpiX, double *pDpiY) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); const GifWord aspect_word = This->parent->gif->SAspectRatio; const double aspect = (aspect_word > 0) ? ((aspect_word + 15.0) / 64.0) : 1.0; TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY); @@ -137,7 +147,7 @@ static HRESULT WINAPI GifFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, IWICPalette *pIPalette) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); WICColor colors[256]; ColorMapObject *cm = This->frame->ImageDesc.ColorMap; int i, trans; @@ -229,7 +239,7 @@ static HRESULT copy_interlaced_pixels(const BYTE *srcbuffer, static HRESULT WINAPI GifFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - GifFrameDecode *This = (GifFrameDecode*)iface; + GifFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); if (This->frame->ImageDesc.Interlace) @@ -284,7 +294,7 @@ static const IWICBitmapFrameDecodeVtbl GifFrameDecode_Vtbl = { static HRESULT WINAPI GifDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { - GifDecoder *This = (GifDecoder*)iface; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -305,7 +315,7 @@ static HRESULT WINAPI GifDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID static ULONG WINAPI GifDecoder_AddRef(IWICBitmapDecoder *iface) { - GifDecoder *This = (GifDecoder*)iface; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -315,7 +325,7 @@ static ULONG WINAPI GifDecoder_AddRef(IWICBitmapDecoder *iface) static ULONG WINAPI GifDecoder_Release(IWICBitmapDecoder *iface) { - GifDecoder *This = (GifDecoder*)iface; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -357,7 +367,7 @@ static int _gif_inputfunc(GifFileType *gif, GifByteType *data, int len) { static HRESULT WINAPI GifDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions) { - GifDecoder *This = (GifDecoder*)iface; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); LARGE_INTEGER seek; int ret; @@ -465,7 +475,7 @@ static HRESULT WINAPI GifDecoder_GetThumbnail(IWICBitmapDecoder *iface, static HRESULT WINAPI GifDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount) { - GifDecoder *This = (GifDecoder*)iface; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); TRACE("(%p,%p)\n", iface, pCount); if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; @@ -480,7 +490,7 @@ static HRESULT WINAPI GifDecoder_GetFrameCount(IWICBitmapDecoder *iface, static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { - GifDecoder *This = (GifDecoder*)iface; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); GifFrameDecode *result; TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); @@ -491,7 +501,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface, result = HeapAlloc(GetProcessHeap(), 0, sizeof(GifFrameDecode)); if (!result) return E_OUTOFMEMORY; - result->lpVtbl = &GifFrameDecode_Vtbl; + result->IWICBitmapFrameDecode_iface.lpVtbl = &GifFrameDecode_Vtbl; result->ref = 1; result->frame = &This->gif->SavedImages[index]; IWICBitmapDecoder_AddRef(iface); @@ -533,7 +543,7 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This = HeapAlloc(GetProcessHeap(), 0, sizeof(GifDecoder)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &GifDecoder_Vtbl; + This->IWICBitmapDecoder_iface.lpVtbl = &GifDecoder_Vtbl; This->ref = 1; This->initialized = FALSE; This->gif = NULL;
1
0
0
0
Michael Stefaniuc : windowscodecs: Use an iface instead of a vtbl pointer in ClassFactoryImpl.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 1881db6ab511a8c76d21c10d8de756ace7f73006 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1881db6ab511a8c76d21c10d8…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:57:27 2010 +0100 windowscodecs: Use an iface instead of a vtbl pointer in ClassFactoryImpl. --- dlls/windowscodecs/clsfactory.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/windowscodecs/clsfactory.c b/dlls/windowscodecs/clsfactory.c index 3c718cb..473a6a9 100644 --- a/dlls/windowscodecs/clsfactory.c +++ b/dlls/windowscodecs/clsfactory.c @@ -59,15 +59,20 @@ static classinfo wic_classes[] = { {0}}; typedef struct { - const IClassFactoryVtbl *lpIClassFactoryVtbl; + IClassFactory IClassFactory_iface; LONG ref; classinfo *info; } ClassFactoryImpl; +static inline ClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, ClassFactoryImpl, IClassFactory_iface); +} + static HRESULT WINAPI ClassFactoryImpl_QueryInterface(IClassFactory *iface, REFIID iid, void **ppv) { - ClassFactoryImpl *This = (ClassFactoryImpl*)iface; + ClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -88,7 +93,7 @@ static HRESULT WINAPI ClassFactoryImpl_QueryInterface(IClassFactory *iface, static ULONG WINAPI ClassFactoryImpl_AddRef(IClassFactory *iface) { - ClassFactoryImpl *This = (ClassFactoryImpl*)iface; + ClassFactoryImpl *This = impl_from_IClassFactory(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -98,7 +103,7 @@ static ULONG WINAPI ClassFactoryImpl_AddRef(IClassFactory *iface) static ULONG WINAPI ClassFactoryImpl_Release(IClassFactory *iface) { - ClassFactoryImpl *This = (ClassFactoryImpl*)iface; + ClassFactoryImpl *This = impl_from_IClassFactory(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -112,7 +117,7 @@ static ULONG WINAPI ClassFactoryImpl_Release(IClassFactory *iface) static HRESULT WINAPI ClassFactoryImpl_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv) { - ClassFactoryImpl *This = (ClassFactoryImpl*)iface; + ClassFactoryImpl *This = impl_from_IClassFactory(iface); return This->info->constructor(pUnkOuter, riid, ppv); } @@ -141,7 +146,7 @@ static HRESULT ClassFactoryImpl_Constructor(classinfo *info, REFIID riid, LPVOID This = HeapAlloc(GetProcessHeap(), 0, sizeof(ClassFactoryImpl)); if (!This) return E_OUTOFMEMORY; - This->lpIClassFactoryVtbl = &ClassFactoryImpl_Vtbl; + This->IClassFactory_iface.lpVtbl = &ClassFactoryImpl_Vtbl; This->ref = 1; This->info = info;
1
0
0
0
Alexandre Julliard : msdaps: Remove the redundant IRowset interface.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 624ca877f1a2637ed96a9776766059a10985110f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=624ca877f1a2637ed96a97767…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 29 12:17:42 2010 +0100 msdaps: Remove the redundant IRowset interface. --- dlls/msdaps/row_server.c | 119 +++++++++------------------------------------- 1 files changed, 23 insertions(+), 96 deletions(-) diff --git a/dlls/msdaps/row_server.c b/dlls/msdaps/row_server.c index 47d4e53..d1e1427 100644 --- a/dlls/msdaps/row_server.c +++ b/dlls/msdaps/row_server.c @@ -844,7 +844,6 @@ static HRESULT create_row_proxy(IWineRowServer *server, IUnknown **obj) typedef struct { - IRowset IRowset_iface; IRowsetLocate IRowsetLocate_iface; IRowsetInfo IRowsetInfo_iface; IAccessor IAccessor_iface; @@ -854,11 +853,6 @@ typedef struct IWineRowServer *server; } rowset_proxy; -static inline rowset_proxy *impl_from_IRowset(IRowset *iface) -{ - return CONTAINING_RECORD(iface, rowset_proxy, IRowset_iface); -} - static inline rowset_proxy *impl_from_IRowsetLocate(IRowsetLocate *iface) { return CONTAINING_RECORD(iface, rowset_proxy, IRowsetLocate_iface); @@ -874,19 +868,16 @@ static inline rowset_proxy *impl_from_IAccessor(IAccessor *iface) return CONTAINING_RECORD(iface, rowset_proxy, IAccessor_iface); } -static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **obj) +static HRESULT WINAPI rowsetlocate_QueryInterface(IRowsetLocate *iface, REFIID iid, void **obj) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), obj); *obj = NULL; if(IsEqualIID(iid, &IID_IUnknown) || - IsEqualIID(iid, &IID_IRowset)) - { - *obj = &This->IRowset_iface; - } - else if(IsEqualIID(iid, &IID_IRowsetLocate)) + IsEqualIID(iid, &IID_IRowset) || + IsEqualIID(iid, &IID_IRowsetLocate)) { *obj = &This->IRowsetLocate_iface; } @@ -908,17 +899,17 @@ static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **o return S_OK; } -static ULONG WINAPI rowset_AddRef(IRowset *iface) +static ULONG WINAPI rowsetlocate_AddRef(IRowsetLocate *iface) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); TRACE("(%p)\n", This); return InterlockedIncrement(&This->ref); } -static ULONG WINAPI rowset_Release(IRowset *iface) +static ULONG WINAPI rowsetlocate_Release(IRowsetLocate *iface) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); LONG ref; TRACE("(%p)\n", This); @@ -933,10 +924,10 @@ static ULONG WINAPI rowset_Release(IRowset *iface) return ref; } -static HRESULT WINAPI rowset_AddRefRows(IRowset *iface, DBCOUNTITEM cRows, const HROW rghRows[], - DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[]) +static HRESULT WINAPI rowsetlocate_AddRefRows(IRowsetLocate *iface, DBCOUNTITEM cRows, const HROW rghRows[], + DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[]) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); HRESULT hr; DBREFCOUNT *refs = rgRefCounts; DBSTATUS *stats = rgRowStatus; @@ -954,9 +945,9 @@ static HRESULT WINAPI rowset_AddRefRows(IRowset *iface, DBCOUNTITEM cRows, const return hr; } -static HRESULT WINAPI rowset_GetData(IRowset *iface, HROW hRow, HACCESSOR hAccessor, void *pData) +static HRESULT WINAPI rowsetlocate_GetData(IRowsetLocate *iface, HROW hRow, HACCESSOR hAccessor, void *pData) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); HRESULT hr; IAccessor *accessor; DBACCESSORFLAGS flags; @@ -966,7 +957,7 @@ static HRESULT WINAPI rowset_GetData(IRowset *iface, HROW hRow, HACCESSOR hAcces TRACE("(%p)->(%lx, %lx, %p)\n", This, hRow, hAccessor, pData); - hr = IRowset_QueryInterface(iface, &IID_IAccessor, (void**)&accessor); + hr = IRowsetLocate_QueryInterface(iface, &IID_IAccessor, (void**)&accessor); if(FAILED(hr)) return hr; hr = IAccessor_GetBindings(accessor, hAccessor, &flags, &count, &bindings); @@ -996,10 +987,10 @@ static HRESULT WINAPI rowset_GetData(IRowset *iface, HROW hRow, HACCESSOR hAcces return hr; } -static HRESULT WINAPI rowset_GetNextRows(IRowset *iface, HCHAPTER hReserved, DBROWOFFSET lRowsOffset, - DBROWCOUNT cRows, DBCOUNTITEM *pcRowObtained, HROW **prghRows) +static HRESULT WINAPI rowsetlocate_GetNextRows(IRowsetLocate *iface, HCHAPTER hReserved, DBROWOFFSET lRowsOffset, + DBROWCOUNT cRows, DBCOUNTITEM *pcRowObtained, HROW **prghRows) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); HRESULT hr; HROW *rows = NULL; @@ -1017,10 +1008,10 @@ static HRESULT WINAPI rowset_GetNextRows(IRowset *iface, HCHAPTER hReserved, DBR return hr; } -static HRESULT WINAPI rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM cRows, const HROW rghRows[], - DBROWOPTIONS rgRowOptions[], DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[]) +static HRESULT WINAPI rowsetlocate_ReleaseRows(IRowsetLocate *iface, DBCOUNTITEM cRows, const HROW rghRows[], + DBROWOPTIONS rgRowOptions[], DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[]) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); HRESULT hr; DBROWOPTIONS *options = rgRowOptions; DBREFCOUNT *refs = rgRefCounts; @@ -1045,78 +1036,15 @@ static HRESULT WINAPI rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM cRows, cons return hr; } -static HRESULT WINAPI rowset_RestartPosition(IRowset* iface, HCHAPTER hReserved) +static HRESULT WINAPI rowsetlocate_RestartPosition(IRowsetLocate* iface, HCHAPTER hReserved) { - rowset_proxy *This = impl_from_IRowset(iface); + rowset_proxy *This = impl_from_IRowsetLocate(iface); FIXME("(%p)->(%lx): stub\n", This, hReserved); return E_NOTIMPL; } -static const IRowsetVtbl rowset_vtbl = -{ - rowset_QueryInterface, - rowset_AddRef, - rowset_Release, - rowset_AddRefRows, - rowset_GetData, - rowset_GetNextRows, - rowset_ReleaseRows, - rowset_RestartPosition -}; - -static HRESULT WINAPI rowsetlocate_QueryInterface(IRowsetLocate *iface, REFIID iid, void **obj) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IUnknown_QueryInterface((IUnknown *)This, iid, obj); -} - -static ULONG WINAPI rowsetlocate_AddRef(IRowsetLocate *iface) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IUnknown_AddRef((IUnknown *)This); -} - -static ULONG WINAPI rowsetlocate_Release(IRowsetLocate *iface) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IUnknown_Release((IUnknown *)This); -} - -static HRESULT WINAPI rowsetlocate_AddRefRows(IRowsetLocate *iface, DBCOUNTITEM cRows, const HROW rghRows[], - DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[]) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IRowset_AddRefRows((IRowset*)This, cRows, rghRows, rgRefCounts, rgRowStatus); -} - -static HRESULT WINAPI rowsetlocate_GetData(IRowsetLocate *iface, HROW hRow, HACCESSOR hAccessor, void *pData) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IRowset_GetData((IRowset*)This, hRow, hAccessor, pData); -} - -static HRESULT WINAPI rowsetlocate_GetNextRows(IRowsetLocate *iface, HCHAPTER hReserved, DBROWOFFSET lRowsOffset, - DBROWCOUNT cRows, DBCOUNTITEM *pcRowObtained, HROW **prghRows) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IRowset_GetNextRows((IRowset*)This, hReserved, lRowsOffset, cRows, pcRowObtained, prghRows); -} - -static HRESULT WINAPI rowsetlocate_ReleaseRows(IRowsetLocate *iface, DBCOUNTITEM cRows, const HROW rghRows[], - DBROWOPTIONS rgRowOptions[], DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[]) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IRowset_ReleaseRows((IRowset*)This, cRows, rghRows, rgRowOptions, rgRefCounts, rgRowStatus); -} - -static HRESULT WINAPI rowsetlocate_RestartPosition(IRowsetLocate *iface, HCHAPTER hReserved) -{ - rowset_proxy *This = impl_from_IRowsetLocate(iface); - return IRowset_RestartPosition((IRowset*)This, hReserved); -} - static HRESULT WINAPI rowsetlocate_Compare(IRowsetLocate *iface, HCHAPTER hReserved, DBBKMARK cbBookmark1, const BYTE *pBookmark1, DBBKMARK cbBookmark2, const BYTE *pBookmark2, DBCOMPARE *pComparison) { @@ -1330,7 +1258,6 @@ static HRESULT create_rowset_proxy(IWineRowServer *server, IUnknown **obj) proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy)); if(!proxy) return E_OUTOFMEMORY; - proxy->IRowset_iface.lpVtbl = &rowset_vtbl; proxy->IRowsetLocate_iface.lpVtbl = &rowsetlocate_vtbl; proxy->IRowsetInfo_iface.lpVtbl = &rowsetinfo_vtbl; proxy->IAccessor_iface.lpVtbl = &accessor_vtbl; @@ -1338,7 +1265,7 @@ static HRESULT create_rowset_proxy(IWineRowServer *server, IUnknown **obj) IWineRowServer_AddRef(server); proxy->server = server; - *obj = (IUnknown *)&proxy->IRowset_iface; + *obj = (IUnknown *)&proxy->IRowsetLocate_iface; TRACE("returning %p\n", *obj); return S_OK; }
1
0
0
0
Michael Stefaniuc : msdaps: Standardize the COM usage in row_server.c.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: f27209eb58aef9ecdf858a95cdd162de9a4d13c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f27209eb58aef9ecdf858a95c…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 01:02:01 2010 +0100 msdaps: Standardize the COM usage in row_server.c. --- dlls/msdaps/row_server.c | 66 +++++++++++++++++++++++----------------------- 1 files changed, 33 insertions(+), 33 deletions(-) diff --git a/dlls/msdaps/row_server.c b/dlls/msdaps/row_server.c index bc0f652..47d4e53 100644 --- a/dlls/msdaps/row_server.c +++ b/dlls/msdaps/row_server.c @@ -75,7 +75,7 @@ static inline DBLENGTH db_type_size(DBTYPE type, DBLENGTH var_len) typedef struct { - const IWineRowServerVtbl *vtbl; + IWineRowServer IWineRowServer_iface; LONG ref; @@ -86,7 +86,7 @@ typedef struct static inline server *impl_from_IWineRowServer(IWineRowServer *iface) { - return (server *)((char*)iface - FIELD_OFFSET(server, vtbl)); + return CONTAINING_RECORD(iface, server, IWineRowServer_iface); } static HRESULT WINAPI server_QueryInterface(IWineRowServer *iface, REFIID riid, void **obj) @@ -586,7 +586,7 @@ static HRESULT create_server(IUnknown *outer, const CLSID *class, void **obj) server = HeapAlloc(GetProcessHeap(), 0, sizeof(*server)); if(!server) return E_OUTOFMEMORY; - server->vtbl = &server_vtbl; + server->IWineRowServer_iface.lpVtbl = &server_vtbl; server->ref = 1; server->class = *class; server->inner_unk = NULL; @@ -613,8 +613,8 @@ HRESULT create_rowset_server(IUnknown *outer, void **obj) typedef struct { - const IRowVtbl *row_vtbl; - const IRowChangeVtbl *row_change_vtbl; + IRow IRow_iface; + IRowChange IRowChange_iface; LONG ref; @@ -623,12 +623,12 @@ typedef struct static inline row_proxy *impl_from_IRow(IRow *iface) { - return (row_proxy *)((char*)iface - FIELD_OFFSET(row_proxy, row_vtbl)); + return CONTAINING_RECORD(iface, row_proxy, IRow_iface); } static inline row_proxy *impl_from_IRowChange(IRowChange *iface) { - return (row_proxy *)((char*)iface - FIELD_OFFSET(row_proxy, row_change_vtbl)); + return CONTAINING_RECORD(iface, row_proxy, IRowChange_iface); } static HRESULT WINAPI row_QueryInterface(IRow *iface, REFIID iid, void **obj) @@ -639,11 +639,11 @@ static HRESULT WINAPI row_QueryInterface(IRow *iface, REFIID iid, void **obj) if(IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IRow)) { - *obj = &This->row_vtbl; + *obj = &This->IRow_iface; } else if(IsEqualIID(iid, &IID_IRowChange)) { - *obj = &This->row_change_vtbl; + *obj = &This->IRowChange_iface; } else { @@ -831,23 +831,23 @@ static HRESULT create_row_proxy(IWineRowServer *server, IUnknown **obj) proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy)); if(!proxy) return E_OUTOFMEMORY; - proxy->row_vtbl = &row_vtbl; - proxy->row_change_vtbl = &row_change_vtbl; + proxy->IRow_iface.lpVtbl = &row_vtbl; + proxy->IRowChange_iface.lpVtbl = &row_change_vtbl; proxy->ref = 1; IWineRowServer_AddRef(server); proxy->server = server; - *obj = (IUnknown*)&proxy->row_vtbl; + *obj = (IUnknown*)&proxy->IRow_iface; TRACE("returning %p\n", *obj); return S_OK; } typedef struct { - const IRowsetVtbl *rowset_vtbl; - const IRowsetLocateVtbl *rowsetlocate_vtbl; - const IRowsetInfoVtbl *rowsetinfo_vtbl; - const IAccessorVtbl *accessor_vtbl; + IRowset IRowset_iface; + IRowsetLocate IRowsetLocate_iface; + IRowsetInfo IRowsetInfo_iface; + IAccessor IAccessor_iface; LONG ref; @@ -856,22 +856,22 @@ typedef struct static inline rowset_proxy *impl_from_IRowset(IRowset *iface) { - return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowset_vtbl)); + return CONTAINING_RECORD(iface, rowset_proxy, IRowset_iface); } static inline rowset_proxy *impl_from_IRowsetLocate(IRowsetLocate *iface) { - return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowsetlocate_vtbl)); + return CONTAINING_RECORD(iface, rowset_proxy, IRowsetLocate_iface); } static inline rowset_proxy *impl_from_IRowsetInfo(IRowsetInfo *iface) { - return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowsetinfo_vtbl)); + return CONTAINING_RECORD(iface, rowset_proxy, IRowsetInfo_iface); } static inline rowset_proxy *impl_from_IAccessor(IAccessor *iface) { - return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, accessor_vtbl)); + return CONTAINING_RECORD(iface, rowset_proxy, IAccessor_iface); } static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **obj) @@ -884,19 +884,19 @@ static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **o if(IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IRowset)) { - *obj = &This->rowset_vtbl; + *obj = &This->IRowset_iface; } else if(IsEqualIID(iid, &IID_IRowsetLocate)) { - *obj = &This->rowsetlocate_vtbl; + *obj = &This->IRowsetLocate_iface; } else if(IsEqualIID(iid, &IID_IRowsetInfo)) { - *obj = &This->rowsetinfo_vtbl; + *obj = &This->IRowsetInfo_iface; } else if(IsEqualIID(iid, &IID_IAccessor)) { - *obj = &This->accessor_vtbl; + *obj = &This->IAccessor_iface; } else { @@ -1330,15 +1330,15 @@ static HRESULT create_rowset_proxy(IWineRowServer *server, IUnknown **obj) proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy)); if(!proxy) return E_OUTOFMEMORY; - proxy->rowset_vtbl = &rowset_vtbl; - proxy->rowsetlocate_vtbl = &rowsetlocate_vtbl; - proxy->rowsetinfo_vtbl = &rowsetinfo_vtbl; - proxy->accessor_vtbl = &accessor_vtbl; + proxy->IRowset_iface.lpVtbl = &rowset_vtbl; + proxy->IRowsetLocate_iface.lpVtbl = &rowsetlocate_vtbl; + proxy->IRowsetInfo_iface.lpVtbl = &rowsetinfo_vtbl; + proxy->IAccessor_iface.lpVtbl = &accessor_vtbl; proxy->ref = 1; IWineRowServer_AddRef(server); proxy->server = server; - *obj = (IUnknown *)&proxy->rowset_vtbl; + *obj = (IUnknown *)&proxy->IRowset_iface; TRACE("returning %p\n", *obj); return S_OK; } @@ -1360,7 +1360,7 @@ static HRESULT create_proxy(IWineRowServer *server, const CLSID *class, IUnknown typedef struct { - const IMarshalVtbl *marshal_vtbl; + IMarshal IMarshal_iface; LONG ref; CLSID unmarshal_class; @@ -1369,7 +1369,7 @@ typedef struct static inline marshal *impl_from_IMarshal(IMarshal *iface) { - return (marshal *)((char*)iface - FIELD_OFFSET(marshal, marshal_vtbl)); + return CONTAINING_RECORD(iface, marshal, IMarshal_iface); } static HRESULT WINAPI marshal_QueryInterface(IMarshal *iface, REFIID iid, void **obj) @@ -1518,10 +1518,10 @@ static HRESULT create_marshal(IUnknown *outer, const CLSID *class, void **obj) marshal->unmarshal_class = *class; marshal->outer = outer; /* don't ref outer unk */ - marshal->marshal_vtbl = &marshal_vtbl; + marshal->IMarshal_iface.lpVtbl = &marshal_vtbl; marshal->ref = 1; - *obj = &marshal->marshal_vtbl; + *obj = &marshal->IMarshal_iface; TRACE("returning %p\n", *obj); return S_OK; }
1
0
0
0
Michael Stefaniuc : dispex/tests: Use an iface instead of a vtbl pointer in dispex.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 87f42eb853777492d7f1205e0d38bd05132034b0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=87f42eb853777492d7f1205e0…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:56:38 2010 +0100 dispex/tests: Use an iface instead of a vtbl pointer in dispex. --- dlls/dispex/tests/marshal.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/dispex/tests/marshal.c b/dlls/dispex/tests/marshal.c index 4380621..7fa9121 100644 --- a/dlls/dispex/tests/marshal.c +++ b/dlls/dispex/tests/marshal.c @@ -140,10 +140,15 @@ static void end_host_object(DWORD tid, HANDLE thread) typedef struct { - const IDispatchExVtbl *lpVtbl; + IDispatchEx IDispatchEx_iface; LONG refs; } dispex; +static inline dispex *impl_from_IDispatchEx(IDispatchEx *iface) +{ + return CONTAINING_RECORD(iface, dispex, IDispatchEx_iface); +} + static HRESULT WINAPI dispex_QueryInterface(IDispatchEx* iface, REFIID iid, void **obj) { @@ -164,7 +169,7 @@ static HRESULT WINAPI dispex_QueryInterface(IDispatchEx* iface, static ULONG WINAPI dispex_AddRef(IDispatchEx* iface) { - dispex *This = (dispex *)iface; + dispex *This = impl_from_IDispatchEx(iface); trace("AddRef\n"); return InterlockedIncrement(&This->refs); @@ -172,7 +177,7 @@ static ULONG WINAPI dispex_AddRef(IDispatchEx* iface) static ULONG WINAPI dispex_Release(IDispatchEx* iface) { - dispex *This = (dispex *)iface; + dispex *This = impl_from_IDispatchEx(iface); ULONG refs = InterlockedDecrement(&This->refs); trace("Release\n"); if(!refs) @@ -349,7 +354,7 @@ static IDispatchEx *dispex_create(void) This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); if (!This) return NULL; - This->lpVtbl = &dispex_vtable; + This->IDispatchEx_iface.lpVtbl = &dispex_vtable; This->refs = 1; return (IDispatchEx *)This; }
1
0
0
0
Michael Stefaniuc : d3drm: Use an iface instead of a vtbl pointer in IDirect3DRMMeshBuilderImpl.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 278b7a0445d638dbfb28e2fdb32b9b32043c00f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=278b7a0445d638dbfb28e2fdb…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:56:33 2010 +0100 d3drm: Use an iface instead of a vtbl pointer in IDirect3DRMMeshBuilderImpl. --- dlls/d3drm/meshbuilder.c | 107 ++++++++++++++++++++++++---------------------- 1 files changed, 56 insertions(+), 51 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=278b7a0445d638dbfb28e…
1
0
0
0
Michael Stefaniuc : d3drm: Use an iface instead of a vtbl pointer in IDirect3DRMImpl.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 93fc13522ce3294adab28ee3384553566e9e6a7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93fc13522ce3294adab28ee33…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:55:07 2010 +0100 d3drm: Use an iface instead of a vtbl pointer in IDirect3DRMImpl. --- dlls/d3drm/d3drm.c | 79 +++++++++++++++++++++++++++------------------------ 1 files changed, 42 insertions(+), 37 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=93fc13522ce3294adab28…
1
0
0
0
Michael Stefaniuc : atl: Use an iface instead of a vtbl pointer in the Registrar object.
by Alexandre Julliard
29 Nov '10
29 Nov '10
Module: wine Branch: master Commit: 0fd3f0a006fc6b1a5372f267a259505f512ab034 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0fd3f0a006fc6b1a5372f267a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 29 00:54:44 2010 +0100 atl: Use an iface instead of a vtbl pointer in the Registrar object. --- dlls/atl/registrar.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index 99dfe73..2188850 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -78,7 +78,7 @@ typedef struct rep_list_str { } rep_list; typedef struct { - const IRegistrarVtbl *lpVtbl; + IRegistrar IRegistrar_iface; LONG ref; rep_list *rep; } Registrar; @@ -89,6 +89,11 @@ typedef struct { DWORD len; } strbuf; +static inline Registrar *impl_from_IRegistrar(IRegistrar *iface) +{ + return CONTAINING_RECORD(iface, Registrar, IRegistrar_iface); +} + static void strbuf_init(strbuf *buf) { buf->str = HeapAlloc(GetProcessHeap(), 0, 128*sizeof(WCHAR)); @@ -549,7 +554,7 @@ static HRESULT WINAPI Registrar_QueryInterface(IRegistrar *iface, REFIID riid, v static ULONG WINAPI Registrar_AddRef(IRegistrar *iface) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ->%d\n", This, ref); return ref; @@ -557,7 +562,7 @@ static ULONG WINAPI Registrar_AddRef(IRegistrar *iface) static ULONG WINAPI Registrar_Release(IRegistrar *iface) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ->%d\n", This, ref); @@ -571,7 +576,7 @@ static ULONG WINAPI Registrar_Release(IRegistrar *iface) static HRESULT WINAPI Registrar_AddReplacement(IRegistrar *iface, LPCOLESTR Key, LPCOLESTR item) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); int len; rep_list *new_rep; @@ -595,7 +600,7 @@ static HRESULT WINAPI Registrar_AddReplacement(IRegistrar *iface, LPCOLESTR Key, static HRESULT WINAPI Registrar_ClearReplacements(IRegistrar *iface) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); rep_list *iter, *iter2; TRACE("(%p)\n", This); @@ -619,7 +624,7 @@ static HRESULT WINAPI Registrar_ClearReplacements(IRegistrar *iface) static HRESULT WINAPI Registrar_ResourceRegisterSz(IRegistrar* iface, LPCOLESTR resFileName, LPCOLESTR szID, LPCOLESTR szType) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(resFileName), debugstr_w(szID), debugstr_w(szType)); return resource_register(This, resFileName, szID, szType, TRUE); } @@ -627,35 +632,35 @@ static HRESULT WINAPI Registrar_ResourceRegisterSz(IRegistrar* iface, LPCOLESTR static HRESULT WINAPI Registrar_ResourceUnregisterSz(IRegistrar* iface, LPCOLESTR resFileName, LPCOLESTR szID, LPCOLESTR szType) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(resFileName), debugstr_w(szID), debugstr_w(szType)); return resource_register(This, resFileName, szID, szType, FALSE); } static HRESULT WINAPI Registrar_FileRegister(IRegistrar* iface, LPCOLESTR fileName) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(fileName)); return file_register(This, fileName, TRUE); } static HRESULT WINAPI Registrar_FileUnregister(IRegistrar* iface, LPCOLESTR fileName) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(fileName)); return file_register(This, fileName, FALSE); } static HRESULT WINAPI Registrar_StringRegister(IRegistrar* iface, LPCOLESTR data) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(data)); return string_register(This, data, TRUE); } static HRESULT WINAPI Registrar_StringUnregister(IRegistrar* iface, LPCOLESTR data) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(data)); return string_register(This, data, FALSE); } @@ -663,7 +668,7 @@ static HRESULT WINAPI Registrar_StringUnregister(IRegistrar* iface, LPCOLESTR da static HRESULT WINAPI Registrar_ResourceRegister(IRegistrar* iface, LPCOLESTR resFileName, UINT nID, LPCOLESTR szType) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s %d %s)\n", iface, debugstr_w(resFileName), nID, debugstr_w(szType)); return resource_register(This, resFileName, MAKEINTRESOURCEW(nID), szType, TRUE); } @@ -671,7 +676,7 @@ static HRESULT WINAPI Registrar_ResourceRegister(IRegistrar* iface, LPCOLESTR re static HRESULT WINAPI Registrar_ResourceUnregister(IRegistrar* iface, LPCOLESTR resFileName, UINT nID, LPCOLESTR szType) { - Registrar *This = (Registrar*)iface; + Registrar *This = impl_from_IRegistrar(iface); TRACE("(%p)->(%s %d %s)\n", This, debugstr_w(resFileName), nID, debugstr_w(szType)); return resource_register(This, resFileName, MAKEINTRESOURCEW(nID), szType, FALSE); } @@ -700,7 +705,7 @@ static HRESULT Registrar_create(const IUnknown *pUnkOuter, REFIID riid, void **p return E_NOINTERFACE; ret = HeapAlloc(GetProcessHeap(), 0, sizeof(Registrar)); - ret->lpVtbl = &RegistrarVtbl; + ret->IRegistrar_iface.lpVtbl = &RegistrarVtbl; ret->ref = 1; ret->rep = NULL; *ppvObject = ret;
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
87
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
Results per page:
10
25
50
100
200