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 2019
----- 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
895 discussions
Start a n
N
ew thread
Conor McCarthy : vkd3d: Remove alignment validation from GetResourceAllocationInfo().
by Alexandre Julliard
27 Nov '19
27 Nov '19
Module: vkd3d Branch: master Commit: 7b88754ff25cebe898c5cfe4d5ce6f13a7dbbaaf URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=7b88754ff25cebe898c5cfe…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Thu Nov 28 00:35:06 2019 +1000 vkd3d: Remove alignment validation from GetResourceAllocationInfo(). The right place for alignment validation is d3d12_resource_validate_desc(). The mod alignment test, which returns a size of ~0 on failure, is incorrect on systems where Vulkan requires alignments of 0x20000 or more, and breaks Hitman 2, which uses the returned value unchecked and allocates heaps of 0xffffffff bytes. Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/device.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 31d793f..e3bb2aa 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2899,10 +2899,8 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour UINT count, const D3D12_RESOURCE_DESC *resource_descs) { struct d3d12_device *device = impl_from_ID3D12Device(iface); - const struct vkd3d_format *format; const D3D12_RESOURCE_DESC *desc; uint64_t requested_alignment; - uint64_t estimated_size; TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p.\n", iface, info, visible_mask, count, resource_descs); @@ -2926,9 +2924,6 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour goto invalid; } - requested_alignment = desc->Alignment - ? desc->Alignment : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; - if (desc->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) { info->SizeInBytes = desc->Width; @@ -2942,27 +2937,9 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour goto invalid; } + requested_alignment = desc->Alignment + ? desc->Alignment : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; info->Alignment = max(info->Alignment, requested_alignment); - - if (info->Alignment < D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT) - { - if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0))) - { - WARN("Invalid format %#x.\n", desc->Format); - goto invalid; - } - - estimated_size = desc->Width * desc->Height * desc->DepthOrArraySize * format->byte_count; - if (estimated_size > D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT) - info->Alignment = max(info->Alignment, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT); - } - } - - if (desc->Alignment % info->Alignment) - { - WARN("Invalid resource alignment %#"PRIx64" (required %#"PRIx64").\n", - desc->Alignment, info->Alignment); - goto invalid; } info->SizeInBytes = align(info->SizeInBytes, info->Alignment);
1
0
0
0
Conor McCarthy : vkd3d/tests: Add tests for block-compressed texture dimensions.
by Alexandre Julliard
27 Nov '19
27 Nov '19
Module: vkd3d Branch: master Commit: 23c4dc26e26040ffc9a233b3dcc383d66d1cf29c URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=23c4dc26e26040ffc9a233b…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Thu Nov 28 00:19:15 2019 +1000 vkd3d/tests: Add tests for block-compressed texture dimensions. Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/d3d12.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index 52de007..47c1649 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1878,6 +1878,49 @@ static void test_create_committed_resource(void) &IID_ID3D12Resource, (void **)&resource); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT; + resource_desc.Format = DXGI_FORMAT_BC1_UNORM; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, + &IID_ID3D12Resource, (void **)&resource); + ok(hr == S_OK, "Failed to create committed resource, hr %#x.\n", hr); + ID3D12Resource_Release(resource); + + resource_desc.Height = 31; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, + &IID_ID3D12Resource, (void **)&resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + resource_desc.Width = 31; + resource_desc.Height = 32; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, + &IID_ID3D12Resource, (void **)&resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + resource_desc.Width = 30; + resource_desc.Height = 30; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, + &IID_ID3D12Resource, (void **)&resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + resource_desc.Width = 2; + resource_desc.Height = 2; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, + &IID_ID3D12Resource, (void **)&resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE1D; + resource_desc.Width = 32; + resource_desc.Height = 1; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, + &IID_ID3D12Resource, (void **)&resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + heap_properties.Type = D3D12_HEAP_TYPE_UPLOAD; resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
1
0
0
0
Conor McCarthy : vkd3d: Validate dimension alignments for block-compressed textures.
by Alexandre Julliard
27 Nov '19
27 Nov '19
Module: vkd3d Branch: master Commit: 5fe91bbf027b7196b44dfa8df4f01455e2dc3a23 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=5fe91bbf027b7196b44dfa8…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Thu Nov 28 00:19:14 2019 +1000 vkd3d: Validate dimension alignments for block-compressed textures. Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/resource.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index e7fc366..f40d986 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1591,6 +1591,29 @@ static void d3d12_validate_resource_flags(D3D12_RESOURCE_FLAGS flags) FIXME("Ignoring D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER.\n"); } +static bool d3d12_resource_validate_texture_format(const D3D12_RESOURCE_DESC *desc, + const struct vkd3d_format *format) +{ + if (!vkd3d_format_is_compressed(format)) + return true; + + if (desc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE1D && format->block_height > 1) + { + WARN("1D texture with a format block height > 1.\n"); + return false; + } + + if (align(desc->Width, format->block_width) != desc->Width + || align(desc->Height, format->block_height) != desc->Height) + { + WARN("Invalid size %"PRIu64"x%u for block compressed format %#x.\n", + desc->Width, desc->Height, desc->Format); + return false; + } + + return true; +} + static bool d3d12_resource_validate_texture_alignment(const D3D12_RESOURCE_DESC *desc, const struct vkd3d_format *format) { @@ -1664,7 +1687,8 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d return E_INVALIDARG; } - if (!d3d12_resource_validate_texture_alignment(desc, format)) + if (!d3d12_resource_validate_texture_format(desc, format) + || !d3d12_resource_validate_texture_alignment(desc, format)) return E_INVALIDARG; break;
1
0
0
0
Conor McCarthy : vkd3d: Validate texture resource alignments.
by Alexandre Julliard
27 Nov '19
27 Nov '19
Module: vkd3d Branch: master Commit: af60bc03ba3e580a44d1b14840fa3cdbcb124c51 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=af60bc03ba3e580a44d1b14…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Thu Nov 28 00:19:13 2019 +1000 vkd3d: Validate texture resource alignments. Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/device.c | 4 ++-- libs/vkd3d/resource.c | 56 ++++++++++++++++++++++++++++++++++++++++------ libs/vkd3d/vkd3d_private.h | 2 +- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 59859ad..31d793f 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2920,7 +2920,7 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour desc = &resource_descs[0]; - if (FAILED(d3d12_resource_validate_desc(desc))) + if (FAILED(d3d12_resource_validate_desc(desc, device))) { WARN("Invalid resource desc.\n"); goto invalid; @@ -3226,7 +3226,7 @@ static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device *i return; } - if (FAILED(d3d12_resource_validate_desc(desc))) + if (FAILED(d3d12_resource_validate_desc(desc, device))) { WARN("Invalid resource desc.\n"); return; diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index f5cdf4a..e7fc366 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1001,7 +1001,7 @@ HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device, HRESULT hr; assert(desc->Dimension != D3D12_RESOURCE_DIMENSION_BUFFER); - assert(d3d12_resource_validate_desc(desc) == S_OK); + assert(d3d12_resource_validate_desc(desc, device) == S_OK); if (!desc->MipLevels) { @@ -1591,8 +1591,45 @@ static void d3d12_validate_resource_flags(D3D12_RESOURCE_FLAGS flags) FIXME("Ignoring D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER.\n"); } -HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc) +static bool d3d12_resource_validate_texture_alignment(const D3D12_RESOURCE_DESC *desc, + const struct vkd3d_format *format) { + uint64_t estimated_size; + + if (!desc->Alignment) + return true; + + if (desc->Alignment != D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT + && desc->Alignment != D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT + && (desc->SampleDesc.Count == 1 || desc->Alignment != D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT)) + { + WARN("Invalid resource alignment %#"PRIx64".\n", desc->Alignment); + return false; + } + + if (desc->Alignment < D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT) + { + /* Windows uses the slice size to determine small alignment eligibility. DepthOrArraySize is ignored. */ + estimated_size = desc->Width * desc->Height * format->byte_count * format->block_byte_count + / (format->block_width * format->block_height); + if (estimated_size > D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT) + { + WARN("Invalid resource alignment %#"PRIx64" (required %#x).\n", + desc->Alignment, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT); + return false; + } + } + + /* The size check for MSAA textures with D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT is probably + * not important. The 4MB requirement is no longer universal and Vulkan has no such requirement. */ + + return true; +} + +HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d12_device *device) +{ + const struct vkd3d_format *format; + switch (desc->Dimension) { case D3D12_RESOURCE_DIMENSION_BUFFER: @@ -1618,10 +1655,17 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc) WARN("1D texture with a height of %u.\n", desc->Height); return E_INVALIDARG; } - break; - + /* Fall through. */ case D3D12_RESOURCE_DIMENSION_TEXTURE2D: case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0))) + { + WARN("Invalid format %#x.\n", desc->Format); + return E_INVALIDARG; + } + + if (!d3d12_resource_validate_texture_alignment(desc, format)) + return E_INVALIDARG; break; default: @@ -1631,8 +1675,6 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc) d3d12_validate_resource_flags(desc->Flags); - /* FIXME: Validate alignment for textures. */ - return S_OK; } @@ -1703,7 +1745,7 @@ static HRESULT d3d12_resource_init(struct d3d12_resource *resource, struct d3d12 resource->gpu_address = 0; resource->flags = 0; - if (FAILED(hr = d3d12_resource_validate_desc(&resource->desc))) + if (FAILED(hr = d3d12_resource_validate_desc(&resource->desc, device))) return hr; switch (desc->Dimension) diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index df8d1a1..9ff6bba 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -435,7 +435,7 @@ static inline bool d3d12_resource_is_texture(const struct d3d12_resource *resour } bool d3d12_resource_is_cpu_accessible(const struct d3d12_resource *resource) DECLSPEC_HIDDEN; -HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc) DECLSPEC_HIDDEN; +HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d12_device *device) DECLSPEC_HIDDEN; HRESULT d3d12_committed_resource_create(struct d3d12_device *device, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
1
0
0
0
Michael Stefaniuc : dmstyle: Implement IDirectMusicStyle8_EnumMotif().
by Alexandre Julliard
26 Nov '19
26 Nov '19
Module: wine Branch: master Commit: ce275f38a02dd5f809eea45ff3fa02f645b56a7c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce275f38a02dd5f809eea45f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Nov 26 21:14:41 2019 +0100 dmstyle: Implement IDirectMusicStyle8_EnumMotif(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmstyle/style.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index b3bce9bba2..5ebe6589d4 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -158,12 +158,37 @@ static HRESULT WINAPI IDirectMusicStyle8Impl_GetDefaultBand(IDirectMusicStyle8 * return S_OK; } -static HRESULT WINAPI IDirectMusicStyle8Impl_EnumMotif(IDirectMusicStyle8 *iface, DWORD dwIndex, - WCHAR *pwszName) +static HRESULT WINAPI IDirectMusicStyle8Impl_EnumMotif(IDirectMusicStyle8 *iface, DWORD index, + WCHAR *name) { - IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); - FIXME("(%p, %d, %p): stub\n", This, dwIndex, pwszName); - return S_OK; + IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); + const struct style_motif *motif = NULL; + const struct list *cursor; + unsigned int i = 0; + + TRACE("(%p, %u, %p)\n", This, index, name); + + if (!name) + return E_POINTER; + + /* index is zero based */ + LIST_FOR_EACH(cursor, &This->motifs) { + if (i == index) { + motif = LIST_ENTRY(cursor, struct style_motif, entry); + break; + } + i++; + } + if (!motif) + return S_FALSE; + + if (motif->desc.dwValidData & DMUS_OBJ_NAME) + lstrcpynW(name, motif->desc.wszName, DMUS_MAX_NAME); + else + name[0] = 0; + + TRACE("returning name: %s\n", debugstr_w(name)); + return S_OK; } static HRESULT WINAPI IDirectMusicStyle8Impl_GetMotif(IDirectMusicStyle8 *iface, WCHAR *pwszName,
1
0
0
0
Michael Stefaniuc : dmstyle: Free lists when IDirectMusicStyleImpl is destroyed.
by Alexandre Julliard
26 Nov '19
26 Nov '19
Module: wine Branch: master Commit: e4e3c0b41727b42712960753c652e9cc780e05aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e4e3c0b41727b42712960753…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Nov 26 21:14:40 2019 +0100 dmstyle: Free lists when IDirectMusicStyleImpl is destroyed. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmstyle/style.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 7c835afe27..b3bce9bba2 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -108,7 +108,25 @@ static ULONG WINAPI IDirectMusicStyle8Impl_Release(IDirectMusicStyle8 *iface) TRACE("(%p) ref=%d\n", This, ref); if (!ref) { - HeapFree(GetProcessHeap(), 0, This); + struct style_band *band, *band2; + struct style_motif *motif, *motif2; + struct style_partref_item *item, *item2; + + LIST_FOR_EACH_ENTRY_SAFE(band, band2, &This->bands, struct style_band, entry) { + list_remove(&band->entry); + if (band->pBand) + IDirectMusicBand_Release(band->pBand); + heap_free(band); + } + LIST_FOR_EACH_ENTRY_SAFE(motif, motif2, &This->motifs, struct style_motif, entry) { + list_remove(&motif->entry); + LIST_FOR_EACH_ENTRY_SAFE(item, item2, &motif->Items, struct style_partref_item, entry) { + list_remove(&item->entry); + heap_free(item); + } + heap_free(motif); + } + heap_free(This); DMSTYLE_UnlockModule(); }
1
0
0
0
Michael Stefaniuc : dmstyle: Move 3 structs where they are used and get rid of typedefs.
by Alexandre Julliard
26 Nov '19
26 Nov '19
Module: wine Branch: master Commit: b9a50481089bf72003f9281ad93caa8d88e43030 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b9a50481089bf72003f9281a…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Nov 26 21:14:39 2019 +0100 dmstyle: Move 3 structs where they are used and get rid of typedefs. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmstyle/dmstyle_private.h | 23 ----------------------- dlls/dmstyle/style.c | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/dlls/dmstyle/dmstyle_private.h b/dlls/dmstyle/dmstyle_private.h index 7d18e9c4ba..2956dad151 100644 --- a/dlls/dmstyle/dmstyle_private.h +++ b/dlls/dmstyle/dmstyle_private.h @@ -55,29 +55,6 @@ extern HRESULT WINAPI create_dmstyletrack(REFIID riid, void **ret_iface) DECLSPE /***************************************************************************** * Auxiliary definitions */ -typedef struct _DMUS_PRIVATE_STYLE_BAND { - struct list entry; /* for listing elements */ - IDirectMusicBand* pBand; -} DMUS_PRIVATE_STYLE_BAND, *LPDMUS_PRIVATE_STYLE_BAND; - -typedef struct _DMUS_PRIVATE_STYLE_PARTREF_ITEM { - struct list entry; /* for listing elements */ - DMUS_OBJECTDESC desc; - DMUS_IO_PARTREF part_ref; -} DMUS_PRIVATE_STYLE_PARTREF_ITEM, *LPDMUS_PRIVATE_STYLE_PARTREF_ITEM; - -typedef struct _DMUS_PRIVATE_STYLE_MOTIF { - struct list entry; /* for listing elements */ - DWORD dwRhythm; - DMUS_IO_PATTERN pattern; - DMUS_OBJECTDESC desc; - /** optional for motifs */ - DMUS_IO_MOTIFSETTINGS settings; - IDirectMusicBand* pBand; - - struct list Items; -} DMUS_PRIVATE_STYLE_MOTIF, *LPDMUS_PRIVATE_STYLE_MOTIF; - typedef struct _DMUS_PRIVATE_STYLE_ITEM { struct list entry; /* for listing elements */ DWORD dwTimeStamp; diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 0884733894..7c835afe27 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -20,10 +20,33 @@ #include "dmstyle_private.h" #include "dmobject.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); WINE_DECLARE_DEBUG_CHANNEL(dmfile); +struct style_band { + struct list entry; + IDirectMusicBand *pBand; +}; + +struct style_partref_item { + struct list entry; + DMUS_OBJECTDESC desc; + DMUS_IO_PARTREF part_ref; +}; + +struct style_motif { + struct list entry; + DWORD dwRhythm; + DMUS_IO_PATTERN pattern; + DMUS_OBJECTDESC desc; + /** optional for motifs */ + DMUS_IO_MOTIFSETTINGS settings; + IDirectMusicBand *pBand; + struct list Items; +}; + /***************************************************************************** * IDirectMusicStyleImpl implementation */ @@ -283,14 +306,13 @@ static HRESULT load_band(IStream *pClonedStream, IDirectMusicBand **ppBand) } static HRESULT parse_part_ref_list(DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm, - DMUS_PRIVATE_STYLE_MOTIF *pNewMotif) + struct style_motif *pNewMotif) { HRESULT hr = E_FAIL; DMUS_PRIVATE_CHUNK Chunk; DWORD ListSize[3], ListCount[3]; LARGE_INTEGER liMove; /* used when skipping chunks */ - - LPDMUS_PRIVATE_STYLE_PARTREF_ITEM pNewItem = NULL; + struct style_partref_item *pNewItem = NULL; if (pChunk->fccID != DMUS_FOURCC_PARTREF_LIST) { @@ -308,7 +330,7 @@ static HRESULT parse_part_ref_list(DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm, switch (Chunk.fccID) { case DMUS_FOURCC_PARTREF_CHUNK: { TRACE_(dmfile)(": PartRef chunk\n"); - pNewItem = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_STYLE_PARTREF_ITEM)); + pNewItem = heap_alloc_zero(sizeof(*pNewItem)); if (!pNewItem) { ERR(": no more memory\n"); return E_OUTOFMEMORY; @@ -514,9 +536,8 @@ static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHU DMUS_PRIVATE_CHUNK Chunk; DWORD ListSize[3], ListCount[3]; LARGE_INTEGER liMove; /* used when skipping chunks */ - IDirectMusicBand* pBand = NULL; - LPDMUS_PRIVATE_STYLE_MOTIF pNewMotif = NULL; + struct style_motif *pNewMotif = NULL; if (pChunk->fccID != DMUS_FOURCC_PATTERN_LIST) { ERR_(dmfile)(": %s chunk should be a PATTERN list\n", debugstr_fourcc (pChunk->fccID)); @@ -534,7 +555,7 @@ static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHU case DMUS_FOURCC_PATTERN_CHUNK: { TRACE_(dmfile)(": Pattern chunk\n"); /** alloc new motif entry */ - pNewMotif = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_STYLE_MOTIF)); + pNewMotif = heap_alloc_zero(sizeof(*pNewMotif)); if (NULL == pNewMotif) { ERR(": no more memory\n"); return E_OUTOFMEMORY; @@ -715,7 +736,7 @@ static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK switch (Chunk.fccID) { case DMUS_FOURCC_BAND_FORM: { LPSTREAM pClonedStream = NULL; - LPDMUS_PRIVATE_STYLE_BAND pNewBand; + struct style_band *pNewBand; TRACE_(dmfile)(": BAND RIFF\n"); @@ -731,8 +752,8 @@ static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK return hr; } IStream_Release (pClonedStream); - - pNewBand = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_STYLE_BAND)); + + pNewBand = heap_alloc_zero(sizeof(*pNewBand)); if (NULL == pNewBand) { ERR(": no more memory\n"); return E_OUTOFMEMORY;
1
0
0
0
Michael Stefaniuc : dmstyle: Avoid capitalized field names in IDirectMusicStyle8Impl.
by Alexandre Julliard
26 Nov '19
26 Nov '19
Module: wine Branch: master Commit: 979e3069f25490496bd97bdf03a4547a5a2d4093 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=979e3069f25490496bd97bdf…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Nov 26 21:14:38 2019 +0100 dmstyle: Avoid capitalized field names in IDirectMusicStyle8Impl. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmstyle/style.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 4e84a3edc3..0884733894 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -32,8 +32,8 @@ typedef struct IDirectMusicStyle8Impl { struct dmobject dmobj; LONG ref; DMUS_IO_STYLE style; - struct list Motifs; - struct list Bands; + struct list motifs; + struct list bands; } IDirectMusicStyle8Impl; static inline IDirectMusicStyle8Impl *impl_from_IDirectMusicStyle8(IDirectMusicStyle8 *iface) @@ -539,7 +539,7 @@ static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHU ERR(": no more memory\n"); return E_OUTOFMEMORY; } - list_add_tail (&This->Motifs, &pNewMotif->entry); + list_add_tail(&This->motifs, &pNewMotif->entry); IStream_Read (pStm, &pNewMotif->pattern, Chunk.dwSize, NULL); /** TODO trace pattern */ @@ -739,7 +739,7 @@ static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK } pNewBand->pBand = pBand; IDirectMusicBand_AddRef(pBand); - list_add_tail (&This->Bands, &pNewBand->entry); + list_add_tail(&This->bands, &pNewBand->entry); IDirectMusicTrack_Release(pBand); pBand = NULL; /* now we can release it as it's inserted */ @@ -893,8 +893,8 @@ HRESULT WINAPI create_dmstyle(REFIID lpcGUID, void **ppobj) dmobject_init(&obj->dmobj, &CLSID_DirectMusicStyle, (IUnknown *)&obj->IDirectMusicStyle8_iface); obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl; obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; - list_init (&obj->Bands); - list_init (&obj->Motifs); + list_init(&obj->bands); + list_init(&obj->motifs); DMSTYLE_LockModule(); hr = IDirectMusicStyle8_QueryInterface(&obj->IDirectMusicStyle8_iface, lpcGUID, ppobj);
1
0
0
0
Chip Davis : ntoskrnl.exe: Add tests for METHOD_NEITHER ioctl behavior.
by Alexandre Julliard
26 Nov '19
26 Nov '19
Module: wine Branch: master Commit: a224824782473c077d24d867a72eec838782db7a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a224824782473c077d24d867…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Mon Nov 25 09:43:05 2019 -0600 ntoskrnl.exe: Add tests for METHOD_NEITHER ioctl behavior. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/driver.c | 30 ++++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/tests/driver.h | 1 + dlls/ntoskrnl.exe/tests/ntoskrnl.c | 13 +++++++++++++ 3 files changed, 44 insertions(+) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index a0f63ade79..6827b74a3c 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -1855,6 +1855,34 @@ static NTSTATUS test_load_driver_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG return ZwUnloadDriver(&name); } +static NTSTATUS test_mismatched_status_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info) +{ + ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength; + char *buffer = irp->UserBuffer; + + if (!buffer) + { + irp->IoStatus.Status = STATUS_ACCESS_VIOLATION; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_ACCESS_VIOLATION; + } + + if (length < sizeof(teststr)) + { + irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_BUFFER_TOO_SMALL; + } + + memcpy(buffer, teststr, sizeof(teststr)); + + /* This is deliberate; some broken drivers do this */ + *info = 0; + irp->IoStatus.Status = STATUS_UNSUCCESSFUL; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + static NTSTATUS WINAPI driver_Create(DEVICE_OBJECT *device, IRP *irp) { IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); @@ -1916,6 +1944,8 @@ static NTSTATUS WINAPI driver_IoControl(DEVICE_OBJECT *device, IRP *irp) IoDetachDevice(lower_device); status = STATUS_SUCCESS; break; + case IOCTL_WINETEST_MISMATCHED_STATUS: + return test_mismatched_status_ioctl(irp, stack, &irp->IoStatus.Information); default: break; } diff --git a/dlls/ntoskrnl.exe/tests/driver.h b/dlls/ntoskrnl.exe/tests/driver.h index 313d554a37..aa9de674e2 100644 --- a/dlls/ntoskrnl.exe/tests/driver.h +++ b/dlls/ntoskrnl.exe/tests/driver.h @@ -33,6 +33,7 @@ #define IOCTL_WINETEST_GET_CLOSE_COUNT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x808, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_WINETEST_GET_FSCONTEXT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x809, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_WINETEST_RETURN_STATUS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80a, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_WINETEST_MISMATCHED_STATUS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80b, METHOD_NEITHER, FILE_ANY_ACCESS) static const char teststr[] = "Wine is not an emulator"; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 76bcf0d0ce..2535ed903e 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -208,6 +208,18 @@ static void test_basic_ioctl(void) ok(!strcmp(buf, "Wine is no"), "got '%s'\n", buf); } +static void test_mismatched_status_ioctl(void) +{ + DWORD written; + char buf[32]; + BOOL res; + + res = DeviceIoControl(device, IOCTL_WINETEST_MISMATCHED_STATUS, NULL, 0, buf, + sizeof(buf), &written, NULL); + todo_wine ok(res, "DeviceIoControl failed: %u\n", GetLastError()); + todo_wine ok(!strcmp(buf, teststr), "got '%s'\n", buf); +} + static void test_overlapped(void) { OVERLAPPED overlapped, overlapped2, *o; @@ -514,6 +526,7 @@ START_TEST(ntoskrnl) ok(device != INVALID_HANDLE_VALUE, "failed to open device: %u\n", GetLastError()); test_basic_ioctl(); + test_mismatched_status_ioctl(); main_test(); test_overlapped(); test_load_driver(service2);
1
0
0
0
Zebediah Figura : wineqtdecoder/qtvdecoder: Don't drop the "csReceive" mutex while calling IMemInputPin::Receive().
by Alexandre Julliard
26 Nov '19
26 Nov '19
Module: wine Branch: master Commit: d45456cecba12fd9c468bf0e60934ca2cbd6e688 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d45456cecba12fd9c468bf0e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Nov 25 19:24:34 2019 -0600 wineqtdecoder/qtvdecoder: Don't drop the "csReceive" mutex while calling IMemInputPin::Receive(). There's no reason to do this, and there may never have been. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineqtdecoder/qtvdecoder.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/wineqtdecoder/qtvdecoder.c b/dlls/wineqtdecoder/qtvdecoder.c index 379150d9a0..3da0738aec 100644 --- a/dlls/wineqtdecoder/qtvdecoder.c +++ b/dlls/wineqtdecoder/qtvdecoder.c @@ -235,9 +235,7 @@ static void trackingCallback( IMediaSample_SetTime(pOutSample, &tStart, &tStop); } - LeaveCriticalSection(&This->tf.csReceive); hr = IMemInputPin_Receive(This->tf.source.pMemInputPin, pOutSample); - EnterCriticalSection(&This->tf.csReceive); if (hr != S_OK && hr != VFW_E_NOT_CONNECTED) ERR("Error sending sample (%x)\n", hr);
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
90
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
Results per page:
10
25
50
100
200