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
September 2017
----- 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
446 discussions
Start a n
N
ew thread
Matteo Bruni : wined3d: Return the up-to-date locations from blitters.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: c50090cb6eeb1abd1d10665d7c9b04fe43f633e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c50090cb6eeb1abd1d10665d7…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Sep 6 01:39:18 2017 +0200 wined3d: Return the up-to-date locations from blitters. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 7 ++++--- dlls/wined3d/surface.c | 36 ++++++++++++++++++++---------------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 25 insertions(+), 20 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c50090cb6eeb1abd1d106…
1
0
0
0
Matteo Bruni : d3d9/tests: Add a test for "NULL" FourCC format.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 99168377865927cf4f93d65cfea8d7de7e511018 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=99168377865927cf4f93d65cf…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Sep 6 01:39:16 2017 +0200 d3d9/tests: Add a test for "NULL" FourCC format. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 194 insertions(+), 2 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index ef91296..822e6e4 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -16101,7 +16101,7 @@ static void resz_test(void) 0x02000001, 0x800f0800, 0x80e40001, /* mov oC0, r1 */ 0x0000ffff, /* end */ }; - struct + static const struct { float x, y, z; float s, t, p, q; @@ -16113,7 +16113,7 @@ static void resz_test(void) { -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f}, { 1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.5f}, }; - struct + static const struct { UINT x, y; D3DCOLOR color; @@ -22850,7 +22850,198 @@ static void test_mvp_software_vertex_shaders(void) done: IDirect3D9_Release(d3d); DestroyWindow(window); +} + +static void test_null_format(void) +{ + static const D3DVIEWPORT9 vp_lower = {0, 60, 640, 420, 0.0f, 1.0f}; + static const D3DVIEWPORT9 vp_560 = {0, 180, 560, 300, 0.0f, 1.0f}; + static const D3DVIEWPORT9 vp_full = {0, 0, 640, 480, 0.0f, 1.0f}; + static const DWORD null_fourcc = MAKEFOURCC('N','U','L','L'); + static const struct + { + struct vec3 pos; + DWORD diffuse; + } + quad_partial[] = + { + {{-1.0f, 0.5f, 0.1f}, 0x000000ff}, + {{ 0.5f, 0.5f, 0.1f}, 0x000000ff}, + {{-1.0f, -1.0f, 0.1f}, 0x000000ff}, + {{ 0.5f, -1.0f, 0.1f}, 0x000000ff}, + }, + quad[] = + { + {{-1.0f, 1.0f, 0.5f}, 0x00ff0000}, + {{ 1.0f, 1.0f, 0.5f}, 0x00ff0000}, + {{-1.0f, -1.0f, 0.5f}, 0x00ff0000}, + {{ 1.0f, -1.0f, 0.5f}, 0x00ff0000}, + }, + quad_far[] = + { + {{-1.0f, 1.0f, 1.0f}, 0x0000ff00}, + {{ 1.0f, 1.0f, 1.0f}, 0x0000ff00}, + {{-1.0f, -1.0f, 1.0f}, 0x0000ff00}, + {{ 1.0f, -1.0f, 1.0f}, 0x0000ff00}, + }; + static const struct + { + unsigned int x, y; + D3DCOLOR color; + BOOL todo; + } + expected_colors[] = + { + {200, 30, 0x0000ff00, FALSE}, + {440, 30, 0x0000ff00, FALSE}, + {520, 30, 0x0000ff00, FALSE}, + {600, 30, 0x0000ff00, FALSE}, + {200, 90, 0x00000000, FALSE}, + {440, 90, 0x0000ff00, FALSE}, + {520, 90, 0x0000ff00, FALSE}, + {600, 90, 0x0000ff00, FALSE}, + {200, 150, 0x000000ff, FALSE}, + {440, 150, 0x000000ff, FALSE}, + {520, 150, 0x0000ff00, FALSE}, + {600, 150, 0x0000ff00, FALSE}, + {200, 320, 0x000000ff, FALSE}, + {440, 320, 0x000000ff, FALSE}, + {520, 320, 0x00000000, TRUE}, + {600, 320, 0x0000ff00, FALSE}, + }; + IDirect3DSurface9 *original_rt, *small_rt, *null_rt, *small_null_rt; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + unsigned int i; + D3DCOLOR color; + HWND window; + HRESULT hr; + + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, + D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, null_fourcc))) + { + skip("No NULL format support, skipping NULL test.\n"); + IDirect3D9_Release(d3d); + return; + } + + window = create_window(); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &original_rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateRenderTarget(device, 400, 300, D3DFMT_A8R8G8B8, + D3DMULTISAMPLE_NONE, 0, FALSE, &small_rt, NULL); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 640, 480, null_fourcc, + D3DMULTISAMPLE_NONE, 0, FALSE, &null_rt, NULL); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 400, 300, null_fourcc, + D3DMULTISAMPLE_NONE, 0, FALSE, &small_null_rt, NULL); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); + ok(SUCCEEDED(hr), "Failed to enable depth test, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZFUNC, D3DCMP_LESSEQUAL); + ok(SUCCEEDED(hr), "Failed to set depth function, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to enable depth write, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + /* Clear extends to viewport size > RT size even if format is not + * "NULL". */ + hr = IDirect3DDevice9_SetRenderTarget(device, 0, small_rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetViewport(device, &vp_full); + ok(hr == D3D_OK, "Failed to set viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_ZBUFFER, 0, 0.2f, 0); + ok(SUCCEEDED(hr), "Failed to clear depth/stencil, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, null_rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_ZBUFFER, 0, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear depth/stencil, hr %#x.\n", hr); + /* Draw only extends to viewport size > RT size if format is "NULL". */ + hr = IDirect3DDevice9_SetRenderTarget(device, 0, small_rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetViewport(device, &vp_lower); + ok(hr == D3D_OK, "Failed to set viewport, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, small_null_rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetViewport(device, &vp_560); + ok(hr == D3D_OK, "Failed to set viewport, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad_partial, sizeof(*quad_partial)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad_far, sizeof(*quad_far)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) + { + color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + todo_wine_if(expected_colors[i].todo) ok(color_match(color, expected_colors[i].color, 1), + "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", + expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); + } + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + IDirect3DSurface9_Release(small_null_rt); + IDirect3DSurface9_Release(null_rt); + IDirect3DSurface9_Release(small_rt); + IDirect3DSurface9_Release(original_rt); + cleanup_device(device); + IDirect3D9_Release(d3d); } START_TEST(visual) @@ -22984,4 +23175,5 @@ START_TEST(visual) test_drawindexedprimitiveup(); test_vertex_texture(); test_mvp_software_vertex_shaders(); + test_null_format(); }
1
0
0
0
Alexandre Julliard : ntdll: Don' t do partial writes in virtual_uninterrupted_write_memory.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 3bfd7973a432450492607a4dfe54f774370e9318 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bfd7973a432450492607a4df…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Sep 6 17:16:25 2017 +0200 ntdll: Don't do partial writes in virtual_uninterrupted_write_memory. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/signal_i386.c | 7 +++--- dlls/ntdll/virtual.c | 56 ++++++++++++++++-------------------------------- 3 files changed, 23 insertions(+), 42 deletions(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index c97b1e1..7b13448 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -171,7 +171,7 @@ extern NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_st extern BOOL virtual_check_buffer_for_read( const void *ptr, SIZE_T size ) DECLSPEC_HIDDEN; extern BOOL virtual_check_buffer_for_write( void *ptr, SIZE_T size ) DECLSPEC_HIDDEN; extern SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size ) DECLSPEC_HIDDEN; -extern SIZE_T virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size ) DECLSPEC_HIDDEN; +extern NTSTATUS virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size ) DECLSPEC_HIDDEN; extern void VIRTUAL_SetForceExec( BOOL enable ) DECLSPEC_HIDDEN; extern void virtual_release_address_space(void) DECLSPEC_HIDDEN; extern void virtual_set_large_address_space(void) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index f33c43f..ab8d114 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -1808,8 +1808,8 @@ static BOOL check_atl_thunk( EXCEPTION_RECORD *rec, CONTEXT *context ) if (thunk_len >= sizeof(thunk_copy.t1) && thunk_copy.t1.movl == 0x042444c7 && thunk_copy.t1.jmp == 0xe9) { - if (virtual_uninterrupted_write_memory( (DWORD *)context->Esp + 1, - &thunk_copy.t1.this, sizeof(DWORD) ) == sizeof(DWORD)) + if (!virtual_uninterrupted_write_memory( (DWORD *)context->Esp + 1, + &thunk_copy.t1.this, sizeof(DWORD) )) { context->Eip = (DWORD_PTR)(&thunk->t1.func + 1) + thunk_copy.t1.func; TRACE( "emulating ATL thunk type 1 at %p, func=%08x arg=%08x\n", @@ -1856,8 +1856,7 @@ static BOOL check_atl_thunk( EXCEPTION_RECORD *rec, CONTEXT *context ) stack, sizeof(stack) ) == sizeof(stack) && virtual_uninterrupted_read_memory( (DWORD *)stack[1] + 1, &func, sizeof(DWORD) ) == sizeof(DWORD) && - virtual_uninterrupted_write_memory( (DWORD *)context->Esp + 1, - &stack[0], sizeof(stack[0]) ) == sizeof(stack[0])) + !virtual_uninterrupted_write_memory( (DWORD *)context->Esp + 1, &stack[0], sizeof(stack[0]) )) { context->Ecx = stack[0]; context->Eax = stack[1]; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 9a69a15..a730417 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1907,54 +1907,36 @@ SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T * permissions are checked before accessing each page, to ensure that no * exceptions can happen. */ -SIZE_T virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size ) +NTSTATUS virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size ) { struct file_view *view; sigset_t sigset; - SIZE_T bytes_written = 0; + NTSTATUS ret = STATUS_ACCESS_VIOLATION; - if (!size) return 0; + if (!size) return STATUS_SUCCESS; server_enter_uninterrupted_section( &csVirtual, &sigset ); - if ((view = VIRTUAL_FindView( addr, size ))) + if ((view = VIRTUAL_FindView( addr, size )) && !(view->protect & VPROT_SYSTEM)) { - if (!(view->protect & VPROT_SYSTEM)) - { - while (bytes_written < size) - { - void *page = ROUND_ADDR( addr, page_mask ); - BYTE vprot = get_page_vprot( page ); - SIZE_T block_size; - - /* If the page is not writable then check for write watches - * before giving up. This can be done without raising a real - * exception. Similar to virtual_handle_fault. */ - if (!(VIRTUAL_GetUnixProt( vprot ) & PROT_WRITE)) - { - if (!(view->protect & VPROT_WRITEWATCH)) - break; - - if (vprot & VPROT_WRITEWATCH) - { - set_page_vprot_bits( page, page_size, 0, VPROT_WRITEWATCH ); - mprotect_range( view, page, page_size, 0, 0 ); - } - /* ignore fault if page is writable now */ - if (!(VIRTUAL_GetUnixProt( get_page_vprot( page )) & PROT_WRITE)) - break; - } - - block_size = min( size, page_size - ((UINT_PTR)addr & page_mask) ); - memcpy( addr, buffer, block_size ); + char *page = ROUND_ADDR( addr, page_mask ); + size_t i, total = ROUND_SIZE( addr, size ); - addr = (void *)((char *)addr + block_size); - buffer = (const void *)((const char *)buffer + block_size); - bytes_written += block_size; - } + for (i = 0; i < total; i += page_size) + { + int prot = VIRTUAL_GetUnixProt( get_page_vprot( page + i ) & ~VPROT_WRITEWATCH ); + if (!(prot & PROT_WRITE)) goto done; } + if (view->protect & VPROT_WRITEWATCH) /* enable write access by clearing write watches */ + { + set_page_vprot_bits( addr, size, 0, VPROT_WRITEWATCH ); + mprotect_range( view, addr, size, 0, 0 ); + } + memcpy( addr, buffer, size ); + ret = STATUS_SUCCESS; } +done: server_leave_uninterrupted_section( &csVirtual, &sigset ); - return bytes_written; + return ret; }
1
0
0
0
Alexandre Julliard : ntdll: Allocate views out of a memory block instead of using a heap.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: a0f64e1231a88417fe8b6e3eb459b2c8a098aec6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a0f64e1231a88417fe8b6e3eb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Sep 6 09:58:18 2017 +0200 ntdll: Allocate views out of a memory block instead of using a heap. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/virtual.c | 62 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 9f1b6da..9a69a15 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -143,8 +143,6 @@ static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); #define VIRTUAL_DEBUG_DUMP_VIEW(view) \ do { if (TRACE_ON(virtual)) VIRTUAL_DumpView(view); } while (0) -#define VIRTUAL_HEAP_SIZE (sizeof(void*)*1024*1024) - #ifdef _WIN64 /* on 64-bit the page protection bytes use a 2-level table */ static const size_t pages_vprot_shift = 20; static const size_t pages_vprot_mask = (1 << 20) - 1; @@ -154,7 +152,8 @@ static BYTE **pages_vprot; static BYTE *pages_vprot; #endif -static HANDLE virtual_heap; +static struct file_view *view_block_start, *view_block_end, *next_free_view; +static const size_t view_block_size = 0x100000; static void *preload_reserve_start; static void *preload_reserve_end; static BOOL use_locks; @@ -587,6 +586,30 @@ static inline void unmap_area( void *addr, size_t size ) /*********************************************************************** + * alloc_view + * + * Allocate a new view. The csVirtual section must be held by caller. + */ +static struct file_view *alloc_view(void) +{ + if (next_free_view) + { + struct file_view *ret = next_free_view; + next_free_view = *(struct file_view **)ret; + return ret; + } + if (view_block_start == view_block_end) + { + void *ptr = wine_anon_mmap( NULL, view_block_size, PROT_READ | PROT_WRITE, 0 ); + if (ptr == (void *)-1) return NULL; + view_block_start = ptr; + view_block_end = view_block_start + view_block_size / sizeof(*view_block_start); + } + return view_block_start++; +} + + +/*********************************************************************** * delete_view * * Deletes a view. The csVirtual section must be held by caller. @@ -596,7 +619,8 @@ static void delete_view( struct file_view *view ) /* [in] View */ if (!(view->protect & VPROT_SYSTEM)) unmap_area( view->base, view->size ); list_remove( &view->entry ); if (view->mapping) close_handle( view->mapping ); - RtlFreeHeap( virtual_heap, 0, view ); + *(struct file_view **)view = next_free_view; + next_free_view = view; } @@ -618,9 +642,9 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz /* Create the view structure */ - if (!(view = RtlAllocateHeap( virtual_heap, 0, sizeof(*view) ))) + if (!(view = alloc_view())) { - FIXME( "out of memory in virtual heap for %p-%p\n", base, (char *)base + size ); + FIXME( "out of memory for %p-%p\n", base, (char *)base + size ); return STATUS_NO_MEMORY; } @@ -1490,9 +1514,8 @@ static int alloc_virtual_heap( void *base, size_t size, void *arg ) void virtual_init(void) { const char *preload; - struct alloc_virtual_heap alloc_heap; + struct alloc_virtual_heap alloc_views; size_t size; - struct file_view *heap_view; #if !defined(__i386__) && !defined(__x86_64__) page_size = sysconf( _SC_PAGESIZE ); @@ -1518,21 +1541,22 @@ void virtual_init(void) } } - /* try to find space in a reserved area for the virtual heap and pages protection table */ + /* try to find space in a reserved area for the views and pages protection table */ #ifdef _WIN64 pages_vprot_size = ((size_t)address_space_limit >> page_shift >> pages_vprot_shift) + 1; - alloc_heap.size = VIRTUAL_HEAP_SIZE + pages_vprot_size * sizeof(*pages_vprot); + alloc_views.size = view_block_size + pages_vprot_size * sizeof(*pages_vprot); #else - alloc_heap.size = VIRTUAL_HEAP_SIZE + (1U << (32 - page_shift)); + alloc_views.size = view_block_size + (1U << (32 - page_shift)); #endif - if (!wine_mmap_enum_reserved_areas( alloc_virtual_heap, &alloc_heap, 1 )) - alloc_heap.base = wine_anon_mmap( NULL, alloc_heap.size, PROT_READ|PROT_WRITE, 0 ); - - assert( alloc_heap.base != (void *)-1 ); - pages_vprot = (void *)((char *)alloc_heap.base + VIRTUAL_HEAP_SIZE); - virtual_heap = RtlCreateHeap( HEAP_NO_SERIALIZE, alloc_heap.base, VIRTUAL_HEAP_SIZE, - VIRTUAL_HEAP_SIZE, NULL, NULL ); - create_view( &heap_view, alloc_heap.base, alloc_heap.size, VPROT_COMMITTED|VPROT_READ|VPROT_WRITE ); + if (wine_mmap_enum_reserved_areas( alloc_virtual_heap, &alloc_views, 1 )) + wine_mmap_remove_reserved_area( alloc_views.base, alloc_views.size, 0 ); + else + alloc_views.base = wine_anon_mmap( NULL, alloc_views.size, PROT_READ | PROT_WRITE, 0 ); + + assert( alloc_views.base != (void *)-1 ); + view_block_start = alloc_views.base; + view_block_end = view_block_start + view_block_size / sizeof(*view_block_start); + pages_vprot = (void *)((char *)alloc_views.base + view_block_size); /* make the DOS area accessible (except the low 64K) to hide bugs in broken apps like Excel 2003 */ size = (char *)address_space_start - (char *)0x10000;
1
0
0
0
Dmitry Timoshkov : windowscodecs: Fix IWICBitmapEncoder:: SetPalette for a not initialized case in PNG encoder.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: eb3eff90be46aada7faa1af36eb68b25f3087a71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eb3eff90be46aada7faa1af36…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Sep 5 13:57:32 2017 -0500 windowscodecs: Fix IWICBitmapEncoder::SetPalette for a not initialized case in PNG encoder. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/pngformat.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 821e2c3..b4fd346 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -1952,10 +1952,20 @@ static HRESULT WINAPI PngEncoder_SetColorContexts(IWICBitmapEncoder *iface, return E_NOTIMPL; } -static HRESULT WINAPI PngEncoder_SetPalette(IWICBitmapEncoder *iface, IWICPalette *pIPalette) +static HRESULT WINAPI PngEncoder_SetPalette(IWICBitmapEncoder *iface, IWICPalette *palette) { - TRACE("(%p,%p)\n", iface, pIPalette); - return WINCODEC_ERR_UNSUPPORTEDOPERATION; + PngEncoder *This = impl_from_IWICBitmapEncoder(iface); + HRESULT hr; + + TRACE("(%p,%p)\n", iface, palette); + + EnterCriticalSection(&This->lock); + + hr = This->stream ? WINCODEC_ERR_UNSUPPORTEDOPERATION : WINCODEC_ERR_NOTINITIALIZED; + + LeaveCriticalSection(&This->lock); + + return hr; } static HRESULT WINAPI PngEncoder_SetThumbnail(IWICBitmapEncoder *iface, IWICBitmapSource *pIThumbnail)
1
0
0
0
Dmitry Timoshkov : windowscodecs: Implement IWICBitmapDecoder:: CopyPalette in PNG decoder.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 2ea95f895be3d07600cc2f8654c7e85ec174b952 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ea95f895be3d07600cc2f865…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Sep 5 13:57:31 2017 -0500 windowscodecs: Implement IWICBitmapDecoder::CopyPalette in PNG decoder. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/pngformat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 815125fd..821e2c3 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -857,10 +857,10 @@ static HRESULT WINAPI PngDecoder_GetDecoderInfo(IWICBitmapDecoder *iface, } static HRESULT WINAPI PngDecoder_CopyPalette(IWICBitmapDecoder *iface, - IWICPalette *pIPalette) + IWICPalette *palette) { - FIXME("(%p,%p): stub\n", iface, pIPalette); - return E_NOTIMPL; + TRACE("(%p,%p)\n", iface, palette); + return WINCODEC_ERR_PALETTEUNAVAILABLE; } static HRESULT WINAPI PngDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface,
1
0
0
0
Vincent Povirk : gdiplus: Account for gdi32 transform in GdipSetClipHrgn.
by Alexandre Julliard
05 Sep '17
05 Sep '17
Module: wine Branch: master Commit: b32c3243782477f7cc6dc5a189a3e4a5dacce1c8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b32c3243782477f7cc6dc5a18…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Sep 5 13:43:33 2017 -0500 gdiplus: Account for gdi32 transform in GdipSetClipHrgn. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 18 ++++++++++++----- dlls/gdiplus/tests/graphics.c | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3b01505..ea02c6b 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -6209,6 +6209,7 @@ GpStatus WINGDIPAPI GdipSetClipHrgn(GpGraphics *graphics, HRGN hrgn, CombineMode { GpRegion *region; GpStatus status; + GpMatrix transform; TRACE("(%p, %p, %d)\n", graphics, hrgn, mode); @@ -6218,14 +6219,21 @@ GpStatus WINGDIPAPI GdipSetClipHrgn(GpGraphics *graphics, HRGN hrgn, CombineMode if(graphics->busy) return ObjectBusy; - /* hrgn is already in device units */ + /* hrgn is in gdi32 device units */ status = GdipCreateRegionHrgn(hrgn, ®ion); - if(status != Ok) - return status; - status = GdipCombineRegionRegion(graphics->clip, region, mode); + if (status == Ok) + { + status = get_graphics_transform(graphics, CoordinateSpaceDevice, WineCoordinateSpaceGdiDevice, &transform); + + if (status == Ok) + status = GdipTransformRegion(region, &transform); + + if (status == Ok) + status = GdipCombineRegionRegion(graphics->clip, region, mode); - GdipDeleteRegion(region); + GdipDeleteRegion(region); + } return status; } diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 5416ebc..651ba53 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -6529,6 +6529,51 @@ static void test_GdipDrawImagePointsRectOnMemoryDC(void) ReleaseDC(hwnd, dc); } +static void test_cliphrgn_transform(void) +{ + HDC hdc; + GpStatus status; + GpGraphics *graphics; + HRGN rgn; + RectF rectf; + BOOL res; + + hdc = GetDC(hwnd); + + SetViewportOrgEx(hdc, 10, 10, NULL); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + rgn = CreateRectRgn(0, 0, 100, 100); + + status = GdipSetClipHrgn(graphics, rgn, CombineModeReplace); + expect(Ok, status); + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + expectf(-10.0, rectf.X); + expectf(-10.0, rectf.Y); + expectf(100.0, rectf.Width); + expectf(100.0, rectf.Height); + + status = GdipIsVisiblePoint(graphics, 95, 95, &res); + expect(Ok, status); + expect(FALSE, res); + + status = GdipIsVisiblePoint(graphics, -5, -5, &res); + expect(Ok, status); + expect(TRUE, res); + + DeleteObject(rgn); + + GdipDeleteGraphics(graphics); + + SetViewportOrgEx(hdc, 0, 0, NULL); + + ReleaseDC(hwnd, hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -6618,6 +6663,7 @@ START_TEST(graphics) test_GdipDrawImagePointsRectOnMemoryDC(); test_container_rects(); test_GdipGraphicsSetAbort(); + test_cliphrgn_transform(); GdiplusShutdown(gdiplusToken); DestroyWindow( hwnd );
1
0
0
0
Vincent Povirk : gdiplus: Account for gdi32 transforms in text functions.
by Alexandre Julliard
05 Sep '17
05 Sep '17
Module: wine Branch: master Commit: 9e1c110585e0b9df28c0d41b47f42ba50a6d23d2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e1c110585e0b9df28c0d41b4…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Sep 5 13:43:32 2017 -0500 gdiplus: Account for gdi32 transforms in text functions. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index da70899..3b01505 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -302,13 +302,6 @@ static void round_points(POINT *pti, GpPointF *ptf, INT count) } } -static void transform_and_round_points(GpGraphics *graphics, POINT *pti, - GpPointF *ptf, INT count) -{ - gdip_transform_points(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, ptf, count); - round_points(pti, ptf, count); -} - static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_width, INT dst_height, HDC hdc, INT src_x, INT src_y, INT src_width, INT src_height) { @@ -2226,7 +2219,7 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, GdipTransformMatrixPoints(&xform, pt, 3); } - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, pt, 3); angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); @@ -5263,7 +5256,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, pt[1].Y = 0.0; pt[2].X = 0.0; pt[2].Y = 1.0; - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, pt, 3); args.rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); args.rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ @@ -5292,9 +5285,13 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, args.regions = regions; + gdi_transform_acquire(graphics); + stat = gdip_format_string(hdc, string, length, font, &scaled_rect, stringFormat, (stringFormat->attr & StringFormatFlagsNoClip) != 0, measure_ranges_callback, &args); + gdi_transform_release(graphics); + SelectObject(hdc, oldfont); DeleteObject(gdifont); @@ -5382,7 +5379,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, pt[1].Y = 0.0; pt[2].X = 0.0; pt[2].Y = 1.0; - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, pt, 3); args.rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); args.rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ @@ -5417,9 +5414,13 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, args.linesfilled = &lines; lines = glyphs = 0; + gdi_transform_acquire(graphics); + gdip_format_string(hdc, string, length, font, &scaled_rect, format, TRUE, measure_string_callback, &args); + gdi_transform_release(graphics); + if (linesfilled) *linesfilled = lines; if (codepointsfitted) *codepointsfitted = glyphs; @@ -5549,7 +5550,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string pt[1].Y = 0.0; pt[2].X = 0.0; pt[2].Y = 1.0; - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, pt, 3); rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ @@ -5559,7 +5560,8 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string rectcpy[1].Y = rectcpy[0].Y = rect->Y; rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width; rectcpy[3].Y = rectcpy[2].Y = rect->Y + rect->Height; - transform_and_round_points(graphics, corners, rectcpy, 4); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, rectcpy, 4); + round_points(corners, rectcpy, 4); margin_x = (format && format->generic_typographic) ? 0.0 : font->emSize / 6.0; margin_x *= units_scale(font->unit, graphics->unit, graphics->xres); @@ -5598,12 +5600,16 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string args.rel_width = rel_width; args.rel_height = rel_height; + gdi_transform_acquire(graphics); + GetTextMetricsW(hdc, &textmetric); args.ascent = textmetric.tmAscent / rel_height; gdip_format_string(hdc, string, length, font, &scaled_rect, format, TRUE, draw_string_callback, &args); + gdi_transform_release(graphics); + DeleteObject(rgn); DeleteObject(gdifont); @@ -6907,7 +6913,7 @@ GpStatus WINGDIPAPI GdipMeasureDriverString(GpGraphics *graphics, GDIPCONST UINT GpMatrix xform = *matrix; GdipTransformMatrixPoints(&xform, pt, 3); } - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, pt, 3); rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ @@ -7001,15 +7007,19 @@ static GpStatus GDI32_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT1 } pt = positions[0]; - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, &pt, 1); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, &pt, 1); get_font_hfont(graphics, font, format, &hfont, matrix); SelectObject(graphics->hdc, hfont); SetTextAlign(graphics->hdc, TA_BASELINE|TA_LEFT); + gdi_transform_acquire(graphics); + ExtTextOutW(graphics->hdc, gdip_round(pt.X), gdip_round(pt.Y), eto_flags, NULL, text, length, NULL); + gdi_transform_release(graphics); + RestoreDC(graphics->hdc, save_state); DeleteObject(hfont); @@ -7057,7 +7067,8 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI { real_position = positions[0]; - transform_and_round_points(graphics, pti, &real_position, 1); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, &real_position, 1); + round_points(pti, &real_position, 1); } else { @@ -7070,7 +7081,8 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI memcpy(real_positions, positions, sizeof(PointF) * length); - transform_and_round_points(graphics, pti, real_positions, length); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, real_positions, length); + round_points(pti, real_positions, length); heap_free(real_positions); } @@ -7210,10 +7222,14 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI heap_free(text_mask); + gdi_transform_acquire(graphics); + /* draw the result */ stat = alpha_blend_pixels(graphics, min_x, min_y, pixel_data, pixel_area.Width, pixel_area.Height, pixel_data_stride, PixelFormat32bppARGB); + gdi_transform_release(graphics); + heap_free(pixel_data); return stat;
1
0
0
0
Vincent Povirk : gdiplus: Account for gdi32 transform in SOFTWARE_GdipDrawPath.
by Alexandre Julliard
05 Sep '17
05 Sep '17
Module: wine Branch: master Commit: ac51280b1f9ab818a136f7b6987a590ea78ea66f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac51280b1f9ab818a136f7b69…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Sep 5 13:43:31 2017 -0500 gdiplus: Account for gdi32 transform in SOFTWARE_GdipDrawPath. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4413e75..da70899 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3799,7 +3799,7 @@ static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath * points[1].X = pen->width; points[2].Y = pen->width; - stat = GdipTransformPoints(graphics, CoordinateSpaceDevice, + stat = gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, points, 3); if (stat != Ok) @@ -3823,7 +3823,7 @@ static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath * stat = GdipCreateMatrix(&transform); if (stat == Ok) - stat = get_graphics_transform(graphics, CoordinateSpaceDevice, + stat = get_graphics_transform(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, transform); } else @@ -3831,7 +3831,7 @@ static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath * /* Set flatness based on the final coordinate space */ GpMatrix t; - stat = get_graphics_transform(graphics, CoordinateSpaceDevice, + stat = get_graphics_transform(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, &t); if (stat != Ok)
1
0
0
0
Hugh McMaster : reg/tests: Delete the test registry key before starting each test.
by Alexandre Julliard
05 Sep '17
05 Sep '17
Module: wine Branch: master Commit: e3395d50a7394e61466ef46e4433e8464c58180f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e3395d50a7394e61466ef46e4…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Tue Sep 5 12:26:44 2017 +0000 reg/tests: Delete the test registry key before starting each test. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/reg.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index ab65c38..8d103df 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -507,6 +507,9 @@ static void test_delete(void) DWORD r; const DWORD deadbeef = 0xdeadbeef; + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + run_reg_exe("reg delete", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); @@ -564,6 +567,9 @@ static void test_query(void) const DWORD dword1 = 0x123; const DWORD dword2 = 0xabc; + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + run_reg_exe("reg query", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); @@ -800,6 +806,9 @@ static void test_import(void) LONG err; BYTE hex[8]; + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + run_reg_exe("reg import", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); @@ -2314,6 +2323,9 @@ static void test_unicode_import(void) char buffer[24]; BYTE hex[8]; + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + test_import_wstr("REGEDIT\n", &r); ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */, "got exit code %d, expected 1\n", r); @@ -3800,6 +3812,9 @@ static void test_import_with_whitespace(void) DWORD r, dword; LONG err; + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + test_import_str(" REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); @@ -3947,6 +3962,9 @@ static void test_unicode_import_with_whitespace(void) DWORD r, dword; LONG err; + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
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
Results per page:
10
25
50
100
200