winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2020
----- 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
535 discussions
Start a n
N
ew thread
André Hentschel : comctl32: Fix Str_SetPtr[AW] spec file entries.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: 570ad8e7875fa8c633839746937d3a7fe0ce9bb4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=570ad8e7875fa8c633839746…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Jan 8 21:21:42 2020 +0100 comctl32: Fix Str_SetPtr[AW] spec file entries. Signed-off-by: André Hentschel <nerv(a)dawncrow.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/comctl32.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index 34d9e7650d..e84eff4b8a 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -35,9 +35,9 @@ 167 stdcall -noname AddMRUData(long ptr long) 169 stdcall -noname FindMRUData(long ptr long ptr) 233 stdcall -noname Str_GetPtrA(str str long) -234 stdcall -noname Str_SetPtrA(str str) +234 stdcall -noname Str_SetPtrA(ptr str) 235 stdcall -noname Str_GetPtrW(wstr wstr long) -236 stdcall -noname Str_SetPtrW(wstr wstr) +236 stdcall -noname Str_SetPtrW(ptr wstr) 320 stdcall -ordinal DSA_Create(long long) 321 stdcall -ordinal DSA_Destroy(ptr) 322 stdcall -ordinal DSA_GetItem(ptr long ptr)
1
0
0
0
Thomas Faber : setupapi/tests: Remove an unused variable.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: dc968dae42e3b3162e2767ed32b0f91ae9b23ad3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dc968dae42e3b3162e2767ed…
Author: Thomas Faber <thomas.faber(a)reactos.org> Date: Wed Jan 8 20:05:41 2020 +0100 setupapi/tests: Remove an unused variable. Signed-off-by: Thomas Faber <thomas.faber(a)reactos.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/tests/devinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 68478b5d80..a02752d2de 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -1446,7 +1446,7 @@ static void test_register_device_iface(void) 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', 'E','n','u','m','\\','R','o','o','t','\\', 'L','E','G','A','C','Y','_','B','O','G','U','S',0}; - SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}, ret_iface = {sizeof(ret_iface)}; + SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; SP_DEVINFO_DATA device = {sizeof(device)}; HDEVINFO set, set2; BOOL ret;
1
0
0
0
Nikolay Sivov : user32/tests: Add some more SetScrollInfo() tests.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: 04643b789cb1810f0cd464677f7b7c55a8a763a1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=04643b789cb1810f0cd46467…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 8 16:30:10 2020 +0300 user32/tests: Add some more SetScrollInfo() tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/scroll.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c index fbc94a6d68..9c892ed484 100644 --- a/dlls/user32/tests/scroll.c +++ b/dlls/user32/tests/scroll.c @@ -561,6 +561,8 @@ static void test_SetScrollInfo(void) ret = IsWindowEnabled(hScroll); ok(!ret, "scroll bar enabled\n"); + ret = IsWindowVisible(hScroll); + ok(!ret, "Unexpected visible state.\n"); memset(&si, 0, sizeof(si)); si.cbSize = sizeof(si); @@ -581,6 +583,8 @@ static void test_SetScrollInfo(void) SetScrollInfo(hScroll, SB_CTL, &si, TRUE); ret = IsWindowEnabled(hScroll); ok(!ret, "scroll bar enabled\n"); + ret = IsWindowVisible(hScroll); + ok(!ret, "Unexpected visible state.\n"); si.fMask = 0xf; ret = GetScrollInfo(hScroll, SB_CTL, &si); @@ -588,6 +592,8 @@ static void test_SetScrollInfo(void) EnableScrollBar(hScroll, SB_CTL, ESB_ENABLE_BOTH); ok(IsWindowEnabled(hScroll), "expected enabled scrollbar\n"); + ret = IsWindowVisible(hScroll); + ok(!ret, "Unexpected visible state.\n"); si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; si.nMax = 10; @@ -597,6 +603,76 @@ static void test_SetScrollInfo(void) SetScrollInfo(hScroll, SB_CTL, &si, TRUE); ret = IsWindowEnabled(hScroll); ok(ret, "scroll bar disabled\n"); + ret = IsWindowVisible(hScroll); + ok(!ret, "Unexpected visible state.\n"); + + /* With visible window. */ + ShowWindow(mainwnd, SW_SHOW); + + ret = IsWindowVisible(hScroll); + ok(ret, "Unexpected visible state.\n"); + + EnableScrollBar(hScroll, SB_CTL, ESB_DISABLE_BOTH); + ret = IsWindowEnabled(hScroll); + ok(!ret, "Unexpected enabled state.\n"); + + /* Enabled state is changed only for visible windows, and only with redraw flag. */ + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 100; + si.nMin = 10; + si.nPos = 0; + si.nPage = 50; + SetScrollInfo(hScroll, SB_CTL, &si, FALSE); + ret = IsWindowEnabled(hScroll); + ok(!ret, "Unexpected enabled state.\n"); + + /* State changes when called with same arguments too. */ + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 100; + si.nMin = 10; + si.nPos = 0; + si.nPage = 50; + SetScrollInfo(hScroll, SB_CTL, &si, TRUE); + ret = IsWindowEnabled(hScroll); +todo_wine + ok(ret, "Unexpected enabled state.\n"); + + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 100; + si.nMin = 10; + si.nPos = 0; + si.nPage = 100; + SetScrollInfo(hScroll, SB_CTL, &si, TRUE); + ret = IsWindowEnabled(hScroll); + ok(!ret, "Unexpected enabled state.\n"); + + EnableScrollBar(hScroll, SB_CTL, ESB_ENABLE_BOTH); + ret = IsWindowEnabled(hScroll); + ok(ret, "Unexpected enabled state.\n"); + + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 100; + si.nMin = 10; + si.nPos = 0; + si.nPage = 100; + SetScrollInfo(hScroll, SB_CTL, &si, TRUE); + ret = IsWindowEnabled(hScroll); +todo_wine + ok(!ret, "Unexpected enabled state.\n"); + + EnableScrollBar(hScroll, SB_CTL, ESB_DISABLE_BOTH); + ret = IsWindowEnabled(hScroll); + ok(!ret, "Unexpected enabled state.\n"); + + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 41; + si.nMin = 0; + si.nPos = 0; + si.nPage = 41; + SetScrollInfo(hScroll, SB_CTL, &si, TRUE); + ret = IsWindowEnabled(hScroll); +todo_wine + ok(ret, "Unexpected enabled state.\n"); DestroyWindow(hScroll); DestroyWindow(mainwnd);
1
0
0
0
Nikolay Sivov : oleaut32/tests: Remove some workarounds for functions that are assumed to be available.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: de388bbec951c01386caab662fab7452db602c26 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de388bbec951c01386caab66…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 8 12:03:54 2020 +0300 oleaut32/tests: Remove some workarounds for functions that are assumed to be available. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/safearray.c | 140 +++++++++++++++++---------------------- dlls/oleaut32/tests/usrmarshal.c | 15 ++--- dlls/oleaut32/tests/varformat.c | 38 +++++------ 3 files changed, 81 insertions(+), 112 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=de388bbec951c01386ca…
1
0
0
0
Nikolay Sivov : gdi32/tests: Remove workarounds for SetLayout().
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: 8ab39efe0af13cad2c898fa68ee98c93bf3b6663 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8ab39efe0af13cad2c898fa6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 8 11:50:13 2020 +0300 gdi32/tests: Remove workarounds for SetLayout(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/tests/bitmap.c | 39 ++++++++++++++------------------------- dlls/gdi32/tests/dc.c | 40 +++++++++++++++++----------------------- dlls/gdi32/tests/mapping.c | 18 ++++++++---------- 3 files changed, 39 insertions(+), 58 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 8f0f6601b3..fe3482671b 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -40,7 +40,6 @@ static NTSTATUS (WINAPI *pD3DKMTCreateDCFromMemory)( D3DKMT_CREATEDCFROMMEMORY * static NTSTATUS (WINAPI *pD3DKMTDestroyDCFromMemory)( const D3DKMT_DESTROYDCFROMMEMORY *desc ); static BOOL (WINAPI *pGdiAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION); static BOOL (WINAPI *pGdiGradientFill)(HDC,TRIVERTEX*,ULONG,void*,ULONG,ULONG); -static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout); static inline int get_bitmap_stride( int width, int bpp ) { @@ -4216,15 +4215,9 @@ static void test_GetSetDIBits_rtl(void) int ret; DWORD bits_1[8 * 8], bits_2[8 * 8]; - if(!pSetLayout) - { - win_skip("Don't have SetLayout\n"); - return; - } - hdc = GetDC( NULL ); hdc_mem = CreateCompatibleDC( hdc ); - pSetLayout( hdc_mem, LAYOUT_LTR ); + SetLayout( hdc_mem, LAYOUT_LTR ); bitmap = CreateCompatibleBitmap( hdc, 8, 8 ); orig_bitmap = SelectObject( hdc_mem, bitmap ); @@ -4244,7 +4237,7 @@ static void test_GetSetDIBits_rtl(void) ok(ret == 8, "got %d\n", ret); ok(bits_1[56] == 0xff0000, "got %08x\n", bits_1[56]); /* check we have a red pixel */ - pSetLayout( hdc_mem, LAYOUT_RTL ); + SetLayout( hdc_mem, LAYOUT_RTL ); ret = GetDIBits( hdc_mem, bitmap, 0, 8, bits_2, &info, DIB_RGB_COLORS ); ok(ret == 8, "got %d\n", ret); @@ -4254,7 +4247,7 @@ static void test_GetSetDIBits_rtl(void) /* Now to show that SetDIBits also ignores the mode, we perform a SetDIBits followed by a GetDIBits and show that the bits remain unchanged. */ - pSetLayout( hdc_mem, LAYOUT_LTR ); + SetLayout( hdc_mem, LAYOUT_LTR ); ret = SetDIBits( hdc_mem, bitmap, 0, 8, bits_1, &info, DIB_RGB_COLORS ); ok(ret == 8, "got %d\n", ret); @@ -4262,7 +4255,7 @@ static void test_GetSetDIBits_rtl(void) ok(ret == 8, "got %d\n", ret); ok(!memcmp( bits_1, bits_2, sizeof(bits_1) ), "bits differ\n"); - pSetLayout( hdc_mem, LAYOUT_RTL ); + SetLayout( hdc_mem, LAYOUT_RTL ); ret = SetDIBits( hdc_mem, bitmap, 0, 8, bits_1, &info, DIB_RGB_COLORS ); ok(ret == 8, "got %d\n", ret); @@ -5165,19 +5158,16 @@ static void test_SetDIBitsToDevice(void) memset( dib_bits, 0xaa, 64 * 4 ); SetMapMode( hdc, MM_TEXT ); - if (pSetLayout) - { - pSetLayout( hdc, LAYOUT_RTL ); - ret = SetDIBitsToDevice( hdc, 1, 2, 3, 2, 1, 2, 1, 5, data, info, DIB_RGB_COLORS ); - ok( ret == 3, "got %d\n", ret ); - for (i = 0; i < 64; i++) - if (i == 36 || i == 37 || i == 38 || i == 44 || i == 45 || i == 46) - ok( dib_bits[i] == data[i - 27], "%d: got %08x\n", i, dib_bits[i] ); - else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - memset( dib_bits, 0xaa, 64 * 4 ); - pSetLayout( hdc, LAYOUT_LTR ); - } + SetLayout( hdc, LAYOUT_RTL ); + ret = SetDIBitsToDevice( hdc, 1, 2, 3, 2, 1, 2, 1, 5, data, info, DIB_RGB_COLORS ); + ok( ret == 3, "got %d\n", ret ); + for (i = 0; i < 64; i++) + if (i == 36 || i == 37 || i == 38 || i == 44 || i == 45 || i == 46) + ok( dib_bits[i] == data[i - 27], "%d: got %08x\n", i, dib_bits[i] ); + else + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + memset( dib_bits, 0xaa, 64 * 4 ); + SetLayout( hdc, LAYOUT_LTR ); /* t-d -> b-u */ info->bmiHeader.biHeight = -8; @@ -5954,7 +5944,6 @@ START_TEST(bitmap) pD3DKMTDestroyDCFromMemory = (void *)GetProcAddress( hdll, "D3DKMTDestroyDCFromMemory" ); pGdiAlphaBlend = (void *)GetProcAddress( hdll, "GdiAlphaBlend" ); pGdiGradientFill = (void *)GetProcAddress( hdll, "GdiGradientFill" ); - pSetLayout = (void *)GetProcAddress( hdll, "SetLayout" ); test_createdibitmap(); test_dibsections(); diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index 4f53e433b4..c8a903e56b 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -38,8 +38,6 @@ #define LAYOUT_LTR 0 #endif -static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout); - static void test_dc_values(void) { HDC hdc = CreateDCA("DISPLAY", NULL, NULL, NULL); @@ -1002,27 +1000,24 @@ static void test_boundsrect(void) SetRect(&expect, 40, 70, 100, 130); ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); - if (pSetLayout) - { - pSetLayout( hdc, LAYOUT_RTL ); - ret = GetBoundsRect(hdc, &rect, 0); - ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret); - SetRect(&expect, 159, 70, 99, 130); - ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); - SetRect(&set_rect, 50, 25, 30, 35); - ret = SetBoundsRect(hdc, &set_rect, DCB_SET); - ok(ret == (DCB_SET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret); - ret = GetBoundsRect(hdc, &rect, 0); - ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret); - SetRect(&expect, 50, 25, 30, 35); - ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); + SetLayout( hdc, LAYOUT_RTL ); + ret = GetBoundsRect(hdc, &rect, 0); + ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret); + SetRect(&expect, 159, 70, 99, 130); + ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); + SetRect(&set_rect, 50, 25, 30, 35); + ret = SetBoundsRect(hdc, &set_rect, DCB_SET); + ok(ret == (DCB_SET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret); + ret = GetBoundsRect(hdc, &rect, 0); + ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret); + SetRect(&expect, 50, 25, 30, 35); + ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); - pSetLayout( hdc, LAYOUT_LTR ); - ret = GetBoundsRect(hdc, &rect, 0); - ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret); - SetRect(&expect, 149, 25, 169, 35); - ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); - } + SetLayout( hdc, LAYOUT_LTR ); + ret = GetBoundsRect(hdc, &rect, 0); + ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret); + SetRect(&expect, 149, 25, 169, 35); + ok(EqualRect(&rect, &expect), "Got %s\n", wine_dbgstr_rect(&rect)); /* empty rect resets, except on nt4 */ SetRect(&expect, 20, 20, 10, 10); @@ -1642,7 +1637,6 @@ static void test_clip_box(void) START_TEST(dc) { - pSetLayout = (void *)GetProcAddress( GetModuleHandleA("gdi32.dll"), "SetLayout"); test_dc_values(); test_savedc(); test_savedc_2(); diff --git a/dlls/gdi32/tests/mapping.c b/dlls/gdi32/tests/mapping.c index 6635a72c18..ea6b7ac2cc 100644 --- a/dlls/gdi32/tests/mapping.c +++ b/dlls/gdi32/tests/mapping.c @@ -28,7 +28,6 @@ #include "winuser.h" #include "winerror.h" -static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout); static DWORD (WINAPI *pGetLayout)(HDC hdc); static INT (WINAPI *pGetRandomRgn)(HDC hDC, HRGN hRgn, INT iCode); static BOOL (WINAPI *pGetTransform)(HDC, DWORD, XFORM *); @@ -247,9 +246,9 @@ static void test_dc_layout(void) HDC hdc; HRGN hrgn; - if (!pGetLayout || !pSetLayout) + if (!pGetLayout) { - win_skip( "Don't have SetLayout\n" ); + win_skip( "Don't have GetLayout\n" ); return; } @@ -271,7 +270,7 @@ static void test_dc_layout(void) expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, 1000, 1000); - pSetLayout( hdc, LAYOUT_RTL ); + SetLayout( hdc, LAYOUT_RTL ); if (!pGetLayout( hdc )) { win_skip( "SetLayout not supported\n" ); @@ -310,7 +309,7 @@ static void test_dc_layout(void) GetClipRgn( hdc, hrgn ); GetRgnBox( hrgn, &ret_rc ); ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc )); - pSetLayout( hdc, LAYOUT_LTR ); + SetLayout( hdc, LAYOUT_LTR ); SetRect( &rc, 80, 10, 90, 20 ); GetClipRgn( hdc, hrgn ); GetRgnBox( hrgn, &ret_rc ); @@ -318,7 +317,7 @@ static void test_dc_layout(void) GetClipBox( hdc, &ret_rc ); ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc )); IntersectClipRect( hdc, 80, 10, 85, 20 ); - pSetLayout( hdc, LAYOUT_RTL ); + SetLayout( hdc, LAYOUT_RTL ); SetRect( &rc, 15, 10, 20, 20 ); GetClipRgn( hdc, hrgn ); GetRgnBox( hrgn, &ret_rc ); @@ -326,9 +325,9 @@ static void test_dc_layout(void) GetClipBox( hdc, &ret_rc ); ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc )); SetRectRgn( hrgn, 60, 10, 80, 20 ); - pSetLayout( hdc, LAYOUT_LTR ); + SetLayout( hdc, LAYOUT_LTR ); ExtSelectClipRgn( hdc, hrgn, RGN_OR ); - pSetLayout( hdc, LAYOUT_RTL ); + SetLayout( hdc, LAYOUT_RTL ); SetRect( &rc, 15, 10, 40, 20 ); GetClipRgn( hdc, hrgn ); GetRgnBox( hrgn, &ret_rc ); @@ -370,7 +369,7 @@ static void test_dc_layout(void) SetMapMode(hdc, MM_TEXT); ret = GetMapMode( hdc ); ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret); - pSetLayout( hdc, LAYOUT_LTR ); + SetLayout( hdc, LAYOUT_LTR ); ret = GetMapMode( hdc ); ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret); SetMapMode(hdc, MM_TEXT); @@ -715,7 +714,6 @@ START_TEST(mapping) { HMODULE mod = GetModuleHandleA("gdi32.dll"); pGetLayout = (void *)GetProcAddress( mod, "GetLayout" ); - pSetLayout = (void *)GetProcAddress( mod, "SetLayout" ); pGetRandomRgn = (void *)GetProcAddress( mod, "GetRandomRgn" ); pGetTransform = (void *)GetProcAddress( mod, "GetTransform" ); pSetVirtualResolution = (void *)GetProcAddress( mod, "SetVirtualResolution" );
1
0
0
0
Nikolay Sivov : gdi32/tests: Remove some workarounds in font tests.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: 9db0d763225b6067b3cafb9d220c436860e4ac42 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9db0d763225b6067b3cafb9d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 8 11:41:38 2020 +0300 gdi32/tests: Remove some workarounds in font tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/tests/font.c | 91 ++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 57 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9db0d763225b6067b3ca…
1
0
0
0
Nikolay Sivov : shell32/tests: Remove some more workarounds from shelllink tests.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: 464bbdcfb10f2a76015dafbee6b1aad9c37c3230 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=464bbdcfb10f2a76015dafbe…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 8 11:24:10 2020 +0300 shell32/tests: Remove some more workarounds from shelllink tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/shelllink.c | 59 +++++++++--------------------------------- 1 file changed, 12 insertions(+), 47 deletions(-) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 7828f0edf2..e4f176237f 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -34,23 +34,12 @@ #include "shell32_test.h" -#ifndef SLDF_HAS_LOGO3ID -# define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */ -#endif - static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHGetFolderLocation)(HWND,INT,HANDLE,DWORD,PIDLIST_ABSOLUTE*); -static HRESULT (WINAPI *pSHDefExtractIconA)(LPCSTR, int, UINT, HICON*, HICON*, UINT); static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINFO *); static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT); static BOOL (WINAPI *pIsProcessDPIAware)(void); -static const GUID _IID_IShellLinkDataList = { - 0x45e2b4ae, 0xb1c3, 0x11d0, - { 0xb9, 0x2f, 0x00, 0xa0, 0xc9, 0x03, 0x12, 0xe1 } -}; - - /* For some reason SHILCreateFromPath does not work on Win98 and * SHSimpleIDListFromPathA does not work on NT4. But if we call both we * get what we want on all platforms. @@ -136,7 +125,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer)); ok(r == S_OK, "GetDescription failed (0x%08x)\n", r); - ok(*buffer=='\0' || broken(strcmp(buffer,str)==0), "GetDescription returned '%s'\n", buffer); /* NT4 */ + ok(!*buffer, "GetDescription returned '%s'\n", buffer); /* Test Getting / Setting the work directory */ strcpy(buffer,"garbage"); @@ -156,14 +145,14 @@ static void test_get_set(void) /* Test Getting / Setting the path */ strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); - ok(r == S_FALSE || broken(r == S_OK) /* NT4/W2K */, "GetPath failed (0x%08x)\n", r); - ok(*buffer=='\0', "GetPath returned '%s'\n", buffer); + ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r); + ok(!*buffer, "GetPath returned '%s'\n", buffer); strcpy(buffer,"garbage"); memset(&finddata, 0xaa, sizeof(finddata)); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), &finddata, SLGP_RAWPATH); - ok(r == S_FALSE || broken(r == S_OK) /* NT4/W2K */, "GetPath failed (0x%08x)\n", r); - ok(*buffer=='\0', "GetPath returned '%s'\n", buffer); + ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r); + ok(!*buffer, "GetPath returned '%s'\n", buffer); ok(finddata.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes); ok(finddata.cFileName[0] == 0, "unexpected filename '%s'\n", finddata.cFileName); @@ -293,8 +282,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); ok(r==S_OK, "GetPath failed (0x%08x)\n", r); - todo_wine ok(!strcmp(buffer, "C:\\nonexistent\\file") || - broken(!strcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */ + todo_wine ok(!strcmp(buffer, "C:\\nonexistent\\file"), "case doesn't match\n"); r = IShellLinkA_SetPath(sl, "\"c:\\foo"); @@ -849,26 +837,10 @@ static void test_datalink(void) r = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (LPVOID*)&sl ); - ok( r == S_OK || - broken(r == E_NOINTERFACE), /* Win9x */ - "CoCreateInstance failed (0x%08x)\n", r); - if (!sl) - { - win_skip("no shelllink\n"); - return; - } - - r = IShellLinkW_QueryInterface( sl, &_IID_IShellLinkDataList, (LPVOID*) &dl ); - ok( r == S_OK || - broken(r == E_NOINTERFACE), /* NT4 */ - "IShellLinkW_QueryInterface failed (0x%08x)\n", r); + ok( r == S_OK, "Failed to create shelllink object, hr %#x.\n", r); - if (!dl) - { - win_skip("no datalink interface\n"); - IShellLinkW_Release( sl ); - return; - } + r = IShellLinkW_QueryInterface( sl, &IID_IShellLinkDataList, (void **)&dl ); + ok( r == S_OK, "Failed to get interface, hr %#x.\n", r); flags = 0; r = IShellLinkDataList_GetFlags( dl, &flags ); @@ -917,13 +889,7 @@ static void test_shdefextracticon(void) HICON hiconlarge=NULL, hiconsmall=NULL; HRESULT res; - if (!pSHDefExtractIconA) - { - win_skip("SHDefExtractIconA is unavailable\n"); - return; - } - - res = pSHDefExtractIconA("shell32.dll", 0, 0, &hiconlarge, &hiconsmall, MAKELONG(16,24)); + res = SHDefExtractIconA("shell32.dll", 0, 0, &hiconlarge, &hiconsmall, MAKELONG(16,24)); ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%x\n", res); ok(hiconlarge != NULL, "got null hiconlarge\n"); ok(hiconsmall != NULL, "got null hiconsmall\n"); @@ -931,12 +897,12 @@ static void test_shdefextracticon(void) DestroyIcon(hiconsmall); hiconsmall = NULL; - res = pSHDefExtractIconA("shell32.dll", 0, 0, NULL, &hiconsmall, MAKELONG(16,24)); + res = SHDefExtractIconA("shell32.dll", 0, 0, NULL, &hiconsmall, MAKELONG(16,24)); ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%x\n", res); ok(hiconsmall != NULL, "got null hiconsmall\n"); DestroyIcon(hiconsmall); - res = pSHDefExtractIconA("shell32.dll", 0, 0, NULL, NULL, MAKELONG(16,24)); + res = SHDefExtractIconA("shell32.dll", 0, 0, NULL, NULL, MAKELONG(16,24)); ok(SUCCEEDED(res), "SHDefExtractIconA failed, res=%x\n", res); } @@ -1454,7 +1420,6 @@ START_TEST(shelllink) pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28); pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation"); - pSHDefExtractIconA = (void *)GetProcAddress(hmod, "SHDefExtractIconA"); pSHGetStockIconInfo = (void *)GetProcAddress(hmod, "SHGetStockIconInfo"); pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW"); pIsProcessDPIAware = (void *)GetProcAddress(huser32, "IsProcessDPIAware");
1
0
0
0
Nikolay Sivov : shell32/tests: Use ILIsEqual() directly.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: b9349d135e655d9a25fc4f77e9dc115757402067 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b9349d135e655d9a25fc4f77…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 8 11:24:09 2020 +0300 shell32/tests: Use ILIsEqual() directly. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/shelllink.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 2c2ee94c17..7828f0edf2 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -38,7 +38,6 @@ # define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */ #endif -static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHGetFolderLocation)(HWND,INT,HANDLE,DWORD,PIDLIST_ABSOLUTE*); static HRESULT (WINAPI *pSHDefExtractIconA)(LPCSTR, int, UINT, HICON*, HICON*, UINT); @@ -234,12 +233,12 @@ static void test_get_set(void) tmp_pidl=NULL; r = IShellLinkA_GetIDList(sl, &tmp_pidl); ok(r == S_OK, "GetIDList failed (0x%08x)\n", r); - ok(tmp_pidl && pILIsEqual(pidl, tmp_pidl), + ok(tmp_pidl && ILIsEqual(pidl, tmp_pidl), "GetIDList returned an incorrect pidl\n"); r = IShellLinkA_GetIDList(sl, &second_pidl); ok(r == S_OK, "GetIDList failed (0x%08x)\n", r); - ok(second_pidl && pILIsEqual(pidl, second_pidl), + ok(second_pidl && ILIsEqual(pidl, second_pidl), "GetIDList returned an incorrect pidl\n"); ok(second_pidl != tmp_pidl, "pidls are the same\n"); @@ -583,7 +582,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo) r = IShellLinkA_GetIDList(sl, &pidl); lok(r == S_OK, "GetIDList failed (0x%08x)\n", r); todo_wine_if ((todo & 0x8) != 0) - lok(pILIsEqual(pidl, desc->pidl), "GetIDList returned an incorrect pidl\n"); + lok(ILIsEqual(pidl, desc->pidl), "GetIDList returned an incorrect pidl\n"); } if (desc->showcmd) { @@ -1453,7 +1452,6 @@ START_TEST(shelllink) HMODULE hmod = GetModuleHandleA("shell32.dll"); HMODULE huser32 = GetModuleHandleA("user32.dll"); - pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21); pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28); pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation"); pSHDefExtractIconA = (void *)GetProcAddress(hmod, "SHDefExtractIconA");
1
0
0
0
Zebediah Figura : user32/tests: Fix some test failures on Windows 10.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: 657aecc283f3ced82b2ad48410b16323f5217d28 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=657aecc283f3ced82b2ad484…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jan 8 00:44:26 2020 -0600 user32/tests: Fix some test failures on Windows 10. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 46784cec43..4e9de6c8bf 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -192,7 +192,8 @@ static BOOL ignore_message( UINT message ) message == WM_TIMER || message == WM_SYSTIMER || message == WM_TIMECHANGE || - message == WM_DEVICECHANGE); + message == WM_DEVICECHANGE || + message == 0x0060 /* undocumented, used by Win10 1709+ */); } static BOOL CALLBACK EnumChildProc( HWND hwndChild, LPARAM lParam) @@ -1117,7 +1118,7 @@ static void wine_AdjustWindowRectExForDpi( RECT *rect, LONG style, BOOL menu, LO int adjust = 0; ncm.cbSize = sizeof(ncm); - pSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); + pSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0, dpi ); if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) adjust = 1; /* for the outer frame always present */ @@ -2541,6 +2542,8 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2) ok( rect.left == 90 && rect.top == 90 && rect.right == 110 && rect.bottom == 110, "invalid client rect %s\n", wine_dbgstr_rect(&rect)); + flush_events( TRUE ); /* needed by Win10 1709+ */ + ret = SetWindowPos(hwnd, 0, 200, 200, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED); ok(ret, "Got %d\n", ret); GetWindowRect( hwnd, &rect ); @@ -3180,8 +3183,10 @@ static void test_SetActiveWindow(HWND hwnd) ShowWindow(hwnd, SW_SHOW); check_wnd_state(hwnd, hwnd, hwnd, 0); + SetLastError(0xdeadbeef); ret = SetActiveWindow(0); - ok(ret == hwnd, "SetActiveWindow returned %p instead of %p\n", ret, hwnd); + ok(ret == hwnd || broken(!ret) /* Win10 1809 */, "expected %p, got %p\n", hwnd, ret); + if (!ret) ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError()); if (!GetActiveWindow()) /* doesn't always work on vista */ { check_wnd_state(0, 0, 0, 0); @@ -3238,8 +3243,10 @@ static void test_SetActiveWindow(HWND hwnd) ret = SetActiveWindow(hwnd2); ok(ret == hwnd, "expected %p, got %p\n", hwnd, ret); check_wnd_state(hwnd, hwnd, hwnd, 0); + SetLastError(0xdeadbeef); ret = SetActiveWindow(0); - ok(ret == hwnd, "expected %p, got %p\n", hwnd, ret); + ok(ret == hwnd || broken(!ret) /* Win10 1809 */, "expected %p, got %p\n", hwnd, ret); + if (!ret) ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError()); if (!GetActiveWindow()) { ret = SetActiveWindow(hwnd2); @@ -3294,8 +3301,10 @@ static void test_SetForegroundWindow(HWND hwnd) ShowWindow(hwnd, SW_SHOW); check_wnd_state(hwnd, hwnd, hwnd, 0); + SetLastError(0xdeadbeef); hwnd2 = SetActiveWindow(0); - ok(hwnd2 == hwnd, "SetActiveWindow(0) returned %p instead of %p\n", hwnd2, hwnd); + ok(hwnd2 == hwnd || broken(!hwnd2) /* Win10 1809 */, "expected %p, got %p\n", hwnd, hwnd2); + if (!hwnd2) ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError()); if (GetActiveWindow() == hwnd) /* doesn't always work on vista */ check_wnd_state(hwnd, hwnd, hwnd, 0); else @@ -3963,13 +3972,12 @@ static void test_mouse_input(HWND hwnd) ret = wait_for_message( &msg ); ok(ret, "no message available\n"); -todo_wine - ok(msg.hwnd == child && msg.message == WM_NCMOUSEMOVE, "hwnd %p/%p message %04x\n", - msg.hwnd, child, msg.message); - - if (msg.message == WM_NCMOUSEMOVE) + if (msg.message == WM_NCMOUSEMOVE) /* not sent by Win10 1709+ */ + { + ok(msg.hwnd == child, "expected %p, got %p\n", child, msg.hwnd); ret = wait_for_message( &msg ); - ok(ret, "no message available\n"); + ok(ret, "no message available\n"); + } ok(msg.hwnd == child && msg.message == WM_NCLBUTTONDOWN, "hwnd %p/%p message %04x\n", msg.hwnd, child, msg.message); ok(msg.wParam == HTSYSMENU, "wparam %ld\n", msg.wParam);
1
0
0
0
Derek Lesho : bcrypt/tests: Add tests for BCRYPT_KDF_HASH.
by Alexandre Julliard
08 Jan '20
08 Jan '20
Module: wine Branch: master Commit: c2840dce7f9e4e86f33e06ebb4ddf9efd6f448b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c2840dce7f9e4e86f33e06eb…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Tue Jan 7 14:22:48 2020 -0600 bcrypt/tests: Add tests for BCRYPT_KDF_HASH. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/tests/bcrypt.c | 60 ++++++++++++++++++++++++++++++++++++++++++++-- include/bcrypt.h | 6 +++++ 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 47bb58d3d1..d26150f469 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -1951,6 +1951,28 @@ static BYTE ecdh_secret[] = 0x9b, 0x69, 0xaf, 0xd1, 0xaf, 0x1f, 0xc2, 0xd7, 0x83, 0x0a, 0xb7, 0xf8, 0x4f, 0x24, 0x32, 0x8e, }; +BCryptBuffer hash_param_buffers[] = +{ +{ + sizeof(BCRYPT_SHA1_ALGORITHM), + KDF_HASH_ALGORITHM, + (void *)BCRYPT_SHA1_ALGORITHM, +} +}; + +BCryptBufferDesc hash_params = +{ + BCRYPTBUFFER_VERSION, + ARRAY_SIZE(hash_param_buffers), + hash_param_buffers, +}; + +static BYTE hashed_secret[] = +{ + 0x1b, 0xe7, 0xbf, 0x0f, 0x65, 0x1e, 0xd0, 0x07, 0xf9, 0xf4, 0x77, 0x48, 0x48, 0x39, 0xd0, 0xf8, + 0xf3, 0xce, 0xfc, 0x89 +}; + static void test_ECDH(void) { BYTE *buf; @@ -2045,14 +2067,14 @@ static void test_ECDH(void) if (status == STATUS_NOT_SUPPORTED) { win_skip("BCRYPT_KDF_RAW_SECRET not supported\n"); - goto derive_end; + goto raw_secret_end; } todo_wine ok(status == STATUS_SUCCESS, "got %08x\n", status); if (status != STATUS_SUCCESS) { - goto derive_end; + goto raw_secret_end; } ok(size == 32, "size of secret key incorrect, got %u, expected 32\n", size); @@ -2062,6 +2084,40 @@ static void test_ECDH(void) ok(!(memcmp(ecdh_secret, buf, size)), "wrong data\n"); HeapFree(GetProcessHeap(), 0, buf); + raw_secret_end: + + status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0); + todo_wine ok (status == STATUS_SUCCESS, "got %08x\n", status); + + if (status != STATUS_SUCCESS) + { + goto derive_end; + } + + ok (size == 20, "got %u\n", size); + buf = HeapAlloc(GetProcessHeap(), 0, size); + status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, buf, size, &size, 0); + ok(status == STATUS_SUCCESS, "got %08x\n", status); + ok(!(memcmp(hashed_secret, buf, size)), "wrong data\n"); + HeapFree(GetProcessHeap(), 0, buf); + + /* ulVersion is not verified */ + hash_params.ulVersion = 0xdeadbeef; + status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0); + ok (status == STATUS_SUCCESS, "got %08x\n", status); + + hash_params.ulVersion = BCRYPTBUFFER_VERSION; + hash_param_buffers[0].pvBuffer = (void*) L"INVALID"; + hash_param_buffers[0].cbBuffer = sizeof(L"INVALID"); + + status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0); + ok (status == STATUS_NOT_SUPPORTED || broken (status == STATUS_NOT_FOUND) /* < win8 */, "got %08x\n", status); + + hash_param_buffers[0].pvBuffer = (void*) BCRYPT_RNG_ALGORITHM; + hash_param_buffers[0].cbBuffer = sizeof(BCRYPT_RNG_ALGORITHM); + status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0); + ok (status == STATUS_NOT_SUPPORTED, "got %08x\n", status); + derive_end: pBCryptDestroySecret(secret); diff --git a/include/bcrypt.h b/include/bcrypt.h index f393dc6e5c..0bc4dea910 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -286,6 +286,10 @@ typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER ULONG cbKeyData; } BCRYPT_KEY_DATA_BLOB_HEADER, *PBCRYPT_KEY_DATA_BLOB_HEADER; +#define KDF_HASH_ALGORITHM 0x00000000 +#define KDF_SECRET_PREPEND 0x00000001 +#define KDF_SECRET_APPEND 0x00000002 + typedef struct _BCryptBuffer { ULONG cbBuffer; @@ -293,6 +297,8 @@ typedef struct _BCryptBuffer void *pvBuffer; } BCryptBuffer, *PBCryptBuffer; +#define BCRYPTBUFFER_VERSION 0 + typedef struct _BCryptBufferDesc { ULONG ulVersion;
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
54
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
Results per page:
10
25
50
100
200