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
March 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
996 discussions
Start a n
N
ew thread
Paul Gofman : wined3d: Handle scale with multisampled blit destination in texture2d_blt().
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 7ec7d812f1d5eabef12ac97d46fbb41bc2a91e98 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7ec7d812f1d5eabef12ac97d…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Mar 12 13:37:49 2020 +0330 wined3d: Handle scale with multisampled blit destination in texture2d_blt(). If either source or destination is multisampled scaled FBO blit results in GL_INVALID_OPERATION. Fixes black screen in 'BlazBlue Calamity Trigger'. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 88 +++++++++++++++++++++++++++++++++++------------- dlls/wined3d/surface.c | 9 +++-- 2 files changed, 71 insertions(+), 26 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index cb84ef6f28..2294d434ba 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -4332,7 +4332,7 @@ static void test_multisample_stretch_rect(void) D3DTEXF_POINT, D3DTEXF_LINEAR, }; - IDirect3DSurface9 *rt, *ms_rt, *rt_r5g6b5; + IDirect3DSurface9 *rt, *ms_rt, *ms_rt2, *rt_r5g6b5; struct surface_readback rb; IDirect3DDevice9 *device; DWORD quality_levels; @@ -4367,27 +4367,30 @@ static void test_multisample_stretch_rect(void) hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, FALSE, &rt, NULL); - ok(hr == S_OK, "Failed to create render target, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_2_SAMPLES, quality_levels - 1, FALSE, &ms_rt, NULL); - ok(hr == S_OK, "Failed to create render target, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128, + D3DFMT_A8R8G8B8, D3DMULTISAMPLE_2_SAMPLES, quality_levels - 1, FALSE, &ms_rt2, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderTarget(device, 0, ms_rt); - ok(hr == D3D_OK, "Failed to set render target, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff00ff, 0.0f, 0); - ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); - ok(hr == D3D_OK, "Failed to set render target, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); for (i = 0; i < ARRAY_SIZE(filters); ++i) { hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Test %u: Failed to clear, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); hr = IDirect3DDevice9_StretchRect(device, ms_rt, NULL, rt, NULL, filters[i]); - ok(hr == S_OK, "Test %u: Failed to stretch rect, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); color = getPixelColor(device, 64, 64); - ok(color == 0x00ff00ff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); } /* Scaling */ @@ -4395,29 +4398,67 @@ static void test_multisample_stretch_rect(void) for (i = 0; i < ARRAY_SIZE(filters); ++i) { hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Test %u: Failed to clear, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + hr = IDirect3DDevice9_StretchRect(device, rt, NULL, ms_rt2, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + hr = IDirect3DDevice9_StretchRect(device, ms_rt, NULL, rt, &rect, filters[i]); - ok(hr == S_OK, "Test %u: Failed to stretch rect, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + get_rt_readback(rt, &rb); + color = get_readback_color(&rb, 32, 32); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); + color = get_readback_color(&rb, 64, 64); + ok(color == 0xffffffff, "Test %u, got unexpected color 0x%08x.\n", i, color); + color = get_readback_color(&rb, 96, 96); + ok(color == 0xffffffff, "Test %u, got unexpected color 0x%08x.\n", i, color); + release_surface_readback(&rb); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + hr = IDirect3DDevice9_StretchRect(device, ms_rt, &rect, rt, NULL, filters[i]); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); get_rt_readback(rt, &rb); color = get_readback_color(&rb, 32, 32); - ok(color == 0x00ff00ff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); color = get_readback_color(&rb, 64, 64); - ok(color == 0xffffffff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); color = get_readback_color(&rb, 96, 96); - ok(color == 0xffffffff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); release_surface_readback(&rb); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 0.0f, 0); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + hr = IDirect3DDevice9_StretchRect(device, rt, NULL, ms_rt, &rect, filters[i]); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Test %u: Failed to clear, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); hr = IDirect3DDevice9_StretchRect(device, ms_rt, &rect, rt, NULL, filters[i]); - ok(hr == S_OK, "Test %u: Failed to stretch rect, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + get_rt_readback(rt, &rb); + color = get_readback_color(&rb, 32, 32); + ok(color == 0xffffff00, "Test %u, got unexpected color 0x%08x.\n", i, color); + color = get_readback_color(&rb, 64, 64); + ok(color == 0xffffff00, "Test %u, got unexpected color 0x%08x.\n", i, color); + color = get_readback_color(&rb, 96, 96); + ok(color == 0xffffff00, "Test %u, got unexpected color 0x%08x.\n", i, color); + release_surface_readback(&rb); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff00ff, 0.0f, 0); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + hr = IDirect3DDevice9_StretchRect(device, rt, NULL, ms_rt, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + + hr = IDirect3DDevice9_StretchRect(device, ms_rt, &rect, ms_rt2, NULL, filters[i]); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); + hr = IDirect3DDevice9_StretchRect(device, ms_rt2, &rect, rt, NULL, filters[i]); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); get_rt_readback(rt, &rb); color = get_readback_color(&rb, 32, 32); - ok(color == 0x00ff00ff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); color = get_readback_color(&rb, 64, 64); - ok(color == 0x00ff00ff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); color = get_readback_color(&rb, 96, 96); - ok(color == 0x00ff00ff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); release_surface_readback(&rb); } @@ -4433,18 +4474,19 @@ static void test_multisample_stretch_rect(void) for (i = 0; i < ARRAY_SIZE(filters); ++i) { hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Test %u: Failed to clear, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); hr = IDirect3DDevice9_StretchRect(device, ms_rt, NULL, rt_r5g6b5, NULL, filters[i]); - ok(hr == S_OK, "Test %u: Failed to stretch rect, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); hr = IDirect3DDevice9_StretchRect(device, rt_r5g6b5, NULL, rt, NULL, filters[i]); - ok(hr == S_OK, "Test %u: Failed to stretch rect, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u, got unexpected hr %#x.\n", i, hr); color = getPixelColor(device, 64, 64); - ok(color == 0x00ff00ff, "Test %u: Got color 0x%08x.\n", i, color); + ok(color == 0x00ff00ff, "Test %u, got unexpected color 0x%08x.\n", i, color); } IDirect3DSurface9_Release(rt_r5g6b5); done: + IDirect3DSurface9_Release(ms_rt2); IDirect3DSurface9_Release(ms_rt); IDirect3DSurface9_Release(rt); refcount = IDirect3DDevice9_Release(device); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 79cca19733..c687e63946 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2612,10 +2612,13 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ else src_location = src_texture->resource.draw_binding; - if (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU) - dst_location = dst_texture->resource.draw_binding; - else + if (!(dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU)) dst_location = dst_texture->resource.map_binding; + else if (dst_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE + && (scale || convert || blit_op != WINED3D_BLIT_OP_COLOR_BLIT)) + dst_location = WINED3D_LOCATION_RB_RESOLVED; + else + dst_location = dst_texture->resource.draw_binding; context = context_acquire(device, dst_texture, dst_sub_resource_idx); valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context,
1
0
0
0
Paul Gofman : wined3d: Manage source texture resolve in texture2d_blt() for colour blits.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: ed93bf497dc2c9a9991ce7b690a27eb3abdf6835 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ed93bf497dc2c9a9991ce7b6…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Mar 12 13:37:48 2020 +0330 wined3d: Manage source texture resolve in texture2d_blt() for colour blits. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/surface.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d8dc379c1a..79cca19733 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -175,13 +175,6 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co break; } - /* Resolve the source surface first if needed. */ - if (wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), src_location) - && (src_texture->resource.format->id != dst_texture->resource.format->id - || abs(src_rect->bottom - src_rect->top) != abs(dst_rect->bottom - dst_rect->top) - || abs(src_rect->right - src_rect->left) != abs(dst_rect->right - dst_rect->left))) - src_location = WINED3D_LOCATION_RB_RESOLVED; - /* Make sure the locations are up-to-date. Loading the destination * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with @@ -2392,7 +2385,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ struct wined3d_device *device = dst_texture->resource.device; struct wined3d_swapchain *src_swapchain, *dst_swapchain; const struct wined3d_color_key *colour_key = NULL; - DWORD dst_location, valid_locations; + DWORD src_location, dst_location, valid_locations; DWORD src_ds_flags, dst_ds_flags; struct wined3d_context *context; enum wined3d_blit_op blit_op; @@ -2613,6 +2606,12 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ if ((flags & WINED3D_BLT_RAW) || (blit_op == WINED3D_BLIT_OP_COLOR_BLIT && !scale && !convert && !resolve)) blit_op = WINED3D_BLIT_OP_RAW_BLIT; + if (src_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE + && (scale || convert || blit_op != WINED3D_BLIT_OP_COLOR_BLIT)) + src_location = WINED3D_LOCATION_RB_RESOLVED; + else + src_location = src_texture->resource.draw_binding; + if (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU) dst_location = dst_texture->resource.draw_binding; else @@ -2620,7 +2619,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ context = context_acquire(device, dst_texture, dst_sub_resource_idx); valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context, - src_texture, src_sub_resource_idx, src_texture->resource.draw_binding, &src_rect, + src_texture, src_sub_resource_idx, src_location, &src_rect, dst_texture, dst_sub_resource_idx, dst_location, &dst_rect, colour_key, filter); context_release(context);
1
0
0
0
Zebediah Figura : kernel32: Reimplement MoveFileWithProgress() on top of NtSetInformationFile(FileRenameInformation).
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 8ca5d4af90e3d8df0cbe188125f1758435f09a9a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8ca5d4af90e3d8df0cbe1881…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 22:38:26 2020 -0500 kernel32: Reimplement MoveFileWithProgress() on top of NtSetInformationFile(FileRenameInformation). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/path.c | 104 ++++++++------------------------------------- dlls/kernel32/tests/file.c | 8 ++-- 2 files changed, 22 insertions(+), 90 deletions(-) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 617b14a717..31652d3164 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -448,14 +448,14 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, LPPROGRESS_ROUTINE fnProgress, LPVOID param, DWORD flag ) { + FILE_RENAME_INFORMATION *rename_info; FILE_BASIC_INFORMATION info; UNICODE_STRING nt_name; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; NTSTATUS status; - HANDLE source_handle = 0, dest_handle = 0; - ANSI_STRING source_unix, dest_unix; - DWORD options; + HANDLE source_handle = 0; + ULONG size; TRACE("(%s,%s,%p,%p,%04x)\n", debugstr_w(source), debugstr_w(dest), fnProgress, param, flag ); @@ -473,8 +473,6 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, SetLastError( ERROR_PATH_NOT_FOUND ); return FALSE; } - source_unix.Buffer = NULL; - dest_unix.Buffer = NULL; attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.Attributes = OBJ_CASE_INSENSITIVE; @@ -484,8 +482,6 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, status = NtOpenFile( &source_handle, DELETE | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT ); - if (status == STATUS_SUCCESS) - status = wine_nt_to_unix_file_name( &nt_name, &source_unix, FILE_OPEN, FALSE ); RtlFreeUnicodeString( &nt_name ); if (status != STATUS_SUCCESS) { @@ -499,101 +495,37 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, goto error; } - /* we must have write access to the destination, and it must */ - /* not exist except if MOVEFILE_REPLACE_EXISTING is set */ - if (!RtlDosPathNameToNtPathName_U( dest, &nt_name, NULL, NULL )) { SetLastError( ERROR_PATH_NOT_FOUND ); goto error; } - options = FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT; - if (flag & MOVEFILE_WRITE_THROUGH) - options |= FILE_WRITE_THROUGH; - status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, options ); - if (status == STATUS_SUCCESS) /* destination exists */ - { - if (!(flag & MOVEFILE_REPLACE_EXISTING)) - { - if (!is_same_file( source_handle, dest_handle )) - { - SetLastError( ERROR_ALREADY_EXISTS ); - RtlFreeUnicodeString( &nt_name ); - goto error; - } - } - else if (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) /* cannot replace directory */ - { - SetLastError( ERROR_ACCESS_DENIED ); - goto error; - } - NtClose( dest_handle ); - dest_handle = NULL; - } - else if (status != STATUS_OBJECT_NAME_NOT_FOUND) - { - SetLastError( RtlNtStatusToDosError(status) ); - RtlFreeUnicodeString( &nt_name ); + size = offsetof( FILE_RENAME_INFORMATION, FileName ) + nt_name.Length; + if (!(rename_info = HeapAlloc( GetProcessHeap(), 0, size ))) goto error; - } - status = wine_nt_to_unix_file_name( &nt_name, &dest_unix, FILE_OPEN_IF, FALSE ); + rename_info->ReplaceIfExists = !!(flag & MOVEFILE_REPLACE_EXISTING); + rename_info->RootDirectory = NULL; + rename_info->FileNameLength = nt_name.Length; + memcpy( rename_info->FileName, nt_name.Buffer, nt_name.Length ); RtlFreeUnicodeString( &nt_name ); - if (status != STATUS_SUCCESS && status != STATUS_NO_SUCH_FILE) - { - SetLastError( RtlNtStatusToDosError(status) ); - goto error; - } - - /* now perform the rename */ - - if (rename( source_unix.Buffer, dest_unix.Buffer ) == -1) + status = NtSetInformationFile( source_handle, &io, rename_info, size, FileRenameInformation ); + if (status == STATUS_NOT_SAME_DEVICE && (flag & MOVEFILE_COPY_ALLOWED)) { - if (errno == EXDEV && (flag & MOVEFILE_COPY_ALLOWED)) - { - NtClose( source_handle ); - RtlFreeAnsiString( &source_unix ); - RtlFreeAnsiString( &dest_unix ); - if (!CopyFileExW( source, dest, fnProgress, param, NULL, - flag & MOVEFILE_REPLACE_EXISTING ? - 0 : COPY_FILE_FAIL_IF_EXISTS )) - return FALSE; - return DeleteFileW( source ); - } - FILE_SetDosError(); - /* if we created the destination, remove it */ - if (io.Information == FILE_CREATED) unlink( dest_unix.Buffer ); - goto error; - } - - /* fixup executable permissions */ - - if (is_executable( source ) != is_executable( dest )) - { - struct stat fstat; - if (stat( dest_unix.Buffer, &fstat ) != -1) - { - if (is_executable( dest )) - /* set executable bit where read bit is set */ - fstat.st_mode |= (fstat.st_mode & 0444) >> 2; - else - fstat.st_mode &= ~0111; - chmod( dest_unix.Buffer, fstat.st_mode ); - } + NtClose( source_handle ); + if (!CopyFileExW( source, dest, fnProgress, param, NULL, + flag & MOVEFILE_REPLACE_EXISTING ? + 0 : COPY_FILE_FAIL_IF_EXISTS )) + return FALSE; + return DeleteFileW( source ); } NtClose( source_handle ); - RtlFreeAnsiString( &source_unix ); - RtlFreeAnsiString( &dest_unix ); - return TRUE; + return set_ntstatus( status ); error: if (source_handle) NtClose( source_handle ); - if (dest_handle) NtClose( dest_handle ); - RtlFreeAnsiString( &source_unix ); - RtlFreeAnsiString( &dest_unix ); return FALSE; } diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index ad0c694f41..785bd60c23 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -5631,7 +5631,7 @@ static void test_move_file(void) SetLastError(0xdeadbeef); ret = MoveFileA( "winetest_dir3", "winetest_dir2" ); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); file = CreateFileA( "winetest_file3", DELETE, 0, NULL, OPEN_EXISTING, 0, 0 ); ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); @@ -5658,14 +5658,14 @@ static void test_move_file(void) ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); SetLastError(0xdeadbeef); ret = MoveFileExA( "winetest_file2", "winetest_file1", MOVEFILE_REPLACE_EXISTING ); - todo_wine ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(!ret, "expected failure\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); CloseHandle( file ); SetLastError(0xdeadbeef); ret = MoveFileExA( "winetest_file2", "winetest_dir2", MOVEFILE_REPLACE_EXISTING ); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); SetLastError(0xdeadbeef); ret = MoveFileExA( "winetest_dir3", "winetest_dir2", MOVEFILE_REPLACE_EXISTING );
1
0
0
0
Zebediah Figura : server: Fix up executable permissions when renaming files.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 4a43546b341917072fd0faa60abd2360203ae533 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4a43546b341917072fd0faa6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 22:38:25 2020 -0500 server: Fix up executable permissions when renaming files. Same as MoveFileWithProgressW(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/fd.c | 10 ++++++++++ server/file.c | 9 +++++++-- server/file.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/server/fd.c b/server/fd.c index 524cc7a507..e7f57966b2 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2430,6 +2430,16 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, goto failed; } + if (is_file_executable( fd->unix_name ) != is_file_executable( name ) && !fstat( fd->unix_fd, &st )) + { + if (is_file_executable( fd->unix_name )) + /* set executable bit where read bit is set */ + st.st_mode |= (st.st_mode & 0444) >> 2; + else + st.st_mode &= ~0111; + fchmod( fd->unix_fd, st.st_mode ); + } + free( fd->unix_name ); fd->unix_name = name; fd->closed->unix_name = name; diff --git a/server/file.c b/server/file.c index 71b84486b0..bce202138e 100644 --- a/server/file.c +++ b/server/file.c @@ -191,6 +191,12 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ return &file->obj; } +int is_file_executable( const char *name ) +{ + int len = strlen( name ); + return len >= 4 && (!strcasecmp( name + len - 4, ".exe") || !strcasecmp( name + len - 4, ".com" )); +} + static struct object *create_file( struct fd *root, const char *nameptr, data_size_t len, unsigned int access, unsigned int sharing, int create, unsigned int options, unsigned int attrs, @@ -236,8 +242,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si else mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666; - if (len >= 4 && - (!strcasecmp( name + len - 4, ".exe" ) || !strcasecmp( name + len - 4, ".com" ))) + if (is_file_executable( name )) { if (mode & S_IRUSR) mode |= S_IXUSR; diff --git a/server/file.h b/server/file.h index 4341ad3b04..0df4c17716 100644 --- a/server/file.h +++ b/server/file.h @@ -149,6 +149,7 @@ extern void file_set_error(void); extern struct object_type *file_get_type( struct object *obj ); extern struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID *group ); extern mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner ); +extern int is_file_executable( const char *name ); /* file mapping functions */
1
0
0
0
Zebediah Figura : server: Allow renaming a file to the same name.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 6971fd2d613b773f4d906243c8386a7a909c40ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6971fd2d613b773f4d906243…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 22:38:24 2020 -0500 server: Allow renaming a file to the same name. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/file.c | 8 ++++---- server/fd.c | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index a05b124fd2..814353e762 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -2123,8 +2123,8 @@ static void test_file_rename_information(void) U(io).Status = 0xdeadbeef; res = pNtSetInformationFile( handle, &io, fri, sizeof(FILE_RENAME_INFORMATION) + fri->FileNameLength, FileRenameInformation ); - todo_wine ok( U(io).Status == STATUS_SUCCESS, "got io status %#x\n", U(io).Status ); - todo_wine ok( res == STATUS_SUCCESS, "got status %x\n", res ); + ok( U(io).Status == STATUS_SUCCESS, "got io status %#x\n", U(io).Status ); + ok( res == STATUS_SUCCESS, "got status %x\n", res ); ok( GetFileAttributesW( oldpath ) != INVALID_FILE_ATTRIBUTES, "file should exist\n" ); CloseHandle( handle ); @@ -2782,8 +2782,8 @@ static void test_file_link_information(void) fli->ReplaceIfExists = TRUE; U(io).Status = 0xdeadbeef; res = pNtSetInformationFile( handle, &io, fli, sizeof(FILE_LINK_INFORMATION) + fli->FileNameLength, FileLinkInformation ); - todo_wine ok( U(io).Status == STATUS_SUCCESS, "got io status %#x\n", U(io).Status ); - todo_wine ok( res == STATUS_SUCCESS, "got status %x\n", res ); + ok( U(io).Status == STATUS_SUCCESS, "got io status %#x\n", U(io).Status ); + ok( res == STATUS_SUCCESS, "got status %x\n", res ); ok( GetFileAttributesW( oldpath ) != INVALID_FILE_ATTRIBUTES, "file should exist\n" ); CloseHandle( handle ); diff --git a/server/fd.c b/server/fd.c index c2cb3c96ac..524cc7a507 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2328,7 +2328,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, data_size_t len, int create_link, int replace ) { struct inode *inode; - struct stat st; + struct stat st, st2; char *name; if (!fd->inode || !fd->unix_name) @@ -2336,6 +2336,12 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, set_error( STATUS_OBJECT_TYPE_MISMATCH ); return; } + if (fd->unix_fd == -1) + { + set_error( fd->no_fd_status ); + return; + } + if (!len || ((nameptr[0] == '/') ^ !root)) { set_error( STATUS_OBJECT_PATH_SYNTAX_BAD ); @@ -2358,8 +2364,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, } /* when creating a hard link, source cannot be a dir */ - if (create_link && fd->unix_fd != -1 && - !fstat( fd->unix_fd, &st ) && S_ISDIR( st.st_mode )) + if (create_link && !fstat( fd->unix_fd, &st ) && S_ISDIR( st.st_mode )) { set_error( STATUS_FILE_IS_A_DIRECTORY ); goto failed; @@ -2367,6 +2372,13 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, if (!stat( name, &st )) { + if (!fstat( fd->unix_fd, &st2 ) && st.st_ino == st2.st_ino && st.st_dev == st2.st_dev) + { + if (create_link && !replace) set_error( STATUS_OBJECT_NAME_COLLISION ); + free( name ); + return; + } + if (!replace) { set_error( STATUS_OBJECT_NAME_COLLISION ); @@ -2394,8 +2406,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, /* link() expects that the target doesn't exist */ /* rename() cannot replace files with directories */ - if (create_link || (fd->unix_fd != -1 && - !fstat( fd->unix_fd, &st ) && S_ISDIR( st.st_mode ))) + if (create_link || S_ISDIR( st2.st_mode )) { if (unlink( name )) {
1
0
0
0
Zebediah Figura : ntdll: Check for an existing file on the server side.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: ee136f98322179006e434197f17016af2fbff140 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee136f98322179006e434197…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 22:38:23 2020 -0500 ntdll: Check for an existing file on the server side. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/file.c | 16 ++-------------- include/wine/server_protocol.h | 4 +++- server/fd.c | 10 ++++++++-- server/protocol.def | 1 + server/request.h | 3 ++- server/trace.c | 1 + 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 96f8cb38fc..5175e9d5ce 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -2778,18 +2778,12 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, if (io->u.Status != STATUS_SUCCESS && io->u.Status != STATUS_NO_SUCH_FILE) break; - if (!info->ReplaceIfExists && io->u.Status == STATUS_SUCCESS) - { - RtlFreeAnsiString( &unix_name ); - io->u.Status = STATUS_OBJECT_NAME_COLLISION; - break; - } - SERVER_START_REQ( set_fd_name_info ) { req->handle = wine_server_obj_handle( handle ); req->rootdir = wine_server_obj_handle( attr.RootDirectory ); req->link = FALSE; + req->replace = info->ReplaceIfExists; wine_server_add_data( req, unix_name.Buffer, unix_name.Length ); io->u.Status = wine_server_call( req ); } @@ -2821,18 +2815,12 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, if (io->u.Status != STATUS_SUCCESS && io->u.Status != STATUS_NO_SUCH_FILE) break; - if (!info->ReplaceIfExists && io->u.Status == STATUS_SUCCESS) - { - RtlFreeAnsiString( &unix_name ); - io->u.Status = STATUS_OBJECT_NAME_COLLISION; - break; - } - SERVER_START_REQ( set_fd_name_info ) { req->handle = wine_server_obj_handle( handle ); req->rootdir = wine_server_obj_handle( attr.RootDirectory ); req->link = TRUE; + req->replace = info->ReplaceIfExists; wine_server_add_data( req, unix_name.Buffer, unix_name.Length ); io->u.Status = wine_server_call( req ); } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 3b457df8b0..af4507b5d1 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -5532,7 +5532,9 @@ struct set_fd_name_info_request obj_handle_t handle; obj_handle_t rootdir; int link; + int replace; /* VARARG(filename,string); */ + char __pad_28[4]; }; struct set_fd_name_info_reply { @@ -6704,6 +6706,6 @@ union generic_reply struct resume_process_reply resume_process_reply; }; -#define SERVER_PROTOCOL_VERSION 595 +#define SERVER_PROTOCOL_VERSION 596 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/fd.c b/server/fd.c index 5d80e218b9..c2cb3c96ac 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2325,7 +2325,7 @@ static void set_fd_disposition( struct fd *fd, int unlink ) /* set new name for the fd */ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, - data_size_t len, int create_link ) + data_size_t len, int create_link, int replace ) { struct inode *inode; struct stat st; @@ -2367,6 +2367,12 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, if (!stat( name, &st )) { + if (!replace) + { + set_error( STATUS_OBJECT_NAME_COLLISION ); + goto failed; + } + /* can't replace directories or special files */ if (!S_ISREG( st.st_mode )) { @@ -2695,7 +2701,7 @@ DECL_HANDLER(set_fd_name_info) if ((fd = get_handle_fd_obj( current->process, req->handle, 0 ))) { - set_fd_name( fd, root_fd, get_req_data(), get_req_data_size(), req->link ); + set_fd_name( fd, root_fd, get_req_data(), get_req_data_size(), req->link, req->replace ); release_object( fd ); } if (root_fd) release_object( root_fd ); diff --git a/server/protocol.def b/server/protocol.def index 6c44b2b43f..722993e59c 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3809,6 +3809,7 @@ struct handle_info obj_handle_t handle; /* handle to a file or directory */ obj_handle_t rootdir; /* root directory */ int link; /* link instead of renaming */ + int replace; /* replace an existing file? */ VARARG(filename,string); /* new file name */ @END diff --git a/server/request.h b/server/request.h index 15fcb671bb..a5472dd1c2 100644 --- a/server/request.h +++ b/server/request.h @@ -2377,7 +2377,8 @@ C_ASSERT( sizeof(struct set_fd_disp_info_request) == 24 ); C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, rootdir) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, link) == 20 ); -C_ASSERT( sizeof(struct set_fd_name_info_request) == 24 ); +C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, replace) == 24 ); +C_ASSERT( sizeof(struct set_fd_name_info_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_window_layered_info_request, handle) == 12 ); C_ASSERT( sizeof(struct get_window_layered_info_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_window_layered_info_reply, color_key) == 8 ); diff --git a/server/trace.c b/server/trace.c index 79e3f22ee5..95db31b4cb 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4464,6 +4464,7 @@ static void dump_set_fd_name_info_request( const struct set_fd_name_info_request fprintf( stderr, " handle=%04x", req->handle ); fprintf( stderr, ", rootdir=%04x", req->rootdir ); fprintf( stderr, ", link=%d", req->link ); + fprintf( stderr, ", replace=%d", req->replace ); dump_varargs_string( ", filename=", cur_size ); }
1
0
0
0
Zebediah Figura : ntdll/tests: Add tests for linking a file to the same name.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 5b75d943044feba2ac92f8e05e3827c8ac3e8a4d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5b75d943044feba2ac92f8e0…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 22:38:22 2020 -0500 ntdll/tests: Add tests for linking a file to the same name. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/file.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index e71f887c2b..a05b124fd2 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -2759,6 +2759,36 @@ static void test_file_link_information(void) HeapFree( GetProcessHeap(), 0, fli ); delete_object( oldpath ); delete_object( newpath ); + + /* oldpath == newpath */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + pRtlDosPathNameToNtPathName_U( oldpath, &name_str, NULL, NULL ); + fli = HeapAlloc( GetProcessHeap(), 0, sizeof(FILE_RENAME_INFORMATION) + name_str.Length ); + fli->ReplaceIfExists = FALSE; + fli->RootDirectory = NULL; + fli->FileNameLength = name_str.Length; + memcpy( fli->FileName, name_str.Buffer, name_str.Length ); + pRtlFreeUnicodeString( &name_str ); + + U(io).Status = 0xdeadbeef; + res = pNtSetInformationFile( handle, &io, fli, sizeof(FILE_LINK_INFORMATION) + fli->FileNameLength, FileLinkInformation ); + todo_wine ok( U(io).Status == 0xdeadbeef, "got io status %#x\n", U(io).Status ); + ok( res == STATUS_OBJECT_NAME_COLLISION, "got status %x\n", res ); + + fli->ReplaceIfExists = TRUE; + U(io).Status = 0xdeadbeef; + res = pNtSetInformationFile( handle, &io, fli, sizeof(FILE_LINK_INFORMATION) + fli->FileNameLength, FileLinkInformation ); + todo_wine ok( U(io).Status == STATUS_SUCCESS, "got io status %#x\n", U(io).Status ); + todo_wine ok( res == STATUS_SUCCESS, "got status %x\n", res ); + ok( GetFileAttributesW( oldpath ) != INVALID_FILE_ATTRIBUTES, "file should exist\n" ); + + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fli ); + delete_object( oldpath ); } static void test_file_both_information(void)
1
0
0
0
Jefferson Carpenter : user32: Always initialize module in load_desktop_driver.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: bc9d4eb55adc2b9063aa9807138b36eff43a96d6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc9d4eb55adc2b9063aa9807…
Author: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Date: Thu Mar 12 07:48:14 2020 +0000 user32: Always initialize module in load_desktop_driver. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48742
Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 8f3e1b3597..6d916c7d65 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -85,6 +85,7 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module ) else { size = sizeof(driver_load_error); + *module = NULL; RegQueryValueExA( hkey, "DriverError", NULL, NULL, (BYTE *)driver_load_error, &size ); } RegCloseKey( hkey );
1
0
0
0
Zebediah Figura : quartz: Unregister the video window class on DLL unload.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 2db87b733f92f8541de6ba4dafefb8f05eb9aae0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2db87b733f92f8541de6ba4d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Mar 11 21:10:13 2020 -0500 quartz: Unregister the video window class on DLL unload. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48734
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/main.c | 7 ++++--- dlls/quartz/quartz_private.h | 1 + dlls/quartz/window.c | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 9c61dd50d7..284f2cacae 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -29,10 +29,11 @@ extern BOOL WINAPI QUARTZ_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; static LONG server_locks = 0; -/* For the moment, do nothing here. */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { - return QUARTZ_DllMain( hInstDLL, fdwReason, lpv ); + if (reason == DLL_PROCESS_DETACH) + video_window_unregister_class(); + return QUARTZ_DllMain(instance, reason, reserved); } static HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out) diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 2b100969eb..3332c27d21 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -123,6 +123,7 @@ typedef struct tagBaseControlWindow HRESULT video_window_init(BaseControlWindow *window, const IVideoWindowVtbl *vtbl, struct strmbase_filter *filter, struct strmbase_pin *pin, const BaseWindowFuncTable *func_table) DECLSPEC_HIDDEN; +void video_window_unregister_class(void) DECLSPEC_HIDDEN; HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow) DECLSPEC_HIDDEN; BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN; diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 6e1a60086f..0b0df136f2 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -741,3 +741,9 @@ HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *C return S_OK; } + +void video_window_unregister_class(void) +{ + if (!UnregisterClassW(class_name, NULL) && GetLastError() != ERROR_CLASS_DOES_NOT_EXIST) + ERR("Failed to unregister class, error %u.\n", GetLastError()); +}
1
0
0
0
Zebediah Figura : strmbase: Move video.c to quartz.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: f55427fb9da28f99593f978f0bbd2b9c41143bd1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f55427fb9da28f99593f978f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Mar 11 21:10:12 2020 -0500 strmbase: Move video.c to quartz. The only filters that expose IBasicVideo live in quartz. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/Makefile.in | 1 + dlls/quartz/quartz_private.h | 39 +++++++++++++++++++++++++++++++++++ dlls/{strmbase => quartz}/video.c | 8 ++++---- dlls/quartz/videorenderer.c | 2 +- dlls/quartz/vmr9.c | 2 +- dlls/strmbase/Makefile.in | 3 +-- include/wine/strmbase.h | 43 --------------------------------------- 7 files changed, 47 insertions(+), 51 deletions(-) diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in index 4ba8edf5fe..858b957879 100644 --- a/dlls/quartz/Makefile.in +++ b/dlls/quartz/Makefile.in @@ -17,6 +17,7 @@ C_SRCS = \ memallocator.c \ regsvr.c \ systemclock.c \ + video.c \ videorenderer.c \ vmr9.c \ window.c diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index cbf5da4c09..2b100969eb 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -174,4 +174,43 @@ HRESULT WINAPI BaseControlWindowImpl_GetRestorePosition(IVideoWindow *iface, LON HRESULT WINAPI BaseControlWindowImpl_HideCursor(IVideoWindow *iface, LONG HideCursor) DECLSPEC_HIDDEN; HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *CursorHidden) DECLSPEC_HIDDEN; +typedef struct tagBaseControlVideo +{ + IBasicVideo IBasicVideo_iface; + + struct strmbase_filter *pFilter; + struct strmbase_pin *pPin; + + const struct BaseControlVideoFuncTable *pFuncsTable; +} BaseControlVideo; + +typedef HRESULT (WINAPI *BaseControlVideo_GetSourceRect)(BaseControlVideo* This, RECT *pSourceRect); +typedef HRESULT (WINAPI *BaseControlVideo_GetStaticImage)(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage); +typedef HRESULT (WINAPI *BaseControlVideo_GetTargetRect)(BaseControlVideo* This, RECT *pTargetRect); +typedef VIDEOINFOHEADER* (WINAPI *BaseControlVideo_GetVideoFormat)(BaseControlVideo* This); +typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultSourceRect)(BaseControlVideo* This); +typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultTargetRect)(BaseControlVideo* This); +typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultSourceRect)(BaseControlVideo* This); +typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultTargetRect)(BaseControlVideo* This); +typedef HRESULT (WINAPI *BaseControlVideo_SetSourceRect)(BaseControlVideo* This, RECT *pSourceRect); +typedef HRESULT (WINAPI *BaseControlVideo_SetTargetRect)(BaseControlVideo* This, RECT *pTargetRect); + +typedef struct BaseControlVideoFuncTable +{ + BaseControlVideo_GetSourceRect pfnGetSourceRect; + BaseControlVideo_GetStaticImage pfnGetStaticImage; + BaseControlVideo_GetTargetRect pfnGetTargetRect; + BaseControlVideo_GetVideoFormat pfnGetVideoFormat; + BaseControlVideo_IsDefaultSourceRect pfnIsDefaultSourceRect; + BaseControlVideo_IsDefaultTargetRect pfnIsDefaultTargetRect; + BaseControlVideo_SetDefaultSourceRect pfnSetDefaultSourceRect; + BaseControlVideo_SetDefaultTargetRect pfnSetDefaultTargetRect; + BaseControlVideo_SetSourceRect pfnSetSourceRect; + BaseControlVideo_SetTargetRect pfnSetTargetRect; +} BaseControlVideoFuncTable; + +HRESULT basic_video_init(BaseControlVideo *video, struct strmbase_filter *filter, + struct strmbase_pin *pin, const BaseControlVideoFuncTable *func_table) DECLSPEC_HIDDEN; +HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo) DECLSPEC_HIDDEN; + #endif /* __QUARTZ_PRIVATE_INCLUDED__ */ diff --git a/dlls/strmbase/video.c b/dlls/quartz/video.c similarity index 98% rename from dlls/strmbase/video.c rename to dlls/quartz/video.c index 081794e9b3..f59c2dee0c 100644 --- a/dlls/strmbase/video.c +++ b/dlls/quartz/video.c @@ -1,5 +1,5 @@ /* - * Generic Implementation of strmbase video classes + * Common implementation of IBasicVideo * * Copyright 2012 Aric Stewart, CodeWeavers * @@ -18,9 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "strmbase_private.h" +#include "quartz_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz); static inline BaseControlVideo *impl_from_IBasicVideo(IBasicVideo *iface) { @@ -647,7 +647,7 @@ static const IBasicVideoVtbl basic_video_vtbl = basic_video_IsUsingDefaultDestination }; -HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, struct strmbase_filter *filter, +HRESULT basic_video_init(BaseControlVideo *video, struct strmbase_filter *filter, struct strmbase_pin *pin, const BaseControlVideoFuncTable *func_table) { video->IBasicVideo_iface.lpVtbl = &basic_video_vtbl; diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 52d4b1aa62..1b5e68e7d5 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -726,7 +726,7 @@ HRESULT video_renderer_create(IUnknown *outer, IUnknown **out) if (FAILED(hr)) goto fail; - hr = strmbase_video_init(&pVideoRenderer->baseControlVideo, &pVideoRenderer->renderer.filter, + hr = basic_video_init(&pVideoRenderer->baseControlVideo, &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.sink.pin, &renderer_BaseControlVideoFuncTable); if (FAILED(hr)) goto fail; diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index c457f31e4e..b8cf0698ec 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2257,7 +2257,7 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid) if (FAILED(hr = BaseWindowImpl_PrepareWindow(&pVMR->baseControlWindow.baseWindow))) goto fail; - hr = strmbase_video_init(&pVMR->baseControlVideo, &pVMR->renderer.filter, + hr = basic_video_init(&pVMR->baseControlVideo, &pVMR->renderer.filter, &pVMR->renderer.sink.pin, &renderer_BaseControlVideoFuncTable); if (FAILED(hr)) goto fail; diff --git a/dlls/strmbase/Makefile.in b/dlls/strmbase/Makefile.in index 607ce235bb..ec13acccf4 100644 --- a/dlls/strmbase/Makefile.in +++ b/dlls/strmbase/Makefile.in @@ -9,5 +9,4 @@ C_SRCS = \ pospass.c \ qualitycontrol.c \ renderer.c \ - seeking.c \ - video.c + seeking.c diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index f874a44186..0bcac13ebb 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -255,49 +255,6 @@ enum strmbase_type_id HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **typeinfo); -#ifdef __IBasicVideo_FWD_DEFINED__ -#ifdef __amvideo_h__ -typedef struct tagBaseControlVideo -{ - IBasicVideo IBasicVideo_iface; - - struct strmbase_filter *pFilter; - struct strmbase_pin *pPin; - - const struct BaseControlVideoFuncTable* pFuncsTable; -} BaseControlVideo; - -typedef HRESULT (WINAPI *BaseControlVideo_GetSourceRect)(BaseControlVideo* This, RECT *pSourceRect); -typedef HRESULT (WINAPI *BaseControlVideo_GetStaticImage)(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage); -typedef HRESULT (WINAPI *BaseControlVideo_GetTargetRect)(BaseControlVideo* This, RECT *pTargetRect); -typedef VIDEOINFOHEADER* (WINAPI *BaseControlVideo_GetVideoFormat)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultSourceRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultTargetRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultSourceRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultTargetRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_SetSourceRect)(BaseControlVideo* This, RECT *pSourceRect); -typedef HRESULT (WINAPI *BaseControlVideo_SetTargetRect)(BaseControlVideo* This, RECT *pTargetRect); - -typedef struct BaseControlVideoFuncTable { - /* Required */ - BaseControlVideo_GetSourceRect pfnGetSourceRect; - BaseControlVideo_GetStaticImage pfnGetStaticImage; - BaseControlVideo_GetTargetRect pfnGetTargetRect; - BaseControlVideo_GetVideoFormat pfnGetVideoFormat; - BaseControlVideo_IsDefaultSourceRect pfnIsDefaultSourceRect; - BaseControlVideo_IsDefaultTargetRect pfnIsDefaultTargetRect; - BaseControlVideo_SetDefaultSourceRect pfnSetDefaultSourceRect; - BaseControlVideo_SetDefaultTargetRect pfnSetDefaultTargetRect; - BaseControlVideo_SetSourceRect pfnSetSourceRect; - BaseControlVideo_SetTargetRect pfnSetTargetRect; -} BaseControlVideoFuncTable; - -HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, struct strmbase_filter *filter, - struct strmbase_pin *pin, const BaseControlVideoFuncTable *func_table); -HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo); -#endif -#endif - struct strmbase_renderer { struct strmbase_filter filter;
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
100
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
Results per page:
10
25
50
100
200