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
January 2011
----- 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
879 discussions
Start a n
N
ew thread
Nikolay Sivov : oleaut32/tests: Test for return value directly.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: d47e638ba3522218684b014ac0c4c14a2d4ff514 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d47e638ba3522218684b014ac…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 11 02:07:42 2011 +0300 oleaut32/tests: Test for return value directly. --- dlls/oleaut32/tests/vartest.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index d1388dd..a1a3ec5 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -106,7 +106,7 @@ static void init(void) HRESULT res; res = VarBstrFromBool(VARIANT_TRUE, LANG_USER_DEFAULT, VAR_LOCALBOOL, &bstr); - ok(SUCCEEDED(res) && (lstrlenW(bstr) > 0), + ok(res == S_OK && (lstrlenW(bstr) > 0), "Expected localized string for 'True'\n"); /* lstrcpyW / lstrcatW do not work on win95 */ memcpy(sz12_true, sz12, sizeof(sz12)); @@ -114,7 +114,7 @@ static void init(void) SysFreeString(bstr); res = VarBstrFromBool(VARIANT_FALSE, LANG_USER_DEFAULT, VAR_LOCALBOOL, &bstr); - ok(SUCCEEDED(res) && (lstrlenW(bstr) > 0), + ok(res == S_OK && (lstrlenW(bstr) > 0), "Expected localized string for 'False'\n"); memcpy(sz12_false, sz12, sizeof(sz12)); if (bstr) memcpy(&sz12_false[2], bstr, SysStringByteLen(bstr) + sizeof(WCHAR)); @@ -1582,7 +1582,7 @@ static void test_UdateFromDate( int line, DATE dt, ULONG flags, HRESULT r, WORD memset(&ud, 0, sizeof(ud)); res = pVarUdateFromDate(dt, flags, &ud); - ok_(__FILE__,line)(r == res && (FAILED(res) || (ud.st.wYear == y && ud.st.wMonth == m && ud.st.wDay == d && + ok_(__FILE__,line)(r == res && (res != S_OK || (ud.st.wYear == y && ud.st.wMonth == m && ud.st.wDay == d && ud.st.wHour == h && ud.st.wMinute == mn && ud.st.wSecond == s && ud.st.wMilliseconds == ms && ud.st.wDayOfWeek == dw && ud.wDayOfYear == dy)), "%.16g expected res(%x) %d,%d,%d,%d,%d,%d,%d %d %d, got res(%x) %d,%d,%d,%d,%d,%d,%d %d %d\n", @@ -1643,7 +1643,7 @@ static void test_DateFromUDate( int line, WORD d, WORD m, WORD y, WORD h, WORD m ud.st.wDayOfWeek = dw; ud.wDayOfYear = dy; res = pVarDateFromUdate(&ud, flags, &out); - ok_(__FILE__,line)(r == res && (FAILED(r) || EQ_DOUBLE(out, dt)), + ok_(__FILE__,line)(r == res && (r != S_OK || EQ_DOUBLE(out, dt)), "expected %x, %.16g, got %x, %.16g\n", r, dt, res, out); } #define UD2T(d,m,y,h,mn,s,ms,dw,dy,flags,r,dt) test_DateFromUDate(__LINE__,d,m,y,h,mn,s,ms,dw,dy,flags,r,dt)
1
0
0
0
Nikolay Sivov : ole32/tests: Test for return value directly without macros.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: d91dbd0baa887349bf9bd665e1475d5e4ac8324f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d91dbd0baa887349bf9bd665e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 11 02:00:14 2011 +0300 ole32/tests: Test for return value directly without macros. --- dlls/ole32/tests/clipboard.c | 6 +++--- dlls/ole32/tests/stg_prop.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 8a44f50..1029a68 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -826,15 +826,15 @@ static void test_set_clipboard(void) cf_onemore = RegisterClipboardFormatA("one more format"); hr = DataObjectImpl_CreateText("data1", &data1); - ok(SUCCEEDED(hr), "Failed to create data1 object: 0x%08x\n", hr); + ok(hr == S_OK, "Failed to create data1 object: 0x%08x\n", hr); if(FAILED(hr)) return; hr = DataObjectImpl_CreateText("data2", &data2); - ok(SUCCEEDED(hr), "Failed to create data2 object: 0x%08x\n", hr); + ok(hr == S_OK, "Failed to create data2 object: 0x%08x\n", hr); if(FAILED(hr)) return; hr = DataObjectImpl_CreateComplex(&data_cmpl); - ok(SUCCEEDED(hr), "Failed to create complex data object: 0x%08x\n", hr); + ok(hr == S_OK, "Failed to create complex data object: 0x%08x\n", hr); if(FAILED(hr)) return; diff --git a/dlls/ole32/tests/stg_prop.c b/dlls/ole32/tests/stg_prop.c index 77f0d7c..db4c142 100644 --- a/dlls/ole32/tests/stg_prop.c +++ b/dlls/ole32/tests/stg_prop.c @@ -186,7 +186,7 @@ static void testProps(void) spec.ulKind = PRSPEC_PROPID; U(spec).propid = PIDSI_THUMBNAIL; hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var); - ok(SUCCEEDED(hr), "ReadMultiple failed: 0x%08x\n", hr); + ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr); ok(var.vt == VT_CF, "variant type wrong\n"); ok(U(var).pclipdata->ulClipFmt == CF_ENHMETAFILE, "clipboard type wrong\n");
1
0
0
0
David Hedberg : oleaut32: Make ITypeComp::BindType case-insensitive.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 900c5cde698d25367d45e6385bb2b836c36c16db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=900c5cde698d25367d45e6385…
Author: David Hedberg <dhedberg(a)codeweavers.com> Date: Tue Jan 11 10:10:01 2011 +0100 oleaut32: Make ITypeComp::BindType case-insensitive. --- dlls/oleaut32/tests/typelib.c | 12 ++++++++++++ dlls/oleaut32/typelib.c | 2 +- 2 files changed, 13 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index a47a188..03eda3b 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -117,6 +117,7 @@ static void test_TypeComp(void) static WCHAR wszIUnknown[] = {'I','U','n','k','n','o','w','n',0}; static WCHAR wszFont[] = {'F','o','n','t',0}; static WCHAR wszGUID[] = {'G','U','I','D',0}; + static WCHAR wszguid[] = {'g','u','i','d',0}; static WCHAR wszStdPicture[] = {'S','t','d','P','i','c','t','u','r','e',0}; static WCHAR wszOLE_COLOR[] = {'O','L','E','_','C','O','L','O','R',0}; static WCHAR wszClone[] = {'C','l','o','n','e',0}; @@ -291,6 +292,17 @@ static void test_TypeComp(void) ITypeInfo_Release(pTypeInfo); if(pTypeComp_tmp) ITypeComp_Release(pTypeComp_tmp); /* fixme */ + /* test BindType case-insensitivity */ + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszguid); + pTypeComp_tmp = (void*)0xdeadbeef; + pTypeInfo = (void*)0xdeadbeef; + hr = ITypeComp_BindType(pTypeComp, wszguid, ulHash, &pTypeInfo, &pTypeComp_tmp); + ok_ole_success(hr, ITypeComp_BindType); + ok(pTypeInfo != NULL, "Got NULL pTypeInfo\n"); + todo_wine ok(pTypeComp_tmp == NULL, "Got pTypeComp_tmp %p\n", pTypeComp_tmp); + ITypeInfo_Release(pTypeInfo); + if(pTypeComp_tmp) ITypeComp_Release(pTypeComp_tmp); /* fixme */ + ITypeComp_Release(pTypeComp); /* tests for ITypeComp on an interface */ diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 91da30a..b1e3e4f 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4914,7 +4914,7 @@ static HRESULT WINAPI ITypeLibComp_fnBindType( for (pTypeInfo = This->pTypeInfo; pTypeInfo; pTypeInfo = pTypeInfo->next) { /* FIXME: should use lHash to do the search */ - if (pTypeInfo->Name && !strcmpW(pTypeInfo->Name, szName)) + if (pTypeInfo->Name && !strcmpiW(pTypeInfo->Name, szName)) { TRACE("returning %p\n", pTypeInfo); *ppTInfo = (ITypeInfo *)&pTypeInfo->lpVtbl;
1
0
0
0
David Hedberg : oleaut32: Handle NULL arguments to ITypeComp::BindType.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 454b1fca24bdf0ba84e8c20e7a619d9e4246b01a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=454b1fca24bdf0ba84e8c20e7…
Author: David Hedberg <dhedberg(a)codeweavers.com> Date: Tue Jan 11 10:10:00 2011 +0100 oleaut32: Handle NULL arguments to ITypeComp::BindType. --- dlls/oleaut32/tests/typelib.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/oleaut32/typelib.c | 3 +++ 2 files changed, 39 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index aabd3e7..a47a188 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -109,6 +109,7 @@ static void test_TypeComp(void) BINDPTR bindptr; ITypeInfo *pTypeInfo; ITypeInfo *pFontTypeInfo; + ITypeComp *pTypeComp_tmp; static WCHAR wszStdFunctions[] = {'S','t','d','F','u','n','c','t','i','o','n','s',0}; static WCHAR wszSavePicture[] = {'S','a','v','e','P','i','c','t','u','r','e',0}; static WCHAR wszOLE_TRISTATE[] = {'O','L','E','_','T','R','I','S','T','A','T','E',0}; @@ -255,6 +256,41 @@ static void test_TypeComp(void) ok(!pTypeInfo, "pTypeInfo should have been set to NULL\n"); ok(!bindptr.lptcomp, "bindptr should have been set to NULL\n"); + /* test basic BindType argument handling */ + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszGUID); + hr = ITypeComp_BindType(pTypeComp, wszGUID, ulHash, NULL, NULL); + ok(hr == E_INVALIDARG, "Got %08x\n", hr); + + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszGUID); + pTypeInfo = (void*)0xdeadbeef; + hr = ITypeComp_BindType(pTypeComp, wszGUID, ulHash, &pTypeInfo, NULL); + ok(hr == E_INVALIDARG, "Got %08x\n", hr); + ok(pTypeInfo == (void*)0xdeadbeef, "Got %p\n", pTypeInfo); + + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszGUID); + pTypeComp_tmp = (void*)0xdeadbeef; + hr = ITypeComp_BindType(pTypeComp, wszGUID, ulHash, NULL, &pTypeComp_tmp); + ok(hr == E_INVALIDARG, "Got %08x\n", hr); + ok(pTypeComp_tmp == (void*)0xdeadbeef, "Got %p\n", pTypeComp_tmp); + + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszGUID); + pTypeComp_tmp = (void*)0xdeadbeef; + pTypeInfo = (void*)0xdeadbeef; + hr = ITypeComp_BindType(pTypeComp, NULL, ulHash, &pTypeInfo, &pTypeComp_tmp); + ok(hr == E_INVALIDARG, "Got %08x\n", hr); + ok(pTypeInfo == (void*)0xdeadbeef, "Got %p\n", pTypeInfo); + ok(pTypeComp_tmp == (void*)0xdeadbeef, "Got %p\n", pTypeComp_tmp); + + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszGUID); + pTypeComp_tmp = (void*)0xdeadbeef; + pTypeInfo = (void*)0xdeadbeef; + hr = ITypeComp_BindType(pTypeComp, wszGUID, ulHash, &pTypeInfo, &pTypeComp_tmp); + ok_ole_success(hr, ITypeComp_BindType); + ok(pTypeInfo != NULL, "Got NULL pTypeInfo\n"); + todo_wine ok(pTypeComp_tmp == NULL, "Got pTypeComp_tmp %p\n", pTypeComp_tmp); + ITypeInfo_Release(pTypeInfo); + if(pTypeComp_tmp) ITypeComp_Release(pTypeComp_tmp); /* fixme */ + ITypeComp_Release(pTypeComp); /* tests for ITypeComp on an interface */ diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 854b165..91da30a 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4908,6 +4908,9 @@ static HRESULT WINAPI ITypeLibComp_fnBindType( TRACE("(%s, %x, %p, %p)\n", debugstr_w(szName), lHash, ppTInfo, ppTComp); + if(!szName || !ppTInfo || !ppTComp) + return E_INVALIDARG; + for (pTypeInfo = This->pTypeInfo; pTypeInfo; pTypeInfo = pTypeInfo->next) { /* FIXME: should use lHash to do the search */
1
0
0
0
Michael Stefaniuc : urlmon: COM cleanup for the IMoniker iface.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 8c0a69430c9555106f7124683c74543abb6d9895 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c0a69430c9555106f7124683…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 11 10:10:04 2011 +0100 urlmon: COM cleanup for the IMoniker iface. --- dlls/urlmon/umon.c | 67 +++++++++++++++++++++++++++------------------------ 1 files changed, 35 insertions(+), 32 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8c0a69430c9555106f712…
1
0
0
0
Michael Stefaniuc : windowscodecs: COM cleanup for stream.c.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 0ceabe8879c34483161dfacc4c41f4875f20addc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ceabe8879c34483161dfacc4…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 11 00:47:30 2011 +0100 windowscodecs: COM cleanup for stream.c. --- dlls/windowscodecs/stream.c | 91 +++++++++++++++++++++++++------------------ 1 files changed, 53 insertions(+), 38 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0ceabe8879c34483161df…
1
0
0
0
Michael Stefaniuc : windowscodecs: Use an iface instead of a vtbl pointer in BmpEncoder.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: d341bea6735f3ebb09e2cd2719093ade956403d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d341bea6735f3ebb09e2cd271…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 11 00:43:15 2011 +0100 windowscodecs: Use an iface instead of a vtbl pointer in BmpEncoder. --- dlls/windowscodecs/bmpencode.c | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index 410c646..69148af 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -412,16 +412,21 @@ static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl = { }; typedef struct BmpEncoder { - const IWICBitmapEncoderVtbl *lpVtbl; + IWICBitmapEncoder IWICBitmapEncoder_iface; LONG ref; IStream *stream; BmpFrameEncode *frame; } BmpEncoder; +static inline BmpEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface) +{ + return CONTAINING_RECORD(iface, BmpEncoder, IWICBitmapEncoder_iface); +} + static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, void **ppv) { - BmpEncoder *This = (BmpEncoder*)iface; + BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -443,7 +448,7 @@ static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID static ULONG WINAPI BmpEncoder_AddRef(IWICBitmapEncoder *iface) { - BmpEncoder *This = (BmpEncoder*)iface; + BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -453,7 +458,7 @@ static ULONG WINAPI BmpEncoder_AddRef(IWICBitmapEncoder *iface) static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface) { - BmpEncoder *This = (BmpEncoder*)iface; + BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); @@ -471,7 +476,7 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface) static HRESULT WINAPI BmpEncoder_Initialize(IWICBitmapEncoder *iface, IStream *pIStream, WICBitmapEncoderCacheOption cacheOption) { - BmpEncoder *This = (BmpEncoder*)iface; + BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOption); @@ -523,7 +528,7 @@ static HRESULT WINAPI BmpEncoder_SetPreview(IWICBitmapEncoder *iface, IWICBitmap static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBitmapFrameEncode **ppIFrameEncode, IPropertyBag2 **ppIEncoderOptions) { - BmpEncoder *This = (BmpEncoder*)iface; + BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); BmpFrameEncode *encode; HRESULT hr; @@ -565,7 +570,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, static HRESULT WINAPI BmpEncoder_Commit(IWICBitmapEncoder *iface) { - BmpEncoder *This = (BmpEncoder*)iface; + BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p)\n", iface); if (!This->frame || !This->frame->committed) return WINCODEC_ERR_WRONGSTATE; @@ -610,13 +615,13 @@ HRESULT BmpEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpEncoder)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &BmpEncoder_Vtbl; + This->IWICBitmapEncoder_iface.lpVtbl = &BmpEncoder_Vtbl; This->ref = 1; This->stream = NULL; This->frame = NULL; - ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); - IUnknown_Release((IUnknown*)This); + ret = IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv); + IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface); return ret; }
1
0
0
0
Michael Stefaniuc : urlmon: Use an iface instead of a vtbl pointer in AsyncBindCtx.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 346e766d5364c566a62f0830fa412cb9c4f73f4d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=346e766d5364c566a62f0830f…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 11 00:41:11 2011 +0100 urlmon: Use an iface instead of a vtbl pointer in AsyncBindCtx. --- dlls/urlmon/bindctx.c | 51 ++++++++++++++++++++++++------------------------- 1 files changed, 25 insertions(+), 26 deletions(-) diff --git a/dlls/urlmon/bindctx.c b/dlls/urlmon/bindctx.c index f04b3e4..1af7fa7 100644 --- a/dlls/urlmon/bindctx.c +++ b/dlls/urlmon/bindctx.c @@ -616,32 +616,33 @@ HRESULT WINAPI RevokeBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc } typedef struct { - const IBindCtxVtbl *lpBindCtxVtbl; + IBindCtx IBindCtx_iface; LONG ref; IBindCtx *bindctx; } AsyncBindCtx; -#define BINDCTX(x) ((IBindCtx*) &(x)->lpBindCtxVtbl) - -#define BINDCTX_THIS(iface) DEFINE_THIS(AsyncBindCtx, BindCtx, iface) +static inline AsyncBindCtx *impl_from_IBindCtx(IBindCtx *iface) +{ + return CONTAINING_RECORD(iface, AsyncBindCtx, IBindCtx_iface); +} static HRESULT WINAPI AsyncBindCtx_QueryInterface(IBindCtx *iface, REFIID riid, void **ppv) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); *ppv = NULL; if(IsEqualGUID(riid, &IID_IUnknown)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = BINDCTX(This); + *ppv = &This->IBindCtx_iface; }else if(IsEqualGUID(riid, &IID_IBindCtx)) { TRACE("(%p)->(IID_IBindCtx %p)\n", This, ppv); - *ppv = BINDCTX(This); + *ppv = &This->IBindCtx_iface; }else if(IsEqualGUID(riid, &IID_IAsyncBindCtx)) { TRACE("(%p)->(IID_IAsyncBindCtx %p)\n", This, ppv); - *ppv = BINDCTX(This); + *ppv = &This->IBindCtx_iface; } if(*ppv) { @@ -655,7 +656,7 @@ static HRESULT WINAPI AsyncBindCtx_QueryInterface(IBindCtx *iface, REFIID riid, static ULONG WINAPI AsyncBindCtx_AddRef(IBindCtx *iface) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -665,7 +666,7 @@ static ULONG WINAPI AsyncBindCtx_AddRef(IBindCtx *iface) static ULONG WINAPI AsyncBindCtx_Release(IBindCtx *iface) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -680,7 +681,7 @@ static ULONG WINAPI AsyncBindCtx_Release(IBindCtx *iface) static HRESULT WINAPI AsyncBindCtx_RegisterObjectBound(IBindCtx *iface, IUnknown *punk) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%p)\n", This, punk); @@ -689,7 +690,7 @@ static HRESULT WINAPI AsyncBindCtx_RegisterObjectBound(IBindCtx *iface, IUnknown static HRESULT WINAPI AsyncBindCtx_RevokeObjectBound(IBindCtx *iface, IUnknown *punk) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p %p)\n", This, punk); @@ -698,7 +699,7 @@ static HRESULT WINAPI AsyncBindCtx_RevokeObjectBound(IBindCtx *iface, IUnknown * static HRESULT WINAPI AsyncBindCtx_ReleaseBoundObjects(IBindCtx *iface) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)\n", This); @@ -707,7 +708,7 @@ static HRESULT WINAPI AsyncBindCtx_ReleaseBoundObjects(IBindCtx *iface) static HRESULT WINAPI AsyncBindCtx_SetBindOptions(IBindCtx *iface, BIND_OPTS *pbindopts) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%p)\n", This, pbindopts); @@ -716,7 +717,7 @@ static HRESULT WINAPI AsyncBindCtx_SetBindOptions(IBindCtx *iface, BIND_OPTS *pb static HRESULT WINAPI AsyncBindCtx_GetBindOptions(IBindCtx *iface, BIND_OPTS *pbindopts) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%p)\n", This, pbindopts); @@ -725,7 +726,7 @@ static HRESULT WINAPI AsyncBindCtx_GetBindOptions(IBindCtx *iface, BIND_OPTS *pb static HRESULT WINAPI AsyncBindCtx_GetRunningObjectTable(IBindCtx *iface, IRunningObjectTable **pprot) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%p)\n", This, pprot); @@ -734,7 +735,7 @@ static HRESULT WINAPI AsyncBindCtx_GetRunningObjectTable(IBindCtx *iface, IRunni static HRESULT WINAPI AsyncBindCtx_RegisterObjectParam(IBindCtx *iface, LPOLESTR pszkey, IUnknown *punk) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_w(pszkey), punk); @@ -743,7 +744,7 @@ static HRESULT WINAPI AsyncBindCtx_RegisterObjectParam(IBindCtx *iface, LPOLESTR static HRESULT WINAPI AsyncBindCtx_GetObjectParam(IBindCtx* iface, LPOLESTR pszkey, IUnknown **punk) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_w(pszkey), punk); @@ -752,7 +753,7 @@ static HRESULT WINAPI AsyncBindCtx_GetObjectParam(IBindCtx* iface, LPOLESTR pszk static HRESULT WINAPI AsyncBindCtx_RevokeObjectParam(IBindCtx *iface, LPOLESTR pszkey) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(pszkey)); @@ -761,15 +762,13 @@ static HRESULT WINAPI AsyncBindCtx_RevokeObjectParam(IBindCtx *iface, LPOLESTR p static HRESULT WINAPI AsyncBindCtx_EnumObjectParam(IBindCtx *iface, IEnumString **pszkey) { - AsyncBindCtx *This = BINDCTX_THIS(iface); + AsyncBindCtx *This = impl_from_IBindCtx(iface); TRACE("(%p)->(%p)\n", This, pszkey); return IBindCtx_EnumObjectParam(This->bindctx, pszkey); } -#undef BINDCTX_THIS - static const IBindCtxVtbl AsyncBindCtxVtbl = { AsyncBindCtx_QueryInterface, @@ -876,16 +875,16 @@ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options, ret = heap_alloc(sizeof(AsyncBindCtx)); - ret->lpBindCtxVtbl = &AsyncBindCtxVtbl; + ret->IBindCtx_iface.lpVtbl = &AsyncBindCtxVtbl; ret->ref = 1; ret->bindctx = bindctx; - hres = init_bindctx(BINDCTX(ret), options, callback, format); + hres = init_bindctx(&ret->IBindCtx_iface, options, callback, format); if(FAILED(hres)) { - IBindCtx_Release(BINDCTX(ret)); + IBindCtx_Release(&ret->IBindCtx_iface); return hres; } - *pbind = BINDCTX(ret); + *pbind = &ret->IBindCtx_iface; return S_OK; }
1
0
0
0
Michael Stefaniuc : urlmon: Use ifaces instead of vtbl pointers in BindStatusCallback.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 2f7da964ace233c3b16417c967e34ddf7c70719c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f7da964ace233c3b16417c96…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 11 00:39:48 2011 +0100 urlmon: Use ifaces instead of vtbl pointers in BindStatusCallback. --- dlls/urlmon/bindctx.c | 146 ++++++++++++++++++++++++------------------------- 1 files changed, 72 insertions(+), 74 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2f7da964ace233c3b1641…
1
0
0
0
Michael Stefaniuc : urlmon: Use an iface instead of a vtbl pointer in stgmed_buf_t.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 482740d0208a3eda63022e9dd0ea8d04ed4b3ff4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=482740d0208a3eda63022e9dd…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 11 00:36:45 2011 +0100 urlmon: Use an iface instead of a vtbl pointer in stgmed_buf_t. --- dlls/urlmon/binding.c | 39 +++++++++++++++++++-------------------- 1 files changed, 19 insertions(+), 20 deletions(-) diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index d5664c7..14f11a7 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -28,7 +28,7 @@ static WCHAR cbinding_contextW[] = {'C','B','i','n','d','i','n','g',' ','C','o', static WCHAR bscb_holderW[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; typedef struct { - const IUnknownVtbl *lpUnknownVtbl; + IUnknown IUnknown_iface; LONG ref; @@ -55,8 +55,6 @@ struct _stgmed_obj_t { const stgmed_obj_vtbl *vtbl; }; -#define STGMEDUNK(x) ((IUnknown*) &(x)->lpUnknownVtbl) - typedef enum { BEFORE_DOWNLOAD, DOWNLOADING, @@ -360,19 +358,22 @@ static void cache_file_available(Binding *This, const WCHAR *file_name) } } -#define STGMEDUNK_THIS(iface) DEFINE_THIS(stgmed_buf_t, Unknown, iface) +static inline stgmed_buf_t *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, stgmed_buf_t, IUnknown_iface); +} static HRESULT WINAPI StgMedUnk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { - stgmed_buf_t *This = STGMEDUNK_THIS(iface); + stgmed_buf_t *This = impl_from_IUnknown(iface); *ppv = NULL; if(IsEqualGUID(riid, &IID_IUnknown)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = STGMEDUNK(This); - IUnknown_AddRef(STGMEDUNK(This)); + *ppv = &This->IUnknown_iface; + IUnknown_AddRef(&This->IUnknown_iface); return S_OK; } @@ -382,7 +383,7 @@ static HRESULT WINAPI StgMedUnk_QueryInterface(IUnknown *iface, REFIID riid, voi static ULONG WINAPI StgMedUnk_AddRef(IUnknown *iface) { - stgmed_buf_t *This = STGMEDUNK_THIS(iface); + stgmed_buf_t *This = impl_from_IUnknown(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -392,7 +393,7 @@ static ULONG WINAPI StgMedUnk_AddRef(IUnknown *iface) static ULONG WINAPI StgMedUnk_Release(IUnknown *iface) { - stgmed_buf_t *This = STGMEDUNK_THIS(iface); + stgmed_buf_t *This = impl_from_IUnknown(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -410,8 +411,6 @@ static ULONG WINAPI StgMedUnk_Release(IUnknown *iface) return ref; } -#undef STGMEDUNK_THIS - static const IUnknownVtbl StgMedUnkVtbl = { StgMedUnk_QueryInterface, StgMedUnk_AddRef, @@ -422,7 +421,7 @@ static stgmed_buf_t *create_stgmed_buf(IInternetProtocolEx *protocol) { stgmed_buf_t *ret = heap_alloc(sizeof(*ret)); - ret->lpUnknownVtbl = &StgMedUnkVtbl; + ret->IUnknown_iface.lpVtbl = &StgMedUnkVtbl; ret->ref = 1; ret->size = 0; ret->init = FALSE; @@ -494,7 +493,7 @@ static ULONG WINAPI ProtocolStream_Release(IStream *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) { - IUnknown_Release(STGMEDUNK(This->buf)); + IUnknown_Release(&This->buf->IUnknown_iface); heap_free(This); URLMON_UnlockModule(); @@ -687,7 +686,7 @@ static HRESULT stgmed_stream_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed) stgmed->tymed = TYMED_ISTREAM; stgmed->u.pstm = STREAM(stream); - stgmed->pUnkForRelease = STGMEDUNK(stream->buf); + stgmed->pUnkForRelease = &stream->buf->IUnknown_iface; return S_OK; } @@ -724,7 +723,7 @@ static stgmed_obj_t *create_stgmed_stream(stgmed_buf_t *buf) ret->lpStreamVtbl = &ProtocolStreamVtbl; ret->ref = 1; - IUnknown_AddRef(STGMEDUNK(buf)); + IUnknown_AddRef(&buf->IUnknown_iface); ret->buf = buf; URLMON_LockModule(); @@ -736,7 +735,7 @@ static void stgmed_file_release(stgmed_obj_t *obj) { stgmed_file_obj_t *file_obj = (stgmed_file_obj_t*)obj; - IUnknown_Release(STGMEDUNK(file_obj->buf)); + IUnknown_Release(&file_obj->buf->IUnknown_iface); heap_free(file_obj); } @@ -753,7 +752,7 @@ static HRESULT stgmed_file_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed) stgmed->tymed = TYMED_FILE; stgmed->u.lpszFileName = file_obj->buf->cache_file; - stgmed->pUnkForRelease = STGMEDUNK(file_obj->buf); + stgmed->pUnkForRelease = &file_obj->buf->IUnknown_iface; return S_OK; } @@ -775,7 +774,7 @@ static stgmed_obj_t *create_stgmed_file(stgmed_buf_t *buf) ret->stgmed_obj.vtbl = &stgmed_file_vtbl; - IUnknown_AddRef(STGMEDUNK(buf)); + IUnknown_AddRef(&buf->IUnknown_iface); ret->buf = buf; return &ret->stgmed_obj; @@ -867,7 +866,7 @@ static ULONG WINAPI Binding_Release(IBinding *iface) if(This->service_provider) IServiceProvider_Release(This->service_provider); if(This->stgmed_buf) - IUnknown_Release(STGMEDUNK(This->stgmed_buf)); + IUnknown_Release(&This->stgmed_buf->IUnknown_iface); if(This->stgmed_obj) This->stgmed_obj->vtbl->release(This->stgmed_obj); if(This->obj) @@ -1499,7 +1498,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB if(binding_ctx) { ret->stgmed_buf = binding_ctx->stgmed_buf; - IUnknown_AddRef(STGMEDUNK(ret->stgmed_buf)); + IUnknown_AddRef(&ret->stgmed_buf->IUnknown_iface); ret->clipboard_format = binding_ctx->clipboard_format; }else { ret->stgmed_buf = create_stgmed_buf(PROTOCOLEX(ret->protocol));
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
88
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
Results per page:
10
25
50
100
200