winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2019
----- 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
1 participants
635 discussions
Start a n
N
ew thread
Hans Leidekker : msado15: Implement _Recordset_MoveFirst and _Recordset_MoveLast.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: eedc6b06ca6538c982004f0e2a529cf900ead04a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eedc6b06ca6538c982004f0e…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Dec 13 15:52:29 2019 +0100 msado15: Implement _Recordset_MoveFirst and _Recordset_MoveLast. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 16 ++++++--- dlls/msado15/tests/msado15.c | 84 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 5 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index b2bc93bb9c..cd623d0dc8 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -987,14 +987,22 @@ static HRESULT WINAPI recordset_MovePrevious( _Recordset *iface ) static HRESULT WINAPI recordset_MoveFirst( _Recordset *iface ) { - FIXME( "%p\n", iface ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p\n", recordset ); + + recordset->index = 0; + return S_OK; } static HRESULT WINAPI recordset_MoveLast( _Recordset *iface ) { - FIXME( "%p\n", iface ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p\n", recordset ); + + recordset->index = (recordset->count > 0) ? recordset->count - 1 : 0; + return S_OK; } static HRESULT WINAPI recordset_Open( _Recordset *iface, VARIANT source, VARIANT active_connection, diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index 04ca338dd8..0e69142b21 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -61,8 +61,9 @@ static void test_Recordset(void) { _Recordset *recordset; Fields *fields, *fields2; + Field *field; LONG refs, count, state; - VARIANT missing; + VARIANT missing, val, index; BSTR name; HRESULT hr; @@ -132,6 +133,11 @@ static void test_Recordset(void) name = SysAllocString( L"field" ); hr = Fields__Append( fields, name, adInteger, 4, adFldUnspecified ); ok( hr == S_OK, "got %08x\n", hr ); + + V_VT( &index ) = VT_BSTR; + V_BSTR( &index ) = name; + hr = Fields_get_Item( fields, index, &field ); + ok( hr == S_OK, "got %08x\n", hr ); SysFreeString( name ); hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified ); @@ -159,6 +165,81 @@ static void test_Recordset(void) ok( hr == S_OK, "got %08x\n", hr ); ok( count == 1, "got %d\n", count ); + /* get_Fields still returns the same object */ + hr = _Recordset_get_Fields( recordset, &fields2 ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( fields2 == fields, "expected same object\n" ); + Fields_Release( fields2 ); + + count = -1; + hr = Fields_get_Count( fields2, &count ); + ok( count == 1, "got %d\n", count ); + + hr = Field_get_Value( field, &val ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &val ) == VT_EMPTY, "got %u\n", V_VT( &val ) ); + + V_VT( &val ) = VT_I4; + V_I4( &val ) = -1; + hr = Field_put_Value( field, val ); + ok( hr == S_OK, "got %08x\n", hr ); + + V_VT( &val ) = VT_ERROR; + V_ERROR( &val ) = DISP_E_PARAMNOTFOUND; + hr = Field_get_Value( field, &val ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &val ) == VT_I4, "got %u\n", V_VT( &val ) ); + ok( V_I4( &val ) == -1, "got %d\n", V_I4( &val ) ); + + hr = _Recordset_AddNew( recordset, missing, missing ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* field object returns different value after AddNew */ + V_VT( &val ) = VT_ERROR; + V_ERROR( &val ) = DISP_E_PARAMNOTFOUND; + hr = Field_get_Value( field, &val ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &val ) == VT_EMPTY, "got %u\n", V_VT( &val ) ); + + ok( !is_eof( recordset ), "eof\n" ); + ok( !is_bof( recordset ), "bof\n" ); + hr = _Recordset_MoveFirst( recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !is_eof( recordset ), "eof\n" ); + ok( !is_bof( recordset ), "bof\n" ); + + V_VT( &val ) = VT_ERROR; + V_ERROR( &val ) = DISP_E_PARAMNOTFOUND; + hr = Field_get_Value( field, &val ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &val ) == VT_I4, "got %u\n", V_VT( &val ) ); + ok( V_I4( &val ) == -1, "got %d\n", V_I4( &val ) ); + + hr = _Recordset_MoveNext( recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !is_eof( recordset ), "eof\n" ); + ok( !is_bof( recordset ), "not bof\n" ); + + hr = _Recordset_MoveNext( recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( is_eof( recordset ), "not eof\n" ); + ok( !is_bof( recordset ), "bof\n" ); + + hr = _Recordset_MoveFirst( recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !is_eof( recordset ), "eof\n" ); + ok( !is_bof( recordset ), "bof\n" ); + + hr = _Recordset_MovePrevious( recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !is_eof( recordset ), "eof\n" ); + ok( is_bof( recordset ), "not bof\n" ); + + /* try get value at BOF */ + VariantInit( &val ); + hr = Field_get_Value( field, &val ); + ok( hr == MAKE_ADO_HRESULT( adErrNoCurrentRecord ), "got %08x\n", hr ); + hr = _Recordset_Close( recordset ); ok( hr == S_OK, "got %08x\n", hr ); @@ -167,6 +248,7 @@ static void test_Recordset(void) ok( hr == S_OK, "got %08x\n", hr ); ok( state == adStateClosed, "got %d\n", state ); + Field_Release( field ); Fields_Release( fields ); _Recordset_Release( recordset ); }
1
0
0
0
Hans Leidekker : msado15: Implement _Recordset_MoveNext and _Recordset_MovePrevious.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 6e5c2bee067f071a2f08ba52d95d0f24688ecade URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6e5c2bee067f071a2f08ba52…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Dec 13 15:52:28 2019 +0100 msado15: Implement _Recordset_MoveNext and _Recordset_MovePrevious. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index bb089cfded..b2bc93bb9c 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -967,14 +967,22 @@ static HRESULT WINAPI recordset_Move( _Recordset *iface, LONG num_records, VARIA static HRESULT WINAPI recordset_MoveNext( _Recordset *iface ) { - FIXME( "%p\n", iface ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p\n", recordset ); + + if (recordset->index < recordset->count) recordset->index++; + return S_OK; } static HRESULT WINAPI recordset_MovePrevious( _Recordset *iface ) { - FIXME( "%p\n", iface ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p\n", recordset ); + + if (recordset->index >= 0) recordset->index--; + return S_OK; } static HRESULT WINAPI recordset_MoveFirst( _Recordset *iface )
1
0
0
0
Hans Leidekker : msado15: Implement _Recordset_get_RecordCount.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 6f1a4fa8e2315c3d60706967db7a3399a6817724 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6f1a4fa8e2315c3d60706967…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Dec 13 15:52:27 2019 +0100 msado15: Implement _Recordset_get_RecordCount. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 8 ++++++-- dlls/msado15/tests/msado15.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index e7c7cdc409..bb089cfded 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -873,8 +873,12 @@ static HRESULT WINAPI recordset_put_MaxRecords( _Recordset *iface, LONG max_reco static HRESULT WINAPI recordset_get_RecordCount( _Recordset *iface, LONG *count ) { - FIXME( "%p, %p\n", iface, count ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p, %p\n", recordset, count ); + + *count = recordset->count; + return S_OK; } static HRESULT WINAPI recordset_putref_Source( _Recordset *iface, IDispatch *source ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index bac1c34a46..04ca338dd8 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -144,11 +144,21 @@ static void test_Recordset(void) ok( hr == S_OK, "got %08x\n", hr ); ok( state == adStateOpen, "got %d\n", state ); + count = -1; + hr = _Recordset_get_RecordCount( recordset, &count ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !count, "got %d\n", count ); + hr = _Recordset_AddNew( recordset, missing, missing ); ok( hr == S_OK, "got %08x\n", hr ); ok( !is_eof( recordset ), "eof\n" ); ok( !is_bof( recordset ), "bof\n" ); + count = -1; + hr = _Recordset_get_RecordCount( recordset, &count ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( count == 1, "got %d\n", count ); + hr = _Recordset_Close( recordset ); ok( hr == S_OK, "got %08x\n", hr );
1
0
0
0
Hans Leidekker : msado15: Implement _Recordset_get_BOF and _Recordset_get_EOF.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 55020bf23962d537535eaacb20b218406af023bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=55020bf23962d537535eaacb…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Dec 13 15:52:26 2019 +0100 msado15: Implement _Recordset_get_BOF and _Recordset_get_EOF. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 16 ++++++++++++---- dlls/msado15/tests/msado15.c | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index 0f0cb24759..e7c7cdc409 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -772,8 +772,12 @@ static HRESULT WINAPI recordset_get_ActiveConnection( _Recordset *iface, VARIANT static HRESULT WINAPI recordset_get_BOF( _Recordset *iface, VARIANT_BOOL *bof ) { - FIXME( "%p, %p\n", iface, bof ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p, %p\n", recordset, bof ); + + *bof = (recordset->index < 0) ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; } static HRESULT WINAPI recordset_get_Bookmark( _Recordset *iface, VARIANT *bookmark ) @@ -814,8 +818,12 @@ static HRESULT WINAPI recordset_put_CursorType( _Recordset *iface, CursorTypeEnu static HRESULT WINAPI recordset_get_EOF( _Recordset *iface, VARIANT_BOOL *eof ) { - FIXME( "%p, %p\n", iface, eof ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p, %p\n", recordset, eof ); + + *eof = (!recordset->count || recordset->index >= recordset->count) ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; } static HRESULT WINAPI recordset_get_Fields( _Recordset *iface, Fields **obj ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index b0ca9cf2a5..bac1c34a46 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -25,6 +25,20 @@ #define MAKE_ADO_HRESULT( err ) MAKE_HRESULT( SEVERITY_ERROR, FACILITY_CONTROL, err ) +static BOOL is_bof( _Recordset *recordset ) +{ + VARIANT_BOOL bof = VARIANT_FALSE; + _Recordset_get_BOF( recordset, &bof ); + return bof == VARIANT_TRUE; +} + +static BOOL is_eof( _Recordset *recordset ) +{ + VARIANT_BOOL eof = VARIANT_FALSE; + _Recordset_get_EOF( recordset, &eof ); + return eof == VARIANT_TRUE; +} + static LONG get_refs_field( Field *field ) { Field_AddRef( field ); @@ -122,6 +136,8 @@ static void test_Recordset(void) hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified ); ok( hr == S_OK, "got %08x\n", hr ); + ok( is_eof( recordset ), "not eof\n" ); + ok( is_bof( recordset ), "not bof\n" ); state = -1; hr = _Recordset_get_State( recordset, &state ); @@ -130,6 +146,8 @@ static void test_Recordset(void) hr = _Recordset_AddNew( recordset, missing, missing ); ok( hr == S_OK, "got %08x\n", hr ); + ok( !is_eof( recordset ), "eof\n" ); + ok( !is_bof( recordset ), "bof\n" ); hr = _Recordset_Close( recordset ); ok( hr == S_OK, "got %08x\n", hr );
1
0
0
0
Hans Leidekker : msado15: Implement _Recordset_get_State.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 435d0924eb8099d85745c9c514cdb2fb838004ec URL:
https://source.winehq.org/git/wine.git/?a=commit;h=435d0924eb8099d85745c9c5…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Dec 13 15:52:25 2019 +0100 msado15: Implement _Recordset_get_State. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 8 ++++++-- dlls/msado15/tests/msado15.c | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index f1c864cdd9..0f0cb24759 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -1075,8 +1075,12 @@ static HRESULT WINAPI recordset_get_Status( _Recordset *iface, LONG *status ) static HRESULT WINAPI recordset_get_State( _Recordset *iface, LONG *state ) { - FIXME( "%p, %p\n", iface, state ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p, %p\n", recordset, state ); + + *state = recordset->state; + return S_OK; } static HRESULT WINAPI recordset__xClone( _Recordset *iface, _Recordset **obj ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index 3b1e953dc7..b0ca9cf2a5 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -100,8 +100,8 @@ static void test_Recordset(void) state = -1; hr = _Recordset_get_State( recordset, &state ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); - todo_wine ok( state == adStateClosed, "got %d\n", state ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == adStateClosed, "got %d\n", state ); VariantInit( &missing ); hr = _Recordset_AddNew( recordset, missing, missing ); @@ -125,8 +125,8 @@ static void test_Recordset(void) state = -1; hr = _Recordset_get_State( recordset, &state ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); - todo_wine ok( state == adStateOpen, "got %d\n", state ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == adStateOpen, "got %d\n", state ); hr = _Recordset_AddNew( recordset, missing, missing ); ok( hr == S_OK, "got %08x\n", hr ); @@ -134,6 +134,11 @@ static void test_Recordset(void) hr = _Recordset_Close( recordset ); ok( hr == S_OK, "got %08x\n", hr ); + state = -1; + hr = _Recordset_get_State( recordset, &state ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == adStateClosed, "got %d\n", state ); + Fields_Release( fields ); _Recordset_Release( recordset ); }
1
0
0
0
Hans Leidekker : msado15: Implement _Recordset_AddNew.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 7fce75805cbd3159d62295d7edccd5d8d252875c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7fce75805cbd3159d62295d7…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Dec 13 15:52:24 2019 +0100 msado15: Implement _Recordset_AddNew. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 29 ++++++++++++++++++++++++++-- dlls/msado15/tests/msado15.c | 46 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index e854b3e824..f1c864cdd9 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -887,10 +887,35 @@ static HRESULT WINAPI recordset_get_Source( _Recordset *iface, VARIANT *source ) return E_NOTIMPL; } +static BOOL resize_recordset( struct recordset *recordset, ULONG row_count ) +{ + ULONG row_size = get_column_count( recordset ) * sizeof(*recordset->data); + + if (row_count > recordset->allocated) + { + VARIANT *tmp; + ULONG count = max( row_count, recordset->allocated * 2 ); + if (!(tmp = heap_realloc_zero( recordset->data, count * row_size ))) return FALSE; + recordset->data = tmp; + recordset->allocated = count; + } + + recordset->count = row_count; + return TRUE; +} + static HRESULT WINAPI recordset_AddNew( _Recordset *iface, VARIANT field_list, VARIANT values ) { - FIXME( "%p, %s, %s\n", iface, debugstr_variant(&field_list), debugstr_variant(&values) ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p, %s, %s\n", recordset, debugstr_variant(&field_list), debugstr_variant(&values) ); + FIXME( "ignoring field list and values\n" ); + + if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed ); + + if (!resize_recordset( recordset, recordset->count + 1 )) return E_OUTOFMEMORY; + recordset->index++; + return S_OK; } static HRESULT WINAPI recordset_CancelUpdate( _Recordset *iface ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index f9a5377c50..3b1e953dc7 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -47,7 +47,9 @@ static void test_Recordset(void) { _Recordset *recordset; Fields *fields, *fields2; - LONG refs, count; + LONG refs, count, state; + VARIANT missing; + BSTR name; HRESULT hr; hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset ); @@ -92,6 +94,48 @@ static void test_Recordset(void) /* fields object still has a reference */ refs = Fields_Release( fields2 ); ok( refs == 1, "got %d\n", refs ); + + hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + + state = -1; + hr = _Recordset_get_State( recordset, &state ); + todo_wine ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( state == adStateClosed, "got %d\n", state ); + + VariantInit( &missing ); + hr = _Recordset_AddNew( recordset, missing, missing ); + ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr ); + + V_VT( &missing ) = VT_ERROR; + V_ERROR( &missing ) = DISP_E_PARAMNOTFOUND; + hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified ); + todo_wine ok( hr == MAKE_ADO_HRESULT( adErrInvalidConnection ), "got %08x\n", hr ); + + hr = _Recordset_get_Fields( recordset, &fields ); + ok( hr == S_OK, "got %08x\n", hr ); + + name = SysAllocString( L"field" ); + hr = Fields__Append( fields, name, adInteger, 4, adFldUnspecified ); + ok( hr == S_OK, "got %08x\n", hr ); + SysFreeString( name ); + + hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified ); + ok( hr == S_OK, "got %08x\n", hr ); + + state = -1; + hr = _Recordset_get_State( recordset, &state ); + todo_wine ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( state == adStateOpen, "got %d\n", state ); + + hr = _Recordset_AddNew( recordset, missing, missing ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = _Recordset_Close( recordset ); + ok( hr == S_OK, "got %08x\n", hr ); + + Fields_Release( fields ); + _Recordset_Release( recordset ); } static void test_Fields(void)
1
0
0
0
Nikolay Sivov : ole32: Handle optional WCHAR data when loading item moniker.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: b6766167002a9be0ab40b8daedecd82a0f76dba6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b6766167002a9be0ab40b8da…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 13 13:06:56 2019 +0300 ole32: Handle optional WCHAR data when loading item moniker. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/itemmoniker.c | 128 ++++++++++++++++++++++++++++----------------- dlls/ole32/tests/moniker.c | 75 ++++++++++++++++++++++++-- 2 files changed, 151 insertions(+), 52 deletions(-) diff --git a/dlls/ole32/itemmoniker.c b/dlls/ole32/itemmoniker.c index 2d325ff50c..bd6fd6fd87 100644 --- a/dlls/ole32/itemmoniker.c +++ b/dlls/ole32/itemmoniker.c @@ -157,72 +157,106 @@ static HRESULT WINAPI ItemMonikerImpl_IsDirty(IMoniker* iface) return S_FALSE; } -/****************************************************************************** - * ItemMoniker_Load - ******************************************************************************/ -static HRESULT WINAPI ItemMonikerImpl_Load(IMoniker* iface,IStream* pStm) +static HRESULT item_moniker_load_string_record(IStream *stream, WCHAR **ret) { - ItemMonikerImpl *This = impl_from_IMoniker(iface); - HRESULT res; - DWORD delimiterLength,nameLength,lenW; - CHAR *itemNameA,*itemDelimiterA; - ULONG bread; - - TRACE("\n"); + DWORD str_len, read_len, lenW, i; + HRESULT hr = S_OK; + char *buffer; + WCHAR *str; - /* for more details about data read by this function see comments of ItemMonikerImpl_Save function */ - - /* read item delimiter string length + 1 */ - res=IStream_Read(pStm,&delimiterLength,sizeof(DWORD),&bread); - if (bread != sizeof(DWORD)) + IStream_Read(stream, &str_len, sizeof(str_len), &read_len); + if (read_len != sizeof(str_len)) return E_FAIL; - /* read item delimiter string */ - if (!(itemDelimiterA=HeapAlloc(GetProcessHeap(),0,delimiterLength))) + if (!str_len) + { + heap_free(*ret); + *ret = NULL; + return S_OK; + } + + if (!(buffer = heap_alloc(str_len))) return E_OUTOFMEMORY; - res=IStream_Read(pStm,itemDelimiterA,delimiterLength,&bread); - if (bread != delimiterLength) + + IStream_Read(stream, buffer, str_len, &read_len); + if (read_len != str_len) { - HeapFree( GetProcessHeap(), 0, itemDelimiterA ); + heap_free(buffer); return E_FAIL; } - lenW = MultiByteToWideChar( CP_ACP, 0, itemDelimiterA, -1, NULL, 0 ); - This->itemDelimiter=HeapReAlloc(GetProcessHeap(),0,This->itemDelimiter,lenW*sizeof(WCHAR)); - if (!This->itemDelimiter) + /* Skip ansi buffer, it must be null terminated. */ + i = 0; + while (i < str_len && buffer[i]) + i++; + + if (buffer[i]) { - HeapFree( GetProcessHeap(), 0, itemDelimiterA ); - return E_OUTOFMEMORY; + WARN("Expected null terminated ansi name.\n"); + hr = E_FAIL; + goto end; } - MultiByteToWideChar( CP_ACP, 0, itemDelimiterA, -1, This->itemDelimiter, lenW ); - HeapFree( GetProcessHeap(), 0, itemDelimiterA ); - /* read item name string length + 1*/ - res=IStream_Read(pStm,&nameLength,sizeof(DWORD),&bread); - if (bread != sizeof(DWORD)) - return E_FAIL; + if (i < str_len - 1) + { + str_len -= i + 1; - /* read item name string */ - if (!(itemNameA=HeapAlloc(GetProcessHeap(),0,nameLength))) - return E_OUTOFMEMORY; - res=IStream_Read(pStm,itemNameA,nameLength,&bread); - if (bread != nameLength) + if (str_len % sizeof(WCHAR)) + { + WARN("Unexpected Unicode name length %d.\n", str_len); + hr = E_FAIL; + goto end; + } + + str = heap_alloc(str_len + sizeof(WCHAR)); + if (str) + { + memcpy(str, &buffer[i + 1], str_len); + str[str_len / sizeof(WCHAR)] = 0; + } + } + else { - HeapFree( GetProcessHeap(), 0, itemNameA ); - return E_FAIL; + lenW = MultiByteToWideChar(CP_ACP, 0, buffer, -1, NULL, 0); + str = heap_alloc(lenW * sizeof(WCHAR)); + if (str) + MultiByteToWideChar(CP_ACP, 0, buffer, -1, str, lenW); } - lenW = MultiByteToWideChar( CP_ACP, 0, itemNameA, -1, NULL, 0 ); - This->itemName=HeapReAlloc(GetProcessHeap(),0,This->itemName,lenW*sizeof(WCHAR)); - if (!This->itemName) + if (str) { - HeapFree( GetProcessHeap(), 0, itemNameA ); - return E_OUTOFMEMORY; + heap_free(*ret); + *ret = str; } - MultiByteToWideChar( CP_ACP, 0, itemNameA, -1, This->itemName, lenW ); - HeapFree( GetProcessHeap(), 0, itemNameA ); + else + hr = E_OUTOFMEMORY; - return res; +end: + heap_free(buffer); + + return hr; +} + +/****************************************************************************** + * ItemMoniker_Load + ******************************************************************************/ +static HRESULT WINAPI ItemMonikerImpl_Load(IMoniker *iface, IStream *stream) +{ + ItemMonikerImpl *This = impl_from_IMoniker(iface); + HRESULT hr; + + TRACE("(%p, %p)\n", iface, stream); + + /* Delimiter and name use the same record structure: 4 bytes byte-length field, followed by + string data. Data starts with single byte null-terminated string, WCHAR non-terminated + string optionally follows. Length of WCHAR string is determined as a difference between total + byte-length and single byte string length. */ + + hr = item_moniker_load_string_record(stream, &This->itemDelimiter); + if (SUCCEEDED(hr)) + hr = item_moniker_load_string_record(stream, &This->itemName); + + return hr; } /****************************************************************************** diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index 8b88ae4a0d..d911ce57e9 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -1674,9 +1674,37 @@ static void test_file_monikers(void) static void test_item_moniker(void) { + static const char item_moniker_unicode_delim_stream[] = + { + 0x05, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, '!', + 0x00, 0x02, 0x00, 0x00, 0x00, 'A', 0x00, + }; + static const char item_moniker_unicode_item_stream[] = + { + 0x02, 0x00, 0x00, 0x00, '!', 0x00, 0x05, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x00, 'B', 0x00, + }; + static const char item_moniker_unicode_delim_item_stream[] = + { + 0x05, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, '!', + 0x00, 0x06, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x00, 'C', 0x00, + }; + static struct + { + const char *data; + int data_len; + const WCHAR *display_name; + } + item_moniker_data[] = + { + { item_moniker_unicode_delim_stream, sizeof(item_moniker_unicode_delim_stream), L"!A" }, + { item_moniker_unicode_item_stream, sizeof(item_moniker_unicode_item_stream), L"!B" }, + { item_moniker_unicode_delim_item_stream, sizeof(item_moniker_unicode_delim_item_stream), L"!C" }, + }; + IMoniker *moniker, *moniker2; HRESULT hr; - IMoniker *moniker; - DWORD moniker_type; + DWORD moniker_type, i; DWORD hash; IBindCtx *bindctx; IMoniker *inverse; @@ -1684,6 +1712,9 @@ static void test_item_moniker(void) static const WCHAR wszDelimiter[] = {'!',0}; static const WCHAR wszObjectName[] = {'T','e','s','t',0}; static const WCHAR expected_display_name[] = { '!','T','e','s','t',0 }; + WCHAR *display_name; + LARGE_INTEGER pos; + IStream *stream; hr = CreateItemMoniker(NULL, wszObjectName, &moniker); ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr); @@ -1727,6 +1758,43 @@ static void test_item_moniker(void) expected_item_moniker_comparison_data5, sizeof(expected_item_moniker_comparison_data5), 58, L"abTest"); + /* Serialize and load back. */ + hr = CreateItemMoniker(NULL, L"object", &moniker2); + ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + + hr = CreateBindCtx(0, &bindctx); + ok(hr == S_OK, "Failed to create bind context, hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(item_moniker_data); ++i) + { + pos.QuadPart = 0; + hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "Failed to seek stream, hr %#x.\n", hr); + + hr = IStream_Write(stream, item_moniker_data[i].data, item_moniker_data[i].data_len, NULL); + ok(hr == S_OK, "Failed to write stream contents, hr %#x.\n", hr); + + pos.QuadPart = 0; + hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "Failed to seek stream, hr %#x.\n", hr); + + hr = IMoniker_Load(moniker2, stream); + ok(hr == S_OK, "Failed to load moniker, hr %#x.\n", hr); + + hr = IMoniker_GetDisplayName(moniker2, bindctx, NULL, &display_name); + ok(hr == S_OK, "Failed to get display name, hr %#x.\n", hr); + ok(!lstrcmpW(display_name, item_moniker_data[i].display_name), "%d: unexpected display name %s.\n", + i, wine_dbgstr_w(display_name)); + + CoTaskMemFree(display_name); + } + + IStream_Release(stream); + + IMoniker_Release(moniker2); IMoniker_Release(moniker); hr = CreateItemMoniker(wszDelimiter, wszObjectName, &moniker); @@ -1756,9 +1824,6 @@ static void test_item_moniker(void) "dwMkSys != MKSYS_ITEMMONIKER, instead was 0x%08x\n", moniker_type); - hr = CreateBindCtx(0, &bindctx); - ok_ole_success(hr, CreateBindCtx); - /* IsRunning test */ hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL); ok(hr == E_INVALIDARG, "IMoniker_IsRunning should return E_INVALIDARG, not 0x%08x\n", hr);
1
0
0
0
Nikolay Sivov : ole32: Improve maximum storage size returned for generic composite monikers.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 7a98b0527a45309b0432942d1c5427cfc3f3d84e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7a98b0527a45309b0432942d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 13 13:06:55 2019 +0300 ole32: Improve maximum storage size returned for generic composite monikers. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/compositemoniker.c | 2 +- dlls/ole32/tests/moniker.c | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c index 5f5c8c7deb..5914008fe3 100644 --- a/dlls/ole32/compositemoniker.c +++ b/dlls/ole32/compositemoniker.c @@ -315,7 +315,7 @@ CompositeMonikerImpl_GetSizeMax(IMoniker* iface,ULARGE_INTEGER* pcbSize) IMoniker_Release(pmk); - pcbSize->QuadPart = ptmpSize.QuadPart + sizeof(CLSID); + pcbSize->QuadPart += ptmpSize.QuadPart + sizeof(CLSID); } IEnumMoniker_Release(enumMk); diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index e04be638a6..8b88ae4a0d 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -1345,15 +1345,16 @@ static void test_moniker( const BYTE *expected_moniker_marshal_data, unsigned int sizeof_expected_moniker_marshal_data, const BYTE *expected_moniker_saved_data, unsigned int sizeof_expected_moniker_saved_data, const BYTE *expected_moniker_comparison_data, unsigned int sizeof_expected_moniker_comparison_data, - LPCWSTR expected_display_name) + int expected_max_size, LPCWSTR expected_display_name) { + ULARGE_INTEGER max_size; IStream * stream; IROTData * rotdata; HRESULT hr; HGLOBAL hglobal; LPBYTE moniker_data; DWORD moniker_size; - DWORD i; + DWORD i, moniker_type; BOOL same; BYTE buffer[128]; IMoniker * moniker_proxy; @@ -1423,6 +1424,13 @@ static void test_moniker( ok_ole_success(hr, CreateStreamOnHGlobal); /* Saving */ + moniker_type = 0; + IMoniker_IsSystemMoniker(moniker, &moniker_type); + + hr = IMoniker_GetSizeMax(moniker, &max_size); + ok(hr == S_OK, "Failed to get max size, hr %#x.\n", hr); +todo_wine_if(moniker_type == MKSYS_GENERICCOMPOSITE) + ok(expected_max_size == max_size.u.LowPart, "%s: unexpected max size %u.\n", testname, max_size.u.LowPart); hr = IMoniker_Save(moniker, stream, TRUE); ok_ole_success(hr, IMoniker_Save); @@ -1541,7 +1549,7 @@ static void test_class_moniker(void) expected_class_moniker_marshal_data, sizeof(expected_class_moniker_marshal_data), expected_class_moniker_saved_data, sizeof(expected_class_moniker_saved_data), expected_class_moniker_comparison_data, sizeof(expected_class_moniker_comparison_data), - expected_class_moniker_display_name); + sizeof(expected_class_moniker_saved_data), expected_class_moniker_display_name); /* Hashing */ @@ -1684,7 +1692,7 @@ static void test_item_moniker(void) expected_item_moniker_marshal_data2, sizeof(expected_item_moniker_marshal_data2), expected_item_moniker_saved_data2, sizeof(expected_item_moniker_saved_data2), expected_item_moniker_comparison_data2, sizeof(expected_item_moniker_comparison_data2), - L"Test"); + 46, L"Test"); IMoniker_Release(moniker); @@ -1695,7 +1703,7 @@ static void test_item_moniker(void) expected_item_moniker_marshal_data3, sizeof(expected_item_moniker_marshal_data3), expected_item_moniker_saved_data3, sizeof(expected_item_moniker_saved_data3), expected_item_moniker_comparison_data2, sizeof(expected_item_moniker_comparison_data2), - L"Test"); + 50, L"Test"); IMoniker_Release(moniker); @@ -1706,7 +1714,7 @@ static void test_item_moniker(void) expected_item_moniker_marshal_data4, sizeof(expected_item_moniker_marshal_data4), expected_item_moniker_saved_data4, sizeof(expected_item_moniker_saved_data4), expected_item_moniker_comparison_data4, sizeof(expected_item_moniker_comparison_data4), - L"&&Test"); + 58, L"&&Test"); IMoniker_Release(moniker); @@ -1717,7 +1725,7 @@ static void test_item_moniker(void) expected_item_moniker_marshal_data5, sizeof(expected_item_moniker_marshal_data5), expected_item_moniker_saved_data5, sizeof(expected_item_moniker_saved_data5), expected_item_moniker_comparison_data5, sizeof(expected_item_moniker_comparison_data5), - L"abTest"); + 58, L"abTest"); IMoniker_Release(moniker); @@ -1728,7 +1736,7 @@ static void test_item_moniker(void) expected_item_moniker_marshal_data, sizeof(expected_item_moniker_marshal_data), expected_item_moniker_saved_data, sizeof(expected_item_moniker_saved_data), expected_item_moniker_comparison_data, sizeof(expected_item_moniker_comparison_data), - expected_display_name); + 54, expected_display_name); /* Hashing */ @@ -1793,7 +1801,7 @@ static void test_anti_moniker(void) expected_anti_moniker_marshal_data, sizeof(expected_anti_moniker_marshal_data), expected_anti_moniker_saved_data, sizeof(expected_anti_moniker_saved_data), expected_anti_moniker_comparison_data, sizeof(expected_anti_moniker_comparison_data), - expected_display_name); + 20, expected_display_name); /* Hashing */ hr = IMoniker_Hash(moniker, &hash); @@ -1863,7 +1871,7 @@ static void test_generic_composite_moniker(void) expected_gc_moniker_marshal_data, sizeof(expected_gc_moniker_marshal_data), expected_gc_moniker_saved_data, sizeof(expected_gc_moniker_saved_data), expected_gc_moniker_comparison_data, sizeof(expected_gc_moniker_comparison_data), - expected_display_name); + 160, expected_display_name); /* Hashing */
1
0
0
0
Nikolay Sivov : ole32: Properly handle NULL delimiter for item monikers.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: f8af254a84c127519421174f82ab462567e14273 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f8af254a84c127519421174f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 13 13:06:54 2019 +0300 ole32: Properly handle NULL delimiter for item monikers. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/itemmoniker.c | 135 +++++++++++++++++++++---------------- dlls/ole32/tests/moniker.c | 165 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 230 insertions(+), 70 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f8af254a84c127519421…
1
0
0
0
Nikolay Sivov : ole32: Use more appropriate type for codepage arguments.
by Alexandre Julliard
13 Dec '19
13 Dec '19
Module: wine Branch: master Commit: 5aa9c433fc869ec8c336565b51d0602d8d35abab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5aa9c433fc869ec8c336565b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 13 13:06:53 2019 +0300 ole32: Use more appropriate type for codepage arguments. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/stg_prop.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 84eaa2aac4..8421353155 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -130,7 +130,7 @@ static void PropertyStorage_DestroyDictionaries(PropertyStorage_impl *); * string using PropertyStorage_StringCopy. */ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, - const PROPVARIANT *propvar, LCID targetCP, LCID srcCP); + const PROPVARIANT *propvar, UINT targetCP, UINT srcCP); /* Copies the string src, which is encoded using code page srcCP, and returns * it in *dst, in the code page specified by targetCP. The returned string is @@ -139,8 +139,8 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, * is CP_UNICODE, the returned string is in fact an LPWSTR. * Returns S_OK on success, something else on failure. */ -static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst, - LCID targetCP); +static HRESULT PropertyStorage_StringCopy(LPCSTR src, UINT srcCP, LPSTR *dst, + UINT targetCP); static const IPropertyStorageVtbl IPropertyStorage_Vtbl; @@ -533,8 +533,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple( return hr; } -static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst, - LCID dstCP) +static HRESULT PropertyStorage_StringCopy(LPCSTR src, UINT srcCP, LPSTR *dst, UINT dstCP) { HRESULT hr = S_OK; int len; @@ -617,8 +616,8 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst, return hr; } -static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, - const PROPVARIANT *propvar, LCID targetCP, LCID srcCP) +static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, const PROPVARIANT *propvar, + UINT targetCP, UINT srcCP) { HRESULT hr = S_OK; @@ -644,7 +643,7 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, * a version 1-only property. */ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This, - PROPID propid, const PROPVARIANT *propvar, LCID lcid) + PROPID propid, const PROPVARIANT *propvar, UINT cp) { HRESULT hr = S_OK; PROPVARIANT *prop = PropertyStorage_FindProperty(This, propid); @@ -665,8 +664,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This, if (prop) { PropVariantClear(prop); - hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage, - lcid); + hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage, cp); } else { @@ -674,8 +672,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This, sizeof(PROPVARIANT)); if (prop) { - hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage, - lcid); + hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage, cp); if (SUCCEEDED(hr)) { dictionary_insert(This->propid_to_prop, UlongToPtr(propid), prop); @@ -699,7 +696,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This, * Doesn't validate id. */ static HRESULT PropertyStorage_StoreNameWithId(PropertyStorage_impl *This, - LPCSTR srcName, LCID cp, PROPID id) + LPCSTR srcName, UINT cp, PROPID id) { LPSTR name; HRESULT hr;
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
64
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
Results per page:
10
25
50
100
200