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
November 2015
----- 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
623 discussions
Start a n
N
ew thread
Józef Kucia : d3d11: Implement d3d11_immediate_context_VSGetConstantBuffers().
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: 1f0236bd6d72669648bebb2fce35e2f2fab027ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f0236bd6d72669648bebb2fc…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 03:40:54 2015 +0100 d3d11: Implement d3d11_immediate_context_VSGetConstantBuffers(). 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/device.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index d838298..b632e08 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -996,8 +996,29 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetConstantBuffers(ID3D11DeviceContext *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_vs_cb(device->wined3d_device, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShaderResources(ID3D11DeviceContext *iface,
1
0
0
0
Józef Kucia : d3d11: Implement d3d11_immediate_context_GSGetShaderResources().
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: 9e18cfacb29f5411f6c8176b333200b3632cb6ff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e18cfacb29f5411f6c8176b3…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 03:40:53 2015 +0100 d3d11: Implement d3d11_immediate_context_GSGetShaderResources(). 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/device.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 811e9d8..d838298 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1219,7 +1219,28 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GetPredication(ID3D11Devic static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D11DeviceContext *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct wined3d_shader_resource_view *wined3d_view; + struct d3d_shader_resource_view *view_impl; + + if (!(wined3d_view = wined3d_device_get_gs_resource_view(device->wined3d_device, start_slot + i))) + { + views[i] = NULL; + continue; + } + + view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); + views[i] = &view_impl->ID3D11ShaderResourceView_iface; + ID3D11ShaderResourceView_AddRef(views[i]); + } + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11DeviceContext *iface,
1
0
0
0
Józef Kucia : d3d11: Implement d3d11_immediate_context_GSGetShader().
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: e7377e6f2d5d87593d20154f6af2034f26ee638e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7377e6f2d5d87593d20154f6…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 03:40:52 2015 +0100 d3d11: Implement d3d11_immediate_context_GSGetShader(). 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/device.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c451514..811e9d8 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1123,8 +1123,28 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceContext *iface, ID3D11GeometryShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) { - FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_geometry_shader *shader_impl; + struct wined3d_shader *wined3d_shader; + + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n", iface, shader, class_instances, class_instance_count); + + if (class_instances || class_instance_count) + FIXME("Dynamic linking not implemented yet.\n"); + + wined3d_mutex_lock(); + if (!(wined3d_shader = wined3d_device_get_geometry_shader(device->wined3d_device))) + { + wined3d_mutex_unlock(); + *shader = NULL; + return; + } + + shader_impl = wined3d_shader_get_parent(wined3d_shader); + wined3d_mutex_unlock(); + *shader = &shader_impl->ID3D11GeometryShader_iface; + ID3D11GeometryShader_AddRef(*shader); } static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetPrimitiveTopology(ID3D11DeviceContext *iface,
1
0
0
0
Józef Kucia : d3d11: Implement d3d11_immediate_context_GSGetConstantBuffers().
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: 58aa9d41083a12873051367ef62e1f0f77694253 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58aa9d41083a12873051367ef…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 03:40:51 2015 +0100 d3d11: Implement d3d11_immediate_context_GSGetConstantBuffers(). 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/device.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index fda0ed7..c451514 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1095,8 +1095,29 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetIndexBuffer(ID3D11Dev static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetConstantBuffers(ID3D11DeviceContext *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_gs_cb(device->wined3d_device, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceContext *iface,
1
0
0
0
Józef Kucia : d3d11: Implement d3d11_immediate_context_GSGetSamplers().
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: aca6aa7ebf6468e039f17f695761221905ee54a6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aca6aa7ebf6468e039f17f695…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 03:40:50 2015 +0100 d3d11: Implement d3d11_immediate_context_GSGetSamplers(). 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/device.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 174754d..fda0ed7 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1184,8 +1184,29 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11DeviceContext *iface, UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) { - FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler_impl; + struct wined3d_sampler *wined3d_sampler; + + if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i))) + { + samplers[i] = NULL; + continue; + } + + sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); + samplers[i] = &sampler_impl->ID3D11SamplerState_iface; + ID3D11SamplerState_AddRef(samplers[i]); + } + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargets(ID3D11DeviceContext *iface,
1
0
0
0
Józef Kucia : d3d11/tests: Avoid multiple readbacks of backbuffer texture.
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: f4e4d7b0b1e61387c972f98948109c51a6f7a525 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4e4d7b0b1e61387c972f9894…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 02:03:34 2015 +0100 d3d11/tests: Avoid multiple readbacks of backbuffer texture. 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 | 90 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 21 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index fe049ca..7021c6f 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -80,36 +80,74 @@ static BOOL compare_color(DWORD c1, DWORD c2, BYTE max_diff) return TRUE; } -static DWORD get_texture_color(ID3D11Texture2D *src_texture, unsigned int x, unsigned int y) +struct texture_readback +{ + ID3D11Resource *texture; + D3D11_MAPPED_SUBRESOURCE map_desc; + ID3D11DeviceContext *immediate_context; +}; + +static void get_texture_readback(ID3D11Texture2D *texture, struct texture_readback *rb) { - D3D11_MAPPED_SUBRESOURCE mapped_texture; D3D11_TEXTURE2D_DESC texture_desc; - ID3D11Texture2D *dst_texture; - ID3D11DeviceContext *context; ID3D11Device *device; - DWORD color; HRESULT hr; - ID3D11Texture2D_GetDevice(src_texture, &device); - ID3D11Device_GetImmediateContext(device, &context); + memset(rb, 0, sizeof(*rb)); + + ID3D11Texture2D_GetDevice(texture, &device); - ID3D11Texture2D_GetDesc(src_texture, &texture_desc); + ID3D11Texture2D_GetDesc(texture, &texture_desc); texture_desc.Usage = D3D11_USAGE_STAGING; texture_desc.BindFlags = 0; texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; texture_desc.MiscFlags = 0; - hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &dst_texture); - ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + if (FAILED(hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&rb->texture))) + { + trace("Failed to create texture, hr %#x.\n", hr); + ID3D11Device_Release(device); + return; + } - ID3D11DeviceContext_CopyResource(context, (ID3D11Resource *)dst_texture, (ID3D11Resource *)src_texture); - hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)dst_texture, 0, D3D11_MAP_READ, 0, &mapped_texture); - ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); - color = *(DWORD *)(((BYTE *)mapped_texture.pData) + mapped_texture.RowPitch * y + x * 4); - ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)dst_texture, 0); + ID3D11Device_GetImmediateContext(device, &rb->immediate_context); + + ID3D11DeviceContext_CopyResource(rb->immediate_context, rb->texture, (ID3D11Resource *)texture); + if (FAILED(hr = ID3D11DeviceContext_Map(rb->immediate_context, rb->texture, 0, D3D11_MAP_READ, 0, &rb->map_desc))) + { + trace("Failed to map texture, hr %#x.\n", hr); + ID3D11Resource_Release(rb->texture); + rb->texture = NULL; + ID3D11DeviceContext_Release(rb->immediate_context); + rb->immediate_context = NULL; + } - ID3D11Texture2D_Release(dst_texture); - ID3D11DeviceContext_Release(context); ID3D11Device_Release(device); +} + +static DWORD get_readback_color(struct texture_readback *rb, unsigned int x, unsigned int y) +{ + return rb->texture + ? ((DWORD *)rb->map_desc.pData)[rb->map_desc.RowPitch * y / sizeof(DWORD) + x] : 0xdeadbeef; +} + +static void release_texture_readback(struct texture_readback *rb) +{ + if (!rb->texture) + return; + + ID3D11DeviceContext_Unmap(rb->immediate_context, rb->texture, 0); + ID3D11Resource_Release(rb->texture); + ID3D11DeviceContext_Release(rb->immediate_context); +} + +static DWORD get_texture_color(ID3D11Texture2D *texture, unsigned int x, unsigned int y) +{ + struct texture_readback rb; + DWORD color; + + get_texture_readback(texture, &rb); + color = get_readback_color(&rb, x, y); + release_texture_readback(&rb); return color; } @@ -2824,6 +2862,7 @@ static void test_texture(void) ID3D11DeviceContext *context; ID3D11Texture2D *backbuffer; unsigned int stride, offset; + struct texture_readback rb; IDXGISwapChain *swapchain; ID3D11Texture2D *texture; ID3D11VertexShader *vs; @@ -3003,16 +3042,18 @@ static void test_texture(void) ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, bitmap_data[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, bitmap_data[j + i * 4]); } } + release_texture_readback(&rb); ID3D11PixelShader_Release(ps); ID3D11VertexShader_Release(vs); @@ -3710,6 +3751,7 @@ static void test_update_subresource(void) ID3D11DeviceContext *context; ID3D11Texture2D *backbuffer; unsigned int stride, offset; + struct texture_readback rb; IDXGISwapChain *swapchain; ID3D11Texture2D *texture; ID3D11VertexShader *vs; @@ -3893,15 +3935,17 @@ static void test_update_subresource(void) ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, 0x00000000, 0), "Got unexpected color 0x%08x at (%u, %u).\n", color, j, i); } } + release_texture_readback(&rb); set_box(&box, 1, 1, 0, 3, 3, 1); ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, @@ -3919,30 +3963,34 @@ static void test_update_subresource(void) ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, bitmap_data, sizeof(*bitmap_data), 0); ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, expected_colors[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, expected_colors[j + i * 4]); } } + release_texture_readback(&rb); ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, NULL, bitmap_data, 4 * sizeof(*bitmap_data), 0); ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, bitmap_data[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, bitmap_data[j + i * 4]); } } + release_texture_readback(&rb); ID3D11PixelShader_Release(ps); ID3D11VertexShader_Release(vs);
1
0
0
0
Józef Kucia : d3d10core/tests: Avoid multiple readbacks of backbuffer texture.
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: c9ea266c011bb4568b31ac4f8573b519843cb2ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9ea266c011bb4568b31ac4f8…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Nov 11 02:03:33 2015 +0100 d3d10core/tests: Avoid multiple readbacks of backbuffer texture. 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 | 79 +++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 17 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index d6b6bfb..bec3763 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -85,33 +85,68 @@ static BOOL compare_color(DWORD c1, DWORD c2, BYTE max_diff) return TRUE; } -static DWORD get_texture_color(ID3D10Texture2D *src_texture, unsigned int x, unsigned int y) +struct texture_readback { + ID3D10Texture2D *texture; D3D10_MAPPED_TEXTURE2D mapped_texture; +}; + +static void get_texture_readback(ID3D10Texture2D *texture, struct texture_readback *rb) +{ D3D10_TEXTURE2D_DESC texture_desc; - ID3D10Texture2D *dst_texture; ID3D10Device *device; - DWORD color; HRESULT hr; - ID3D10Texture2D_GetDevice(src_texture, &device); + memset(rb, 0, sizeof(*rb)); + + ID3D10Texture2D_GetDevice(texture, &device); - ID3D10Texture2D_GetDesc(src_texture, &texture_desc); + ID3D10Texture2D_GetDesc(texture, &texture_desc); texture_desc.Usage = D3D10_USAGE_STAGING; texture_desc.BindFlags = 0; texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; texture_desc.MiscFlags = 0; - hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &dst_texture); - ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &rb->texture))) + { + trace("Failed to create texture, hr %#x.\n", hr); + ID3D10Device_Release(device); + return; + } - ID3D10Device_CopyResource(device, (ID3D10Resource *)dst_texture, (ID3D10Resource *)src_texture); - hr = ID3D10Texture2D_Map(dst_texture, 0, D3D10_MAP_READ, 0, &mapped_texture); - ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); - color = *(DWORD *)(((BYTE *)mapped_texture.pData) + mapped_texture.RowPitch * y + x * 4); - ID3D10Texture2D_Unmap(dst_texture, 0); + ID3D10Device_CopyResource(device, (ID3D10Resource *)rb->texture, (ID3D10Resource *)texture); + if (FAILED(hr = ID3D10Texture2D_Map(rb->texture, 0, D3D10_MAP_READ, 0, &rb->mapped_texture))) + { + trace("Failed to map texture, hr %#x.\n", hr); + ID3D10Texture2D_Release(rb->texture); + rb->texture = NULL; + } - ID3D10Texture2D_Release(dst_texture); ID3D10Device_Release(device); +} + +static DWORD get_readback_color(struct texture_readback *rb, unsigned int x, unsigned int y) +{ + return rb->texture + ? ((DWORD *)rb->mapped_texture.pData)[rb->mapped_texture.RowPitch * y / sizeof(DWORD) + x] : 0xdeadbeef; +} + +static void release_texture_readback(struct texture_readback *rb) +{ + if (!rb->texture) + return; + + ID3D10Texture2D_Unmap(rb->texture, 0); + ID3D10Texture2D_Release(rb->texture); +} + +static DWORD get_texture_color(ID3D10Texture2D *texture, unsigned int x, unsigned int y) +{ + struct texture_readback rb; + DWORD color; + + get_texture_readback(texture, &rb); + color = get_readback_color(&rb, x, y); + release_texture_readback(&rb); return color; } @@ -3179,6 +3214,7 @@ static void test_texture(void) D3D10_BUFFER_DESC buffer_desc; ID3D10Texture2D *backbuffer; unsigned int stride, offset; + struct texture_readback rb; IDXGISwapChain *swapchain; ID3D10Texture2D *texture; ID3D10VertexShader *vs; @@ -3355,16 +3391,18 @@ static void test_texture(void) ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, bitmap_data[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, bitmap_data[j + i * 4]); } } + release_texture_readback(&rb); ID3D10PixelShader_Release(ps); ID3D10VertexShader_Release(vs); @@ -4047,6 +4085,7 @@ static void test_update_subresource(void) D3D10_BUFFER_DESC buffer_desc; ID3D10Texture2D *backbuffer; unsigned int stride, offset; + struct texture_readback rb; IDXGISwapChain *swapchain; ID3D10Texture2D *texture; ID3D10VertexShader *vs; @@ -4227,15 +4266,17 @@ static void test_update_subresource(void) ID3D10Device_ClearRenderTargetView(device, backbuffer_rtv, red); ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, 0x00000000, 0), "Got unexpected color 0x%08x at (%u, %u).\n", color, j, i); } } + release_texture_readback(&rb); set_box(&box, 1, 1, 0, 3, 3, 1); ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)texture, 0, &box, @@ -4253,30 +4294,34 @@ static void test_update_subresource(void) ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)texture, 0, &box, bitmap_data, sizeof(*bitmap_data), 0); ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, expected_colors[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, expected_colors[j + i * 4]); } } + release_texture_readback(&rb); ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)texture, 0, NULL, bitmap_data, 4 * sizeof(*bitmap_data), 0); ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, bitmap_data[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, bitmap_data[j + i * 4]); } } + release_texture_readback(&rb); ID3D10PixelShader_Release(ps); ID3D10VertexShader_Release(vs);
1
0
0
0
Sebastian Lackner : server: Only send WM_WINE_CLIPCURSOR for forced clip resets.
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: 55c4a108d7e695bb09f5b909fca45784737e188f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=55c4a108d7e695bb09f5b909f…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Wed Nov 11 05:30:50 2015 +0100 server: Only send WM_WINE_CLIPCURSOR for forced clip resets. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/queue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/queue.c b/server/queue.c index 13ca2b2..5136f43 100644 --- a/server/queue.c +++ b/server/queue.c @@ -374,7 +374,7 @@ static void get_message_defaults( struct msg_queue *queue, int *x, int *y, unsig } /* set the cursor clip rectangle */ -static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect ) +static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, int send_clip_msg ) { rectangle_t top_rect; int x, y; @@ -392,7 +392,7 @@ static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect } else desktop->cursor.clip = top_rect; - if (desktop->cursor.clip_msg) + if (desktop->cursor.clip_msg && send_clip_msg) post_desktop_message( desktop, desktop->cursor.clip_msg, rect != NULL, 0 ); /* warp the mouse to be inside the clip rect */ @@ -405,7 +405,7 @@ static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect static void set_foreground_input( struct desktop *desktop, struct thread_input *input ) { if (desktop->foreground_input == input) return; - set_clip_rectangle( desktop, NULL ); + set_clip_rectangle( desktop, NULL, 1 ); desktop->foreground_input = input; } @@ -3091,7 +3091,7 @@ DECL_HANDLER(set_cursor) if (req->clip_msg && get_top_window_owner(desktop) == current->process) desktop->cursor.clip_msg = req->clip_msg; - set_clip_rectangle( desktop, (req->flags & SET_CURSOR_NOCLIP) ? NULL : &req->clip ); + set_clip_rectangle( desktop, (req->flags & SET_CURSOR_NOCLIP) ? NULL : &req->clip, 0 ); } reply->new_x = input->desktop->cursor.x;
1
0
0
0
Jacek Caban : ntdll: Added KeyCachedInformation key info class implementation.
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: 5eb30353747303699ceb1ae99b6c33d6879721ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5eb30353747303699ceb1ae99…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 11 14:17:09 2015 +0100 ntdll: Added KeyCachedInformation key info class implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/reg.c | 26 +++++++++++++++++++---- dlls/ntdll/tests/reg.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++- include/winternl.h | 19 ++++++++++++++++- server/registry.c | 6 +++++- 4 files changed, 101 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index 0701426..be95a2a 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -257,10 +257,11 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i switch(info_class) { - case KeyBasicInformation: data_ptr = ((KEY_BASIC_INFORMATION *)info)->Name; break; - case KeyFullInformation: data_ptr = ((KEY_FULL_INFORMATION *)info)->Class; break; - case KeyNodeInformation: data_ptr = ((KEY_NODE_INFORMATION *)info)->Name; break; - case KeyNameInformation: data_ptr = ((KEY_NAME_INFORMATION *)info)->Name; break; + case KeyBasicInformation: data_ptr = ((KEY_BASIC_INFORMATION *)info)->Name; break; + case KeyFullInformation: data_ptr = ((KEY_FULL_INFORMATION *)info)->Class; break; + case KeyNodeInformation: data_ptr = ((KEY_NODE_INFORMATION *)info)->Name; break; + case KeyNameInformation: data_ptr = ((KEY_NAME_INFORMATION *)info)->Name; break; + case KeyCachedInformation: data_ptr = ((KEY_CACHED_INFORMATION *)info)+1; break; default: FIXME( "Information class %d not implemented\n", info_class ); return STATUS_INVALID_PARAMETER; @@ -332,6 +333,23 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i memcpy( info, &keyinfo, min( length, fixed_size ) ); } break; + case KeyCachedInformation: + { + KEY_CACHED_INFORMATION keyinfo; + fixed_size = sizeof(keyinfo); + keyinfo.LastWriteTime.QuadPart = reply->modif; + keyinfo.TitleIndex = 0; + keyinfo.SubKeys = reply->subkeys; + keyinfo.MaxNameLen = reply->max_subkey; + keyinfo.Values = reply->values; + keyinfo.MaxValueNameLen = reply->max_value; + keyinfo.MaxValueDataLen = reply->max_data; + keyinfo.NameLength = reply->namelen; + memcpy( info, &keyinfo, min( length, fixed_size ) ); + } + break; + default: + break; } *result_len = fixed_size + reply->total; if (length < *result_len) ret = STATUS_BUFFER_OVERFLOW; diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 149910a..dfec007 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -1466,12 +1466,14 @@ static void test_long_value_name(void) static void test_NtQueryKey(void) { - HANDLE key; + HANDLE key, subkey, subkey2; NTSTATUS status; OBJECT_ATTRIBUTES attr; ULONG length, len; KEY_NAME_INFORMATION *info = NULL; + KEY_CACHED_INFORMATION cached_info; UNICODE_STRING str; + DWORD dw; InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); status = pNtOpenKey(&key, KEY_READ, &attr); @@ -1506,6 +1508,59 @@ static void test_NtQueryKey(void) wine_dbgstr_wn(winetestpath.Buffer, winetestpath.Length/sizeof(WCHAR))); HeapFree(GetProcessHeap(), 0, info); + + attr.RootDirectory = key; + attr.ObjectName = &str; + pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); + status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + + status = pNtQueryKey(subkey, KeyCachedInformation, &cached_info, sizeof(cached_info), &len); + ok(status == STATUS_SUCCESS, "NtQueryKey Failed: 0x%08x\n", status); + + if (status == STATUS_SUCCESS) + { + ok(len == sizeof(cached_info), "got unexpected length %d\n", len); + ok(cached_info.SubKeys == 0, "cached_info.SubKeys = %u\n", cached_info.SubKeys); + ok(cached_info.MaxNameLen == 0, "cached_info.MaxNameLen = %u\n", cached_info.MaxNameLen); + ok(cached_info.Values == 0, "cached_info.Values = %u\n", cached_info.Values); + ok(cached_info.MaxValueNameLen == 0, "cached_info.MaxValueNameLen = %u\n", cached_info.MaxValueNameLen); + ok(cached_info.MaxValueDataLen == 0, "cached_info.MaxValueDataLen = %u\n", cached_info.MaxValueDataLen); + ok(cached_info.NameLength == 22, "cached_info.NameLength = %u\n", cached_info.NameLength); + } + + attr.RootDirectory = subkey; + attr.ObjectName = &str; + pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey2"); + status = pNtCreateKey(&subkey2, GENERIC_ALL, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + + pRtlCreateUnicodeStringFromAsciiz(&str, "val"); + dw = 64; + status = pNtSetValueKey( subkey, &str, 0, REG_DWORD, &dw, sizeof(dw) ); + ok( status == STATUS_SUCCESS, "NtSetValueKey failed: 0x%08x\n", status ); + + status = pNtQueryKey(subkey, KeyCachedInformation, &cached_info, sizeof(cached_info), &len); + ok(status == STATUS_SUCCESS, "NtQueryKey Failed: 0x%08x\n", status); + + if (status == STATUS_SUCCESS) + { + ok(len == sizeof(cached_info), "got unexpected length %d\n", len); + ok(cached_info.SubKeys == 1, "cached_info.SubKeys = %u\n", cached_info.SubKeys); + ok(cached_info.MaxNameLen == 24, "cached_info.MaxNameLen = %u\n", cached_info.MaxNameLen); + ok(cached_info.Values == 1, "cached_info.Values = %u\n", cached_info.Values); + ok(cached_info.MaxValueNameLen == 6, "cached_info.MaxValueNameLen = %u\n", cached_info.MaxValueNameLen); + ok(cached_info.MaxValueDataLen == 4, "cached_info.MaxValueDataLen = %u\n", cached_info.MaxValueDataLen); + ok(cached_info.NameLength == 22, "cached_info.NameLength = %u\n", cached_info.NameLength); + } + + status = pNtDeleteKey(subkey2); + ok(status == STATUS_SUCCESS, "NtDeleteSubkey failed: %x\n", status); + status = pNtDeleteKey(subkey); + ok(status == STATUS_SUCCESS, "NtDeleteSubkey failed: %x\n", status); + + pNtClose(subkey2); + pNtClose(subkey); pNtClose(key); } diff --git a/include/winternl.h b/include/winternl.h index 1746601..ecd5791 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -696,7 +696,12 @@ typedef enum _KEY_INFORMATION_CLASS { KeyBasicInformation, KeyNodeInformation, KeyFullInformation, - KeyNameInformation + KeyNameInformation, + KeyCachedInformation, + KeyFlagsInformation, + KeyVirtualizationInformation, + KeyHandleTagsInformation, + MaxKeyInfoClass } KEY_INFORMATION_CLASS; typedef enum _KEY_VALUE_INFORMATION_CLASS { @@ -1024,6 +1029,18 @@ typedef struct _KEY_NAME_INFORMATION { WCHAR Name[1]; } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION; +typedef struct _KEY_CACHED_INFORMATION +{ + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG SubKeys; + ULONG MaxNameLen; + ULONG Values; + ULONG MaxValueNameLen; + ULONG MaxValueDataLen; + ULONG NameLength; +} KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION; + typedef struct _KEY_VALUE_ENTRY { PUNICODE_STRING ValueName; diff --git a/server/registry.c b/server/registry.c index 94777b3..dad86e7 100644 --- a/server/registry.c +++ b/server/registry.c @@ -906,6 +906,7 @@ static void enum_key( const struct key *key, int index, int info_class, reply->max_data = 0; break; case KeyFullInformation: + case KeyCachedInformation: for (i = 0; i <= key->last_subkey; i++) { if (key->subkeys[i]->namelen > max_subkey) max_subkey = key->subkeys[i]->namelen; @@ -920,7 +921,10 @@ static void enum_key( const struct key *key, int index, int info_class, reply->max_class = max_class; reply->max_value = max_value; reply->max_data = max_data; - namelen = 0; /* only return the class */ + reply->namelen = namelen; + if (info_class == KeyCachedInformation) + classlen = 0; /* don't return any data, only its size */ + namelen = 0; /* don't return name */ break; default: set_error( STATUS_INVALID_PARAMETER );
1
0
0
0
Jacek Caban : server: Return KeyFullInformation maximal string lengths in bytes.
by Alexandre Julliard
12 Nov '15
12 Nov '15
Module: wine Branch: master Commit: 3d5db6bdf5e13a61a226ff5531e8f3fb18ecf3e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d5db6bdf5e13a61a226ff553…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 11 14:16:59 2015 +0100 server: Return KeyFullInformation maximal string lengths in bytes. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/registry.c | 12 ++++++------ server/registry.c | 13 ++++--------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 67120cd..0f23f4c 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -895,10 +895,10 @@ LSTATUS WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPD if (class_len) *class_len = info->ClassLength / sizeof(WCHAR); if (subkeys) *subkeys = info->SubKeys; - if (max_subkey) *max_subkey = info->MaxNameLen; - if (max_class) *max_class = info->MaxClassLen; + if (max_subkey) *max_subkey = info->MaxNameLen / sizeof(WCHAR); + if (max_class) *max_class = info->MaxClassLen / sizeof(WCHAR); if (values) *values = info->Values; - if (max_value) *max_value = info->MaxValueNameLen; + if (max_value) *max_value = info->MaxValueNameLen / sizeof(WCHAR); if (max_data) *max_data = info->MaxValueDataLen; if (modif) *modif = *(FILETIME *)&info->LastWriteTime; @@ -1090,10 +1090,10 @@ LSTATUS WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDW else status = STATUS_SUCCESS; if (subkeys) *subkeys = info->SubKeys; - if (max_subkey) *max_subkey = info->MaxNameLen; - if (max_class) *max_class = info->MaxClassLen; + if (max_subkey) *max_subkey = info->MaxNameLen / sizeof(WCHAR); + if (max_class) *max_class = info->MaxClassLen / sizeof(WCHAR); if (values) *values = info->Values; - if (max_value) *max_value = info->MaxValueNameLen; + if (max_value) *max_value = info->MaxValueNameLen / sizeof(WCHAR); if (max_data) *max_data = info->MaxValueDataLen; if (modif) *modif = *(FILETIME *)&info->LastWriteTime; diff --git a/server/registry.c b/server/registry.c index 3c9ae70..94777b3 100644 --- a/server/registry.c +++ b/server/registry.c @@ -908,18 +908,13 @@ static void enum_key( const struct key *key, int index, int info_class, case KeyFullInformation: for (i = 0; i <= key->last_subkey; i++) { - struct key *subkey = key->subkeys[i]; - len = subkey->namelen / sizeof(WCHAR); - if (len > max_subkey) max_subkey = len; - len = subkey->classlen / sizeof(WCHAR); - if (len > max_class) max_class = len; + if (key->subkeys[i]->namelen > max_subkey) max_subkey = key->subkeys[i]->namelen; + if (key->subkeys[i]->classlen > max_class) max_class = key->subkeys[i]->classlen; } for (i = 0; i <= key->last_value; i++) { - len = key->values[i].namelen / sizeof(WCHAR); - if (len > max_value) max_value = len; - len = key->values[i].len; - if (len > max_data) max_data = len; + if (key->values[i].namelen > max_value) max_value = key->values[i].namelen; + if (key->values[i].len > max_data) max_data = key->values[i].len; } reply->max_subkey = max_subkey; reply->max_class = max_class;
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
63
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
Results per page:
10
25
50
100
200