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
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-devel
February 2019
----- 2025 -----
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-devel@winehq.org
73 participants
737 discussions
Start a n
N
ew thread
[PATCH 1/2] msi: Initialize assembly caches before disabling redirection.
by Hans Leidekker
15 Feb '19
15 Feb '19
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46638
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/msi/action.c | 13 ++++++------- dlls/msi/assembly.c | 5 +++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 9407d36520..d95960590c 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -995,13 +995,6 @@ UINT msi_load_all_components( MSIPACKAGE *package ) if (r != ERROR_SUCCESS) return r;
…
[View More]
- if (!msi_init_assembly_caches( package )) - { - ERR("can't initialize assembly caches\n"); - msiobj_release( &view->hdr ); - return ERROR_FUNCTION_FAILED; - } - r = MSI_IterateRecords(view, NULL, load_component, package); msiobj_release(&view->hdr); return r; @@ -8094,6 +8087,12 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) TRACE("Performing action (%s)\n", debugstr_w(action)); + if (!msi_init_assembly_caches( package )) + { + ERR("can't initialize assembly caches\n"); + return ERROR_FUNCTION_FAILED; + } + package->action_progress_increment = 0; rc = ACTION_HandleStandardAction(package, action); diff --git a/dlls/msi/assembly.c b/dlls/msi/assembly.c index f46ff02eeb..cb406111c9 100644 --- a/dlls/msi/assembly.c +++ b/dlls/msi/assembly.c @@ -41,6 +41,7 @@ static HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **, LPCWSTR, D static HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName *, DWORD, LPVOID ); static HMODULE hfusion10, hfusion11, hfusion20, hfusion40, hmscoree, hsxs; +static BOOL assembly_caches_initialized; static BOOL init_function_pointers( void ) { @@ -91,12 +92,16 @@ static BOOL init_function_pointers( void ) BOOL msi_init_assembly_caches( MSIPACKAGE *package ) { + if (assembly_caches_initialized) return TRUE; if (!init_function_pointers()) return FALSE; + if (pCreateAssemblyCacheSxs( &package->cache_sxs, 0 ) != S_OK) return FALSE; if (pCreateAssemblyCacheNet10) pCreateAssemblyCacheNet10( &package->cache_net[CLR_VERSION_V10], 0 ); if (pCreateAssemblyCacheNet11) pCreateAssemblyCacheNet11( &package->cache_net[CLR_VERSION_V11], 0 ); if (pCreateAssemblyCacheNet20) pCreateAssemblyCacheNet20( &package->cache_net[CLR_VERSION_V20], 0 ); if (pCreateAssemblyCacheNet40) pCreateAssemblyCacheNet40( &package->cache_net[CLR_VERSION_V40], 0 ); + + assembly_caches_initialized = TRUE; return TRUE; } -- 2.20.1
[View Less]
1
0
0
0
[PATCH 1/9] user32/listbox: Resize the entire item array at once in SetCount
by Gabriel Ivăncescu
15 Feb '19
15 Feb '19
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- user32 versions of the comctl32 series. dlls/user32/listbox.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index a2791eb..a9195dc 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -139,6 +139,12 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size) descr->items_size =
…
[View More]
items_size; descr->items = items; } + + if ((descr->style & LBS_NODATA) && items_size > descr->nb_items) + { + memset(&descr->items[descr->nb_items], 0, + (items_size - descr->nb_items) * sizeof(LB_ITEMDATA)); + } return TRUE; } @@ -1751,9 +1757,9 @@ static void LISTBOX_ResetContent( LB_DESCR *descr ) /*********************************************************************** * LISTBOX_SetCount */ -static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count ) +static LRESULT LISTBOX_SetCount( LB_DESCR *descr, UINT count ) { - LRESULT ret; + UINT orig_num = descr->nb_items; if (!(descr->style & LBS_NODATA)) { @@ -1761,19 +1767,30 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count ) return LB_ERR; } - /* FIXME: this is far from optimal... */ - if (count > descr->nb_items) - { - while (count > descr->nb_items) - if ((ret = LISTBOX_InsertString( descr, -1, 0 )) < 0) - return ret; - } - else if (count < descr->nb_items) + if (!resize_storage(descr, count)) + return LB_ERRSPACE; + descr->nb_items = count; + + if (count) { - while (count < descr->nb_items) - if ((ret = LISTBOX_RemoveItem( descr, (descr->nb_items - 1) )) < 0) - return ret; + LISTBOX_UpdateScroll(descr); + if (count < orig_num) + { + descr->anchor_item = min(descr->anchor_item, count - 1); + if (descr->selected_item >= count) + descr->selected_item = -1; + + /* If we removed the scrollbar, reset the top of the list */ + if (count <= descr->page_size && orig_num > descr->page_size) + LISTBOX_SetTopItem(descr, 0, TRUE); + + descr->focus_item = min(descr->focus_item, count - 1); + } + + /* If it was empty before growing, set focus to the first item */ + else if (orig_num == 0) LISTBOX_SetCaretIndex(descr, 0, FALSE); } + else SendMessageW(descr->self, LB_RESETCONTENT, 0, 0); InvalidateRect( descr->self, NULL, TRUE ); return LB_OKAY; -- 2.20.1
[View Less]
3
22
0
0
[PATCH v2 4/4] propsys: Implement PropVariantToBuffer().
by Jactry Zeng
15 Feb '19
15 Feb '19
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> --- dlls/propsys/propsys.spec | 2 +- dlls/propsys/propvar.c | 13 ++++++++++++ dlls/propsys/tests/propsys.c | 39 ++++++++++++++++++++++++++++++++++++ include/propvarutil.h | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/dlls/propsys/propsys.spec b/dlls/propsys/propsys.spec index d9347e27ae..8416b6dc74 100644 --- a/dlls/propsys/propsys.spec +++ b/dlls/propsys/propsys.spec @@ -111,7 +111,7 @@ @
…
[View More]
stub PropVariantToBooleanVector @ stub PropVariantToBooleanVectorAlloc @ stub PropVariantToBooleanWithDefault -@ stub PropVariantToBuffer +@ stdcall PropVariantToBuffer(ptr ptr long) @ stdcall PropVariantToDouble(ptr ptr) @ stub PropVariantToDoubleVector @ stub PropVariantToDoubleVectorAlloc diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 988cf81971..5817d502f3 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -306,6 +306,19 @@ HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret) return hr; } +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb) +{ + TRACE("(%p, %p, %d)\n", propvarIn, ret, cb); + + if(cb > propvarIn->u.caub.cElems) + return E_FAIL; + + memcpy(ret, propvarIn->u.caub.pElems, cb); + + return S_OK; +} + + HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch) { HRESULT hr; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 059b622544..1e5e88bc3b 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -1407,6 +1407,44 @@ static void test_PropVariantToString(void) SysFreeString(propvar.u.bstrVal); } +static void test_PropVariantToBuffer(void) +{ + PROPVARIANT propvar; + HRESULT hr; + UINT8 data[] = {1,2,3,4,5,6,7,8,9,10}; + UINT8 buffer[256]; + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, NULL, 0); /* crash when cb isn't zero */ + ok(hr == S_OK, "PropVariantToBuffer fail: 0x%08x.\n", hr); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 10); + ok(hr == S_OK, "PropVariantToBuffer fail: 0x%08x.\n", hr); + ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 11); + ok(hr == E_FAIL, "PropVariantToBuffer fail: 0x%08x.\n", hr); + ok(!buffer[0], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 9); + ok(hr == S_OK, "PropVariantToBuffer fail: 0x%08x.\n", hr); + ok(!memcmp(buffer, data, 9) && !buffer[9], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); +} + START_TEST(propsys) { test_PSStringFromPropertyKey(); @@ -1424,4 +1462,5 @@ START_TEST(propsys) test_InitPropVariantFromCLSID(); test_PropVariantToDouble(); test_PropVariantToString(); + test_PropVariantToBuffer(); } diff --git a/include/propvarutil.h b/include/propvarutil.h index 4fb12d87eb..a4eedefdb6 100644 --- a/include/propvarutil.h +++ b/include/propvarutil.h @@ -79,6 +79,7 @@ HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret); HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret); HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret); HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret); +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb); HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch); PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault); -- 2.20.1
[View Less]
3
3
0
0
[PATCH 3/3] propsys: Implement PropVariantToBuffer().
by Jactry Zeng
15 Feb '19
15 Feb '19
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> --- dlls/propsys/propsys.spec | 2 +- dlls/propsys/propvar.c | 12 ++++++++++++ dlls/propsys/tests/propsys.c | 33 +++++++++++++++++++++++++++++++++ include/propvarutil.h | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/dlls/propsys/propsys.spec b/dlls/propsys/propsys.spec index d9347e27ae..8416b6dc74 100644 --- a/dlls/propsys/propsys.spec +++ b/dlls/propsys/propsys.spec @@ -111,7 +111,7 @@ @
…
[View More]
stub PropVariantToBooleanVector @ stub PropVariantToBooleanVectorAlloc @ stub PropVariantToBooleanWithDefault -@ stub PropVariantToBuffer +@ stdcall PropVariantToBuffer(ptr ptr long) @ stdcall PropVariantToDouble(ptr ptr) @ stub PropVariantToDoubleVector @ stub PropVariantToDoubleVectorAlloc diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 5950cc833b..6200e3e993 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -306,6 +306,18 @@ HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret) return hr; } +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb) +{ + TRACE("(%p, %p, %d)\n", propvarIn, ret, cb); + + if(cb > propvarIn->u.caub.cElems) + return E_FAIL; + + memcpy(ret, propvarIn->u.caub.pElems, cb); + + return S_OK; +} + HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch) { HRESULT hr = S_OK; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 05cff65151..740e349bfb 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -1406,6 +1406,38 @@ static void test_PropVariantToString(void) PropVariantClear(&propvar); } +static void test_PropVariantToBuffer(void) +{ + PROPVARIANT propvar; + HRESULT hr; + UINT8 data[] = {1,2,3,4,5,6,7,8,9,10}; + UINT8 buffer[256]; + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 10); + ok(hr == S_OK, "PropVariantToBuffer fail: 0x%08x.\n", hr); + ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 11); + ok(hr == E_FAIL, "PropVariantToBuffer fail: 0x%08x.\n", hr); + ok(!buffer[0], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 9); + ok(hr == S_OK, "PropVariantToBuffer fail: 0x%08x.\n", hr); + ok(!memcmp(buffer, data, 9) && !buffer[9], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); +} + START_TEST(propsys) { test_PSStringFromPropertyKey(); @@ -1423,4 +1455,5 @@ START_TEST(propsys) test_InitPropVariantFromCLSID(); test_PropVariantToDouble(); test_PropVariantToString(); + test_PropVariantToBuffer(); } diff --git a/include/propvarutil.h b/include/propvarutil.h index 4fb12d87eb..a4eedefdb6 100644 --- a/include/propvarutil.h +++ b/include/propvarutil.h @@ -79,6 +79,7 @@ HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret); HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret); HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret); HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret); +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb); HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch); PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault); -- 2.20.1
[View Less]
4
3
0
0
[PATCH v2 2/4] propsys: Implement PropVariantToString().
by Jactry Zeng
15 Feb '19
15 Feb '19
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> --- dlls/propsys/propsys.spec | 2 +- dlls/propsys/propvar.c | 25 ++++++++++ dlls/propsys/tests/propsys.c | 91 ++++++++++++++++++++++++++++++++++++ include/propvarutil.h | 1 + 4 files changed, 118 insertions(+), 1 deletion(-) diff --git a/dlls/propsys/propsys.spec b/dlls/propsys/propsys.spec index 9193f3664d..d9347e27ae 100644 --- a/dlls/propsys/propsys.spec +++ b/dlls/propsys/propsys.spec @@ -133,7 +133,7 @@ @
…
[View More]
stub PropVariantToInt64VectorAlloc @ stub PropVariantToInt64WithDefault @ stub PropVariantToStrRet -@ stub PropVariantToString +@ stdcall PropVariantToString(ptr ptr long) @ stdcall PropVariantToStringAlloc(ptr ptr) @ stub PropVariantToStringVector @ stub PropVariantToStringVectorAlloc diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 396afbf050..ef490be978 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -34,6 +34,7 @@ #include "winuser.h" #include "shlobj.h" #include "propvarutil.h" +#include "strsafe.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -305,6 +306,30 @@ HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret) return hr; } +HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch) +{ + HRESULT hr; + WCHAR *stringW = NULL; + + TRACE("(%p, %p, %d)\n", propvarIn, ret, cch); + + ret[0] = '\0'; + + if(!cch) + return E_INVALIDARG; + + hr = PropVariantToStringAlloc(propvarIn, &stringW); + if(SUCCEEDED(hr)) + { + if(lstrlenW(stringW) >= cch) + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + lstrcpynW(ret, stringW, cch); + CoTaskMemFree(stringW); + } + + return hr; +} + HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) { WCHAR *res = NULL; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 926dc3de71..299675db2e 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -32,6 +32,7 @@ #include "initguid.h" #include "propsys.h" #include "propvarutil.h" +#include "strsafe.h" #include "wine/test.h" DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); @@ -1310,6 +1311,95 @@ static void test_PropVariantToDouble(void) ok(value == 8.0, "Unexpected value: %f.\n", value); } +static void test_PropVariantToString(void) +{ + PROPVARIANT propvar; + static CHAR string[] = "Wine"; + static WCHAR stringW[] = {'W','i','n','e',0}; + WCHAR bufferW[256] = {0}; + HRESULT hr; + + PropVariantInit(&propvar); + propvar.vt = VT_EMPTY; + U(propvar).pwszVal = stringW; + bufferW[0] = 65; + hr = PropVariantToString(&propvar, bufferW, 0); + ok(hr == E_INVALIDARG, "PropVariantToString should fail: 0x%08x.\n", hr); + ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_EMPTY; + U(propvar).pwszVal = stringW; + bufferW[0] = 65; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_NULL; + U(propvar).pwszVal = stringW; + bufferW[0] = 65; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_I4; + U(propvar).lVal = 22; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + todo_wine ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + todo_wine ok(!strcmp_wa(bufferW, "22"), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_LPWSTR; + U(propvar).pwszVal = stringW; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_LPSTR; + U(propvar).pszVal = string; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_LPWSTR; + U(propvar).pwszVal = stringW; + hr = PropVariantToString(&propvar, bufferW, 4); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "PropVariantToString returned: 0x%08x.\n", hr); + ok(!memcmp(bufferW, stringW, 4), "got wrong string.\n"); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_LPSTR; + U(propvar).pszVal = string; + hr = PropVariantToString(&propvar, bufferW, 4); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "PropVariantToString returned: 0x%08x.\n", hr); + ok(!memcmp(bufferW, stringW, 4), "got wrong string.\n"); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_BSTR; + propvar.u.bstrVal = SysAllocString(stringW); + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + SysFreeString(propvar.u.bstrVal); +} + START_TEST(propsys) { test_PSStringFromPropertyKey(); @@ -1326,4 +1416,5 @@ START_TEST(propsys) test_PropVariantToStringWithDefault(); test_InitPropVariantFromCLSID(); test_PropVariantToDouble(); + test_PropVariantToString(); } diff --git a/include/propvarutil.h b/include/propvarutil.h index 80f081cbc3..4fb12d87eb 100644 --- a/include/propvarutil.h +++ b/include/propvarutil.h @@ -79,6 +79,7 @@ HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret); HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret); HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret); HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret); +HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch); PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault); HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret); -- 2.20.1
[View Less]
1
0
0
0
[PATCH v2 3/4] propsys: Add VT_CLSID support for PropVariantToGUID().
by Jactry Zeng
15 Feb '19
15 Feb '19
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> --- dlls/propsys/propvar.c | 3 +++ dlls/propsys/tests/propsys.c | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index ef490be978..988cf81971 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -739,6 +739,9 @@ HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid) return PROPVAR_WCHARToGUID(
…
[View More]
ppropvar->u.bstrVal, SysStringLen(ppropvar->u.bstrVal), guid); case VT_LPWSTR: return PROPVAR_WCHARToGUID(ppropvar->u.pwszVal, strlenW(ppropvar->u.pwszVal), guid); + case VT_CLSID: + memcpy(guid, ppropvar->u.puuid, sizeof(*ppropvar->u.puuid)); + return S_OK; default: FIXME("unsupported vt: %d\n", ppropvar->vt); diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 299675db2e..059b622544 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -568,7 +568,7 @@ static void test_PropVariantToGUID(void) hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&IID_NULL, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&IID_NULL, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); PropVariantClear(&propvar); hres = InitPropVariantFromGUIDAsString(&dummy_guid, &propvar); @@ -576,7 +576,7 @@ static void test_PropVariantToGUID(void) hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); ok(propvar.vt == VT_LPWSTR, "incorrect PROPVARIANT type: %d\n", propvar.vt); propvar.u.pwszVal[1] = 'd'; @@ -584,7 +584,7 @@ static void test_PropVariantToGUID(void) propvar.u.pwszVal[3] = 'a'; hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); propvar.u.pwszVal[1] = 'z'; hres = PropVariantToGUID(&propvar, &guid); @@ -597,7 +597,7 @@ static void test_PropVariantToGUID(void) hres = VariantToGUID(&var, &guid); ok(hres == S_OK, "VariantToGUID failed %x\n", hres); - ok(!memcmp(&IID_NULL, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&IID_NULL, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); VariantClear(&var); hres = InitVariantFromGUIDAsString(&dummy_guid, &var); @@ -605,7 +605,7 @@ static void test_PropVariantToGUID(void) hres = VariantToGUID(&var, &guid); ok(hres == S_OK, "VariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); ok(V_VT(&var) == VT_BSTR, "incorrect VARIANT type: %d\n", V_VT(&var)); V_BSTR(&var)[1] = 'z'; @@ -618,7 +618,14 @@ static void test_PropVariantToGUID(void) V_VT(&var) = VT_EMPTY; hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + PropVariantClear(&propvar); + + memset(&guid, 0, sizeof(guid)); + InitPropVariantFromCLSID(&dummy_guid, &propvar); + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); PropVariantClear(&propvar); } -- 2.20.1
[View Less]
1
0
0
0
[PATCH v2 1/4] propsys: Add VT_EMPTY support for PropVariantToStringAlloc().
by Jactry Zeng
15 Feb '19
15 Feb '19
Superseded patch 158558 to 158560. ChangeLog: v2: - Fix test failures on Windows 64 bit.(1/3) - Use PropVariantToStringAlloc() for implementing PropVariantToString().(1/3) - Use IsEqualGUID() for checking GUID instread of memcmp().(2/3) - Add more tests for PropVariantToBuffer().(3/3) Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> --- dlls/propsys/propvar.c | 1 + dlls/propsys/tests/propsys.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/dlls/propsys/propvar.c
…
[View More]
b/dlls/propsys/propvar.c index 0edf4621b3..396afbf050 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -314,6 +314,7 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) switch(propvarIn->vt) { + case VT_EMPTY: case VT_NULL: res = CoTaskMemAlloc(1*sizeof(WCHAR)); res[0] = '\0'; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index a9c0a7730b..926dc3de71 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -641,6 +641,12 @@ static void test_PropVariantToStringAlloc(void) ok(!lstrcmpW(str, topicW), "got %s\n", wine_dbgstr_w(str)); CoTaskMemFree(str); PropVariantClear(&prop); + + prop.vt = VT_EMPTY; + hres = PropVariantToStringAlloc(&prop, &str); + ok(hres == S_OK, "returned %x\n", hres); + ok(!lstrcmpW(str, emptyW), "got %s\n", wine_dbgstr_w(str)); + CoTaskMemFree(str); } static void test_PropVariantCompare(void) -- 2.20.1
[View Less]
1
0
0
0
[PATCH v3] po: Update French translation.
by Isira Seneviratne
15 Feb '19
15 Feb '19
1
0
0
0
[PATCH] wordpad: Update STRING_TEXT_FILES_UNICODE_TXT string to plural format.
by Isira Seneviratne
15 Feb '19
15 Feb '19
1
0
0
0
[PATCH 1/2] msvcrt: Add _ismbcl2_l().
by Nikolay Sivov
15 Feb '19
15 Feb '19
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- .../api-ms-win-crt-multibyte-l1-1-0.spec | 2 +- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 21 +++++++++++++++++++ dlls/msvcrt/msvcrt.spec
…
[View More]
| 2 +- dlls/ucrtbase/ucrtbase.spec | 2 +- 9 files changed, 29 insertions(+), 8 deletions(-) diff --git a/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec b/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec index 270e2c23da..3f60bb4162 100644 --- a/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec +++ b/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec @@ -43,7 +43,7 @@ @ cdecl _ismbcl1(long) ucrtbase._ismbcl1 @ cdecl _ismbcl1_l(long ptr) ucrtbase._ismbcl1_l @ cdecl _ismbcl2(long) ucrtbase._ismbcl2 -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) ucrtbase._ismbcl2_l @ cdecl _ismbclegal(long) ucrtbase._ismbclegal @ cdecl _ismbclegal_l(long ptr) ucrtbase._ismbclegal_l @ cdecl _ismbclower(long) ucrtbase._ismbclower diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 202042da58..eefa57348d 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -991,7 +991,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ cdecl _ismbclower(long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 1f4bfe3a92..a6ed5c1235 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1337,7 +1337,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ stub _ismbclower(long) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 7e03eb1e99..441c0bee86 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1342,7 +1342,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ stub _ismbclower(long) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 7dc4ea881c..43c3e46325 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -663,7 +663,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ cdecl _ismbclower(long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 16a24735ff..a9bf0a2702 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -641,7 +641,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ cdecl _ismbclower(long) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 909ea46371..1026465644 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -2608,3 +2608,24 @@ int CDECL _ismbcl1(unsigned int c) { return _ismbcl1_l(c, NULL); } + +/********************************************************************* + * _ismbcl2_l (MSVCRT.@) + */ +int CDECL _ismbcl2_l(unsigned int c, MSVCRT__locale_t locale) +{ + MSVCRT_pthreadmbcinfo mbcinfo; + + if(!locale) + mbcinfo = get_mbcinfo(); + else + mbcinfo = locale->mbcinfo; + + if(mbcinfo->mbcodepage == 932) + { + /* JIS level-2 */ + return _ismbclegal(c) && c >= 0x989f && c <= 0xeaa4; + } + + return 0; +} diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 1f9ad647cf..42de9ced96 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -612,7 +612,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -# stub _ismbcl2_l(long ptr) +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ cdecl _ismbclower(long) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index db894a0eb9..e1315ec1ce 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -481,7 +481,7 @@ @ cdecl _ismbcl1(long) @ cdecl _ismbcl1_l(long ptr) @ stub _ismbcl2(long) -@ stub _ismbcl2_l +@ cdecl _ismbcl2_l(long ptr) @ cdecl _ismbclegal(long) @ cdecl _ismbclegal_l(long ptr) @ stub _ismbclower(long) -- 2.20.1
[View Less]
1
1
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
74
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
Results per page:
10
25
50
100
200