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
February 2022
----- 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
1495 discussions
Start a n
N
ew thread
Zhiyi Zhang : uxtheme: Use TransparentBlt() for bitmaps with all alpha values being 0xff.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: 7398ed2977ec495fcd074e4c98d434b05304f19d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7398ed2977ec495fcd074e4c…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Aug 25 14:24:31 2021 +0800 uxtheme: Use TransparentBlt() for bitmaps with all alpha values being 0xff. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51553
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 96b7a8a317a859dd6f9bf9a0e03d303e7d3503b3) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/uxtheme/msstyles.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index cd7677e5783..3624bb2d4a6 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -1074,11 +1074,18 @@ static BOOL prepare_alpha (HBITMAP bmp, BOOL* hasAlpha) if (!bmp || GetObjectW( bmp, sizeof(dib), &dib ) != sizeof(dib)) return FALSE; - if(dib.dsBm.bmBitsPixel != 32) + if (dib.dsBm.bmBitsPixel != 32 || dib.dsBmih.biCompression != BI_RGB) /* nothing to do */ return TRUE; - *hasAlpha = TRUE; + /* If all alpha values are 0xff, don't use alpha blending */ + for (n = 0, p = dib.dsBm.bmBits; n < dib.dsBmih.biWidth * dib.dsBmih.biHeight; n++, p += 4) + if ((*hasAlpha = (p[3] != 0xff))) + break; + + if (!*hasAlpha) + return TRUE; + p = dib.dsBm.bmBits; n = dib.dsBmih.biHeight * dib.dsBmih.biWidth; /* AlphaBlend() wants premultiplied alpha, so do that now */
1
0
0
0
Nikolay Sivov : d3dx9/effect: Reset output handle for next after last technique in FindNextValidTechnique().
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: f1589ee006bfff29e1aea70bd82a80ce213bc5e9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1589ee006bfff29e1aea70b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 17 19:17:33 2021 +0200 d3dx9/effect: Reset output handle for next after last technique in FindNextValidTechnique(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 60a3e0106246cb91d598a815d4fadf2791011142) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/d3dx9_36/effect.c | 2 +- dlls/d3dx9_36/tests/effect.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 710e999f27f..22afa649db3 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -3816,7 +3816,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D } } - *next_technique = get_technique_handle(&effect->techniques[0]); + *next_technique = NULL; return S_FALSE; } diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index ae6f65d52d5..d6998284271 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -7892,9 +7892,9 @@ static void test_effect_find_next_valid_technique(void) D3DPRESENT_PARAMETERS present_parameters = {0}; IDirect3DDevice9 *device; D3DXTECHNIQUE_DESC desc; + D3DXHANDLE tech, tech2; ID3DXEffect *effect; IDirect3D9 *d3d; - D3DXHANDLE tech; ULONG refcount; HWND window; HRESULT hr; @@ -7939,9 +7939,12 @@ static void test_effect_find_next_valid_technique(void) ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name); - hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech); + tech2 = tech; + hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2); ok(hr == S_FALSE, "Got result %#x.\n", hr); - hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc); + ok(!tech2, "Unexpected technique handle %p.\n", tech2); + /* Test GetTechniqueDesc() with a NULL handle. */ + hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc); ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name); @@ -7957,9 +7960,10 @@ static void test_effect_find_next_valid_technique(void) ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name); - hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech); + hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2); ok(hr == S_FALSE, "Got result %#x.\n", hr); - hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc); + ok(!tech2, "Unexpected technique handle %p.\n", tech2); + hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc); ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name); @@ -7985,8 +7989,9 @@ static void test_effect_find_next_valid_technique(void) ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name); - hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech); + hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2); ok(hr == S_FALSE, "Got result %#x.\n", hr); + ok(!tech2, "Unexpected technique handle %p.\n", tech2); hr = effect->lpVtbl->FindNextValidTechnique(effect, "nope", &tech); ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
1
0
0
0
Alistair Leslie-Hughes : dpnet: Implement IDirectPlay8Server EnumServiceProviders.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: a941df5c128c954737a4428a413b99d7fb40c0bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a941df5c128c954737a4428a…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Aug 24 16:43:54 2021 +1000 dpnet: Implement IDirectPlay8Server EnumServiceProviders. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit d4565f1541b2b8fae2030cceed4487c3d8a06518) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/dpnet/server.c | 14 ++++++-- dlls/dpnet/tests/server.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/dlls/dpnet/server.c b/dlls/dpnet/server.c index 977771697ac..26dd76388b1 100644 --- a/dlls/dpnet/server.c +++ b/dlls/dpnet/server.c @@ -126,9 +126,19 @@ static HRESULT WINAPI IDirectPlay8ServerImpl_EnumServiceProviders(IDirectPlay8Se PDWORD pcReturned, DWORD dwFlags) { IDirectPlay8ServerImpl *This = impl_from_IDirectPlay8Server(iface); - FIXME("(%p)->(%s %s %p %p %p %d)\n", This, debugstr_guid(pguidServiceProvider), debugstr_guid(pguidApplication), + TRACE("(%p)->(%s %s %p %p %p %d)\n", This, debugstr_guid(pguidServiceProvider), debugstr_guid(pguidApplication), pSPInfoBuffer, pcbEnumData, pcReturned, dwFlags); - return E_NOTIMPL; + + if(!This->msghandler) + return DPNERR_UNINITIALIZED; + + if(dwFlags) + FIXME("Unhandled flags %x\n", dwFlags); + + if(pguidApplication) + FIXME("Application guid %s is currently being ignored\n", debugstr_guid(pguidApplication)); + + return enum_services_providers(pguidServiceProvider, pSPInfoBuffer, pcbEnumData, pcReturned); } static HRESULT WINAPI IDirectPlay8ServerImpl_CancelAsyncOperation(IDirectPlay8Server *iface, DPNHANDLE hAsyncHandle, DWORD dwFlags) diff --git a/dlls/dpnet/tests/server.c b/dlls/dpnet/tests/server.c index 74a0e5adfcf..4314c69ccc1 100644 --- a/dlls/dpnet/tests/server.c +++ b/dlls/dpnet/tests/server.c @@ -184,6 +184,91 @@ static void test_server_info(void) } } +static void test_enum_service_providers(void) +{ + DPN_SERVICE_PROVIDER_INFO *serv_prov_info = NULL; + IDirectPlay8Server *server = NULL; + DWORD items, size; + DWORD i; + HRESULT hr; + + hr = CoCreateInstance( &CLSID_DirectPlay8Server, NULL, CLSCTX_ALL, &IID_IDirectPlay8Server, (LPVOID*)&server); + ok(hr == S_OK, "Failed to create IDirectPlay8Server object\n"); + if (FAILED(hr)) + return; + + size = 0; + items = 0; + hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, serv_prov_info, &size, &items, 0); + ok(hr == DPNERR_UNINITIALIZED, "got %x\n", hr); + + hr = IDirectPlay8Server_Initialize(server, NULL, DirectPlayMessageHandler, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (FAILED(hr)) + { + IDirectPlay8Server_Release(server); + return; + } + + size = 0; + items = 0; + + hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, NULL, &size, NULL, 0); + ok(hr == E_POINTER, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr); + + hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, NULL, NULL, &items, 0); + ok(hr == E_POINTER, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr); + + hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, NULL, &size, &items, 0); + ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr); + ok(size != 0, "size is unexpectedly 0\n"); + + serv_prov_info = HeapAlloc(GetProcessHeap(), 0, size); + + hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, serv_prov_info, &size, &items, 0); + ok(hr == S_OK, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr); + ok(items != 0, "Found unexpectedly no service providers\n"); + + trace("number of items found: %d\n", items); + + for (i=0;i<items;i++) + { + trace("Found Service Provider: %s\n", wine_dbgstr_w(serv_prov_info[i].pwszName)); + trace("Found guid: %s\n", wine_dbgstr_guid(&serv_prov_info[i].guid)); + } + + ok(HeapFree(GetProcessHeap(), 0, serv_prov_info), "Failed freeing server provider info\n"); + + size = 0; + items = 0; + + hr = IDirectPlay8Server_EnumServiceProviders(server, &CLSID_DP8SP_TCPIP, NULL, NULL, &size, &items, 0); + ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr); + ok(size != 0, "size is unexpectedly 0\n"); + + serv_prov_info = HeapAlloc(GetProcessHeap(), 0, size); + + hr = IDirectPlay8Server_EnumServiceProviders(server, &CLSID_DP8SP_TCPIP, NULL, serv_prov_info, &size, &items, 0); + ok(hr == S_OK, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr); + ok(items != 0, "Found unexpectedly no adapter\n"); + + + for (i=0;i<items;i++) + { + trace("Found adapter: %s\n", wine_dbgstr_w(serv_prov_info[i].pwszName)); + trace("Found adapter guid: %s\n", wine_dbgstr_guid(&serv_prov_info[i].guid)); + } + + /* Invalid GUID */ + items = 88; + hr = IDirectPlay8Server_EnumServiceProviders(server, &appguid, NULL, serv_prov_info, &size, &items, 0); + ok(hr == DPNERR_DOESNOTEXIST, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr); + ok(items == 88, "Found adapter %d\n", items); + + HeapFree(GetProcessHeap(), 0, serv_prov_info); + IDirectPlay8Server_Release(server); +} + BOOL is_process_elevated(void) { HANDLE token; @@ -398,6 +483,7 @@ START_TEST(server) create_server(); test_server_info(); + test_enum_service_providers(); CoUninitialize();
1
0
0
0
Alistair Leslie-Hughes : services: Check correct permission for QueryServiceConfig2W.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: 675908b29ce1b0b6d7d7f8a7a36b234ff72fdd68 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=675908b29ce1b0b6d7d7f8a7…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Aug 25 18:04:57 2021 +1000 services: Check correct permission for QueryServiceConfig2W. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50412
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 4a18232e455d82c9334c71ebea833dfb5b50b19e) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- programs/services/rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/services/rpc.c b/programs/services/rpc.c index d0f85024191..6aa5a630a0c 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -981,7 +981,7 @@ DWORD __cdecl svcctl_QueryServiceConfig2W( SC_RPC_HANDLE hService, DWORD level, memset(buffer, 0, size); - if ((err = validate_service_handle(hService, SERVICE_QUERY_STATUS, &service)) != 0) + if ((err = validate_service_handle(hService, SERVICE_QUERY_CONFIG, &service)) != 0) return err; switch (level)
1
0
0
0
Akihiro Sagawa : user32/listbox: Fix redraw after LB_SETCOUNT message.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: 904ad1e120eb0e72f1af414848fbf365c43f68cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=904ad1e120eb0e72f1af4148…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Aug 12 21:17:42 2021 +0900 user32/listbox: Fix redraw after LB_SETCOUNT message. 3ef790b9680cbf38fc93b4902e3ca6c9f57c5422 accidentally dropped updating LBS_DISPLAYCHANGED flag that had been done in LISTBOX_InvalidateItems() if the count value was changed. In fact, the newly added test shows LB_SETCOUNT message always causes WM_DRAWITEM requests regardless of the count value. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51591
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 247185ba78a22bd0f84eeb753b59e377cebfd7a9) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/user32/listbox.c | 2 ++ dlls/user32/tests/listbox.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 0122f928ba8..912adb716d0 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1839,6 +1839,8 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, UINT count ) if (!resize_storage(descr, count)) return LB_ERRSPACE; descr->nb_items = count; + if (descr->style & LBS_NOREDRAW) + descr->style |= LBS_DISPLAYCHANGED; if (count) { diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 7d0ae5a2157..7817d623134 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -447,7 +447,6 @@ static void test_ownerdraw(void) got_drawitem = 0; ret = RedrawWindow(hLB, NULL, 0, RDW_UPDATENOW); ok(ret, "RedrawWindow failed\n"); - todo_wine_if(testcase[i].message == LB_SETCOUNT) ok(got_drawitem == testcase[i].drawitem, "expected %u, got %u\n", testcase[i].drawitem, got_drawitem); DestroyWindow(hLB);
1
0
0
0
Akihiro Sagawa : user32/tests: Test pending redraw state with owner-drawn list box.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: b823fa1a3a5ee2c7dc2343f03ac928a8aec51537 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b823fa1a3a5ee2c7dc2343f0…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Aug 12 21:17:40 2021 +0900 user32/tests: Test pending redraw state with owner-drawn list box. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit a70ed810d59dbbcaaa65db515ee92b9b985323ff) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/user32/tests/listbox.c | 51 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index cd372f8ac59..7d0ae5a2157 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -238,7 +238,7 @@ static void check_item_height(void) DestroyWindow (hLB); } -static int got_selchange; +static unsigned int got_selchange, got_drawitem; static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { @@ -293,6 +293,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA trace("item rect %s\n", wine_dbgstr_rect(&rc_item)); ok(EqualRect(&dis->rcItem, &rc_item), "item rects are not equal\n"); + got_drawitem++; break; } @@ -343,6 +344,19 @@ static void test_ownerdraw(void) 0, LBS_NODATA }; + static const struct { + UINT message; + WPARAM wparam; + LPARAM lparam; + UINT drawitem; + } testcase[] = { + { WM_NULL, 0, 0, 0 }, + { WM_PAINT, 0, 0, 0 }, + { LB_GETCOUNT, 0, 0, 0 }, + { LB_SETCOUNT, ARRAY_SIZE(strings), 0, ARRAY_SIZE(strings) }, + { LB_ADDSTRING, 0, (LPARAM)"foo", ARRAY_SIZE(strings)+1 }, + { LB_DELETESTRING, 0, 0, ARRAY_SIZE(strings)-1 }, + }; HWND parent, hLB; INT ret; RECT rc; @@ -405,6 +419,41 @@ static void test_ownerdraw(void) DestroyWindow (hLB); } + + /* test pending redraw state */ + for (i = 0; i < ARRAY_SIZE(testcase); i++) + { + winetest_push_context("%d", i); + hLB = create_listbox(LBS_OWNERDRAWFIXED | LBS_NODATA | WS_CHILD | WS_VISIBLE, parent); + assert(hLB); + + ret = SendMessageA(hLB, WM_SETREDRAW, FALSE, 0); + ok(!ret, "got %d\n", ret); + ret = SendMessageA(hLB, testcase[i].message, testcase[i].wparam, testcase[i].lparam); + if (testcase[i].message >= LB_ADDSTRING && testcase[i].message < LB_MSGMAX && + testcase[i].message != LB_SETCOUNT) + ok(ret > 0, "expected > 0, got %d\n", ret); + else + ok(!ret, "expected 0, got %d\n", ret); + + got_drawitem = 0; + ret = RedrawWindow(hLB, NULL, 0, RDW_UPDATENOW); + ok(ret, "RedrawWindow failed\n"); + ok(!got_drawitem, "got %u\n", got_drawitem); + + ret = SendMessageA(hLB, WM_SETREDRAW, TRUE, 0); + ok(!ret, "got %d\n", ret); + + got_drawitem = 0; + ret = RedrawWindow(hLB, NULL, 0, RDW_UPDATENOW); + ok(ret, "RedrawWindow failed\n"); + todo_wine_if(testcase[i].message == LB_SETCOUNT) + ok(got_drawitem == testcase[i].drawitem, "expected %u, got %u\n", testcase[i].drawitem, got_drawitem); + + DestroyWindow(hLB); + winetest_pop_context(); + } + DestroyWindow(parent); }
1
0
0
0
Austin English : virtdisk: Add DetachVirtualDisk stub.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: 7409b1090231517258832fedce9f750f109dc0bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7409b1090231517258832fed…
Author: Austin English <austinenglish(a)gmail.com> Date: Tue Aug 3 11:39:25 2021 -0500 virtdisk: Add DetachVirtualDisk stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51535
Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit ccbb0eef7bcaae672e9f7f69d3a9cdce62574177) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/virtdisk/virtdisk.spec | 2 +- dlls/virtdisk/virtdisk_main.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/virtdisk/virtdisk.spec b/dlls/virtdisk/virtdisk.spec index f35b8df524b..d3d90cf8f87 100644 --- a/dlls/virtdisk/virtdisk.spec +++ b/dlls/virtdisk/virtdisk.spec @@ -4,7 +4,7 @@ @ stub CompactVirtualDisk @ stub CreateVirtualDisk @ stub DeleteVirtualDiskMetadata -@ stub DetachVirtualDisk +@ stdcall DetachVirtualDisk(ptr long long) @ stub EnumerateVirtualDiskMetadata @ stub ExpandVirtualDisk @ stub GetAllAttachedVirtualDiskPhysicalPaths diff --git a/dlls/virtdisk/virtdisk_main.c b/dlls/virtdisk/virtdisk_main.c index 630a97b59bd..30c7a083e4d 100644 --- a/dlls/virtdisk/virtdisk_main.c +++ b/dlls/virtdisk/virtdisk_main.c @@ -77,3 +77,9 @@ DWORD WINAPI OpenVirtualDisk(VIRTUAL_STORAGE_TYPE *type, const WCHAR *path, VIRT return ERROR_CALL_NOT_IMPLEMENTED; } + +DWORD WINAPI DetachVirtualDisk(HANDLE handle, DETACH_VIRTUAL_DISK_FLAG flags, ULONG specific_flags) +{ + FIXME("(%p, 0x%x, %d): stub\n", handle, flags, specific_flags); + return ERROR_INVALID_PARAMETER; +}
1
0
0
0
Francois Gouget : oleaut32: Add support for longer currency symbols.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: bc3524e8e58a20fa6d4355c78ea24c98c744b756 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc3524e8e58a20fa6d4355c7…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Aug 8 00:49:01 2021 +0200 oleaut32: Add support for longer currency symbols. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit fc5e603cd3e8ff68e52044e24a12e3f19a116afa) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/oleaut32/tests/vartest.c | 4 ++-- dlls/oleaut32/variant.c | 46 ++++++++++++++++++++++++++----------------- dlls/oleaut32/variant.h | 13 ------------ 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 58fa5aaf3a7..d8144ed8af8 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -2441,10 +2441,10 @@ static void test_VarParseNumFromStrMisc(void) /* Windows 8.1 incorrectly doubles the right-to-left mark: * "\x62f.\x645.\x200f\x200f 5" */ - todo_wine ok(hres == S_OK || broken(hres == DISP_E_TYPEMISMATCH), "returned %08x\n", hres); + ok(hres == S_OK || broken(hres == DISP_E_TYPEMISMATCH), "returned %08x\n", hres); if (hres == S_OK) { - todo_wine EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,6,0,0); + EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,6,0,0); EXPECT2(5,FAILDIG); } diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index d0d6f491255..596d2dd8473 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -1498,6 +1498,19 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) return S_OK; } +/* The localised characters that make up a valid number */ +typedef struct tagVARIANT_NUMBER_CHARS +{ + WCHAR cNegativeSymbol; + WCHAR cPositiveSymbol; + WCHAR cDecimalPoint; + WCHAR cDigitSeparator; + DWORD sCurrencyLen; + WCHAR sCurrency[8]; + WCHAR cCurrencyDecimalPoint; + WCHAR cCurrencyDigitSeparator; +} VARIANT_NUMBER_CHARS; + #define GET_NUMBER_TEXT(fld,name) \ buff[0] = 0; \ if (!GetLocaleInfoW(lcid, lctype|fld, buff, 2)) \ @@ -1509,7 +1522,7 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) /* Get the valid number characters for an lcid */ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags) { - static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,'$',0,'.',',' }; + static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,1,{'$',0},'.',',' }; LCTYPE lctype = dwFlags & LOCALE_NOUSEROVERRIDE; WCHAR buff[4]; @@ -1521,17 +1534,16 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID GET_NUMBER_TEXT(LOCALE_SMONDECIMALSEP, cCurrencyDecimalPoint); GET_NUMBER_TEXT(LOCALE_SMONTHOUSANDSEP, cCurrencyDigitSeparator); - /* Local currency symbols are often 2 characters */ - lpChars->cCurrencyLocal2 = '\0'; - switch(GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, buff, ARRAY_SIZE(buff))) + if (!GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, lpChars->sCurrency, ARRAY_SIZE(lpChars->sCurrency))) { - case 3: lpChars->cCurrencyLocal2 = buff[1]; /* Fall through */ - case 2: lpChars->cCurrencyLocal = buff[0]; - break; - default: WARN("buffer too small for LOCALE_SCURRENCY\n"); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + WARN("buffer too small for LOCALE_SCURRENCY\n"); + *lpChars->sCurrency = 0; } - TRACE("lcid 0x%x, cCurrencyLocal=%d,%d %s\n", lcid, lpChars->cCurrencyLocal, - lpChars->cCurrencyLocal2, wine_dbgstr_w(buff)); + if (!*lpChars->sCurrency) + wcscpy(lpChars->sCurrency, L"$"); + lpChars->sCurrencyLen = wcslen(lpChars->sCurrency); + TRACE("lcid 0x%x, sCurrency=%u %s\n", lcid, lpChars->sCurrencyLen, wine_dbgstr_w(lpChars->sCurrency)); } /* Number Parsing States */ @@ -1652,12 +1664,11 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, } else if (pNumprs->dwInFlags & NUMPRS_CURRENCY && !(pNumprs->dwOutFlags & NUMPRS_CURRENCY) && - *lpszStr == chars.cCurrencyLocal && - (!chars.cCurrencyLocal2 || lpszStr[1] == chars.cCurrencyLocal2)) + wcsncmp(lpszStr, chars.sCurrency, chars.sCurrencyLen) == 0) { pNumprs->dwOutFlags |= NUMPRS_CURRENCY; - cchUsed += chars.cCurrencyLocal2 ? 2 : 1; - lpszStr += chars.cCurrencyLocal2 ? 2 : 1; + cchUsed += chars.sCurrencyLen; + lpszStr += chars.sCurrencyLen; /* Only accept currency characters */ chars.cDecimalPoint = chars.cCurrencyDecimalPoint; } @@ -1968,12 +1979,11 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, pNumprs->dwOutFlags |= NUMPRS_NEG; } else if (pNumprs->dwInFlags & NUMPRS_CURRENCY && - *lpszStr == chars.cCurrencyLocal && - (!chars.cCurrencyLocal2 || lpszStr[1] == chars.cCurrencyLocal2)) + wcsncmp(lpszStr, chars.sCurrency, chars.sCurrencyLen) == 0) { pNumprs->dwOutFlags |= NUMPRS_CURRENCY; - cchUsed += chars.cCurrencyLocal2 ? 2 : 1; - lpszStr += chars.cCurrencyLocal2 ? 2 : 1; + cchUsed += chars.sCurrencyLen; + lpszStr += chars.sCurrencyLen; } else break; diff --git a/dlls/oleaut32/variant.h b/dlls/oleaut32/variant.h index 76444cf0514..1be8f8cdc79 100644 --- a/dlls/oleaut32/variant.h +++ b/dlls/oleaut32/variant.h @@ -101,19 +101,6 @@ #define VAR_BOOLYESNO 0x0800 /* Convert bool to "Yes"/"No" */ #define VAR_NEGATIVE 0x1000 /* Number is negative */ -/* The localised characters that make up a valid number */ -typedef struct tagVARIANT_NUMBER_CHARS -{ - WCHAR cNegativeSymbol; - WCHAR cPositiveSymbol; - WCHAR cDecimalPoint; - WCHAR cDigitSeparator; - WCHAR cCurrencyLocal; - WCHAR cCurrencyLocal2; - WCHAR cCurrencyDecimalPoint; - WCHAR cCurrencyDigitSeparator; -} VARIANT_NUMBER_CHARS; - unsigned int get_type_size(ULONG*, VARTYPE) DECLSPEC_HIDDEN; HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN; BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *,
1
0
0
0
Francois Gouget : oleaut32: Fix VarParseNumFromStr()'s handling of currency thousands separators.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: e3aa6390dcd31b7698af362489cd32528dadafa9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3aa6390dcd31b7698af3624…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Aug 6 12:53:09 2021 +0200 oleaut32: Fix VarParseNumFromStr()'s handling of currency thousands separators. They are have no default, are not allowed before the first digit, are unaffected by the presence / absence of a currency symbol, can be mixed with regular digit separators, are incompatible with hexadecimal and octal numbers (as are regular digit separators), and mask trailing spaces. Also they don't match regular spaces when set to a non-breaking space. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 9e4524ffb09be6bba828ea66b8fe1bb64b996b66) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/oleaut32/tests/vartest.c | 19 +++++-------------- dlls/oleaut32/variant.c | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 93f2225e983..58fa5aaf3a7 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1599,11 +1599,8 @@ static void test_VarParseNumFromStrEn(void) /* With flag, thousands sep. and following digits consumed */ CONVERT("&h1,000", NUMPRS_HEX_OCT|NUMPRS_THOUSANDS); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_HEX_OCT|NUMPRS_THOUSANDS,NUMPRS_HEX_OCT,3,4,0); - todo_wine ok(np.dwOutFlags == NUMPRS_HEX_OCT, "Got dwOutFlags=%08x\n", np.dwOutFlags); - EXPECTRGB(0,1); - todo_wine EXPECTRGB(1,FAILDIG); + EXPECTRGB(1,FAILDIG); /* With flag and decimal point, thousands sep. but not decimals consumed */ CONVERT("1,001.0", NUMPRS_THOUSANDS); @@ -2173,7 +2170,7 @@ static void test_VarParseNumFromStrMisc(void) SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHOUSANDSEP, L"~"); SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, L""); hres = wconvert_str(L"1,000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECTFAIL; + EXPECTFAIL; SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, L"~"); /* But SMONTHOUSANDSEP defaults to ','! */ @@ -2235,9 +2232,7 @@ static void test_VarParseNumFromStrMisc(void) EXPECTRGB(4,FAILDIG); hres = wconvert_str(L"1 000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,5,0,3); - todo_wine ok(np.dwOutFlags == (NUMPRS_THOUSANDS|NUMPRS_CURRENCY), "Got dwOutFlags=%08x\n", np.dwOutFlags); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); @@ -2248,15 +2243,13 @@ static void test_VarParseNumFromStrMisc(void) /* But trailing ones are allowed (same as sThousand) */ hres = wconvert_str(L"1 000 ", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,6,0,3); - todo_wine ok(np.dwOutFlags == (NUMPRS_THOUSANDS|NUMPRS_CURRENCY), "Got dwOutFlags=%08x\n", np.dwOutFlags); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); /* And they break NUMPRS_TRAILING_WHITE (same as sThousand) */ hres = wconvert_str(L"1000 ", ARRAY_SIZE(rgb), NUMPRS_TRAILING_WHITE|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECTFAIL; + EXPECTFAIL; /* NUMPRS_CURRENCY is not enough for sMonThousandSep */ @@ -2271,13 +2264,13 @@ static void test_VarParseNumFromStrMisc(void) */ SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L"/"); hres = wconvert_str(L"$1|000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,6,0,3); + EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,6,0,3); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); /* Mixing both thousands separators is allowed */ hres = wconvert_str(L"1 000|000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,9,0,6); + EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,9,0,6); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(7,FAILDIG); @@ -2332,9 +2325,7 @@ static void test_VarParseNumFromStrMisc(void) EXPECTRGB(1,FAILDIG); hres = wconvert_str(L"1~", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,2,0,0); - todo_wine ok(np.dwOutFlags == (NUMPRS_THOUSANDS|NUMPRS_CURRENCY), "Got dwOutFlags=%08x\n", np.dwOutFlags); EXPECT2(1,FAILDIG); diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 80072a35140..d0d6f491255 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -1509,7 +1509,7 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) /* Get the valid number characters for an lcid */ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags) { - static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',',','$',0,'.',',' }; + static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,'$',0,'.',',' }; LCTYPE lctype = dwFlags & LOCALE_NOUSEROVERRIDE; WCHAR buff[4]; @@ -1629,6 +1629,11 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, { return DISP_E_TYPEMISMATCH; /* Not allowed before the first digit */ } + else if ((pNumprs->dwInFlags & (NUMPRS_THOUSANDS|NUMPRS_CURRENCY)) == (NUMPRS_THOUSANDS|NUMPRS_CURRENCY) && + chars.cCurrencyDigitSeparator && *lpszStr == chars.cCurrencyDigitSeparator) + { + return DISP_E_TYPEMISMATCH; /* Not allowed before the first digit */ + } else if (pNumprs->dwInFlags & NUMPRS_LEADING_PLUS && *lpszStr == chars.cPositiveSymbol && !(pNumprs->dwOutFlags & NUMPRS_LEADING_PLUS)) @@ -1655,8 +1660,6 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, lpszStr += chars.cCurrencyLocal2 ? 2 : 1; /* Only accept currency characters */ chars.cDecimalPoint = chars.cCurrencyDecimalPoint; - chars.cDigitSeparator = chars.cCurrencyDigitSeparator; - cDigitSeparator2 = chars.cDigitSeparator == 0xa0 ? ' ' : 0; } else if (pNumprs->dwInFlags & NUMPRS_PARENS && *lpszStr == '(' && !(pNumprs->dwOutFlags & NUMPRS_PARENS)) @@ -1673,7 +1676,6 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, { /* Only accept non-currency characters */ chars.cCurrencyDecimalPoint = chars.cDecimalPoint; - chars.cCurrencyDigitSeparator = chars.cDigitSeparator; } if ((*lpszStr == '&' && (*(lpszStr+1) == 'H' || *(lpszStr+1) == 'h')) && @@ -1765,12 +1767,20 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, } } else if (pNumprs->dwInFlags & NUMPRS_THOUSANDS && + !(pNumprs->dwOutFlags & NUMPRS_HEX_OCT) && ((chars.cDigitSeparator && *lpszStr == chars.cDigitSeparator) || (cDigitSeparator2 && *lpszStr == cDigitSeparator2))) { pNumprs->dwOutFlags |= NUMPRS_THOUSANDS; cchUsed++; } + else if ((pNumprs->dwInFlags & (NUMPRS_THOUSANDS|NUMPRS_CURRENCY)) == (NUMPRS_THOUSANDS|NUMPRS_CURRENCY) && + !(pNumprs->dwOutFlags & NUMPRS_HEX_OCT) && + chars.cCurrencyDigitSeparator && *lpszStr == chars.cCurrencyDigitSeparator) + { + pNumprs->dwOutFlags |= NUMPRS_THOUSANDS|NUMPRS_CURRENCY; + cchUsed++; + } else if (*lpszStr == chars.cDecimalPoint && pNumprs->dwInFlags & NUMPRS_DECIMAL && !(pNumprs->dwOutFlags & (NUMPRS_DECIMAL|NUMPRS_EXPONENT))) @@ -1897,7 +1907,8 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, if ((chars.cDigitSeparator && *lpszStr == chars.cDigitSeparator) || (cDigitSeparator2 && *lpszStr == cDigitSeparator2)) { - if (pNumprs->dwInFlags & NUMPRS_THOUSANDS) + if (pNumprs->dwInFlags & NUMPRS_THOUSANDS && + !(pNumprs->dwOutFlags & NUMPRS_HEX_OCT)) { pNumprs->dwOutFlags |= NUMPRS_THOUSANDS; cchUsed++; @@ -1909,6 +1920,21 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, break; } } + else if (*lpszStr == chars.cCurrencyDigitSeparator) + { + if ((pNumprs->dwInFlags & (NUMPRS_THOUSANDS|NUMPRS_CURRENCY)) == (NUMPRS_THOUSANDS|NUMPRS_CURRENCY) && + !(pNumprs->dwOutFlags & NUMPRS_HEX_OCT)) + { + pNumprs->dwOutFlags |= NUMPRS_THOUSANDS|NUMPRS_CURRENCY; + cchUsed++; + lpszStr++; + } + else + { + /* Not allowed, even with NUMPRS_TRAILING_WHITE */ + break; + } + } else if ((pNumprs->dwInFlags & NUMPRS_TRAILING_WHITE) && iswspace(*lpszStr)) { pNumprs->dwOutFlags |= NUMPRS_TRAILING_WHITE;
1
0
0
0
Francois Gouget : oleaut32: Remove caching from VARIANT_GetLocalisedNumberChars().
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: oldstable Commit: 617015e11a7b11b3a52d511a45d496c1b4a10fe5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=617015e11a7b11b3a52d511a…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Aug 5 15:20:45 2021 +0200 oleaut32: Remove caching from VARIANT_GetLocalisedNumberChars(). GetLocaleInfoW() already caches the registry information and is fast enough. This also avoids using out-of-date information after a SetLocaleInfoW() call. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit d8656b47676a3448a19d9ee2da0c337e3cb64e94) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/oleaut32/tests/vartest.c | 12 +++--------- dlls/oleaut32/variant.c | 28 ---------------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 0d42dd7e852..93f2225e983 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -2197,7 +2197,7 @@ static void test_VarParseNumFromStrMisc(void) /* But SMONDECIMALSEP has no default! */ SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L""); hres = wconvert_str(L"3.9", ARRAY_SIZE(rgb), NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECTFAIL; + EXPECTFAIL; SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, L"."); SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L"."); @@ -2205,9 +2205,7 @@ static void test_VarParseNumFromStrMisc(void) SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, L" "); hres = wconvert_str(L"1 000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_THOUSANDS,NUMPRS_THOUSANDS,5,0,3); - todo_wine ok(np.dwOutFlags == NUMPRS_THOUSANDS, "Got dwOutFlags=%08x\n", np.dwOutFlags); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); @@ -2224,9 +2222,7 @@ static void test_VarParseNumFromStrMisc(void) SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHOUSANDSEP, L" "); hres = wconvert_str(L"1|000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_THOUSANDS,NUMPRS_THOUSANDS,5,0,3); - todo_wine ok(np.dwOutFlags == NUMPRS_THOUSANDS, "Got dwOutFlags=%08x\n", np.dwOutFlags); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); @@ -2234,9 +2230,7 @@ static void test_VarParseNumFromStrMisc(void) EXPECTFAIL; hres = wconvert_str(L"1|000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,NUMPRS_THOUSANDS,5,0,3); - todo_wine ok(np.dwOutFlags == NUMPRS_THOUSANDS, "Got dwOutFlags=%08x\n", np.dwOutFlags); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); @@ -2297,14 +2291,14 @@ static void test_VarParseNumFromStrMisc(void) SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, L"\xa0"); hres = wconvert_str(L"1 000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3); + EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); /* Regular thousands separators also have precedence over the currency ones */ hres = wconvert_str(L"1\xa0\x30\x30\x30", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3); + EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3); EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */ EXPECTRGB(4,FAILDIG); diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 0f00384aeb2..80072a35140 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -42,14 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(variant); -static CRITICAL_SECTION cache_cs; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &cache_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": cache_cs") } -}; -static CRITICAL_SECTION cache_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; /* Convert a variant from one type to another */ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags, @@ -1518,24 +1510,9 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags) { static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',',','$',0,'.',',' }; - static VARIANT_NUMBER_CHARS lastChars; - static LCID lastLcid = -1; - static DWORD lastFlags = 0; LCTYPE lctype = dwFlags & LOCALE_NOUSEROVERRIDE; WCHAR buff[4]; - /* To make caching thread-safe, a critical section is needed */ - EnterCriticalSection(&cache_cs); - - /* Asking for default locale entries is very expensive: It is a registry - server call. So cache one locally, as Microsoft does it too */ - if(lcid == lastLcid && dwFlags == lastFlags) - { - memcpy(lpChars, &lastChars, sizeof(defaultChars)); - LeaveCriticalSection(&cache_cs); - return; - } - memcpy(lpChars, &defaultChars, sizeof(defaultChars)); GET_NUMBER_TEXT(LOCALE_SNEGATIVESIGN, cNegativeSymbol); GET_NUMBER_TEXT(LOCALE_SPOSITIVESIGN, cPositiveSymbol); @@ -1555,11 +1532,6 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID } TRACE("lcid 0x%x, cCurrencyLocal=%d,%d %s\n", lcid, lpChars->cCurrencyLocal, lpChars->cCurrencyLocal2, wine_dbgstr_w(buff)); - - memcpy(&lastChars, lpChars, sizeof(defaultChars)); - lastLcid = lcid; - lastFlags = dwFlags; - LeaveCriticalSection(&cache_cs); } /* Number Parsing States */
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
150
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Results per page:
10
25
50
100
200