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
April 2018
----- 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
542 discussions
Start a n
N
ew thread
Józef Kucia : d3d11/tests: Add test for ResolveSubresource().
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 27ededcb31d4215bc0d51e291c04aeabb99beb54 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=27ededcb31d4215bc0d51e29…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 17 14:26:52 2018 +0200 d3d11/tests: Add test for ResolveSubresource(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index b3597ad..36320f4 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -26110,6 +26110,146 @@ todo_wine release_test_context(&test_context); } +static void test_multisample_resolve(void) +{ + struct d3d11_test_context test_context; + D3D11_RENDER_TARGET_VIEW_DESC rtv_desc; + ID3D11Texture2D *texture, *ms_texture; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11DeviceContext *context; + ID3D11RenderTargetView *rtv; + ID3D11Device *device; + unsigned int i; + HRESULT hr; + + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const struct vec4 green = {0.0f, 1.0f, 0.0f, 1.0f}; + static const struct vec4 color = {0.25f, 0.5f, 0.75f, 1.0f}; + static const struct + { + DXGI_FORMAT src_format; + DXGI_FORMAT dst_format; + DXGI_FORMAT format; + + DXGI_FORMAT rtv_format; + + const struct vec4 *color; + DWORD expected_color; + + BOOL todo; + } + tests[] = + { + {DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + &green, 0xff00ff00}, + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + &green, 0xff00ff00}, + {DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + &color, 0xffbf7f40}, + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + &color, 0xffe1bc89}, + + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + &green, 0xff00ff00, TRUE}, + {DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + &green, 0xff00ff00, TRUE}, + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + &color, 0xffe1bc89, TRUE}, + {DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + &color, 0xffe1bc89, TRUE}, + + {DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + &green, 0xff00ff00, TRUE}, + {DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + &green, 0xff00ff00, TRUE}, + {DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + &color, 0xffbf7f40, TRUE}, + {DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM, + &color, 0xffbf7f40, TRUE}, + }; + + if (!init_test_context(&test_context, NULL)) + return; + device = test_context.device; + context = test_context.immediate_context; + + if (FAILED(hr = ID3D11Device_CheckMultisampleQualityLevels(device, + DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, &i))) + { + skip("4xMSAA not supported.\n"); + release_test_context(&test_context); + return; + } + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + ID3D11Texture2D_GetDesc(test_context.backbuffer, &texture_desc); + texture_desc.Format = tests[i].dst_format; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr); + + texture_desc.Format = tests[i].src_format; + texture_desc.SampleDesc.Count = 4; + texture_desc.SampleDesc.Quality = 0; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &ms_texture); + ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr); + rtv_desc.Format = tests[i].rtv_format; + rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS; + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)ms_texture, &rtv_desc, &rtv); + ok(hr == S_OK, "Failed to create render target view, hr %#x.\n", hr); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &rtv, NULL); + ID3D11DeviceContext_ClearRenderTargetView(context, rtv, white); + draw_color_quad(&test_context, tests[i].color); + ID3D11DeviceContext_ResolveSubresource(context, (ID3D11Resource *)texture, 0, + (ID3D11Resource *)ms_texture, 0, tests[i].format); + todo_wine_if(tests[i].todo) + check_texture_color(texture, tests[i].expected_color, 2); + + ID3D11RenderTargetView_Release(rtv); + ID3D11Texture2D_Release(ms_texture); + ID3D11Texture2D_Release(texture); + } + + release_test_context(&test_context); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -26244,4 +26384,5 @@ START_TEST(d3d11) test_alpha_to_coverage(); test_unbound_multisample_texture(); test_multiple_viewports(); + test_multisample_resolve(); }
1
0
0
0
Józef Kucia : d3d10core/tests: Add test for state refcounting.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 0e2297e98163a7ad61daf3d98c898f9a3c91617b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0e2297e98163a7ad61daf3d9…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 17 14:26:51 2018 +0200 d3d10core/tests: Add test for state refcounting. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 123 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 421512f..0cfd547 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -17,6 +17,7 @@ */ #include <assert.h> +#include <float.h> #include <limits.h> #include <math.h> #define COBJMACROS @@ -8096,6 +8097,127 @@ static void test_private_data(void) ok(!refcount, "Test object has %u references left.\n", refcount); } +static void test_state_refcounting(void) +{ + ID3D10RasterizerState *rasterizer_state, *tmp_rasterizer_state; + D3D10_RASTERIZER_DESC rasterizer_desc; + D3D10_TEXTURE2D_DESC texture_desc; + D3D10_QUERY_DESC predicate_desc; + D3D10_SAMPLER_DESC sampler_desc; + ID3D10ShaderResourceView *srv; + ID3D10RenderTargetView *rtv; + ID3D10SamplerState *sampler; + ID3D10Predicate *predicate; + ID3D10Texture2D *texture; + ID3D10Device *device; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + /* ID3D10SamplerState */ + memset(&sampler_desc, 0, sizeof(sampler_desc)); + sampler_desc.Filter = D3D10_FILTER_MIN_MAG_MIP_LINEAR; + sampler_desc.AddressU = D3D10_TEXTURE_ADDRESS_WRAP; + sampler_desc.AddressV = D3D10_TEXTURE_ADDRESS_WRAP; + sampler_desc.AddressW = D3D10_TEXTURE_ADDRESS_WRAP; + sampler_desc.MaxLOD = FLT_MAX; + hr = ID3D10Device_CreateSamplerState(device, &sampler_desc, &sampler); + ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); + + refcount = get_refcount(sampler); + ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + ID3D10Device_PSSetSamplers(device, 0, 1, &sampler); + refcount = ID3D10SamplerState_Release(sampler); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + sampler = NULL; + ID3D10Device_PSGetSamplers(device, 0, 1, &sampler); + todo_wine ok(!sampler, "Got unexpected pointer %p, expected NULL.\n", sampler); + if (sampler) + ID3D10SamplerState_Release(sampler); + + /* ID3D10RasterizerState */ + memset(&rasterizer_desc, 0, sizeof(rasterizer_desc)); + rasterizer_desc.FillMode = D3D10_FILL_SOLID; + rasterizer_desc.CullMode = D3D10_CULL_BACK; + rasterizer_desc.DepthClipEnable = TRUE; + hr = ID3D10Device_CreateRasterizerState(device, &rasterizer_desc, &rasterizer_state); + ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); + + ID3D10Device_RSSetState(device, rasterizer_state); + refcount = ID3D10RasterizerState_Release(rasterizer_state); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + ID3D10Device_RSGetState(device, &tmp_rasterizer_state); + ok(tmp_rasterizer_state == rasterizer_state, "Got rasterizer state %p, expected %p.\n", + tmp_rasterizer_state, rasterizer_state); + refcount = ID3D10RasterizerState_Release(tmp_rasterizer_state); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + + /* ID3D10ShaderResourceView */ + memset(&texture_desc, 0, sizeof(texture_desc)); + texture_desc.Width = 32; + texture_desc.Height = 32; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.SampleDesc.Count = 1; + texture_desc.Usage = D3D10_USAGE_DEFAULT; + texture_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)texture, NULL, &srv); + ok(SUCCEEDED(hr), "Failed to create shader resource view, hr %#x.\n", hr); + ID3D10Texture2D_Release(texture); + + ID3D10Device_PSSetShaderResources(device, 0, 1, &srv); + refcount = ID3D10ShaderResourceView_Release(srv); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + srv = NULL; + ID3D10Device_PSGetShaderResources(device, 0, 1, &srv); + todo_wine ok(!srv, "Got unexpected pointer %p, expected NULL.\n", srv); + if (srv) + ID3D10ShaderResourceView_Release(srv); + + /* ID3D10RenderTargetView */ + texture_desc.BindFlags = D3D10_BIND_RENDER_TARGET; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, NULL, &rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + ID3D10Texture2D_Release(texture); + + ID3D10Device_OMSetRenderTargets(device, 1, &rtv, NULL); + refcount = ID3D10RenderTargetView_Release(rtv); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + rtv = NULL; + ID3D10Device_OMGetRenderTargets(device, 1, &rtv, NULL); + todo_wine ok(!rtv, "Got unexpected pointer %p, expected NULL.\n", rtv); + if (rtv) + ID3D10RenderTargetView_Release(rtv); + + /* ID3D10Predicate */ + predicate_desc.Query = D3D10_QUERY_OCCLUSION_PREDICATE; + predicate_desc.MiscFlags = 0; + hr = ID3D10Device_CreatePredicate(device, &predicate_desc, &predicate); + ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr); + + ID3D10Device_SetPredication(device, predicate, TRUE); + refcount = ID3D10Predicate_Release(predicate); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + predicate = NULL; + ID3D10Device_GetPredication(device, &predicate, NULL); + todo_wine ok(!predicate, "Got unexpected pointer %p, expected NULL.\n", predicate); + if (predicate) + ID3D10Predicate_Release(predicate); + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_il_append_aligned(void) { struct d3d10core_test_context test_context; @@ -16299,6 +16421,7 @@ START_TEST(device) test_depth_stencil_sampling(); test_multiple_render_targets(); test_private_data(); + test_state_refcounting(); test_il_append_aligned(); test_instance_id(); test_fragment_coords();
1
0
0
0
Józef Kucia : d3d10core/tests: Add additional tests for shader input/output matching.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 2d4371846c34903ebd83544aaa4af8cf4fa27f7c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2d4371846c34903ebd83544a…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 17 14:26:50 2018 +0200 d3d10core/tests: Add additional tests for shader input/output matching. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 80 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 6982a4e..421512f 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -10583,6 +10583,7 @@ static void test_shader_interstage_interface(void) ID3D10Device *device; UINT stride, offset; ID3D10Buffer *vb; + unsigned int i; HRESULT hr; static const DWORD vs_code[] = @@ -10655,6 +10656,56 @@ static void test_shader_interstage_interface(void) 0x0010000a, 0x00000000, 0x07000000, 0x00102012, 0x00000000, 0x0010101a, 0x00000001, 0x0010100a, 0x00000002, 0x05000036, 0x001020c2, 0x00000000, 0x001012a6, 0x00000001, 0x0100003e, }; + static const DWORD ps_partial_input_code[] = + { +#if 0 + void main(float4 position : SV_Position, float2 t0 : TEXCOORD0, + nointerpolation float t1 : TEXCOORD1, uint t2 : TEXCOORD2, + uint t3 : TEXCOORD3, out float4 o : SV_Target) + { + o.x = t0.y + t1; + o.y = t2 + t3; + o.z = 0.0f; + o.w = t0.x; + } +#endif + 0x43425844, 0x5b1db356, 0xaa5a5e9d, 0xb916a081, 0x61e6dcb1, 0x00000001, 0x000001cc, 0x00000003, + 0x0000002c, 0x000000cc, 0x00000100, 0x4e475349, 0x00000098, 0x00000005, 0x00000008, 0x00000080, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000008c, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000303, 0x0000008c, 0x00000001, 0x00000000, 0x00000003, 0x00000002, + 0x00000101, 0x0000008c, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000202, 0x0000008c, + 0x00000003, 0x00000000, 0x00000001, 0x00000002, 0x00000404, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000000c4, 0x00000040, 0x00000031, 0x03001062, 0x00101032, 0x00000001, 0x03000862, + 0x00101012, 0x00000002, 0x03000862, 0x00101022, 0x00000002, 0x03000862, 0x00101042, 0x00000002, + 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0700001e, 0x00100012, 0x00000000, + 0x0010102a, 0x00000002, 0x0010101a, 0x00000002, 0x05000056, 0x00102022, 0x00000000, 0x0010000a, + 0x00000000, 0x07000000, 0x00102012, 0x00000000, 0x0010101a, 0x00000001, 0x0010100a, 0x00000002, + 0x05000036, 0x00102042, 0x00000000, 0x00004001, 0x00000000, 0x05000036, 0x00102082, 0x00000000, + 0x0010100a, 0x00000001, 0x0100003e, + }; + static const DWORD ps_single_input_code[] = + { +#if 0 + void main(float4 position : SV_Position, float2 t0 : TEXCOORD0, out float4 o : SV_Target) + { + o.x = t0.x; + o.y = t0.y; + o.z = 1.0f; + o.w = 2.0f; + } +#endif + 0x43425844, 0x7cc601b6, 0xc65b8bdb, 0x54d0f606, 0x9cc74d3d, 0x00000001, 0x00000118, 0x00000003, + 0x0000002c, 0x00000084, 0x000000b8, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000303, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, + 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, + 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000058, + 0x00000040, 0x00000016, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x05000036, 0x00102032, 0x00000000, 0x00101046, 0x00000001, 0x08000036, 0x001020c2, 0x00000000, + 0x00004002, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x0100003e, + }; static const D3D10_INPUT_ELEMENT_DESC layout_desc[] = { {"SV_POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0}, @@ -10681,7 +10732,18 @@ static void test_shader_interstage_interface(void) {{ 1.0f, 1.0f}, {3.0f, 5.0f}, 5.0f, 2, 6, 7.0f}, }; static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; - static const struct vec4 expected_result = {10.0f, 8.0f, 7.0f, 3.0f}; + static const struct + { + const DWORD *ps_code; + size_t ps_size; + struct vec4 expected_result; + } + tests[] = + { + {ps_code, sizeof(ps_code), {10.0f, 8.0f, 7.0f, 3.0f}}, + {ps_partial_input_code, sizeof(ps_partial_input_code), {10.0f, 8.0f, 0.0f, 3.0f}}, + {ps_single_input_code, sizeof(ps_single_input_code), {3.0f, 5.0f, 1.0f, 2.0f}}, + }; if (!init_test_context(&test_context)) return; @@ -10690,8 +10752,6 @@ static void test_shader_interstage_interface(void) hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &vs); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); - hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps); - ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); ID3D10Texture2D_GetDesc(test_context.backbuffer, &texture_desc); texture_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; @@ -10711,20 +10771,26 @@ static void test_shader_interstage_interface(void) ID3D10Device_OMSetRenderTargets(device, 1, &rtv, NULL); - ID3D10Device_PSSetShader(device, ps); ID3D10Device_VSSetShader(device, vs); ID3D10Device_IASetInputLayout(device, input_layout); ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); offset = 0; stride = sizeof(*quad); ID3D10Device_IASetVertexBuffers(device, 0, 1, &vb, &stride, &offset); - ID3D10Device_Draw(device, 4, 0); - check_texture_vec4(render_target, &expected_result, 0); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + hr = ID3D10Device_CreatePixelShader(device, tests[i].ps_code, tests[i].ps_size, &ps); + ok(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr); + ID3D10Device_PSSetShader(device, ps); + ID3D10Device_Draw(device, 4, 0); + check_texture_vec4(render_target, &tests[i].expected_result, 0); + ID3D10PixelShader_Release(ps); + } ID3D10InputLayout_Release(input_layout); ID3D10RenderTargetView_Release(rtv); ID3D10Texture2D_Release(render_target); - ID3D10PixelShader_Release(ps); ID3D10VertexShader_Release(vs); ID3D10Buffer_Release(vb); release_test_context(&test_context);
1
0
0
0
Dmitry Timoshkov : schedsvc: Implement NetrJobAdd.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: ba55cce8bc3d7d373a498cbe85522e7ecf6fee94 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ba55cce8bc3d7d373a498cbe…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:17 2018 +0800 schedsvc: Implement NetrJobAdd. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/atsvc.c | 230 ++++++++++++++++++++++++++++++++++++++++- dlls/schedsvc/tests/atsvcapi.c | 1 - 2 files changed, 228 insertions(+), 3 deletions(-) diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c index c53e4cf..e46c1e9 100644 --- a/dlls/schedsvc/atsvc.c +++ b/dlls/schedsvc/atsvc.c @@ -327,6 +327,180 @@ void add_job(const WCHAR *name) } } +static BOOL write_signature(HANDLE hfile) +{ + struct + { + USHORT SignatureVersion; + USHORT ClientVersion; + BYTE md5[64]; + } signature; + DWORD size; + + signature.SignatureVersion = 0x0001; + signature.ClientVersion = 0x0001; + memset(&signature.md5, 0, sizeof(signature.md5)); + + return WriteFile(hfile, &signature, sizeof(signature), &size, NULL); +} + +static BOOL write_reserved_data(HANDLE hfile) +{ + static const struct + { + USHORT size; + BYTE data[8]; + } user = { 8, { 0xff,0x0f,0x1d,0,0,0,0,0 } }; + DWORD size; + + return WriteFile(hfile, &user, sizeof(user), &size, NULL); +} + +static BOOL write_trigger(HANDLE hfile, const AT_INFO *info) +{ + USHORT count; + DWORD size; + SYSTEMTIME st; + TASK_TRIGGER trigger; + + count = 1; + if (!WriteFile(hfile, &count, sizeof(count), &size, NULL)) + return FALSE; + + GetSystemTime(&st); + if (!(info->Flags & JOB_ADD_CURRENT_DATE)) + { + /* FIXME: parse AT_INFO */ + } + + trigger.cbTriggerSize = sizeof(trigger); + trigger.Reserved1 = 0; + trigger.wBeginYear = st.wYear; + trigger.wBeginMonth = st.wMonth; + trigger.wBeginDay = st.wDay; + trigger.wEndYear = st.wYear; + trigger.wEndMonth = st.wMonth; + trigger.wEndDay = st.wDay; + trigger.wStartHour = st.wHour; + trigger.wStartMinute = st.wMinute; + trigger.MinutesDuration = 0; + trigger.MinutesInterval = 0; + /* FIXME */ + trigger.rgFlags = TASK_TRIGGER_FLAG_HAS_END_DATE; + trigger.TriggerType = TASK_TIME_TRIGGER_MONTHLYDATE; + trigger.Type.MonthlyDate.rgfDays = 0; + trigger.Type.MonthlyDate.rgfMonths = 0xffff; + trigger.Reserved2 = 0; + trigger.wRandomMinutesInterval = 0; + + return WriteFile(hfile, &trigger, sizeof(trigger), &size, NULL); +} + +static BOOL write_unicode_string(HANDLE hfile, const WCHAR *str) +{ + USHORT count; + DWORD size; + + count = str ? (lstrlenW(str) + 1) : 0; + if (!WriteFile(hfile, &count, sizeof(count), &size, NULL)) + return FALSE; + + if (!str) return TRUE; + + count *= sizeof(WCHAR); + return WriteFile(hfile, str, count, &size, NULL); +} + +static BOOL create_job(const WCHAR *job_name, const AT_INFO *info) +{ + static WCHAR authorW[] = { 'W','i','n','e',0 }; + static WCHAR commentW[] = { 'C','r','e','a','t','e','d',' ','b','y',' ','W','i','n','e',0 }; + FIXDLEN_DATA fixed; + USHORT word; + HANDLE hfile; + DWORD size, ver; + BOOL ret = FALSE; + + TRACE("trying to create job %s\n", debugstr_w(job_name)); + hfile = CreateFileW(job_name, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0); + if (hfile == INVALID_HANDLE_VALUE) + return FALSE; + + ver = GetVersion(); + fixed.product_version = MAKEWORD(ver >> 8, ver); + fixed.file_version = 0x0001; + UuidCreate(&fixed.uuid); + fixed.name_size_offset = sizeof(fixed) + sizeof(USHORT); /* FIXDLEN_DATA + Instance Count */ + fixed.trigger_offset = sizeof(fixed) + sizeof(USHORT); /* FIXDLEN_DATA + Instance Count */ + fixed.trigger_offset += sizeof(USHORT) + (lstrlenW(info->Command) + 1) * sizeof(WCHAR); /* Application Name */ + fixed.trigger_offset += sizeof(USHORT); /* Parameters */ + fixed.trigger_offset += sizeof(USHORT); /* Working Directory */ + fixed.trigger_offset += sizeof(USHORT) + (lstrlenW(authorW) + 1) * sizeof(WCHAR); /* Author */ + fixed.trigger_offset += sizeof(USHORT) + (lstrlenW(commentW) + 1) * sizeof(WCHAR); /* Comment */ + fixed.trigger_offset += sizeof(USHORT); /* User Data */ + fixed.trigger_offset += 10; /* Reserved Data */ + fixed.error_retry_count = 0; + fixed.error_retry_interval = 0; + fixed.idle_deadline = 60; + fixed.idle_wait = 10; + fixed.priority = NORMAL_PRIORITY_CLASS; + fixed.maximum_runtime = 259200000; + fixed.exit_code = 0; + fixed.status = SCHED_S_TASK_HAS_NOT_RUN; + fixed.flags = TASK_FLAG_DELETE_WHEN_DONE; + if (!(info->Flags & JOB_NONINTERACTIVE)) + fixed.flags |= TASK_FLAG_INTERACTIVE; + /* FIXME: add other flags */ + memset(&fixed.last_runtime, 0, sizeof(fixed.last_runtime)); + + if (!WriteFile(hfile, &fixed, sizeof(fixed), &size, NULL)) + goto failed; + + /* Instance Count */ + word = 0; + if (!WriteFile(hfile, &word, sizeof(word), &size, NULL)) + goto failed; + /* Application Name */ + if (!write_unicode_string(hfile, info->Command)) + goto failed; + /* Parameters */ + if (!write_unicode_string(hfile, NULL)) + goto failed; + /* Working Directory */ + if (!write_unicode_string(hfile, NULL)) + goto failed; + /* Author */ + if (!write_unicode_string(hfile, authorW)) + goto failed; + /* Comment */ + if (!write_unicode_string(hfile, commentW)) + goto failed; + + /* User Data */ + word = 0; + if (!WriteFile(hfile, &word, sizeof(word), &size, NULL)) + goto failed; + + /* Reserved Data */ + if (!write_reserved_data(hfile)) + goto failed; + + /* Trigegrs */ + if (!write_trigger(hfile, info)) + goto failed; + + /* Signature */ + if (!write_signature(hfile)) + goto failed; + + ret = TRUE; + +failed: + CloseHandle(hfile); + if (!ret) DeleteFileW(job_name); + return ret; +} + static struct job_t *find_job(DWORD jobid, const WCHAR *name) { struct job_t *job; @@ -357,8 +531,60 @@ void remove_job(const WCHAR *name) DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid) { - FIXME("%s,%p,%p: stub\n", debugstr_w(server_name), info, jobid); - return ERROR_NOT_SUPPORTED; + WCHAR windir[MAX_PATH]; + + TRACE("%s,%p,%p\n", debugstr_w(server_name), info, jobid); + + GetWindowsDirectoryW(windir, MAX_PATH); + + for (;;) + { + static const WCHAR fmtW[] = { '\\','T','a','s','k','s','\\','A','t','%','u','.','j','o','b',0 }; + WCHAR task_name[MAX_PATH], name[32]; + + strcpyW(task_name, windir); + sprintfW(name, fmtW, current_jobid); + strcatW(task_name, name); + if (create_job(task_name, info)) + { + struct job_t *job; + int i; + + for (i = 0; i < 5; i++) + { + EnterCriticalSection(&at_job_list_section); + job = find_job(0, task_name); + LeaveCriticalSection(&at_job_list_section); + + if (job) + { + *jobid = job->info.JobId; + break; + } + + Sleep(50); + } + + if (!job) + { + ERR("couldn't find just created job %s\n", debugstr_w(task_name)); + return ERROR_FILE_NOT_FOUND; + } + + break; + } + + if (GetLastError() != ERROR_FILE_EXISTS) + { + + TRACE("create_job error %u\n", GetLastError()); + return GetLastError(); + } + + InterlockedIncrement(¤t_jobid); + } + + return ERROR_SUCCESS; } DWORD __cdecl NetrJobDel(ATSVC_HANDLE server_name, DWORD min_jobid, DWORD max_jobid) diff --git a/dlls/schedsvc/tests/atsvcapi.c b/dlls/schedsvc/tests/atsvcapi.c index d429232..2226480 100644 --- a/dlls/schedsvc/tests/atsvcapi.c +++ b/dlls/schedsvc/tests/atsvcapi.c @@ -91,7 +91,6 @@ START_TEST(atsvcapi) win_skip("NetrJobAdd: Access denied, skipping the tests\n"); goto skip_tests; } -todo_wine ok(ret == ERROR_SUCCESS || broken(ret == ERROR_NOT_SUPPORTED) /* Win8+ */, "NetrJobAdd error %u\n", ret); if (ret == ERROR_NOT_SUPPORTED) {
1
0
0
0
Dmitry Timoshkov : schedsvc: Implement NetrJobDel.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 934a64919dfc936d694083fe7e6abc70a841d807 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=934a64919dfc936d694083fe…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:15 2018 +0800 schedsvc: Implement NetrJobDel. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/atsvc.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c index 49b203b..c53e4cf 100644 --- a/dlls/schedsvc/atsvc.c +++ b/dlls/schedsvc/atsvc.c @@ -363,8 +363,35 @@ DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid) DWORD __cdecl NetrJobDel(ATSVC_HANDLE server_name, DWORD min_jobid, DWORD max_jobid) { - FIXME("%s,%u,%u: stub\n", debugstr_w(server_name), min_jobid, max_jobid); - return ERROR_NOT_SUPPORTED; + DWORD jobid, ret = ERROR_FILE_NOT_FOUND; + + TRACE("%s,%u,%u\n", debugstr_w(server_name), min_jobid, max_jobid); + + EnterCriticalSection(&at_job_list_section); + + for (jobid = min_jobid; jobid <= max_jobid; jobid++) + { + struct job_t *job = find_job(jobid, NULL); + + if (!job) + { + TRACE("job %u not found\n", jobid); + ret = ERROR_FILE_NOT_FOUND; + break; + } + + TRACE("deleting job %s\n", debugstr_w(job->name)); + if (!DeleteFileW(job->name)) + { + ret = GetLastError(); + break; + } + + ret = ERROR_SUCCESS; + } + + LeaveCriticalSection(&at_job_list_section); + return ret; } static void free_container(AT_ENUM_CONTAINER *container)
1
0
0
0
Dmitry Timoshkov : schedsvc: Implement NetrJobEnum.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: bab40d15a0cf6424d2026243afe8e0c8696905fb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bab40d15a0cf6424d2026243…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:13 2018 +0800 schedsvc: Implement NetrJobEnum. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/atsvc.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c index a843b08..49b203b 100644 --- a/dlls/schedsvc/atsvc.c +++ b/dlls/schedsvc/atsvc.c @@ -367,11 +367,67 @@ DWORD __cdecl NetrJobDel(ATSVC_HANDLE server_name, DWORD min_jobid, DWORD max_jo return ERROR_NOT_SUPPORTED; } +static void free_container(AT_ENUM_CONTAINER *container) +{ + DWORD i; + + for (i = 0; i < container->EntriesRead; i++) + heap_free(container->Buffer[i].Command); + + heap_free(container->Buffer); +} + DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container, DWORD max_length, DWORD *total, DWORD *resume) { - FIXME("%s,%p,%u,%p,%p: stub\n", debugstr_w(server_name), container, max_length, total, resume); - return ERROR_NOT_SUPPORTED; + DWORD allocated; + struct job_t *job; + + TRACE("%s,%p,%u,%p,%p\n", debugstr_w(server_name), container, max_length, total, resume); + + *total = 0; + *resume = 0; + container->EntriesRead = 0; + + allocated = 64; + container->Buffer = heap_alloc(allocated * sizeof(AT_ENUM)); + if (!container->Buffer) return ERROR_NOT_ENOUGH_MEMORY; + + EnterCriticalSection(&at_job_list_section); + + LIST_FOR_EACH_ENTRY(job, &at_job_list, struct job_t, entry) + { + if (container->EntriesRead >= max_length) + { + *resume = container->EntriesRead; + break; + } + + if (allocated <= container->EntriesRead) + { + AT_ENUM *new_buffer; + + allocated *= 2; + new_buffer = heap_realloc(container->Buffer, allocated * sizeof(AT_ENUM)); + if (!new_buffer) + { + free_container(container); + LeaveCriticalSection(&at_job_list_section); + return ERROR_NOT_ENOUGH_MEMORY; + } + container->Buffer = new_buffer; + } + + container->Buffer[container->EntriesRead] = job->info; + container->Buffer[container->EntriesRead].Command = heap_strdupW(job->info.Command); + container->EntriesRead++; + } + + LeaveCriticalSection(&at_job_list_section); + + *total = container->EntriesRead; + + return ERROR_SUCCESS; } DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **info)
1
0
0
0
Dmitry Timoshkov : schedsvc: Implement NetrJobGetInfo.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: be3f4a797fdf243515015d06da7a8adde498f39d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be3f4a797fdf243515015d06…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:10 2018 +0800 schedsvc: Implement NetrJobGetInfo. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/atsvc.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c index 7b1c60b..a843b08 100644 --- a/dlls/schedsvc/atsvc.c +++ b/dlls/schedsvc/atsvc.c @@ -376,6 +376,30 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **info) { - FIXME("%s,%u,%p: stub\n", debugstr_w(server_name), jobid, info); - return ERROR_NOT_SUPPORTED; + struct job_t *job; + DWORD ret = ERROR_SUCCESS; + + TRACE("%s,%u,%p\n", debugstr_w(server_name), jobid, info); + + EnterCriticalSection(&at_job_list_section); + + job = find_job(jobid, NULL); + if (job) + { + AT_INFO *info_ret = heap_alloc(sizeof(*info_ret)); + if (!info_ret) + ret = ERROR_NOT_ENOUGH_MEMORY; + else + { + info_ret->JobTime = job->info.JobTime; + info_ret->DaysOfMonth = job->info.DaysOfMonth; + info_ret->DaysOfWeek = job->info.DaysOfWeek; + info_ret->Flags = job->info.Flags; + info_ret->Command = heap_strdupW(job->info.Command); + *info = info_ret; + } + } + + LeaveCriticalSection(&at_job_list_section); + return ret; }
1
0
0
0
Dmitry Timoshkov : schedsvc: Remove job from the list when job file is deleted.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: c85bc14d55e0f75de1591cf2b0f50c36898c9cb0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c85bc14d55e0f75de1591cf2…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:08 2018 +0800 schedsvc: Remove job from the list when job file is deleted. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/atsvc.c | 28 ++++++++++++++++++++++++++++ dlls/schedsvc/schedsvc_private.h | 1 + dlls/schedsvc/svc_main.c | 8 ++++++++ 3 files changed, 37 insertions(+) diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c index baa808a..7b1c60b 100644 --- a/dlls/schedsvc/atsvc.c +++ b/dlls/schedsvc/atsvc.c @@ -327,6 +327,34 @@ void add_job(const WCHAR *name) } } +static struct job_t *find_job(DWORD jobid, const WCHAR *name) +{ + struct job_t *job; + + LIST_FOR_EACH_ENTRY(job, &at_job_list, struct job_t, entry) + { + if ((name && !lstrcmpiW(job->name, name)) || job->info.JobId == jobid) + return job; + } + + return NULL; +} + +void remove_job(const WCHAR *name) +{ + struct job_t *job; + + EnterCriticalSection(&at_job_list_section); + job = find_job(0, name); + if (job) + { + list_remove(&job->entry); + heap_free(job->name); + heap_free(job); + } + LeaveCriticalSection(&at_job_list_section); +} + DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid) { FIXME("%s,%p,%p: stub\n", debugstr_w(server_name), info, jobid); diff --git a/dlls/schedsvc/schedsvc_private.h b/dlls/schedsvc/schedsvc_private.h index 1e5d575..215bba0 100644 --- a/dlls/schedsvc/schedsvc_private.h +++ b/dlls/schedsvc/schedsvc_private.h @@ -24,6 +24,7 @@ void schedsvc_auto_start(void) DECLSPEC_HIDDEN; void add_job(const WCHAR *name) DECLSPEC_HIDDEN; +void remove_job(const WCHAR *name) DECLSPEC_HIDDEN; static inline WCHAR *heap_strdupW(const WCHAR *src) { diff --git a/dlls/schedsvc/svc_main.c b/dlls/schedsvc/svc_main.c index 0835d71..1ccc345 100644 --- a/dlls/schedsvc/svc_main.c +++ b/dlls/schedsvc/svc_main.c @@ -91,6 +91,14 @@ static DWORD WINAPI tasks_monitor_thread(void *arg) add_job(path); break; + case FILE_ACTION_REMOVED: + TRACE("FILE_ACTION_REMOVED %s\n", debugstr_w(info.data.FileName)); + GetWindowsDirectoryW(path, MAX_PATH); + lstrcatW(path, tasksW); + lstrcatW(path, info.data.FileName); + remove_job(path); + break; + default: FIXME("%s: action %#x not handled\n", debugstr_w(info.data.FileName), info.data.Action); break;
1
0
0
0
Dmitry Timoshkov : schedsvc: Add support for reading .job files.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 2b8d47694d07c6d82fe27589cb40c4d9a6084e85 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2b8d47694d07c6d82fe27589…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:06 2018 +0800 schedsvc: Add support for reading .job files. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/atsvc.c | 301 +++++++++++++++++++++++++++++++++++++++ dlls/schedsvc/schedsvc_private.h | 1 + dlls/schedsvc/svc_main.c | 9 ++ include/mstask.idl | 14 ++ 4 files changed, 325 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2b8d47694d07c6d82fe2…
1
0
0
0
Dmitry Timoshkov : schedsvc: Add a thread for monitoring version 1 task files.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 2eb6f886708f83dea275d0ba14305a51de443f40 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2eb6f886708f83dea275d0ba…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 17 15:12:03 2018 +0800 schedsvc: Add a thread for monitoring version 1 task files. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/schedsvc/svc_main.c | 73 +++++++++++++++++++++++++++++++++++++++++++++--- loader/wine.inf.in | 1 + 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/dlls/schedsvc/svc_main.c b/dlls/schedsvc/svc_main.c index 8713bdb..3de0253 100644 --- a/dlls/schedsvc/svc_main.c +++ b/dlls/schedsvc/svc_main.c @@ -36,6 +36,66 @@ static const WCHAR scheduleW[] = {'S','c','h','e','d','u','l','e',0}; static SERVICE_STATUS_HANDLE schedsvc_handle; static HANDLE done_event; +static DWORD WINAPI tasks_monitor_thread(void *arg) +{ + static const WCHAR tasksW[] = { '\\','T','a','s','k','s','\\',0 }; + WCHAR path[MAX_PATH]; + HANDLE htasks; + OVERLAPPED ov; + + TRACE("Starting...\n"); + + GetWindowsDirectoryW(path, MAX_PATH); + lstrcatW(path, tasksW); + + htasks = CreateFileW(path, FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL); + if (htasks == INVALID_HANDLE_VALUE) return -1; + + memset(&ov, 0, sizeof(ov)); + ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + + for (;;) + { + struct + { + FILE_NOTIFY_INFORMATION data; + WCHAR name_buffer[MAX_PATH]; + } info; + HANDLE events[2]; + DWORD ret; + + /* the buffer must be DWORD aligned */ + C_ASSERT(!(sizeof(info) & 3)); + + memset(&info, 0, sizeof(info)); + + ret = ReadDirectoryChangesW(htasks, &info, sizeof(info), FALSE, + FILE_NOTIFY_CHANGE_FILE_NAME, NULL, &ov, NULL); + if (!ret) break; + + events[0] = done_event; + events[1] = ov.hEvent; + + ret = WaitForMultipleObjects(2, events, FALSE, INFINITE); + if (ret == WAIT_OBJECT_0) break; + + switch (info.data.Action) + { + default: + FIXME("%s: action %#x not handled\n", debugstr_w(info.data.FileName), info.data.Action); + break; + } + } + + CloseHandle(ov.hEvent); + CloseHandle(htasks); + + TRACE("Finished.\n"); + + return 0; +} + void schedsvc_auto_start(void) { static DWORD start_type; @@ -201,6 +261,9 @@ static void RPC_finish(void) void WINAPI ServiceMain(DWORD argc, LPWSTR *argv) { + HANDLE thread; + DWORD tid; + TRACE("starting Task Scheduler Service\n"); schedsvc_handle = RegisterServiceCtrlHandlerW(scheduleW, schedsvc_handler); @@ -210,14 +273,16 @@ void WINAPI ServiceMain(DWORD argc, LPWSTR *argv) return; } - done_event = CreateEventW(NULL, TRUE, FALSE, NULL); - schedsvc_update_status(SERVICE_START_PENDING); - if (RPC_init() == RPC_S_OK) + done_event = CreateEventW(NULL, TRUE, FALSE, NULL); + thread = CreateThread(NULL, 0, tasks_monitor_thread, NULL, 0, &tid); + + if (thread && RPC_init() == RPC_S_OK) { schedsvc_update_status(SERVICE_RUNNING); - WaitForSingleObject(done_event, INFINITE); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); RPC_finish(); } diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 0df7622..627c6ef 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2579,6 +2579,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 10,help, 10,inf, 10,logs, +10,tasks, 10,temp, 11,catroot, 11,mui,
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
55
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
Results per page:
10
25
50
100
200