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
April 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
898 discussions
Start a n
N
ew thread
Alex Villacís Lasso : oledb32: Add tests for DBTYPE_I4 to DBTYPE_WSTR/DBTYPE_STR conversion.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: cad15d3a7c519c89c9f8ef7c6ec9d3de825afd1b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cad15d3a7c519c89c9f8ef7c6…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 5 11:39:49 2010 -0500 oledb32: Add tests for DBTYPE_I4 to DBTYPE_WSTR/DBTYPE_STR conversion. --- dlls/oledb32/tests/convert.c | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 115 insertions(+), 0 deletions(-) diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c index eb62e91..f25288e 100644 --- a/dlls/oledb32/tests/convert.c +++ b/dlls/oledb32/tests/convert.c @@ -1002,6 +1002,64 @@ static void test_converttowstr(void) ok(dst[3] == 0, "got %02x\n", dst[3]); ok(dst[4] == 0xcccc, "got %02x\n", dst[4]); + + + *(int *)src = 4321; + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_WSTR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 8, "got %d\n", dst_len); + ok(!lstrcmpW(dst, fourthreetwoone), "got %s\n", wine_dbgstr_w(dst)); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_WSTR, 0, &dst_len, src, dst, 0, 0, &dst_status, 0, 0, 0); + ok(hr == DB_E_ERRORSOCCURRED, "got %08x\n", hr); + ok(dst_status == DBSTATUS_E_DATAOVERFLOW, "got %08x\n", dst_status); + ok(dst_len == 8, "got %d\n", dst_len); + ok(dst[0] == 0xcccc, "got %02x\n", dst[0]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_WSTR, 0, &dst_len, src, NULL, 0, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 8, "got %d\n", dst_len); + ok(dst[0] == 0xcccc, "got %02x\n", dst[0]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_WSTR, 0, &dst_len, src, dst, 4, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 8, "got %d\n", dst_len); + ok(dst[0] == '4', "got %02x\n", dst[0]); + ok(dst[1] == 0, "got %02x\n", dst[1]); + ok(dst[2] == 0xcccc, "got %02x\n", dst[2]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_WSTR, 0, &dst_len, src, dst, 2, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 8, "got %d\n", dst_len); + ok(dst[0] == 0, "got %02x\n", dst[0]); + ok(dst[1] == 0xcccc, "got %02x\n", dst[1]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_WSTR, 0, &dst_len, src, dst, 8, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 8, "got %d\n", dst_len); + ok(dst[0] == '4', "got %02x\n", dst[0]); + ok(dst[1] == '3', "got %02x\n", dst[1]); + ok(dst[2] == '2', "got %02x\n", dst[2]); + ok(dst[3] == 0, "got %02x\n", dst[3]); + ok(dst[4] == 0xcccc, "got %02x\n", dst[4]); + + + b = SysAllocString(ten); *(BSTR *)src = b; hr = IDataConvert_DataConvert(convert, DBTYPE_BSTR, DBTYPE_WSTR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); @@ -1126,6 +1184,63 @@ static void test_converttostr(void) ok(dst[3] == 0, "got %02x\n", dst[3]); ok(dst[4] == (char)0xcc, "got %02x\n", dst[4]); + + *(int *)src = 4321; + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(!lstrcmpA(dst, fourthreetwoone), "got %s\n", dst); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_STR, 0, &dst_len, src, dst, 0, 0, &dst_status, 0, 0, 0); + ok(hr == DB_E_ERRORSOCCURRED, "got %08x\n", hr); + ok(dst_status == DBSTATUS_E_DATAOVERFLOW, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_STR, 0, &dst_len, src, NULL, 0, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_STR, 0, &dst_len, src, dst, 2, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == '4', "got %02x\n", dst[0]); + ok(dst[1] == 0, "got %02x\n", dst[1]); + ok(dst[2] == (char)0xcc, "got %02x\n", dst[2]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_STR, 0, &dst_len, src, dst, 1, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == 0, "got %02x\n", dst[0]); + ok(dst[1] == (char)0xcc, "got %02x\n", dst[1]); + + *(int *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_STR, 0, &dst_len, src, dst, 4, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == '4', "got %02x\n", dst[0]); + ok(dst[1] == '3', "got %02x\n", dst[1]); + ok(dst[2] == '2', "got %02x\n", dst[2]); + ok(dst[3] == 0, "got %02x\n", dst[3]); + ok(dst[4] == (char)0xcc, "got %02x\n", dst[4]); + + + b = SysAllocString(ten); *(BSTR *)src = b; memset(dst, 0xcc, sizeof(dst));
1
0
0
0
Alex Villacís Lasso : oledb32: Implemented OLEDB32 conversion to DBTYPE_STR.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: 5f236f1a5c25820f1a7d25c6664e96e2e054aae2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f236f1a5c25820f1a7d25c66…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 5 11:39:08 2010 -0500 oledb32: Implemented OLEDB32 conversion to DBTYPE_STR. --- dlls/oledb32/convert.c | 32 ++++++++++++++++++++++++++++++++ dlls/oledb32/tests/convert.c | 32 +++----------------------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c index 27ff585..4f2c303 100644 --- a/dlls/oledb32/convert.c +++ b/dlls/oledb32/convert.c @@ -136,6 +136,7 @@ static int get_length(DBTYPE type) case DBTYPE_GUID: return sizeof(GUID); case DBTYPE_WSTR: + case DBTYPE_STR: case DBTYPE_BYREF | DBTYPE_WSTR: return 0; default: @@ -473,6 +474,37 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, SysFreeString(b); return hr; } + case DBTYPE_STR: + { + BSTR b; + DBLENGTH bstr_len; + INT bytes_to_copy; + hr = IDataConvert_DataConvert(iface, src_type, DBTYPE_BSTR, src_len, &bstr_len, + src, &b, sizeof(BSTR), src_status, dst_status, + precision, scale, flags); + if(hr != S_OK) return hr; + bstr_len = SysStringLen(b); + *dst_len = bstr_len * sizeof(char); /* Doesn't include size for '\0' */ + *dst_status = DBSTATUS_S_OK; + bytes_to_copy = min(*dst_len + sizeof(char), dst_max_len); + if(dst) + { + if(bytes_to_copy >= sizeof(char)) + { + WideCharToMultiByte(CP_ACP, 0, b, bytes_to_copy - sizeof(char), dst, dst_max_len, NULL, NULL); + *((char *)dst + bytes_to_copy / sizeof(char) - 1) = 0; + if(bytes_to_copy < *dst_len + sizeof(char)) + *dst_status = DBSTATUS_S_TRUNCATED; + } + else + { + *dst_status = DBSTATUS_E_DATAOVERFLOW; + hr = DB_E_ERRORSOCCURRED; + } + } + SysFreeString(b); + return hr; + } case DBTYPE_BYREF | DBTYPE_WSTR: { diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c index e20d619..eb62e91 100644 --- a/dlls/oledb32/tests/convert.c +++ b/dlls/oledb32/tests/convert.c @@ -1059,10 +1059,10 @@ static void test_converttostr(void) memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_EMPTY, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine ok(hr == S_OK, "got %08x\n", hr); - todo_wine ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 0, "got %d\n", dst_len); - todo_wine ok(dst[0] == 0, "got %02x\n", dst[0]); + ok(dst[0] == 0, "got %02x\n", dst[0]); ok(dst[1] == (char)0xcc, "got %02x\n", dst[1]); memset(dst, 0xcc, sizeof(dst)); @@ -1074,60 +1074,49 @@ static void test_converttostr(void) *(short *)src = 4321; hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); ok(!lstrcmpA(dst, fourthreetwoone), "got %s\n", dst); - } *(short *)src = 4321; memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 0, 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == DB_E_ERRORSOCCURRED, "got %08x\n", hr); ok(dst_status == DBSTATUS_E_DATAOVERFLOW, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); - } ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); *(short *)src = 4321; memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, NULL, 0, 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); - } ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); *(short *)src = 4321; memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 2, 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); ok(dst[0] == '4', "got %02x\n", dst[0]); ok(dst[1] == 0, "got %02x\n", dst[1]); - } ok(dst[2] == (char)0xcc, "got %02x\n", dst[2]); *(short *)src = 4321; memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 1, 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); ok(dst[0] == 0, "got %02x\n", dst[0]); - } ok(dst[1] == (char)0xcc, "got %02x\n", dst[1]); *(short *)src = 4321; memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 4, 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); @@ -1135,84 +1124,69 @@ static void test_converttostr(void) ok(dst[1] == '3', "got %02x\n", dst[1]); ok(dst[2] == '2', "got %02x\n", dst[2]); ok(dst[3] == 0, "got %02x\n", dst[3]); - } ok(dst[4] == (char)0xcc, "got %02x\n", dst[4]); b = SysAllocString(ten); *(BSTR *)src = b; memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_BSTR, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 2, "got %d\n", dst_len); ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); - } SysFreeString(b); memcpy(src, ten, sizeof(ten)); memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR, 2, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 1, "got %d\n", dst_len); ok(dst[0] == '1', "got %02x\n", dst[0]); ok(dst[1] == 0, "got %02x\n", dst[1]); - } memcpy(src, ten, sizeof(ten)); memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR, 4, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 2, "got %d\n", dst_len); ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); - } memcpy(src, ten, sizeof(ten)); memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, DBDATACONVERT_LENGTHFROMNTS); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 2, "got %d\n", dst_len); ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); - } memcpy(src, ten_a, sizeof(ten_a)); memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_STR, DBTYPE_STR, 2, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 2, "got %d\n", dst_len); ok(dst[0] == '1', "got %02x\n", dst[0]); ok(dst[1] == '0', "got %02x\n", dst[1]); ok(dst[2] == 0, "got %02x\n", dst[2]); - } ok(dst[3] == (char)0xcc, "got %02x\n", dst[3]); memcpy(src, ten_a, sizeof(ten_a)); memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_STR, DBTYPE_STR, 4, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 4, "got %d\n", dst_len); ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); - } memcpy(src, ten_a, sizeof(ten_a)); memset(dst, 0xcc, sizeof(dst)); hr = IDataConvert_DataConvert(convert, DBTYPE_STR, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, DBDATACONVERT_LENGTHFROMNTS); - todo_wine { ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == 2, "got %d\n", dst_len); ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); - } IDataConvert_Release(convert); }
1
0
0
0
Alex Villacís Lasso : oledb32: Tests for OLEDB32 conversion to DBTYPE_STR, marked as todo_wine.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: ac408708bc060418ad05cecf9de13caeb4882c08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac408708bc060418ad05cecf9…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Apr 5 11:38:16 2010 -0500 oledb32: Tests for OLEDB32 conversion to DBTYPE_STR, marked as todo_wine. --- dlls/oledb32/tests/convert.c | 182 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 182 insertions(+), 0 deletions(-) diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c index 1f7ca08..e20d619 100644 --- a/dlls/oledb32/tests/convert.c +++ b/dlls/oledb32/tests/convert.c @@ -1036,6 +1036,187 @@ static void test_converttowstr(void) IDataConvert_Release(convert); } +static void test_converttostr(void) +{ + IDataConvert *convert; + HRESULT hr; + char dst[100]; + BYTE src[64]; + DBSTATUS dst_status; + DBLENGTH dst_len; + static const WCHAR ten[] = {'1','0',0}; + static const char ten_a[] = "10"; + static const char fourthreetwoone[] = "4321"; + BSTR b; + + hr = CoCreateInstance(&CLSID_OLEDB_CONVERSIONLIBRARY, NULL, CLSCTX_INPROC_SERVER, &IID_IDataConvert, (void**)&convert); + if(FAILED(hr)) + { + win_skip("Unable to load oledb conversion library\n"); + return; + } + + + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_EMPTY, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine ok(hr == S_OK, "got %08x\n", hr); + todo_wine ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 0, "got %d\n", dst_len); + todo_wine ok(dst[0] == 0, "got %02x\n", dst[0]); + ok(dst[1] == (char)0xcc, "got %02x\n", dst[1]); + + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_NULL, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == DB_E_UNSUPPORTEDCONVERSION, "got %08x\n", hr); + ok(dst_status == DBSTATUS_E_BADACCESSOR, "got %08x\n", dst_status); + ok(dst_len == 0, "got %d\n", dst_len); + ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); + + *(short *)src = 4321; + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(!lstrcmpA(dst, fourthreetwoone), "got %s\n", dst); + } + + *(short *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 0, 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == DB_E_ERRORSOCCURRED, "got %08x\n", hr); + ok(dst_status == DBSTATUS_E_DATAOVERFLOW, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + } + ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); + + *(short *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, NULL, 0, 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + } + ok(dst[0] == (char)0xcc, "got %02x\n", dst[0]); + + *(short *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 2, 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == '4', "got %02x\n", dst[0]); + ok(dst[1] == 0, "got %02x\n", dst[1]); + } + ok(dst[2] == (char)0xcc, "got %02x\n", dst[2]); + + *(short *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 1, 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == 0, "got %02x\n", dst[0]); + } + ok(dst[1] == (char)0xcc, "got %02x\n", dst[1]); + + *(short *)src = 4321; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR, 0, &dst_len, src, dst, 4, 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_TRUNCATED, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(dst[0] == '4', "got %02x\n", dst[0]); + ok(dst[1] == '3', "got %02x\n", dst[1]); + ok(dst[2] == '2', "got %02x\n", dst[2]); + ok(dst[3] == 0, "got %02x\n", dst[3]); + } + ok(dst[4] == (char)0xcc, "got %02x\n", dst[4]); + + b = SysAllocString(ten); + *(BSTR *)src = b; + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_BSTR, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %d\n", dst_len); + ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); + } + SysFreeString(b); + + memcpy(src, ten, sizeof(ten)); + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR, 2, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 1, "got %d\n", dst_len); + ok(dst[0] == '1', "got %02x\n", dst[0]); + ok(dst[1] == 0, "got %02x\n", dst[1]); + } + + memcpy(src, ten, sizeof(ten)); + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR, 4, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %d\n", dst_len); + ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); + } + + memcpy(src, ten, sizeof(ten)); + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, DBDATACONVERT_LENGTHFROMNTS); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %d\n", dst_len); + ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); + } + + memcpy(src, ten_a, sizeof(ten_a)); + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_STR, DBTYPE_STR, 2, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %d\n", dst_len); + ok(dst[0] == '1', "got %02x\n", dst[0]); + ok(dst[1] == '0', "got %02x\n", dst[1]); + ok(dst[2] == 0, "got %02x\n", dst[2]); + } + ok(dst[3] == (char)0xcc, "got %02x\n", dst[3]); + + memcpy(src, ten_a, sizeof(ten_a)); + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_STR, DBTYPE_STR, 4, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %d\n", dst_len); + ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); + } + + memcpy(src, ten_a, sizeof(ten_a)); + memset(dst, 0xcc, sizeof(dst)); + hr = IDataConvert_DataConvert(convert, DBTYPE_STR, DBTYPE_STR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, DBDATACONVERT_LENGTHFROMNTS); + todo_wine { + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %d\n", dst_len); + ok(!lstrcmpA(ten_a, dst), "got %s\n", dst); + } + + IDataConvert_Release(convert); +} + static void test_converttobyrefwstr(void) { IDataConvert *convert; @@ -1468,6 +1649,7 @@ START_TEST(convert) test_canconvert(); test_converttoi2(); test_converttoi4(); + test_converttostr(); test_converttobstr(); test_converttowstr(); test_converttobyrefwstr();
1
0
0
0
Alexandre Julliard : rpcrt4: Add support for complex arrays in the generic array unmarshalling functions .
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: fe2f875aafea660527a10a81b1d06a44c9fc6f23 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fe2f875aafea660527a10a81b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 22:02:20 2010 +0200 rpcrt4: Add support for complex arrays in the generic array unmarshalling functions. --- dlls/rpcrt4/ndr_marshall.c | 132 +++++++++++++++++++++++++++----------------- 1 files changed, 82 insertions(+), 50 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index d28bf62..24c7dbc 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -27,6 +27,7 @@ * - Checks for integer addition overflow in user marshall functions */ +#include <assert.h> #include <stdarg.h> #include <stdio.h> #include <string.h> @@ -2046,7 +2047,8 @@ static inline void array_write_variance_and_marshall( static inline ULONG array_read_conformance( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { - DWORD esize; + DWORD def, esize; + unsigned char alignment; switch (fc) { @@ -2070,6 +2072,21 @@ static inline ULONG array_read_conformance( else ReadConformance(pStubMsg, NULL); return safe_multiply(esize, pStubMsg->MaxCount); + case RPC_FC_BOGUS_ARRAY: + alignment = pFormat[1] + 1; + def = *(const WORD *)(pFormat + 2); + pFormat += 4; + if (IsConformanceOrVariancePresent(pFormat)) pFormat = ReadConformance(pStubMsg, pFormat); + else + { + pStubMsg->MaxCount = def; + pFormat = SkipConformance( pStubMsg, pFormat ); + } + pFormat = SkipVariance( pStubMsg, pFormat ); + + align_pointer(&pStubMsg->Buffer, alignment); + esize = ComplexStructSize(pStubMsg, pFormat); + return safe_multiply(pStubMsg->MaxCount, esize); default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -2084,8 +2101,8 @@ static inline ULONG array_read_variance_and_unmarshall( ULONG bufsize, memsize; WORD esize; unsigned char alignment; - unsigned char *saved_buffer; - ULONG offset; + unsigned char *saved_buffer, *pMemory; + ULONG i, offset, count; switch (fc) { @@ -2204,6 +2221,31 @@ static inline ULONG array_read_variance_and_unmarshall( TRACE("string=%s\n", debugstr_w((LPWSTR)*ppMemory)); } return bufsize; + + case RPC_FC_BOGUS_ARRAY: + alignment = pFormat[1] + 1; + pFormat = SkipConformance(pStubMsg, pFormat + 4); + pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount); + + esize = ComplexStructSize(pStubMsg, pFormat); + memsize = safe_multiply(esize, pStubMsg->MaxCount); + + assert( fUnmarshall ); + + if (!fMustAlloc && !*ppMemory) + fMustAlloc = TRUE; + if (fMustAlloc) + *ppMemory = NdrAllocate(pStubMsg, memsize); + + align_pointer(&pStubMsg->Buffer, alignment); + saved_buffer = pStubMsg->Buffer; + + pMemory = *ppMemory; + count = pStubMsg->ActualCount; + for (i = 0; i < count; i++) + pMemory = ComplexUnmarshall(pStubMsg, pMemory, pFormat, NULL, fMustAlloc); + return pStubMsg->Buffer - saved_buffer; + default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -2214,6 +2256,7 @@ static inline void array_memory_size( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, unsigned char fHasPointers) { + ULONG i, count, SavedMemorySize; ULONG bufsize, memsize; DWORD esize; unsigned char alignment; @@ -2286,6 +2329,24 @@ static inline void array_memory_size( safe_buffer_increment(pStubMsg, bufsize); pStubMsg->MemorySize += memsize; break; + case RPC_FC_BOGUS_ARRAY: + alignment = pFormat[1] + 1; + pFormat = SkipConformance(pStubMsg, pFormat + 4); + pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount); + + align_pointer(&pStubMsg->Buffer, alignment); + + SavedMemorySize = pStubMsg->MemorySize; + + esize = ComplexStructSize(pStubMsg, pFormat); + memsize = safe_multiply(pStubMsg->MaxCount, esize); + + count = pStubMsg->ActualCount; + for (i = 0; i < count; i++) + ComplexStructMemorySize(pStubMsg, pFormat, NULL); + + pStubMsg->MemorySize = SavedMemorySize + memsize; + break; default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -2296,6 +2357,8 @@ static inline void array_free( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, unsigned char fHasPointers) { + DWORD i, count; + switch (fc) { case RPC_FC_CARRAY: @@ -2313,6 +2376,15 @@ static inline void array_free( case RPC_FC_C_WSTRING: /* No embedded pointers so nothing to do */ break; + case RPC_FC_BOGUS_ARRAY: + count = *(const WORD *)(pFormat + 2); + pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, count); + pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount); + + count = pStubMsg->ActualCount; + for (i = 0; i < count; i++) + pMemory = ComplexFree(pStubMsg, pMemory, pFormat, NULL); + break; default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -4048,9 +4120,7 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, unsigned char fMustAlloc) { - ULONG i, count, size; - unsigned char alignment; - unsigned char *pMemory; + ULONG size; unsigned char *saved_buffer; int pointer_buffer_mark_set = 0; int saved_ignore_embedded; @@ -4064,8 +4134,6 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, return NULL; } - alignment = pFormat[1] + 1; - saved_ignore_embedded = pStubMsg->IgnoreEmbeddedPointers; /* save buffer pointer */ saved_buffer = pStubMsg->Buffer; @@ -4087,22 +4155,9 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, /* restore the original buffer */ pStubMsg->Buffer = saved_buffer; - pFormat += 4; - - pFormat = ReadConformance(pStubMsg, pFormat); - pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount); - - if (!fMustAlloc && !*ppMemory) - fMustAlloc = TRUE; - if (fMustAlloc) - *ppMemory = NdrAllocate(pStubMsg, size); - - align_pointer(&pStubMsg->Buffer, alignment); - - pMemory = *ppMemory; - count = pStubMsg->ActualCount; - for (i = 0; i < count; i++) - pMemory = ComplexUnmarshall(pStubMsg, pMemory, pFormat, NULL, fMustAlloc); + array_read_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pFormat); + array_read_variance_and_unmarshall(RPC_FC_BOGUS_ARRAY, pStubMsg, ppMemory, pFormat, fMustAlloc, + TRUE /* fUseBufferMemoryServer */, TRUE /* fUnmarshall */); if (pointer_buffer_mark_set) { @@ -4174,9 +4229,6 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, ULONG WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { - ULONG i, count, esize, SavedMemorySize, MemorySize; - unsigned char alignment; - TRACE("(%p,%p)\n", pStubMsg, pFormat); if (pFormat[0] != RPC_FC_BOGUS_ARRAY) @@ -4186,29 +4238,9 @@ ULONG WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg, return 0; } - alignment = pFormat[1] + 1; - - pFormat += 4; - - pFormat = ReadConformance(pStubMsg, pFormat); - pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount); - - align_pointer(&pStubMsg->Buffer, alignment); - - SavedMemorySize = pStubMsg->MemorySize; - - esize = ComplexStructSize(pStubMsg, pFormat); - - MemorySize = safe_multiply(pStubMsg->MaxCount, esize); - - count = pStubMsg->ActualCount; - for (i = 0; i < count; i++) - ComplexStructMemorySize(pStubMsg, pFormat, NULL); - - pStubMsg->MemorySize = SavedMemorySize; - - pStubMsg->MemorySize += MemorySize; - return MemorySize; + array_read_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pFormat); + array_memory_size(RPC_FC_BOGUS_ARRAY, pStubMsg, pFormat, TRUE /* fHasPointers */); + return pStubMsg->MemorySize; } /***********************************************************************
1
0
0
0
Alexandre Julliard : rpcrt4: Add support for complex arrays in the generic array marshalling functions.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: 3243ee7e0b2703619944535a0eef5f1163863a2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3243ee7e0b2703619944535a0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 22:01:46 2010 +0200 rpcrt4: Add support for complex arrays in the generic array marshalling functions. --- dlls/rpcrt4/ndr_marshall.c | 121 ++++++++++++++++++++++++++------------------ 1 files changed, 72 insertions(+), 49 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 80020ee..d28bf62 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -139,6 +139,27 @@ static void WINAPI NdrRangeFree(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STR static ULONG WINAPI NdrByteCountPointerMemorySize(PMIDL_STUB_MESSAGE, PFORMAT_STRING); +static unsigned char * ComplexBufferSize(PMIDL_STUB_MESSAGE pStubMsg, + unsigned char *pMemory, + PFORMAT_STRING pFormat, + PFORMAT_STRING pPointer); +static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, + unsigned char *pMemory, + PFORMAT_STRING pFormat, + PFORMAT_STRING pPointer); +static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, + unsigned char *pMemory, + PFORMAT_STRING pFormat, + PFORMAT_STRING pPointer, + unsigned char fMustAlloc); +static ULONG ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, + PFORMAT_STRING pFormat, + PFORMAT_STRING pPointer); +static unsigned char * ComplexFree(PMIDL_STUB_MESSAGE pStubMsg, + unsigned char *pMemory, + PFORMAT_STRING pFormat, + PFORMAT_STRING pPointer); + const NDR_MARSHALL NdrMarshaller[NDR_TABLE_SIZE] = { 0, NdrBaseTypeMarshall, NdrBaseTypeMarshall, NdrBaseTypeMarshall, @@ -1777,6 +1798,8 @@ static inline void array_compute_and_size_conformance( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat) { + DWORD count; + switch (fc) { case RPC_FC_CARRAY: @@ -1808,6 +1831,13 @@ static inline void array_compute_and_size_conformance( SizeConformance(pStubMsg); break; + case RPC_FC_BOGUS_ARRAY: + count = *(const WORD *)(pFormat + 2); + pFormat += 4; + if (IsConformanceOrVariancePresent(pFormat)) SizeConformance(pStubMsg); + pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, count); + pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount); + break; default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -1818,7 +1848,7 @@ static inline void array_buffer_size( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, unsigned char fHasPointers) { - DWORD size; + DWORD i, size; DWORD esize; unsigned char alignment; @@ -1868,6 +1898,18 @@ static inline void array_buffer_size( size = safe_multiply(esize, pStubMsg->ActualCount); safe_buffer_length_increment(pStubMsg, size); break; + case RPC_FC_BOGUS_ARRAY: + alignment = pFormat[1] + 1; + pFormat = SkipConformance(pStubMsg, pFormat + 4); + if (IsConformanceOrVariancePresent(pFormat)) SizeVariance(pStubMsg); + pFormat = SkipVariance(pStubMsg, pFormat); + + align_length(&pStubMsg->BufferLength, alignment); + + size = pStubMsg->ActualCount; + for (i = 0; i < size; i++) + pMemory = ComplexBufferSize(pStubMsg, pMemory, pFormat, NULL); + break; default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -1878,6 +1920,9 @@ static inline void array_compute_and_write_conformance( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat) { + ULONG def; + BOOL conformance_present; + switch (fc) { case RPC_FC_CARRAY: @@ -1908,6 +1953,14 @@ static inline void array_compute_and_write_conformance( pStubMsg->Offset = 0; WriteConformance(pStubMsg); break; + case RPC_FC_BOGUS_ARRAY: + def = *(const WORD *)(pFormat + 2); + pFormat += 4; + conformance_present = IsConformanceOrVariancePresent(pFormat); + pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def); + pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount); + if (conformance_present) WriteConformance(pStubMsg); + break; default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -1918,7 +1971,7 @@ static inline void array_write_variance_and_marshall( unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, unsigned char fHasPointers) { - DWORD size; + DWORD i, size; DWORD esize; unsigned char alignment; @@ -1972,6 +2025,18 @@ static inline void array_write_variance_and_marshall( size = safe_multiply(esize, pStubMsg->ActualCount); safe_copy_to_buffer(pStubMsg, pMemory, size); /* the string itself */ break; + case RPC_FC_BOGUS_ARRAY: + alignment = pFormat[1] + 1; + pFormat = SkipConformance(pStubMsg, pFormat + 4); + if (IsConformanceOrVariancePresent(pFormat)) WriteVariance(pStubMsg); + pFormat = SkipVariance(pStubMsg, pFormat); + + align_pointer_clear(&pStubMsg->Buffer, alignment); + + size = pStubMsg->ActualCount; + for (i = 0; i < size; i++) + pMemory = ComplexMarshall(pStubMsg, pMemory, pFormat, NULL); + break; default: ERR("unknown array format 0x%x\n", fc); RpcRaiseException(RPC_X_BAD_STUB_DATA); @@ -3920,9 +3985,6 @@ unsigned char * WINAPI NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat) { - ULONG i, count, def; - BOOL variance_present; - unsigned char alignment; int pointer_buffer_mark_set = 0; TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); @@ -3934,8 +3996,6 @@ unsigned char * WINAPI NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg, return NULL; } - alignment = pFormat[1] + 1; - if (!pStubMsg->PointerBufferMark) { /* save buffer fields that may be changed by buffer sizer functions @@ -3965,25 +4025,9 @@ unsigned char * WINAPI NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->BufferLength = saved_buffer_length; } - def = *(const WORD*)&pFormat[2]; - pFormat += 4; - - pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def); - TRACE("conformance = %ld\n", pStubMsg->MaxCount); - - variance_present = IsConformanceOrVariancePresent(pFormat); - pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount); - TRACE("variance = %d\n", pStubMsg->ActualCount); - - WriteConformance(pStubMsg); - if (variance_present) - WriteVariance(pStubMsg); - - align_pointer_clear(&pStubMsg->Buffer, alignment); - - count = pStubMsg->ActualCount; - for (i = 0; i < count; i++) - pMemory = ComplexMarshall(pStubMsg, pMemory, pFormat, NULL); + array_compute_and_write_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat); + array_write_variance_and_marshall(RPC_FC_BOGUS_ARRAY, pStubMsg, + pMemory, pFormat, TRUE /* fHasPointers */); STD_OVERFLOW_CHECK(pStubMsg); @@ -4076,9 +4120,6 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat) { - ULONG i, count, def; - unsigned char alignment; - BOOL variance_present; int pointer_length_set = 0; TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); @@ -4090,8 +4131,6 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, return; } - alignment = pFormat[1] + 1; - if (!pStubMsg->IgnoreEmbeddedPointers && !pStubMsg->PointerLength) { /* save buffer fields that may be changed by buffer sizer functions @@ -4118,25 +4157,9 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->MaxCount = saved_max_count; pStubMsg->BufferLength = saved_buffer_length; } - def = *(const WORD*)&pFormat[2]; - pFormat += 4; - - pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def); - TRACE("conformance = %ld\n", pStubMsg->MaxCount); - SizeConformance(pStubMsg); - variance_present = IsConformanceOrVariancePresent(pFormat); - pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount); - TRACE("variance = %d\n", pStubMsg->ActualCount); - - if (variance_present) - SizeVariance(pStubMsg); - - align_length(&pStubMsg->BufferLength, alignment); - - count = pStubMsg->ActualCount; - for (i = 0; i < count; i++) - pMemory = ComplexBufferSize(pStubMsg, pMemory, pFormat, NULL); + array_compute_and_size_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat); + array_buffer_size(RPC_FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); if(pointer_length_set) {
1
0
0
0
Alexandre Julliard : rpcrt4: Always skip the conformance format, even if conformance is not present in the buffer.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: c1a9dc8ad22a5ca8b977b111850ffc7a914315fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c1a9dc8ad22a5ca8b977b1118…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 21:59:30 2010 +0200 rpcrt4: Always skip the conformance format, even if conformance is not present in the buffer. Add an identical SkipVariance function to make the code clearer. --- dlls/rpcrt4/ndr_marshall.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 3b5a340..80020ee 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -644,14 +644,16 @@ finish_conf: static inline PFORMAT_STRING SkipConformance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { - if (IsConformanceOrVariancePresent(pFormat)) - { if (pStubMsg->fHasNewCorrDesc) pFormat += 6; else pFormat += 4; - } - return pFormat; + return pFormat; +} + +static inline PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) +{ + return SkipConformance( pStubMsg, pFormat ); } /* multiply two numbers together, raising an RPC_S_INVALID_BOUND exception if @@ -1842,7 +1844,7 @@ static inline void array_buffer_size( alignment = pFormat[1] + 1; pFormat = SkipConformance(pStubMsg, pFormat + 4); - pFormat = SkipConformance(pStubMsg, pFormat); + pFormat = SkipVariance(pStubMsg, pFormat); SizeVariance(pStubMsg); @@ -1942,10 +1944,8 @@ static inline void array_write_variance_and_marshall( esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1; - /* conformance */ pFormat = SkipConformance(pStubMsg, pFormat + 4); - /* variance */ - pFormat = SkipConformance(pStubMsg, pFormat); + pFormat = SkipVariance(pStubMsg, pFormat); WriteVariance(pStubMsg);
1
0
0
0
Alexandre Julliard : rpcrt4: Fix tracing of non-conformant strings.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: 5728d6b402c7f5697e82573f19313b9b2e30073d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5728d6b402c7f5697e82573f1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 21:58:06 2010 +0200 rpcrt4: Fix tracing of non-conformant strings. --- dlls/rpcrt4/ndr_marshall.c | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index ac72055..3b5a340 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -2405,20 +2405,18 @@ unsigned char * WINAPI NdrNonConformantStringMarshall(PMIDL_STUB_MESSAGE pStubM if (*pFormat == RPC_FC_CSTRING) { - ULONG i; + ULONG i = 0; const char *str = (const char *)pMemory; - for (i = 0; i < maxsize && *str; i++, str++) - ; + while (i < maxsize && str[i]) i++; TRACE("string=%s\n", debugstr_an(str, i)); pStubMsg->ActualCount = i + 1; esize = 1; } else if (*pFormat == RPC_FC_WSTRING) { - ULONG i; + ULONG i = 0; const WCHAR *str = (const WCHAR *)pMemory; - for (i = 0; i < maxsize && *str; i++, str++) - ; + while (i < maxsize && str[i]) i++; TRACE("string=%s\n", debugstr_wn(str, i)); pStubMsg->ActualCount = i + 1; esize = 2; @@ -2507,20 +2505,18 @@ void WINAPI NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, if (*pFormat == RPC_FC_CSTRING) { - ULONG i; + ULONG i = 0; const char *str = (const char *)pMemory; - for (i = 0; i < maxsize && *str; i++, str++) - ; + while (i < maxsize && str[i]) i++; TRACE("string=%s\n", debugstr_an(str, i)); pStubMsg->ActualCount = i + 1; esize = 1; } else if (*pFormat == RPC_FC_WSTRING) { - ULONG i; + ULONG i = 0; const WCHAR *str = (const WCHAR *)pMemory; - for (i = 0; i < maxsize && *str; i++, str++) - ; + while (i < maxsize && str[i]) i++; TRACE("string=%s\n", debugstr_wn(str, i)); pStubMsg->ActualCount = i + 1; esize = 2;
1
0
0
0
Alexandre Julliard : widl: Alignment for complex arrays and structs is the buffer alignment, not the memory one.
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: 1707c1c5cb6290560b16f4f6b2e5e8c09377d69e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1707c1c5cb6290560b16f4f6b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 20:05:05 2010 +0200 widl: Alignment for complex arrays and structs is the buffer alignment, not the memory one. --- tools/widl/typegen.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 102 insertions(+), 7 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index c3cfdc0..9e85fa0 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1344,6 +1344,100 @@ unsigned int type_memsize(const type_t *t) return type_memsize_and_alignment( t, &align ); } +static unsigned int type_buffer_alignment(const type_t *t) +{ + const var_list_t *fields; + const var_t *var; + unsigned int max = 0, align; + + switch (type_get_type(t)) + { + case TYPE_BASIC: + switch (get_basic_fc(t)) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_USMALL: + case RPC_FC_SMALL: + return 1; + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + return 2; + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_ERROR_STATUS_T: + case RPC_FC_FLOAT: + case RPC_FC_INT3264: + case RPC_FC_UINT3264: + return 4; + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + return 8; + default: + error("type_buffer_alignment: Unknown type 0x%x\n", get_basic_fc(t)); + } + break; + case TYPE_ENUM: + switch (get_enum_fc(t)) + { + case RPC_FC_ENUM16: + return 2; + case RPC_FC_ENUM32: + return 4; + default: + error("type_buffer_alignment: Unknown enum type\n"); + } + break; + case TYPE_STRUCT: + if (!(fields = type_struct_get_fields(t))) break; + LIST_FOR_EACH_ENTRY( var, fields, const var_t, entry ) + { + if (!var->type) continue; + align = type_buffer_alignment( var->type ); + if (max < align) max = align; + } + break; + case TYPE_ENCAPSULATED_UNION: + if (!(fields = type_encapsulated_union_get_fields(t))) break; + LIST_FOR_EACH_ENTRY( var, fields, const var_t, entry ) + { + if (!var->type) continue; + align = type_buffer_alignment( var->type ); + if (max < align) max = align; + } + break; + case TYPE_UNION: + if (!(fields = type_union_get_cases(t))) break; + LIST_FOR_EACH_ENTRY( var, fields, const var_t, entry ) + { + if (!var->type) continue; + align = type_buffer_alignment( var->type ); + if (max < align) max = align; + } + break; + case TYPE_ARRAY: + if (!type_array_is_decl_as_ptr(t)) + return type_buffer_alignment( type_array_get_element(t) ); + /* else fall through */ + case TYPE_POINTER: + return 4; + case TYPE_INTERFACE: + case TYPE_ALIAS: + case TYPE_VOID: + case TYPE_COCLASS: + case TYPE_MODULE: + case TYPE_FUNCTION: + case TYPE_BITFIELD: + /* these types should not be encountered here due to language + * restrictions (interface, void, coclass, module), logical + * restrictions (alias - due to type_get_type call above) or + * checking restrictions (function, bitfield). */ + assert(0); + } + return max; +} + int is_full_pointer_function(const var_t *func) { const var_t *var; @@ -1511,10 +1605,10 @@ static int user_type_has_variable_size(const type_t *t) static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff) { unsigned int start, absoff, flags; - unsigned int ualign = 0; const char *name = NULL; type_t *utype = get_user_type(type, &name); - unsigned int usize = type_memsize_and_alignment(utype, &ualign); + unsigned int usize = type_memsize(utype); + unsigned int ualign = type_buffer_alignment(utype); unsigned int size = type_memsize(type); unsigned short funoff = user_type_offset(name); short reloff; @@ -2168,7 +2262,7 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t { const expr_t *length_is = type_array_get_variance(type); const expr_t *size_is = type_array_get_conformance(type); - unsigned int align = 0; + unsigned int align; unsigned int size; unsigned int start_offset; unsigned char fc; @@ -2183,8 +2277,8 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); - align = 0; - size = type_memsize_and_alignment((is_conformant_array(type) ? type_array_get_element(type) : type), &align); + size = type_memsize(is_conformant_array(type) ? type_array_get_element(type) : type); + align = type_buffer_alignment(is_conformant_array(type) ? type_array_get_element(type) : type); fc = get_array_fc(type); start_offset = *typestring_offset; @@ -2359,7 +2453,7 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type, const var_t *array; unsigned int start_offset; unsigned int array_offset; - unsigned int align = 0; + unsigned int align; unsigned int corroff; var_t *f; unsigned char fc = get_struct_fc(type); @@ -2368,7 +2462,8 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type, guard_rec(type); current_structure = type; - total_size = type_memsize_and_alignment(type, &align); + total_size = type_memsize(type); + align = type_buffer_alignment(type); if (total_size > USHRT_MAX) error("structure size for %s exceeds %d bytes by %d bytes\n", name, USHRT_MAX, total_size - USHRT_MAX);
1
0
0
0
Alexandre Julliard : widl: Add a type_memsize_and_alignment function to make it explicit where the alignment is truly needed .
by Alexandre Julliard
06 Apr '10
06 Apr '10
Module: wine Branch: master Commit: cb6a2254819faea6a4cd5b7208688facbf94e92a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb6a2254819faea6a4cd5b720…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 19:48:07 2010 +0200 widl: Add a type_memsize_and_alignment function to make it explicit where the alignment is truly needed. --- tools/widl/expr.c | 6 +-- tools/widl/parser.y | 7 +-- tools/widl/typegen.c | 109 ++++++++++++++++++++----------------------------- tools/widl/typegen.h | 2 +- 4 files changed, 50 insertions(+), 74 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=cb6a2254819faea6a4cd5…
1
0
0
0
Alexandre Julliard : mmdevapi: Include system headers before Wine headers.
by Alexandre Julliard
05 Apr '10
05 Apr '10
Module: wine Branch: master Commit: a7d000e2e2d86a1fb7e635662fb1fcb461f1f4e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7d000e2e2d86a1fb7e635662…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 5 17:44:23 2010 +0200 mmdevapi: Include system headers before Wine headers. --- dlls/mmdevapi/devenum.c | 10 +++++++++- dlls/mmdevapi/main.c | 8 ++++++++ dlls/mmdevapi/mmdevapi.h | 13 ++++--------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index 362855e..b593eb6 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -16,11 +16,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION #include "config.h" #include <stdarg.h> +#ifdef HAVE_AL_AL_H +#include <AL/al.h> +#include <AL/alc.h> +#elif defined(HAVE_OPENAL_AL_H) +#include <OpenAL/al.h> +#include <OpenAL/alc.h> +#endif + +#define NONAMELESSUNION #define CINTERFACE #define COBJMACROS #include "windef.h" diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c index d9536aa..0467963 100644 --- a/dlls/mmdevapi/main.c +++ b/dlls/mmdevapi/main.c @@ -21,6 +21,14 @@ #include <stdarg.h> +#ifdef HAVE_AL_AL_H +#include <AL/al.h> +#include <AL/alc.h> +#elif defined(HAVE_OPENAL_AL_H) +#include <OpenAL/al.h> +#include <OpenAL/alc.h> +#endif + #define CINTERFACE #define COBJMACROS #include "windef.h" diff --git a/dlls/mmdevapi/mmdevapi.h b/dlls/mmdevapi/mmdevapi.h index 310c9f1..bcca85e 100644 --- a/dlls/mmdevapi/mmdevapi.h +++ b/dlls/mmdevapi/mmdevapi.h @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv); extern void MMDevEnum_Free(void); @@ -37,15 +41,6 @@ typedef struct MMDevice { #ifdef HAVE_OPENAL -#ifdef HAVE_AL_AL_H -#include <AL/al.h> -#include <AL/alc.h> -#elif defined(HAVE_OPENAL_AL_H) -#include <OpenAL/al.h> -#include <OpenAL/alc.h> -#else -#error No OpenAL headers found? -#endif #include "alext.h" /* All openal functions */
1
0
0
0
← Newer
1
...
76
77
78
79
80
81
82
...
90
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
Results per page:
10
25
50
100
200