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
July
June
May
April
March
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-devel
October 2021
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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-devel@winehq.org
81 participants
772 discussions
Start a n
N
ew thread
[PATCH] include: Use __builtin_offsetof on Clang.
by Jacek Caban
07 Oct '21
07 Oct '21
Fixes a number of warning on MSVC target. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> --- include/msvcrt/stddef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
1
0
0
0
[PATCH vkd3d 5/5] vkd3d: Create and write descriptor sets for root signature unbounded ranges.
by Henri Verbeet
07 Oct '21
07 Oct '21
From: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- libs/vkd3d/command.c | 120 +++++++++++++++++++----- libs/vkd3d/device.c | 114 +++++++++++++++++++++++ libs/vkd3d/resource.c | 9 ++ libs/vkd3d/state.c | 181 ++++++++++++++++++++++++++++++++----- libs/vkd3d/vkd3d_private.h | 40 +++++++- tests/d3d12.c | 18 ++--
…
[View More]
6 files changed, 424 insertions(+), 58 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 9f4a4149..118fc4bb 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1,6 +1,7 @@ /* * Copyright 2016 Józef Kucia for CodeWeavers * Copyright 2016 Henri Verbeet for CodeWeavers + * Copyright 2021 Conor McCarthy for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1363,10 +1364,12 @@ static VkDescriptorPool d3d12_command_allocator_allocate_descriptor_pool( } static VkDescriptorSet d3d12_command_allocator_allocate_descriptor_set( - struct d3d12_command_allocator *allocator, VkDescriptorSetLayout vk_set_layout) + struct d3d12_command_allocator *allocator, VkDescriptorSetLayout vk_set_layout, + unsigned int variable_binding_size, bool unbounded) { struct d3d12_device *device = allocator->device; const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; + VkDescriptorSetVariableDescriptorCountAllocateInfoEXT set_size; struct VkDescriptorSetAllocateInfo set_desc; VkDevice vk_device = device->vk_device; VkDescriptorSet vk_descriptor_set; @@ -1382,6 +1385,14 @@ static VkDescriptorSet d3d12_command_allocator_allocate_descriptor_set( set_desc.descriptorPool = allocator->vk_descriptor_pool; set_desc.descriptorSetCount = 1; set_desc.pSetLayouts = &vk_set_layout; + if (unbounded) + { + set_desc.pNext = &set_size; + set_size.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT; + set_size.pNext = NULL; + set_size.descriptorSetCount = 1; + set_size.pDescriptorCounts = &variable_binding_size; + } if ((vr = VK_CALL(vkAllocateDescriptorSets(vk_device, &set_desc, &vk_descriptor_set))) >= 0) return vk_descriptor_set; @@ -2562,7 +2573,12 @@ static void d3d12_command_list_prepare_descriptors(struct d3d12_command_list *li enum vkd3d_pipeline_bind_point bind_point) { struct vkd3d_pipeline_bindings *bindings = &list->pipeline_bindings[bind_point]; + unsigned int variable_binding_size, unbounded_offset, table_index, heap_size, i; const struct d3d12_root_signature *root_signature = bindings->root_signature; + const struct d3d12_descriptor_set_layout *layout; + struct d3d12_device *device = list->device; + const struct d3d12_desc *base_descriptor; + VkDescriptorSet vk_descriptor_set; if (bindings->descriptor_set_count && !bindings->in_use) return; @@ -2579,9 +2595,33 @@ static void d3d12_command_list_prepare_descriptors(struct d3d12_command_list *li * by an update command, or freed) between when the command is recorded * and when the command completes executing on the queue." */ - bindings->descriptor_sets[0] = d3d12_command_allocator_allocate_descriptor_set(list->allocator, - root_signature->vk_set_layouts[root_signature->main_set]); - bindings->descriptor_set_count = 1; + bindings->descriptor_set_count = 0; + for (i = root_signature->main_set; i < root_signature->vk_set_count; ++i) + { + layout = &root_signature->descriptor_set_layouts[i]; + unbounded_offset = layout->unbounded_offset; + table_index = layout->table_index; + variable_binding_size = 0; + + if (unbounded_offset != UINT_MAX + /* Descriptors may not be set, eg. WoW. */ + && (base_descriptor = d3d12_desc_from_gpu_handle(bindings->descriptor_tables[table_index]))) + { + heap_size = vkd3d_gpu_descriptor_allocator_range_size_from_descriptor( + &device->gpu_descriptor_allocator, base_descriptor); + + if (heap_size < unbounded_offset) + WARN("Descriptor heap size %u is less than the offset %u of an unbounded range in table %u, " + "vk set %u.\n", heap_size, unbounded_offset, table_index, i); + else + variable_binding_size = heap_size - unbounded_offset; + } + + vk_descriptor_set = d3d12_command_allocator_allocate_descriptor_set(list->allocator, + layout->vk_layout, variable_binding_size, unbounded_offset != UINT_MAX); + bindings->descriptor_sets[bindings->descriptor_set_count++] = vk_descriptor_set; + } + bindings->in_use = false; bindings->descriptor_table_dirty_mask |= bindings->descriptor_table_active_mask & root_signature->descriptor_table_mask; @@ -2596,13 +2636,14 @@ static bool vk_write_descriptor_set_from_d3d12_desc(VkWriteDescriptorSet *vk_des uint32_t descriptor_range_magic = range->descriptor_magic; const struct vkd3d_view *view = descriptor->u.view; uint32_t vk_binding = range->binding; + uint32_t set = range->set; if (descriptor->magic != descriptor_range_magic) return false; vk_descriptor_write->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; vk_descriptor_write->pNext = NULL; - vk_descriptor_write->dstSet = vk_descriptor_sets[0]; + vk_descriptor_write->dstSet = vk_descriptor_sets[set]; vk_descriptor_write->dstBinding = use_array ? vk_binding : vk_binding + index; vk_descriptor_write->dstArrayElement = use_array ? index : 0; vk_descriptor_write->descriptorCount = 1; @@ -2620,12 +2661,26 @@ static bool vk_write_descriptor_set_from_d3d12_desc(VkWriteDescriptorSet *vk_des case VKD3D_DESCRIPTOR_MAGIC_SRV: case VKD3D_DESCRIPTOR_MAGIC_UAV: /* We use separate bindings for buffer and texture SRVs/UAVs. - * See d3d12_root_signature_init(). */ - if (!use_array) - vk_descriptor_write->dstBinding = vk_binding + 2 * index; - if (descriptor->vk_descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER - && descriptor->vk_descriptor_type != VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) - ++vk_descriptor_write->dstBinding; + * See d3d12_root_signature_init(). For unbounded ranges the + * descriptors exist in two consecutive sets, otherwise they occur + * in pairs in one set. */ + if (range->descriptor_count == UINT_MAX) + { + if (descriptor->vk_descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER + && descriptor->vk_descriptor_type != VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) + { + vk_descriptor_write->dstSet = vk_descriptor_sets[set + 1]; + vk_descriptor_write->dstBinding = 0; + } + } + else + { + if (!use_array) + vk_descriptor_write->dstBinding = vk_binding + 2 * index; + if (descriptor->vk_descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER + && descriptor->vk_descriptor_type != VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) + ++vk_descriptor_write->dstBinding; + } if (descriptor->vk_descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER || descriptor->vk_descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) @@ -2673,19 +2728,38 @@ static void d3d12_command_list_update_descriptor_table(struct d3d12_command_list VkDevice vk_device = list->device->vk_device; unsigned int i, j, k, descriptor_count; struct d3d12_desc *descriptor; + unsigned int write_count = 0; + bool unbounded = false; descriptor_table = root_signature_get_descriptor_table(root_signature, index); - descriptor_count = 0; current_descriptor_write = descriptor_writes; current_image_info = image_infos; for (i = 0; i < descriptor_table->range_count; ++i) { range = &descriptor_table->ranges[i]; + /* The first unbounded range of each type is written until the heap end is reached. Do not repeat. */ + if (unbounded && i && range->type == descriptor_table->ranges[i - 1].type) + continue; + descriptor = base_descriptor + range->offset; - for (j = 0; j < range->descriptor_count; ++j, ++descriptor) + descriptor_count = range->descriptor_count; + if ((unbounded = descriptor_count == UINT_MAX)) + { + descriptor_count = vkd3d_gpu_descriptor_allocator_range_size_from_descriptor( + &list->device->gpu_descriptor_allocator, descriptor); + + if (descriptor_count > range->vk_binding_count) + { + ERR("Heap descriptor count %u exceeds maximum Vulkan count %u. Reducing to the Vulkan maximum.\n", + descriptor_count, range->vk_binding_count); + descriptor_count = range->vk_binding_count; + } + } + + for (j = 0; j < descriptor_count; ++j, ++descriptor) { unsigned int register_idx = range->base_register_idx + j; @@ -2707,25 +2781,29 @@ static void d3d12_command_list_update_descriptor_table(struct d3d12_command_list } } + /* Not all descriptors are necessarily populated if the range is unbounded. */ + if (descriptor->magic == VKD3D_DESCRIPTOR_MAGIC_FREE) + continue; + if (!vk_write_descriptor_set_from_d3d12_desc(current_descriptor_write, current_image_info, descriptor, range, bindings->descriptor_sets, j, root_signature->use_descriptor_arrays)) continue; - ++descriptor_count; + ++write_count; ++current_descriptor_write; ++current_image_info; - if (descriptor_count == ARRAY_SIZE(descriptor_writes)) + if (write_count == ARRAY_SIZE(descriptor_writes)) { - VK_CALL(vkUpdateDescriptorSets(vk_device, descriptor_count, descriptor_writes, 0, NULL)); - descriptor_count = 0; + VK_CALL(vkUpdateDescriptorSets(vk_device, write_count, descriptor_writes, 0, NULL)); + write_count = 0; current_descriptor_write = descriptor_writes; current_image_info = image_infos; } } } - VK_CALL(vkUpdateDescriptorSets(vk_device, descriptor_count, descriptor_writes, 0, NULL)); + VK_CALL(vkUpdateDescriptorSets(vk_device, write_count, descriptor_writes, 0, NULL)); } static bool vk_write_descriptor_set_from_root_descriptor(VkWriteDescriptorSet *vk_descriptor_write, @@ -2850,8 +2928,8 @@ static void d3d12_command_list_update_uav_counter_descriptors(struct d3d12_comma uav_counter_count = state->uav_counters.binding_count; if (!(vk_descriptor_writes = vkd3d_calloc(uav_counter_count, sizeof(*vk_descriptor_writes)))) return; - if (!(vk_descriptor_set = d3d12_command_allocator_allocate_descriptor_set(list->allocator, - state->uav_counters.vk_set_layout))) + if (!(vk_descriptor_set = d3d12_command_allocator_allocate_descriptor_set( + list->allocator, state->uav_counters.vk_set_layout, 0, false))) goto done; for (i = 0; i < uav_counter_count; ++i) @@ -4946,7 +5024,7 @@ static void d3d12_command_list_clear_uav(struct d3d12_command_list *list, } if (!(write_set.dstSet = d3d12_command_allocator_allocate_descriptor_set( - list->allocator, pipeline.vk_set_layout))) + list->allocator, pipeline.vk_set_layout, 0, false))) { ERR("Failed to allocate descriptor set.\n"); return; diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 0fadb521..320a759a 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2173,6 +2173,118 @@ static void vkd3d_gpu_va_allocator_cleanup(struct vkd3d_gpu_va_allocator *alloca pthread_mutex_destroy(&allocator->mutex); } +bool vkd3d_gpu_descriptor_allocator_register_range(struct vkd3d_gpu_descriptor_allocator *allocator, + const struct d3d12_desc *base, size_t count) +{ + struct vkd3d_gpu_descriptor_allocation *allocation; + int rc; + + if ((rc = pthread_mutex_lock(&allocator->mutex))) + { + ERR("Failed to lock mutex, error %d.\n", rc); + return false; + } + + if (!vkd3d_array_reserve((void **)&allocator->allocations, &allocator->allocations_size, + allocator->allocation_count + 1, sizeof(*allocator->allocations))) + { + pthread_mutex_unlock(&allocator->mutex); + return false; + } + + allocation = &allocator->allocations[allocator->allocation_count++]; + allocation->base = base; + allocation->count = count; + + pthread_mutex_unlock(&allocator->mutex); + + return true; +} + +bool vkd3d_gpu_descriptor_allocator_unregister_range( + struct vkd3d_gpu_descriptor_allocator *allocator, const struct d3d12_desc *base) +{ + bool found; + size_t i; + int rc; + + if ((rc = pthread_mutex_lock(&allocator->mutex))) + { + ERR("Failed to lock mutex, error %d.\n", rc); + return false; + } + + for (i = 0, found = false; i < allocator->allocation_count; ++i) + { + if (allocator->allocations[i].base != base) + continue; + + if (i != --allocator->allocation_count) + allocator->allocations[i] = allocator->allocations[allocator->allocation_count]; + + found = true; + break; + } + + pthread_mutex_unlock(&allocator->mutex); + + return found; +} + +/* Return the available size from the specified descriptor to the heap end. */ +size_t vkd3d_gpu_descriptor_allocator_range_size_from_descriptor( + struct vkd3d_gpu_descriptor_allocator *allocator, const struct d3d12_desc *desc) +{ + struct vkd3d_gpu_descriptor_allocation *allocation; + size_t remaining, offset, i; + int rc; + + if ((rc = pthread_mutex_lock(&allocator->mutex))) + { + ERR("Failed to lock mutex, error %d.\n", rc); + return 0; + } + + for (i = 0, remaining = 0; i < allocator->allocation_count; ++i) + { + allocation = &allocator->allocations[i]; + + if (desc < allocation->base) + continue; + + offset = desc - allocation->base; + if (offset >= allocation->count) + continue; + + remaining = allocation->count - offset; + break; + } + + pthread_mutex_unlock(&allocator->mutex); + + return remaining; +} + +static bool vkd3d_gpu_descriptor_allocator_init(struct vkd3d_gpu_descriptor_allocator *allocator) +{ + int rc; + + memset(allocator, 0, sizeof(*allocator)); + if ((rc = pthread_mutex_init(&allocator->mutex, NULL))) + { + ERR("Failed to initialise mutex, error %d.\n", rc); + return false; + } + + return true; +} + +static void vkd3d_gpu_descriptor_allocator_cleanup(struct vkd3d_gpu_descriptor_allocator *allocator) +{ + vkd3d_free(allocator->allocations); + pthread_mutex_destroy(&allocator->mutex); +} + /* ID3D12Device */ static inline struct d3d12_device *impl_from_ID3D12Device(ID3D12Device *iface) { @@ -2227,6 +2339,7 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device *iface) vkd3d_uav_clear_state_cleanup(&device->uav_clear_state, device); vkd3d_destroy_null_resources(&device->null_resources, device); vkd3d_gpu_va_allocator_cleanup(&device->gpu_va_allocator); + vkd3d_gpu_descriptor_allocator_cleanup(&device->gpu_descriptor_allocator); vkd3d_render_pass_cache_cleanup(&device->render_pass_cache, device); vkd3d_fence_worker_stop(&device->fence_worker, device); d3d12_device_destroy_pipeline_cache(device); @@ -3729,6 +3842,7 @@ static HRESULT d3d12_device_init(struct d3d12_device *device, goto out_destroy_null_resources; vkd3d_render_pass_cache_init(&device->render_pass_cache); + vkd3d_gpu_descriptor_allocator_init(&device->gpu_descriptor_allocator); vkd3d_gpu_va_allocator_init(&device->gpu_va_allocator); for (i = 0; i < ARRAY_SIZE(device->desc_mutex); ++i) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 1ca23a90..a51f5795 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -3351,6 +3351,10 @@ static ULONG STDMETHODCALLTYPE d3d12_descriptor_heap_Release(ID3D12DescriptorHea { d3d12_desc_destroy(&descriptors[i], device); } + + if (device->vk_info.EXT_descriptor_indexing && !vkd3d_gpu_descriptor_allocator_unregister_range( + &device->gpu_descriptor_allocator, descriptors)) + ERR("Failed to unregister descriptor range.\n"); break; } @@ -3547,6 +3551,11 @@ HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device, memset(object->descriptors, 0, descriptor_size * desc->NumDescriptors); + if ((desc->Type == D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV || desc->Type == D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER) + && device->vk_info.EXT_descriptor_indexing && !vkd3d_gpu_descriptor_allocator_register_range( + &device->gpu_descriptor_allocator, (struct d3d12_desc *)object->descriptors, desc->NumDescriptors)) + ERR("Failed to register descriptor range.\n"); + TRACE("Created descriptor heap %p.\n", object); *descriptor_heap = object; diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 990b49b2..78b0c717 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1,6 +1,7 @@ /* * Copyright 2016 Józef Kucia for CodeWeavers * Copyright 2016 Henri Verbeet for CodeWeavers + * Copyright 2021 Conor McCarthy for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -57,6 +58,14 @@ static ULONG STDMETHODCALLTYPE d3d12_root_signature_AddRef(ID3D12RootSignature * return refcount; } +static void d3d12_descriptor_set_layout_cleanup( + struct d3d12_descriptor_set_layout *layout, struct d3d12_device *device) +{ + const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; + + VK_CALL(vkDestroyDescriptorSetLayout(device->vk_device, layout->vk_layout, NULL)); +} + static void d3d12_root_signature_cleanup(struct d3d12_root_signature *root_signature, struct d3d12_device *device) { @@ -66,7 +75,9 @@ static void d3d12_root_signature_cleanup(struct d3d12_root_signature *root_signa if (root_signature->vk_pipeline_layout) VK_CALL(vkDestroyPipelineLayout(device->vk_device, root_signature->vk_pipeline_layout, NULL)); for (i = 0; i < root_signature->vk_set_count; ++i) - VK_CALL(vkDestroyDescriptorSetLayout(device->vk_device, root_signature->vk_set_layouts[i], NULL)); + { + d3d12_descriptor_set_layout_cleanup(&root_signature->descriptor_set_layouts[i], device); + } if (root_signature->parameters) { @@ -370,10 +381,10 @@ static HRESULT d3d12_root_signature_info_count_descriptors(struct d3d12_root_sig info->binding_count += binding_count; } - if (unbounded) + if (unbounded && !use_array) { - FIXME("Unhandled unbounded descriptor range.\n"); - return E_NOTIMPL; + FIXME("The device does not support unbounded descriptor ranges.\n"); + return E_FAIL; } return S_OK; @@ -526,6 +537,8 @@ struct vkd3d_descriptor_set_context { VkDescriptorSetLayoutBinding *current_binding; VkDescriptorSetLayoutBinding *first_binding; + unsigned int table_index; + unsigned int unbounded_offset; unsigned int descriptor_index; uint32_t descriptor_binding; }; @@ -544,24 +557,30 @@ static bool vkd3d_validate_descriptor_set_count(struct d3d12_device *device, uns } static HRESULT vkd3d_create_descriptor_set_layout(struct d3d12_device *device, - VkDescriptorSetLayoutCreateFlags flags, unsigned int binding_count, + VkDescriptorSetLayoutCreateFlags flags, unsigned int binding_count, bool unbounded, const VkDescriptorSetLayoutBinding *bindings, VkDescriptorSetLayout *set_layout); static HRESULT d3d12_root_signature_append_descriptor_set_layout(struct d3d12_root_signature *root_signature, struct vkd3d_descriptor_set_context *context, VkDescriptorSetLayoutCreateFlags flags) { + struct d3d12_descriptor_set_layout *layout; + unsigned int index; HRESULT hr; if (!context->descriptor_binding) return S_OK; - if (!vkd3d_validate_descriptor_set_count(root_signature->device, root_signature->vk_set_count + 1)) + index = root_signature->vk_set_count; + layout = &root_signature->descriptor_set_layouts[index]; + + if (!vkd3d_validate_descriptor_set_count(root_signature->device, index + 1)) return E_INVALIDARG; - if (FAILED(hr = vkd3d_create_descriptor_set_layout(root_signature->device, - flags, context->descriptor_binding, context->first_binding, - &root_signature->vk_set_layouts[root_signature->vk_set_count]))) + if (FAILED(hr = vkd3d_create_descriptor_set_layout(root_signature->device, flags, context->descriptor_binding, + context->unbounded_offset != UINT_MAX, context->first_binding, &layout->vk_layout))) return hr; + layout->table_index = context->table_index; + layout->unbounded_offset = context->unbounded_offset; ++root_signature->vk_set_count; context->current_binding = context->first_binding; @@ -586,6 +605,9 @@ static void d3d12_root_signature_append_vk_binding(struct d3d12_root_signature * mapping->binding.set = root_signature->vk_set_count; mapping->binding.binding = context->descriptor_binding++; mapping->binding.count = descriptor_count; + + if (context->unbounded_offset != UINT_MAX) + d3d12_root_signature_append_descriptor_set_layout(root_signature, context, 0); } static uint32_t d3d12_root_signature_assign_vk_bindings(struct d3d12_root_signature *root_signature, @@ -632,6 +654,16 @@ static uint32_t vkd3d_descriptor_magic_from_d3d12(D3D12_DESCRIPTOR_RANGE_TYPE ty } } +static unsigned int vk_binding_count_from_descriptor_range(const struct d3d12_root_descriptor_table_range *range) +{ + if (range->descriptor_count != UINT_MAX) + return range->descriptor_count; + + /* TODO: Calculate an upper bound from unbounded set counts and Vulkan + * device limits. */ + return 1024; +} + static HRESULT d3d12_root_signature_init_descriptor_array_binding(struct d3d12_root_signature *root_signature, const struct d3d12_root_descriptor_table_range *range, D3D12_SHADER_VISIBILITY visibility, struct vkd3d_descriptor_set_context *context) @@ -640,28 +672,62 @@ static HRESULT d3d12_root_signature_init_descriptor_array_binding(struct d3d12_r bool is_buffer = range->type == VKD3D_SHADER_DESCRIPTOR_TYPE_CBV; enum vkd3d_shader_descriptor_type descriptor_type = range->type; + if (range->descriptor_count == UINT_MAX) + context->unbounded_offset = range->offset; + if (descriptor_type == VKD3D_SHADER_DESCRIPTOR_TYPE_SRV || descriptor_type == VKD3D_SHADER_DESCRIPTOR_TYPE_UAV) { if (!vk_binding_from_d3d12_descriptor_range(context->current_binding, - descriptor_type, visibility, true, context->descriptor_binding, range->descriptor_count)) + descriptor_type, visibility, true, context->descriptor_binding, range->vk_binding_count)) return E_NOTIMPL; ++context->current_binding; d3d12_root_signature_append_vk_binding(root_signature, descriptor_type, range->register_space, - range->base_register_idx, true, shader_visibility, range->descriptor_count, context); + range->base_register_idx, true, shader_visibility, range->vk_binding_count, context); } if (!vk_binding_from_d3d12_descriptor_range(context->current_binding, - descriptor_type, visibility, is_buffer, context->descriptor_binding, range->descriptor_count)) + descriptor_type, visibility, is_buffer, context->descriptor_binding, range->vk_binding_count)) return E_NOTIMPL; ++context->current_binding; d3d12_root_signature_append_vk_binding(root_signature, descriptor_type, range->register_space, - range->base_register_idx, is_buffer, shader_visibility, range->descriptor_count, context); + range->base_register_idx, is_buffer, shader_visibility, range->vk_binding_count, context); + + context->unbounded_offset = UINT_MAX; return S_OK; } +static void d3d12_root_signature_map_vk_unbounded_binding(struct d3d12_root_signature *root_signature, + const struct d3d12_root_descriptor_table_range *range, bool buffer_descriptor, + enum vkd3d_shader_visibility shader_visibility, struct vkd3d_descriptor_set_context *context) +{ + struct vkd3d_shader_resource_binding *mapping = &root_signature->descriptor_mapping[context->descriptor_index++]; + + mapping->type = range->type; + mapping->register_space = range->register_space; + mapping->register_index = range->base_register_idx; + mapping->shader_visibility = shader_visibility; + mapping->flags = buffer_descriptor ? VKD3D_SHADER_BINDING_FLAG_BUFFER : VKD3D_SHADER_BINDING_FLAG_IMAGE; + mapping->binding.set = root_signature->main_set + range->set + ((range->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SRV + || range->type == VKD3D_SHADER_DESCRIPTOR_TYPE_UAV) && !buffer_descriptor); + mapping->binding.binding = range->binding; + mapping->binding.count = range->vk_binding_count; +} + +static void d3d12_root_signature_map_descriptor_unbounded_binding(struct d3d12_root_signature *root_signature, + const struct d3d12_root_descriptor_table_range *range, + enum vkd3d_shader_visibility shader_visibility, struct vkd3d_descriptor_set_context *context) +{ + bool is_buffer = range->type == VKD3D_SHADER_DESCRIPTOR_TYPE_CBV; + + if (range->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SRV || range->type == VKD3D_SHADER_DESCRIPTOR_TYPE_UAV) + d3d12_root_signature_map_vk_unbounded_binding(root_signature, range, true, shader_visibility, context); + + d3d12_root_signature_map_vk_unbounded_binding(root_signature, range, is_buffer, shader_visibility, context); +} + static int compare_register_range(const void *a, const void *b) { const struct d3d12_root_descriptor_table_range *range_a = a, *range_b = b; @@ -676,6 +742,20 @@ static int compare_register_range(const void *a, const void *b) return range_a->base_register_idx - range_b->base_register_idx; } +static int compare_descriptor_range(const void *a, const void *b) +{ + const struct d3d12_root_descriptor_table_range *range_a = a, *range_b = b; + int ret; + + if ((ret = range_a->type - range_b->type)) + return ret; + + if ((ret = range_a->offset - range_b->offset)) + return ret; + + return (range_a->descriptor_count == UINT_MAX) - (range_b->descriptor_count == UINT_MAX); +} + static HRESULT validate_descriptor_register_ranges(const struct d3d12_root_descriptor_table_range *ranges, unsigned int count) { @@ -707,6 +787,7 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo for (i = 0; i < desc->NumParameters; ++i) { + const struct d3d12_root_descriptor_table_range *base_range = NULL; const D3D12_ROOT_PARAMETER *p = &desc->pParameters[i]; enum vkd3d_shader_visibility shader_visibility; unsigned int offset = 0; @@ -725,6 +806,8 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo if (!(table->ranges = vkd3d_calloc(table->range_count, sizeof(*table->ranges)))) return E_OUTOFMEMORY; + context->table_index = i; + for (j = 0; j < range_count; ++j) { const D3D12_DESCRIPTOR_RANGE *range = &p->u.DescriptorTable.pDescriptorRanges[j]; @@ -732,7 +815,7 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo if (range->OffsetInDescriptorsFromTableStart != D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) offset = range->OffsetInDescriptorsFromTableStart; - if (!vkd3d_bound_range(offset, range->NumDescriptors, UINT_MAX)) + if (range->NumDescriptors != UINT_MAX && !vkd3d_bound_range(offset, range->NumDescriptors, UINT_MAX)) return E_INVALIDARG; table->ranges[j].offset = offset; @@ -745,6 +828,7 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo TRACE("Descriptor table %u, range %u, offset %u, type %#x, count %u.\n", i, j, offset, range->RangeType, range->NumDescriptors); + /* If NumDescriptors == UINT_MAX, validation during counting ensures this offset is not used. */ offset += range->NumDescriptors; } @@ -752,15 +836,49 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo if (FAILED(hr = validate_descriptor_register_ranges(table->ranges, range_count))) return hr; + qsort(table->ranges, range_count, sizeof(*table->ranges), compare_descriptor_range); + for (j = 0; j < range_count; ++j) { struct d3d12_root_descriptor_table_range *range; VkDescriptorSetLayoutBinding *cur_binding; + range = &table->ranges[j]; + range->set = root_signature->vk_set_count - root_signature->main_set; + if (root_signature->use_descriptor_arrays) { + if (j && range->type != table->ranges[j - 1].type) + base_range = NULL; + + /* Bounded and unbounded ranges can follow unbounded ones, + * so map them all into the first unbounded range. */ + if (base_range) + { + unsigned int rel_offset = range->offset - base_range->offset; + + if (rel_offset >= base_range->vk_binding_count) + { + ERR("Available binding size of %u is insufficient for an offset of %u.\n", + base_range->vk_binding_count, rel_offset); + continue; + } + + range->set = base_range->set; + range->binding = base_range->binding; + range->vk_binding_count = base_range->vk_binding_count - rel_offset; + d3d12_root_signature_map_descriptor_unbounded_binding(root_signature, range, + shader_visibility, context); + continue; + } + else if (range->descriptor_count == UINT_MAX) + { + base_range = range; + } + range->binding = context->descriptor_binding; + range->vk_binding_count = vk_binding_count_from_descriptor_range(range); if (FAILED(hr = d3d12_root_signature_init_descriptor_array_binding(root_signature, range, p->ShaderVisibility, context))) @@ -800,6 +918,7 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo ++cur_binding; } + table->ranges[j].vk_binding_count = table->ranges[j].descriptor_count; table->ranges[j].binding = vk_binding; context->current_binding = cur_binding; @@ -897,7 +1016,7 @@ static bool vk_binding_uses_partial_binding(const VkDescriptorSetLayoutBinding * } static HRESULT vkd3d_create_descriptor_set_layout(struct d3d12_device *device, - VkDescriptorSetLayoutCreateFlags flags, unsigned int binding_count, + VkDescriptorSetLayoutCreateFlags flags, unsigned int binding_count, bool unbounded, const VkDescriptorSetLayoutBinding *bindings, VkDescriptorSetLayout *set_layout) { const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; @@ -916,7 +1035,7 @@ static HRESULT vkd3d_create_descriptor_set_layout(struct d3d12_device *device, unsigned int i; for (i = 0; i < binding_count; ++i) - if (vk_binding_uses_partial_binding(&bindings[i])) + if (unbounded || vk_binding_uses_partial_binding(&bindings[i])) break; if (i < binding_count) @@ -928,6 +1047,10 @@ static HRESULT vkd3d_create_descriptor_set_layout(struct d3d12_device *device, set_flags[i] = vk_binding_uses_partial_binding(&bindings[i]) ? VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT : 0; + if (unbounded) + set_flags[binding_count - 1] = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT + | VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT; + flags_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT; flags_info.pNext = NULL; flags_info.bindingCount = binding_count; @@ -957,6 +1080,9 @@ static HRESULT vkd3d_create_pipeline_layout(struct d3d12_device *device, struct VkPipelineLayoutCreateInfo pipeline_layout_info; VkResult vr; + if (!vkd3d_validate_descriptor_set_count(device, set_layout_count)) + return E_INVALIDARG; + pipeline_layout_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; pipeline_layout_info.pNext = NULL; pipeline_layout_info.flags = 0; @@ -977,13 +1103,16 @@ static HRESULT vkd3d_create_pipeline_layout(struct d3d12_device *device, static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signature, struct d3d12_device *device, const D3D12_ROOT_SIGNATURE_DESC *desc) { + VkDescriptorSetLayout vk_layouts[VKD3D_MAX_DESCRIPTOR_SETS]; const struct vkd3d_vulkan_info *vk_info = &device->vk_info; struct vkd3d_descriptor_set_context context; VkDescriptorSetLayoutBinding *binding_desc; struct d3d12_root_signature_info info; + unsigned int i; HRESULT hr; memset(&context, 0, sizeof(context)); + context.unbounded_offset = UINT_MAX; binding_desc = NULL; root_signature->ID3D12RootSignature_iface.lpVtbl = &d3d12_root_signature_vtbl; @@ -1047,6 +1176,8 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa goto fail; } + root_signature->main_set = root_signature->vk_set_count; + if (FAILED(hr = d3d12_root_signature_init_push_constants(root_signature, desc, root_signature->push_constant_ranges, &root_signature->push_constant_range_count))) goto fail; @@ -1055,16 +1186,19 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa if (FAILED(hr = d3d12_root_signature_init_root_descriptor_tables(root_signature, desc, &context))) goto fail; - root_signature->main_set = root_signature->vk_set_count; - if (FAILED(hr = d3d12_root_signature_append_descriptor_set_layout(root_signature, &context, 0))) goto fail; vkd3d_free(binding_desc); binding_desc = NULL; + for (i = 0; i < root_signature->vk_set_count; ++i) + { + vk_layouts[i] = root_signature->descriptor_set_layouts[i].vk_layout; + } + if (FAILED(hr = vkd3d_create_pipeline_layout(device, root_signature->vk_set_count, - root_signature->vk_set_layouts, root_signature->push_constant_range_count, + vk_layouts, root_signature->push_constant_range_count, root_signature->push_constant_ranges, &root_signature->vk_pipeline_layout))) goto fail; @@ -1670,7 +1804,7 @@ static HRESULT d3d12_pipeline_state_init_uav_counters(struct d3d12_pipeline_stat descriptor_binding = 0; for (set_index = 0; set_index < root_signature->vk_set_count; ++set_index) - set_layouts[set_index] = root_signature->vk_set_layouts[set_index]; + set_layouts[set_index] = root_signature->descriptor_set_layouts[set_index].vk_layout; for (i = 0, j = 0; i < shader_info->descriptor_count; ++i) { @@ -1699,8 +1833,8 @@ static HRESULT d3d12_pipeline_state_init_uav_counters(struct d3d12_pipeline_stat } /* Create a descriptor set layout for UAV counters. */ - hr = vkd3d_create_descriptor_set_layout(device, - 0, descriptor_binding, binding_desc, &state->uav_counters.vk_set_layout); + hr = vkd3d_create_descriptor_set_layout(device, 0, descriptor_binding, + false, binding_desc, &state->uav_counters.vk_set_layout); vkd3d_free(binding_desc); if (FAILED(hr)) { @@ -3196,7 +3330,8 @@ HRESULT vkd3d_uav_clear_state_init(struct vkd3d_uav_clear_state *state, struct d { set_binding.descriptorType = set_layouts[i].descriptor_type; - if (FAILED(hr = vkd3d_create_descriptor_set_layout(device, 0, 1, &set_binding, set_layouts[i].set_layout))) + if (FAILED(hr = vkd3d_create_descriptor_set_layout(device, 0, + 1, false, &set_binding, set_layouts[i].set_layout))) { ERR("Failed to create descriptor set layout %u, hr %#x.\n", i, hr); goto fail; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 0b326b11..f8474caa 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -54,7 +54,7 @@ #define VKD3D_MAX_SHADER_EXTENSIONS 2u #define VKD3D_MAX_SHADER_STAGES 5u #define VKD3D_MAX_VK_SYNC_OBJECTS 4u -#define VKD3D_MAX_DESCRIPTOR_SETS 2u +#define VKD3D_MAX_DESCRIPTOR_SETS 64u struct d3d12_command_list; struct d3d12_device; @@ -234,6 +234,28 @@ D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate(struct vkd3d_gpu_va_al void *vkd3d_gpu_va_allocator_dereference(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address); void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address); +struct vkd3d_gpu_descriptor_allocation +{ + const struct d3d12_desc *base; + size_t count; +}; + +struct vkd3d_gpu_descriptor_allocator +{ + pthread_mutex_t mutex; + + struct vkd3d_gpu_descriptor_allocation *allocations; + size_t allocations_size; + size_t allocation_count; +}; + +size_t vkd3d_gpu_descriptor_allocator_range_size_from_descriptor( + struct vkd3d_gpu_descriptor_allocator *allocator, const struct d3d12_desc *desc); +bool vkd3d_gpu_descriptor_allocator_register_range(struct vkd3d_gpu_descriptor_allocator *allocator, + const struct d3d12_desc *base, size_t count); +bool vkd3d_gpu_descriptor_allocator_unregister_range( + struct vkd3d_gpu_descriptor_allocator *allocator, const struct d3d12_desc *base); + struct vkd3d_render_pass_key { unsigned int attachment_count; @@ -647,6 +669,8 @@ struct d3d12_root_descriptor_table_range { unsigned int offset; unsigned int descriptor_count; + unsigned int vk_binding_count; + uint32_t set; uint32_t binding; enum vkd3d_shader_descriptor_type type; @@ -683,6 +707,13 @@ struct d3d12_root_parameter } u; }; +struct d3d12_descriptor_set_layout +{ + VkDescriptorSetLayout vk_layout; + unsigned int unbounded_offset; + unsigned int table_index; +}; + /* ID3D12RootSignature */ struct d3d12_root_signature { @@ -690,8 +721,8 @@ struct d3d12_root_signature LONG refcount; VkPipelineLayout vk_pipeline_layout; + struct d3d12_descriptor_set_layout descriptor_set_layouts[VKD3D_MAX_DESCRIPTOR_SETS]; uint32_t vk_set_count; - VkDescriptorSetLayout vk_set_layouts[VKD3D_MAX_DESCRIPTOR_SETS]; bool use_descriptor_arrays; struct d3d12_root_parameter *parameters; @@ -912,8 +943,10 @@ struct vkd3d_pipeline_bindings const struct d3d12_root_signature *root_signature; VkPipelineBindPoint vk_bind_point; + /* All descriptor sets at index > 1 are for unbounded d3d12 ranges. Set + * 0 or 1 may be unbounded too. */ size_t descriptor_set_count; - VkDescriptorSet descriptor_sets[VKD3D_MAX_DESCRIPTOR_SETS - 1]; + VkDescriptorSet descriptor_sets[VKD3D_MAX_DESCRIPTOR_SETS]; bool in_use; D3D12_GPU_DESCRIPTOR_HANDLE descriptor_tables[D3D12_MAX_ROOT_COST]; @@ -1126,6 +1159,7 @@ struct d3d12_device PFN_vkd3d_signal_event signal_event; size_t wchar_size; + struct vkd3d_gpu_descriptor_allocator gpu_descriptor_allocator; struct vkd3d_gpu_va_allocator gpu_va_allocator; struct vkd3d_fence_worker fence_worker; diff --git a/tests/d3d12.c b/tests/d3d12.c index 57c39d27..2a8bdcf3 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -2799,7 +2799,7 @@ static void test_create_root_signature(void) root_signature_desc.pStaticSamplers = NULL; root_signature_desc.Flags = D3D12_ROOT_SIGNATURE_FLAG_NONE; hr = create_root_signature(device, &root_signature_desc, &root_signature); - todo ok(hr == S_OK || (binding_tier == D3D12_RESOURCE_BINDING_TIER_1 && (hr == E_FAIL || hr == E_INVALIDARG)), + ok(hr == S_OK || (binding_tier == D3D12_RESOURCE_BINDING_TIER_1 && (hr == E_FAIL || hr == E_INVALIDARG)), "Got unexpected hr %#x.\n", hr); if (SUCCEEDED(hr)) { @@ -2819,13 +2819,13 @@ static void test_create_root_signature(void) descriptor_ranges[1].RegisterSpace = 0; descriptor_ranges[1].OffsetInDescriptorsFromTableStart = 16; hr = create_root_signature(device, &root_signature_desc, &root_signature); - todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); /* A bounded range overlapping an unbounded one, mapped to the same * register space, but a different type. */ descriptor_ranges[1].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_CBV; hr = create_root_signature(device, &root_signature_desc, &root_signature); - todo ok(hr == S_OK || (binding_tier <= D3D12_RESOURCE_BINDING_TIER_2 && (hr == E_FAIL || hr == E_INVALIDARG)), + ok(hr == S_OK || (binding_tier <= D3D12_RESOURCE_BINDING_TIER_2 && (hr == E_FAIL || hr == E_INVALIDARG)), "Got unexpected hr %#x.\n", hr); if (SUCCEEDED(hr)) { @@ -2838,9 +2838,7 @@ static void test_create_root_signature(void) descriptor_ranges[1].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV; descriptor_ranges[1].NumDescriptors = UINT_MAX; hr = create_root_signature(device, &root_signature_desc, &root_signature); - todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D12RootSignature_Release(root_signature); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); /* And unbounded range overlapping a bounded one, mapped to the same * register space and type. */ @@ -2848,9 +2846,7 @@ static void test_create_root_signature(void) descriptor_ranges[1].BaseShaderRegister = 0; descriptor_ranges[1].OffsetInDescriptorsFromTableStart = 15; hr = create_root_signature(device, &root_signature_desc, &root_signature); - todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D12RootSignature_Release(root_signature); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); refcount = ID3D12Device_Release(device); ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount); @@ -34925,7 +34921,6 @@ static void test_unbounded_resource_arrays(void) root_signature_desc.NumParameters = ARRAY_SIZE(root_parameters); root_signature_desc.pParameters = root_parameters; hr = create_root_signature(device, &root_signature_desc, &context.root_signature); - todo ok(hr == S_OK, "Failed to create root signature, hr %#x.\n", hr); if (FAILED(hr)) goto done; @@ -34999,6 +34994,7 @@ static void test_unbounded_resource_arrays(void) D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE); get_buffer_readback_with_command_list(output_buffers[i], DXGI_FORMAT_R32_UINT, &rb, queue, command_list); /* Buffers at index >= 64 are aliased. */ + todo_if(i != 10 && i != 74) check_readback_data_uint(&rb, NULL, (i < 64 ? 63 - i : 127 - i) ^ 0x35, 0); release_resource_readback(&rb); reset_command_list(command_list, context.allocator); @@ -35088,7 +35084,6 @@ static void test_unbounded_samplers(void) root_signature_desc.pParameters = root_parameters; hr = create_root_signature(device, &root_signature_desc, &context.root_signature); - todo ok(SUCCEEDED(hr), "Failed to create root signature, hr %#x.\n", hr); if (FAILED(hr)) goto done; @@ -35146,6 +35141,7 @@ static void test_unbounded_samplers(void) { unsigned int value = get_readback_uint(&rb, i, 0, 0); unsigned int expected = (i & 1) ? 100 : 10; + todo_if(i & 1) ok(value == expected, "Got %u, expected %u at %u.\n", value, expected, i); } release_resource_readback(&rb); -- 2.20.1
[View Less]
3
3
0
0
[PATCH] wpcap: Map Unix interfaces to Windows adapters.
by Hans Leidekker
07 Oct '21
07 Oct '21
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=37167
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/wpcap/Makefile.in | 1 + dlls/wpcap/unixlib.c | 4 +- dlls/wpcap/unixlib.h | 25 +++- dlls/wpcap/wpcap.c | 307 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 318 insertions(+), 19 deletions(-) diff --git a/dlls/wpcap/Makefile.in b/dlls/wpcap/Makefile.in index 4409a8c9e3a..ba3d0145cde 100644 --- a/dlls/wpcap/Makefile.in +++ b/dlls/wpcap/
…
[View More]
Makefile.in @@ -1,4 +1,5 @@ MODULE = wpcap.dll +IMPORTS = iphlpapi DELAYIMPORTS = ws2_32 EXTRALIBS = $(PCAP_LIBS) diff --git a/dlls/wpcap/unixlib.c b/dlls/wpcap/unixlib.c index 96e30fe2f11..00f412b7869 100644 --- a/dlls/wpcap/unixlib.c +++ b/dlls/wpcap/unixlib.c @@ -143,7 +143,7 @@ static void * CDECL wrap_dump_open( struct pcap *pcap, const char *name ) return pcap_dump_open( pcap->handle, name ); } -static int CDECL wrap_findalldevs( struct pcap_if_hdr **devs, char *errbuf ) +static int CDECL wrap_findalldevs( struct pcap_interface **devs, char *errbuf ) { int ret; ret = pcap_findalldevs( (pcap_if_t **)devs, errbuf ); @@ -162,7 +162,7 @@ static void CDECL wrap_free_tstamp_types( int *types ) pcap_free_tstamp_types( types ); } -static void CDECL wrap_freealldevs( struct pcap_if_hdr *devs ) +static void CDECL wrap_freealldevs( struct pcap_interface *devs ) { pcap_freealldevs( (pcap_if_t *)devs ); } diff --git a/dlls/wpcap/unixlib.h b/dlls/wpcap/unixlib.h index aa00bc33153..f7d627ebad4 100644 --- a/dlls/wpcap/unixlib.h +++ b/dlls/wpcap/unixlib.h @@ -17,10 +17,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -struct pcap_if_hdr +struct sockaddr_hdr { - struct pcap_if_hdr *next; + unsigned short sa_family; +}; + +struct pcap_address +{ + struct pcap_address *next; + struct sockaddr_hdr *addr; + struct sockaddr_hdr *netmask; + struct sockaddr_hdr *broadaddr; + struct sockaddr_hdr *dstaddr; +}; + +struct pcap_interface +{ + struct pcap_interface *next; char *name; + char *description; + struct pcap_address *addresses; + unsigned int flags; }; struct pcap_pkthdr_win32 @@ -63,10 +80,10 @@ struct pcap_funcs unsigned char * ); void (CDECL *dump)( unsigned char *, const struct pcap_pkthdr_win32 *, const unsigned char * ); void * (CDECL *dump_open)( struct pcap *, const char * ); - int (CDECL *findalldevs)( struct pcap_if_hdr **, char * ); + int (CDECL *findalldevs)( struct pcap_interface **, char * ); void (CDECL *free_datalinks)( int * ); void (CDECL *free_tstamp_types)( int * ); - void (CDECL *freealldevs)( struct pcap_if_hdr * ); + void (CDECL *freealldevs)( struct pcap_interface * ); void (CDECL *freecode)( void * ); int (CDECL *get_tstamp_precision)( struct pcap * ); char * (CDECL *geterr)( struct pcap * ); diff --git a/dlls/wpcap/wpcap.c b/dlls/wpcap/wpcap.c index ffdb1a3e8d3..3a0b2381697 100644 --- a/dlls/wpcap/wpcap.c +++ b/dlls/wpcap/wpcap.c @@ -23,8 +23,9 @@ #include "winbase.h" #include "winternl.h" #include "winnls.h" -#define USE_WS_PREFIX #include "winsock2.h" +#include "ws2ipdef.h" +#include "iphlpapi.h" #include "wine/debug.h" #include "unixlib.h" @@ -138,16 +139,254 @@ void * CDECL pcap_dump_open( struct pcap *pcap, const char *filename ) return dumper; } -int CDECL pcap_findalldevs( struct pcap_if_hdr **devs, char *errbuf ) +static void free_addresses( struct pcap_address *addrs ) +{ + struct pcap_address *next, *cur = addrs; + if (!addrs) return; + do + { + free( cur->addr ); + free( cur->netmask ); + free( cur->broadaddr ); + free( cur->dstaddr ); + next = cur->next; + free( cur ); + cur = next; + } while (next); +} + +static void free_devices( struct pcap_interface *devs ) +{ + struct pcap_interface *next, *cur = devs; + if (!devs) return; + do + { + free( cur->name ); + free( cur->description ); + free_addresses( cur->addresses ); + next = cur->next; + free( cur ); + cur = next; + } while (next); +} + +static IP_ADAPTER_ADDRESSES *get_adapters( void ) +{ + DWORD size = 0; + IP_ADAPTER_ADDRESSES *ret; + ULONG flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER; + + if (GetAdaptersAddresses( AF_UNSPEC, flags, NULL, NULL, &size ) != ERROR_BUFFER_OVERFLOW) return NULL; + if (!(ret = malloc( size ))) return NULL; + if (GetAdaptersAddresses( AF_UNSPEC, flags, NULL, ret, &size )) + { + free( ret ); + return NULL; + } + return ret; +} + +static IP_ADAPTER_ADDRESSES *find_adapter( IP_ADAPTER_ADDRESSES *list, const char *name ) +{ + IP_ADAPTER_ADDRESSES *ret; + WCHAR *nameW; + + if (!(nameW = strdupAW( name ))) return NULL; + for (ret = list; ret; ret = ret->Next) + { + if (!wcscmp( nameW, ret->FriendlyName )) break; + } + free( nameW); + return ret; +} + +static char *build_win32_name( const char *source, const char *adapter_name ) +{ + const char prefix[] = "\\Device\\NPF_"; + int len = sizeof(prefix) + strlen(adapter_name); + char *ret; + + if (source) len += strlen( source ); + if ((ret = malloc( len ))) + { + ret[0] = 0; + if (source) strcat( ret, source ); + strcat( ret, prefix ); + strcat( ret, adapter_name ); + } + return ret; +} + +static char *build_win32_description( const struct pcap_interface *unix_dev ) +{ + int len = strlen(unix_dev->name) + 1; + char *ret, *ptr; + + if (unix_dev->description && unix_dev->description[0]) len += strlen(unix_dev->description) + 1; + if ((ret = ptr = malloc( len ))) + { + if (unix_dev->description) + { + strcpy( ret, unix_dev->description ); + strcat( ret, " " ); + strcat( ret, unix_dev->name ); + } + else strcpy( ret, unix_dev->name ); + } + return ret; +} + +static struct sockaddr_hdr *dup_sockaddr( const struct sockaddr_hdr *addr ) +{ + struct sockaddr_hdr *ret; + + switch (addr->sa_family) + { + case AF_INET: + { + struct sockaddr_in *dst, *src = (struct sockaddr_in *)addr; + if (!(dst = calloc( 1, sizeof(*dst) ))) return NULL; + dst->sin_family = src->sin_family; + dst->sin_port = src->sin_port; + dst->sin_addr = src->sin_addr; + ret = (struct sockaddr_hdr *)dst; + break; + } + case AF_INET6: + { + struct sockaddr_in6 *dst, *src = (struct sockaddr_in6 *)addr; + if (!(dst = malloc( sizeof(*dst) ))) return NULL; + dst->sin6_family = src->sin6_family; + dst->sin6_port = src->sin6_port; + dst->sin6_flowinfo = src->sin6_flowinfo; + dst->sin6_addr = src->sin6_addr; + dst->sin6_scope_id = src->sin6_scope_id; + ret = (struct sockaddr_hdr *)dst; + break; + } + default: + FIXME( "address family %u not supported\n", addr->sa_family ); + return NULL; + } + + return ret; +} + +static struct pcap_address *build_win32_address( struct pcap_address *src ) +{ + struct pcap_address *dst; + + if (!(dst = calloc( 1, sizeof(*dst) ))) return NULL; + if (src->addr && !(dst->addr = dup_sockaddr( src->addr ))) goto err; + if (src->netmask && !(dst->netmask = dup_sockaddr( src->netmask ))) goto err; + if (src->broadaddr && !(dst->broadaddr = dup_sockaddr( src->broadaddr ))) goto err; + if (src->dstaddr && !(dst->dstaddr = dup_sockaddr( src->dstaddr ))) goto err; + return dst; + +err: + free( dst->addr ); + free( dst->netmask ); + free( dst->broadaddr ); + free( dst->dstaddr ); + free( dst ); + return NULL; +} + +static void add_win32_address( struct pcap_address **list, struct pcap_address *addr ) +{ + struct pcap_address *cur = *list; + if (!cur) *list = addr; + else + { + while (cur->next) { cur = cur->next; } + cur->next = addr; + } +} + +static struct pcap_address *build_win32_addresses( struct pcap_address *addrs ) +{ + struct pcap_address *src, *dst, *ret = NULL; + src = addrs; + while (src) + { + if ((dst = build_win32_address( src ))) add_win32_address( &ret, dst ); + src = src->next; + } + return ret; +} + +static struct pcap_interface *build_win32_device( const struct pcap_interface *unix_dev, const char *source, + const char *adapter_name ) +{ + struct pcap_interface *ret; + + if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL; + if (!(ret->name = build_win32_name( source, adapter_name ))) goto err; + if (!(ret->description = build_win32_description( unix_dev ))) goto err; + if (!(ret->addresses = build_win32_addresses( unix_dev->addresses ))) goto err; + ret->flags = unix_dev->flags; + return ret; + +err: + free( ret->name ); + free( ret->description ); + free_addresses( ret->addresses ); + free( ret ); + return NULL; +} + +static void add_win32_device( struct pcap_interface **list, struct pcap_interface *dev ) +{ + struct pcap_interface *cur = *list; + if (!cur) *list = dev; + else + { + while (cur->next) { cur = cur->next; } + cur->next = dev; + } +} + +static int find_all_devices( const char *source, struct pcap_interface **devs, char *errbuf ) +{ + struct pcap_interface *unix_devs, *win32_devs = NULL, *cur, *dev; + IP_ADAPTER_ADDRESSES *ptr, *adapters = get_adapters(); + int ret; + + if (!adapters) + { + if (errbuf) sprintf( errbuf, "Out of memory." ); + return -1; + } + + if (!(ret = pcap_funcs->findalldevs( &unix_devs, errbuf ))) + { + cur = unix_devs; + while (cur) + { + if ((ptr = find_adapter( adapters, cur->name )) && (dev = build_win32_device( cur, source, ptr->AdapterName ))) + { + add_win32_device( &win32_devs, dev ); + } + cur = cur->next; + } + *devs = win32_devs; + pcap_funcs->freealldevs( unix_devs ); + } + + free( adapters ); + return ret; +} + +int CDECL pcap_findalldevs( struct pcap_interface **devs, char *errbuf ) { TRACE( "%p, %p\n", devs, errbuf ); - return pcap_funcs->findalldevs( devs, errbuf ); + return find_all_devices( NULL, devs, errbuf ); } -int CDECL pcap_findalldevs_ex( char *source, void *auth, struct pcap_if_hdr **devs, char *errbuf ) +int CDECL pcap_findalldevs_ex( char *source, void *auth, struct pcap_interface **devs, char *errbuf ) { FIXME( "%s, %p, %p, %p: partial stub\n", debugstr_a(source), auth, devs, errbuf ); - return pcap_funcs->findalldevs( devs, errbuf ); + return find_all_devices( source, devs, errbuf ); } void CDECL pcap_free_datalinks( int *links ) @@ -162,10 +401,10 @@ void CDECL pcap_free_tstamp_types( int *types ) pcap_funcs->free_tstamp_types( types ); } -void CDECL pcap_freealldevs( struct pcap_if_hdr *devs ) +void CDECL pcap_freealldevs( struct pcap_interface *devs ) { TRACE( "%p\n", devs ); - pcap_funcs->freealldevs( devs ); + free_devices( devs ); } void CDECL pcap_freecode( void *program ) @@ -229,15 +468,14 @@ int CDECL pcap_list_tstamp_types( struct pcap *pcap, int **types ) char * CDECL pcap_lookupdev( char *errbuf ) { static char *ret; - struct pcap_if_hdr *devs; + struct pcap_interface *devs; TRACE( "%p\n", errbuf ); if (!ret) { - if (pcap_funcs->findalldevs( &devs, errbuf ) == -1) return NULL; - if (!devs) return NULL; + if (pcap_findalldevs( &devs, errbuf ) == -1 || devs) return NULL; if ((ret = malloc( strlen(devs->name) + 1 ))) strcpy( ret, devs->name ); - pcap_funcs->freealldevs( devs ); + pcap_freealldevs( devs ); } return ret; } @@ -280,17 +518,60 @@ int CDECL pcap_next_ex( struct pcap *pcap, struct pcap_pkthdr_win32 **hdr, const return pcap_funcs->next_ex( pcap, hdr, data ); } +static char *strdupWA( const WCHAR *src ) +{ + char *dst; + int len = WideCharToMultiByte( CP_ACP, 0, src, -1, NULL, 0, NULL, NULL ); + if ((dst = malloc( len ))) WideCharToMultiByte( CP_ACP, 0, src, -1, dst, len, NULL, NULL ); + return dst; +} + +static char *map_win32_device_name( const char *dev ) +{ + IP_ADAPTER_ADDRESSES *ptr, *adapters = get_adapters(); + const char *name = strchr( dev, '{' ); + char *ret = NULL; + + if (!adapters || !name) return NULL; + for (ptr = adapters; ptr; ptr = ptr->Next) + { + if (!strcmp( name, ptr->AdapterName )) + { + ret = strdupWA( ptr->FriendlyName ); + break; + } + } + free( adapters ); + return ret; +} + +static struct pcap *open_live( const char *source, int snaplen, int promisc, int timeout, char *errbuf ) +{ + char *unix_dev; + struct pcap *ret; + + if (!(unix_dev = map_win32_device_name( source ))) + { + if (errbuf) sprintf( errbuf, "Unable to open the adapter." ); + return NULL; + } + + ret = pcap_funcs->open_live( unix_dev, snaplen, promisc, timeout, errbuf ); + free( unix_dev ); + return ret; +} + #define PCAP_OPENFLAG_PROMISCUOUS 1 struct pcap * CDECL pcap_open( const char *source, int snaplen, int flags, int timeout, void *auth, char *errbuf ) { FIXME( "%s, %d, %d, %d, %p, %p: partial stub\n", debugstr_a(source), snaplen, flags, timeout, auth, errbuf ); - return pcap_funcs->open_live( source, snaplen, flags & PCAP_OPENFLAG_PROMISCUOUS, timeout, errbuf ); + return open_live( source, snaplen, flags & PCAP_OPENFLAG_PROMISCUOUS, timeout, errbuf ); } struct pcap * CDECL pcap_open_live( const char *source, int snaplen, int promisc, int to_ms, char *errbuf ) { TRACE( "%s, %d, %d, %d, %p\n", debugstr_a(source), snaplen, promisc, to_ms, errbuf ); - return pcap_funcs->open_live( source, snaplen, promisc, to_ms, errbuf ); + return open_live( source, snaplen, promisc, to_ms, errbuf ); } #define PCAP_SRC_FILE 2 -- 2.30.2
[View Less]
1
0
0
0
[PATCH v3 01/17] mshtml: Add names for each object and use it in the Navigator.
by Gabriel Ivăncescu
07 Oct '21
07 Oct '21
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/dispex.c | 29 +++++++++++++++++++++++++++++ dlls/mshtml/htmlanchor.c | 1 + dlls/mshtml/htmlarea.c | 1 + dlls/mshtml/htmlattr.c | 1 + dlls/mshtml/htmlbody.c | 1 + dlls/mshtml/htmlcomment.c | 1 + dlls/mshtml/htmlcurstyle.c | 1 + dlls/mshtml/htmldoc.c | 2 ++ dlls/mshtml/htmlelem.c | 6 ++++++ dlls/mshtml/htmlelemcol.c | 1 + dlls/mshtml/htmlevent.c
…
[View More]
| 6 ++++++ dlls/mshtml/htmlform.c | 1 + dlls/mshtml/htmlframe.c | 2 ++ dlls/mshtml/htmlgeneric.c | 1 + dlls/mshtml/htmlhead.c | 4 ++++ dlls/mshtml/htmlimg.c | 2 ++ dlls/mshtml/htmlinput.c | 3 +++ dlls/mshtml/htmllink.c | 1 + dlls/mshtml/htmllocation.c | 1 + dlls/mshtml/htmlnode.c | 2 ++ dlls/mshtml/htmlobject.c | 2 ++ dlls/mshtml/htmlscript.c | 1 + dlls/mshtml/htmlselect.c | 3 +++ dlls/mshtml/htmlstorage.c | 1 + dlls/mshtml/htmlstyle.c | 2 ++ dlls/mshtml/htmlstyleelem.c | 1 + dlls/mshtml/htmlstylesheet.c | 4 ++++ dlls/mshtml/htmltable.c | 3 +++ dlls/mshtml/htmltextarea.c | 1 + dlls/mshtml/htmltextnode.c | 1 + dlls/mshtml/htmlwindow.c | 1 + dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/omnavigator.c | 18 ++++++++++++------ dlls/mshtml/range.c | 2 ++ dlls/mshtml/selection.c | 1 + dlls/mshtml/xmlhttprequest.c | 2 ++ 36 files changed, 106 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 64ead8f..1adcc67 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -886,6 +886,7 @@ static const dispex_static_data_vtbl_t function_dispex_vtbl = { static const tid_t function_iface_tids[] = {0}; static dispex_static_data_t function_dispex = { + L"Function", &function_dispex_vtbl, NULL_tid, function_iface_tids @@ -1482,6 +1483,34 @@ compat_mode_t dispex_compat_mode(DispatchEx *dispex) : dispex->info->desc->vtbl->get_compat_mode(dispex); } +HRESULT dispex_to_string(DispatchEx *dispex, BSTR *ret) +{ + static const WCHAR prefix[8] = L"[object "; + static const WCHAR suffix[] = L"]"; + WCHAR buf[ARRAY_SIZE(prefix) + 28 + ARRAY_SIZE(suffix)], *p = buf; + compat_mode_t compat_mode = dispex_compat_mode(dispex); + const WCHAR *name = dispex->info->desc->name; + unsigned len; + + if(!ret) + return E_INVALIDARG; + + memcpy(p, prefix, sizeof(prefix)); + p += ARRAY_SIZE(prefix); + if(compat_mode < COMPAT_MODE_IE9) + p--; + else { + len = wcslen(name); + assert(len <= 28); + memcpy(p, name, len * sizeof(WCHAR)); + p += len; + } + memcpy(p, suffix, sizeof(suffix)); + + *ret = SysAllocString(buf); + return *ret ? S_OK : E_OUTOFMEMORY; +} + static dispex_data_t *ensure_dispex_info(dispex_static_data_t *desc, compat_mode_t compat_mode) { if(!desc->info_cache[compat_mode]) { diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index da48601..4416624 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -857,6 +857,7 @@ static const tid_t HTMLAnchorElement_iface_tids[] = { }; static dispex_static_data_t HTMLAnchorElement_dispex = { + L"HTMLAnchorElement", NULL, DispHTMLAnchorElement_tid, HTMLAnchorElement_iface_tids, diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index e785871..6c0da36 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -477,6 +477,7 @@ static const tid_t HTMLAreaElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLAreaElement_dispex = { + L"HTMLAreaElement", NULL, DispHTMLAreaElement_tid, HTMLAreaElement_iface_tids, diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index dc8c45e..e10c7c3 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -484,6 +484,7 @@ static const tid_t HTMLDOMAttribute_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMAttribute_dispex = { + L"Attr", NULL, DispHTMLDOMAttribute_tid, HTMLDOMAttribute_iface_tids diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 32c49fe..551c3a1 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -1008,6 +1008,7 @@ static const tid_t HTMLBodyElement_iface_tids[] = { }; static dispex_static_data_t HTMLBodyElement_dispex = { + L"HTMLBodyElement", NULL, DispHTMLBody_tid, HTMLBodyElement_iface_tids, diff --git a/dlls/mshtml/htmlcomment.c b/dlls/mshtml/htmlcomment.c index 85eceef..7815865 100644 --- a/dlls/mshtml/htmlcomment.c +++ b/dlls/mshtml/htmlcomment.c @@ -199,6 +199,7 @@ static const tid_t HTMLCommentElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLCommentElement_dispex = { + L"Comment", NULL, DispHTMLCommentElement_tid, HTMLCommentElement_iface_tids, diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 2abe5df..e66a42c 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -1300,6 +1300,7 @@ static const tid_t HTMLCurrentStyle_iface_tids[] = { 0 }; static dispex_static_data_t HTMLCurrentStyle_dispex = { + L"MSCurrentStyleCSSProperties", &CSSStyle_dispex_vtbl, DispHTMLCurrentStyle_tid, HTMLCurrentStyle_iface_tids, diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 9faf987..6bbf058 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5654,6 +5654,7 @@ static void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t } static dispex_static_data_t HTMLDocumentNode_dispex = { + L"HTMLDocument", &HTMLDocumentNode_event_target_vtbl.dispex_vtbl, DispHTMLDocument_tid, HTMLDocumentNode_iface_tids, @@ -5949,6 +5950,7 @@ static const tid_t HTMLDocumentObj_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDocumentObj_dispex = { + L"HTMLDocumentObj", NULL, DispHTMLDocument_tid, HTMLDocumentObj_iface_tids diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index b07de03..cb7a528 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -527,6 +527,7 @@ static const tid_t HTMLRect_iface_tids[] = { 0 }; static dispex_static_data_t HTMLRect_dispex = { + L"ClientRect", NULL, IHTMLRect_tid, HTMLRect_iface_tids @@ -788,6 +789,7 @@ static const tid_t HTMLRectCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLRectCollection_dispex = { + L"ClientRectList", &HTMLRectCollection_dispex_vtbl, IHTMLRectCollection_tid, HTMLRectCollection_iface_tids @@ -6669,6 +6671,7 @@ static const tid_t token_list_iface_tids[] = { 0 }; static dispex_static_data_t token_list_dispex = { + L"DOMTokenList", &token_list_dispex_vtbl, IWineDOMTokenList_tid, token_list_iface_tids @@ -6779,6 +6782,7 @@ static const IWineHTMLElementPrivateVtbl WineHTMLElementPrivateVtbl = { }; static dispex_static_data_t HTMLElement_dispex = { + L"HTMLElement", &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLUnknownElement_tid, HTMLElement_iface_tids, @@ -7053,6 +7057,7 @@ static const tid_t HTMLFiltersCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLFiltersCollection_dispex = { + L"FiltersCollection", &HTMLFiltersCollection_dispex_vtbl, IHTMLFiltersCollection_tid, HTMLFiltersCollection_iface_tids @@ -7626,6 +7631,7 @@ static const tid_t HTMLAttributeCollection_iface_tids[] = { }; static dispex_static_data_t HTMLAttributeCollection_dispex = { + L"NamedNodeMap", &HTMLAttributeCollection_dispex_vtbl, DispHTMLAttributeCollection_tid, HTMLAttributeCollection_iface_tids diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index e72f21f..86ef3a3 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -618,6 +618,7 @@ static const tid_t HTMLElementCollection_iface_tids[] = { }; static dispex_static_data_t HTMLElementCollection_dispex = { + L"HTMLCollection", &HTMLElementColection_dispex_vtbl, DispHTMLElementCollection_tid, HTMLElementCollection_iface_tids diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 5b040c4..3f545bb 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -750,6 +750,7 @@ static const tid_t HTMLEventObj_iface_tids[] = { }; static dispex_static_data_t HTMLEventObj_dispex = { + L"MSEventObj", NULL, DispCEventObj_tid, HTMLEventObj_iface_tids @@ -2135,6 +2136,7 @@ static const tid_t DOMEvent_iface_tids[] = { }; static dispex_static_data_t DOMEvent_dispex = { + L"Event", NULL, DispDOMEvent_tid, DOMEvent_iface_tids @@ -2147,6 +2149,7 @@ static const tid_t DOMUIEvent_iface_tids[] = { }; static dispex_static_data_t DOMUIEvent_dispex = { + L"UIEvent", NULL, DispDOMUIEvent_tid, DOMUIEvent_iface_tids @@ -2160,6 +2163,7 @@ static const tid_t DOMMouseEvent_iface_tids[] = { }; static dispex_static_data_t DOMMouseEvent_dispex = { + L"MouseEvent", NULL, DispDOMMouseEvent_tid, DOMMouseEvent_iface_tids @@ -2173,6 +2177,7 @@ static const tid_t DOMKeyboardEvent_iface_tids[] = { }; static dispex_static_data_t DOMKeyboardEvent_dispex = { + L"KeyboardEvent", NULL, DispDOMKeyboardEvent_tid, DOMKeyboardEvent_iface_tids @@ -2185,6 +2190,7 @@ static const tid_t DOMCustomEvent_iface_tids[] = { }; static dispex_static_data_t DOMCustomEvent_dispex = { + L"CustomEvent", NULL, DispDOMCustomEvent_tid, DOMCustomEvent_iface_tids diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 5d0928e..566612f 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -827,6 +827,7 @@ static const tid_t HTMLFormElement_iface_tids[] = { }; static dispex_static_data_t HTMLFormElement_dispex = { + L"HTMLFormElement", NULL, DispHTMLFormElement_tid, HTMLFormElement_iface_tids, diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 7118ea8..e794284 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -1023,6 +1023,7 @@ static const tid_t HTMLFrameElement_iface_tids[] = { }; static dispex_static_data_t HTMLFrameElement_dispex = { + L"HTMLFrameElement", NULL, DispHTMLFrameElement_tid, HTMLFrameElement_iface_tids, @@ -1603,6 +1604,7 @@ static const tid_t HTMLIFrame_iface_tids[] = { }; static dispex_static_data_t HTMLIFrame_dispex = { + L"HTMLIFrameElement", NULL, DispHTMLIFrame_tid, HTMLIFrame_iface_tids, diff --git a/dlls/mshtml/htmlgeneric.c b/dlls/mshtml/htmlgeneric.c index 639c95e..459fc78 100644 --- a/dlls/mshtml/htmlgeneric.c +++ b/dlls/mshtml/htmlgeneric.c @@ -168,6 +168,7 @@ static const tid_t HTMLGenericElement_iface_tids[] = { }; static dispex_static_data_t HTMLGenericElement_dispex = { + L"HTMLUnknownElement", NULL, DispHTMLGenericElement_tid, HTMLGenericElement_iface_tids, diff --git a/dlls/mshtml/htmlhead.c b/dlls/mshtml/htmlhead.c index 5dbf8d6..1bad06e 100644 --- a/dlls/mshtml/htmlhead.c +++ b/dlls/mshtml/htmlhead.c @@ -169,6 +169,7 @@ static const tid_t HTMLTitleElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLTitleElement_dispex = { + L"HTMLTitleElement", NULL, DispHTMLTitleElement_tid, HTMLTitleElement_iface_tids, @@ -352,6 +353,7 @@ static const tid_t HTMLHtmlElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLHtmlElement_dispex = { + L"HTMLHtmlElement", NULL, DispHTMLHtmlElement_tid, HTMLHtmlElement_iface_tids, @@ -588,6 +590,7 @@ static const tid_t HTMLMetaElement_iface_tids[] = { }; static dispex_static_data_t HTMLMetaElement_dispex = { + L"HTMLMetaElement", NULL, DispHTMLMetaElement_tid, HTMLMetaElement_iface_tids, @@ -751,6 +754,7 @@ static const tid_t HTMLHeadElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLHeadElement_dispex = { + L"HTMLHeadElement", NULL, DispHTMLHeadElement_tid, HTMLHeadElement_iface_tids, diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index f89e8e5..96b8d31 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -730,6 +730,7 @@ static const tid_t HTMLImgElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLImgElement_dispex = { + L"HTMLImageElement", NULL, DispHTMLImg_tid, HTMLImgElement_iface_tids, @@ -974,6 +975,7 @@ static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { }; static dispex_static_data_t HTMLImageElementFactory_dispex = { + L"Function", &HTMLImageElementFactory_dispex_vtbl, IHTMLImageElementFactory_tid, HTMLImageElementFactory_iface_tids diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 1a0a739..e9b53da 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1441,6 +1441,7 @@ static const tid_t HTMLInputElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLInputElement_dispex = { + L"HTMLInputElement", NULL, DispHTMLInputElement_tid, HTMLInputElement_iface_tids, @@ -1637,6 +1638,7 @@ static const tid_t HTMLLabelElement_iface_tids[] = { }; static dispex_static_data_t HTMLLabelElement_dispex = { + L"HTMLLabelElement", NULL, DispHTMLLabelElement_tid, HTMLLabelElement_iface_tids, @@ -1983,6 +1985,7 @@ static const tid_t HTMLButtonElement_iface_tids[] = { }; static dispex_static_data_t HTMLButtonElement_dispex = { + L"HTMLButtonElement", NULL, DispHTMLButtonElement_tid, HTMLButtonElement_iface_tids, diff --git a/dlls/mshtml/htmllink.c b/dlls/mshtml/htmllink.c index ddf67ca..1dd4873 100644 --- a/dlls/mshtml/htmllink.c +++ b/dlls/mshtml/htmllink.c @@ -446,6 +446,7 @@ static const tid_t HTMLLinkElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLLinkElement_dispex = { + L"HTMLLinkElement", NULL, DispHTMLLinkElement_tid, HTMLLinkElement_iface_tids, diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index a85c9a6..85dfc40 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -631,6 +631,7 @@ static const tid_t HTMLLocation_iface_tids[] = { 0 }; static dispex_static_data_t HTMLLocation_dispex = { + L"Object", NULL, DispHTMLLocation_tid, HTMLLocation_iface_tids diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index b5ff02b..996c28c 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -429,6 +429,7 @@ static const tid_t HTMLDOMChildrenCollection_iface_tids[] = { }; static dispex_static_data_t HTMLDOMChildrenCollection_dispex = { + L"NodeList", &HTMLDOMChildrenCollection_dispex_vtbl, DispDOMChildrenCollection_tid, HTMLDOMChildrenCollection_iface_tids, @@ -1476,6 +1477,7 @@ static const tid_t HTMLDOMNode_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMNode_dispex = { + L"Node", NULL, IHTMLDOMNode_tid, HTMLDOMNode_iface_tids, diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index 6702548..9c8af17 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -766,6 +766,7 @@ static const tid_t HTMLObjectElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLObjectElement_dispex = { + L"HTMLObjectElement", NULL, DispHTMLObjectElement_tid, HTMLObjectElement_iface_tids, @@ -1028,6 +1029,7 @@ static const tid_t HTMLEmbedElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLEmbedElement_dispex = { + L"HTMLEmbedElement", NULL, DispHTMLEmbed_tid, HTMLEmbedElement_iface_tids, diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c index 9b7f95e..9f3a0b2 100644 --- a/dlls/mshtml/htmlscript.c +++ b/dlls/mshtml/htmlscript.c @@ -479,6 +479,7 @@ static const tid_t HTMLScriptElement_iface_tids[] = { }; static dispex_static_data_t HTMLScriptElement_dispex = { + L"HTMLScriptElement", NULL, DispHTMLScriptElement_tid, HTMLScriptElement_iface_tids, diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index ad801f8..7869a8e 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -416,6 +416,7 @@ static const tid_t HTMLOptionElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLOptionElement_dispex = { + L"HTMLOptionElement", NULL, DispHTMLOptionElement_tid, HTMLOptionElement_iface_tids, @@ -595,6 +596,7 @@ static const tid_t HTMLOptionElementFactory_iface_tids[] = { }; static dispex_static_data_t HTMLOptionElementFactory_dispex = { + L"Function", NULL, IHTMLOptionElementFactory_tid, HTMLOptionElementFactory_iface_tids, @@ -1281,6 +1283,7 @@ static const tid_t HTMLSelectElement_tids[] = { }; static dispex_static_data_t HTMLSelectElement_dispex = { + L"HTMLSelectElement", NULL, DispHTMLSelectElement_tid, HTMLSelectElement_tids, diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index c389647..9c1f904 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -195,6 +195,7 @@ static const tid_t HTMLStorage_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStorage_dispex = { + L"Storage", NULL, IHTMLStorage_tid, HTMLStorage_iface_tids diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 4ee81ba..7dd7000 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -10006,6 +10006,7 @@ static const tid_t HTMLStyle_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyle_dispex = { + L"MSStyleCSSProperties", &CSSStyle_dispex_vtbl, DispHTMLStyle_tid, HTMLStyle_iface_tids, @@ -10100,6 +10101,7 @@ static const tid_t HTMLW3CComputedStyle_iface_tids[] = { 0 }; static dispex_static_data_t HTMLW3CComputedStyle_dispex = { + L"CSSStyleDeclaration", &CSSStyle_dispex_vtbl, DispHTMLW3CComputedStyle_tid, HTMLW3CComputedStyle_iface_tids, diff --git a/dlls/mshtml/htmlstyleelem.c b/dlls/mshtml/htmlstyleelem.c index d2a4a75..cf57547 100644 --- a/dlls/mshtml/htmlstyleelem.c +++ b/dlls/mshtml/htmlstyleelem.c @@ -462,6 +462,7 @@ static const tid_t HTMLStyleElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleElement_dispex = { + L"HTMLStyleElement", NULL, DispHTMLStyleElement_tid, HTMLStyleElement_iface_tids, diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index b6f1c98..cbc2adf 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -202,6 +202,7 @@ static const tid_t HTMLStyleSheetRule_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheetRule_dispex = { + L"CSSStyleRule", NULL, DispHTMLStyleSheetRule_tid, HTMLStyleSheetRule_iface_tids @@ -376,6 +377,7 @@ static const tid_t HTMLStyleSheetRulesCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheetRulesCollection_dispex = { + L"MSCSSRuleList", NULL, DispHTMLStyleSheetRulesCollection_tid, HTMLStyleSheetRulesCollection_iface_tids @@ -575,6 +577,7 @@ static const tid_t HTMLStyleSheetsCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheetsCollection_dispex = { + L"StyleSheetList", NULL, DispHTMLStyleSheetsCollection_tid, HTMLStyleSheetsCollection_iface_tids @@ -1144,6 +1147,7 @@ static const tid_t HTMLStyleSheet_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheet_dispex = { + L"CSSStyleSheet", NULL, DispHTMLStyleSheet_tid, HTMLStyleSheet_iface_tids, diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 178e9e5..53c9820 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -520,6 +520,7 @@ static const tid_t HTMLTableCell_iface_tids[] = { }; static dispex_static_data_t HTMLTableCell_dispex = { + L"HTMLTableDataCellElement", NULL, DispHTMLTableCell_tid, HTMLTableCell_iface_tids, @@ -964,6 +965,7 @@ static const tid_t HTMLTableRow_iface_tids[] = { }; static dispex_static_data_t HTMLTableRow_dispex = { + L"HTMLTableRowElement", NULL, DispHTMLTableRow_tid, HTMLTableRow_iface_tids, @@ -1996,6 +1998,7 @@ static const tid_t HTMLTable_iface_tids[] = { }; static dispex_static_data_t HTMLTable_dispex = { + L"HTMLTableElement", NULL, DispHTMLTable_tid, HTMLTable_iface_tids, diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index 57f3373..f95b559 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -479,6 +479,7 @@ static const tid_t HTMLTextAreaElement_iface_tids[] = { }; static dispex_static_data_t HTMLTextAreaElement_dispex = { + L"HTMLTextAreaElement", NULL, DispHTMLTextAreaElement_tid, HTMLTextAreaElement_iface_tids, diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index 56a0572..afe5d21 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -358,6 +358,7 @@ static const tid_t HTMLDOMTextNode_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMTextNode_dispex = { + L"Text", NULL, DispHTMLDOMTextNode_tid, HTMLDOMTextNode_iface_tids, diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 870d7e8..2dfa879 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3687,6 +3687,7 @@ static const tid_t HTMLWindow_iface_tids[] = { }; static dispex_static_data_t HTMLWindow_dispex = { + L"Window", &HTMLWindow_event_target_vtbl.dispex_vtbl, DispHTMLWindow2_tid, HTMLWindow_iface_tids, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index c1e7e78..9429a4b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -327,6 +327,7 @@ typedef struct { } dispex_static_data_vtbl_t; typedef struct { + const WCHAR *name; const dispex_static_data_vtbl_t *vtbl; const tid_t disp_tid; const tid_t* const iface_tids; @@ -393,6 +394,7 @@ HRESULT get_class_typeinfo(const CLSID*,ITypeInfo**) DECLSPEC_HIDDEN; const void *dispex_get_vtbl(DispatchEx*) DECLSPEC_HIDDEN; void dispex_info_add_interface(dispex_data_t*,tid_t,const dispex_hook_t*) DECLSPEC_HIDDEN; compat_mode_t dispex_compat_mode(DispatchEx*) DECLSPEC_HIDDEN; +HRESULT dispex_to_string(DispatchEx*,BSTR*) DECLSPEC_HIDDEN; typedef enum { DISPEXPROP_CUSTOM, diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index eff9576..7b41563 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -304,6 +304,7 @@ static const tid_t HTMLDOMImplementation_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMImplementation_dispex = { + L"DOMImplementation", NULL, DispHTMLDOMImplementation_tid, HTMLDOMImplementation_iface_tids @@ -555,6 +556,7 @@ static const tid_t HTMLScreen_iface_tids[] = { 0 }; static dispex_static_data_t HTMLScreen_dispex = { + L"Screen", NULL, DispHTMLScreen_tid, HTMLScreen_iface_tids @@ -718,6 +720,7 @@ static const tid_t OmHistory_iface_tids[] = { 0 }; static dispex_static_data_t OmHistory_dispex = { + L"History", NULL, DispHTMLHistory_tid, OmHistory_iface_tids @@ -874,6 +877,7 @@ static const tid_t HTMLPluginsCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPluginsCollection_dispex = { + L"PluginArray", NULL, DispCPlugins_tid, HTMLPluginsCollection_iface_tids @@ -1018,6 +1022,7 @@ static const tid_t HTMLMimeTypesCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLMimeTypesCollection_dispex = { + L"MimeTypeArray", NULL, IHTMLMimeTypesCollection_tid, HTMLMimeTypesCollection_iface_tids @@ -1310,12 +1315,7 @@ static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String) TRACE("(%p)->(%p)\n", This, String); - if(!String) - return E_INVALIDARG; - - *String = SysAllocString(dispex_compat_mode(&This->dispex) < COMPAT_MODE_IE9 - ? L"[object]" : L"[object Navigator]"); - return *String ? S_OK : E_OUTOFMEMORY; + return dispex_to_string(&This->dispex, String); } static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p) @@ -1469,6 +1469,7 @@ static const tid_t OmNavigator_iface_tids[] = { 0 }; static dispex_static_data_t OmNavigator_dispex = { + L"Navigator", NULL, DispHTMLNavigator_tid, OmNavigator_iface_tids @@ -1849,6 +1850,7 @@ static const tid_t HTMLPerformanceTiming_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPerformanceTiming_dispex = { + L"PerformanceTiming", NULL, IHTMLPerformanceTiming_tid, HTMLPerformanceTiming_iface_tids @@ -1998,6 +2000,7 @@ static const tid_t HTMLPerformanceNavigation_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPerformanceNavigation_dispex = { + L"PerformanceNavigation", NULL, IHTMLPerformanceNavigation_tid, HTMLPerformanceNavigation_iface_tids @@ -2188,6 +2191,7 @@ static const tid_t HTMLPerformance_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPerformance_dispex = { + L"Performance", NULL, IHTMLPerformance_tid, HTMLPerformance_iface_tids @@ -2346,6 +2350,7 @@ static const tid_t HTMLNamespaceCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLNamespaceCollection_dispex = { + L"MSNamespaceInfoCollection", NULL, DispHTMLNamespaceCollection_tid, HTMLNamespaceCollection_iface_tids @@ -2601,6 +2606,7 @@ static const tid_t console_iface_tids[] = { 0 }; static dispex_static_data_t console_dispex = { + L"Console", NULL, IWineMSHTMLConsole_tid, console_iface_tids diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 89f6804..bea5ac6 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1715,6 +1715,7 @@ static const tid_t HTMLTxtRange_iface_tids[] = { 0 }; static dispex_static_data_t HTMLTxtRange_dispex = { + L"TextRange", NULL, IHTMLTxtRange_tid, HTMLTxtRange_iface_tids @@ -2060,6 +2061,7 @@ static const tid_t HTMLDOMRange_iface_tids[] = { }; static dispex_static_data_t HTMLDOMRange_dispex = { + L"Range", NULL, DispHTMLDOMRange_tid, HTMLDOMRange_iface_tids diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index 786c2bd..280fdaa 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -330,6 +330,7 @@ static const tid_t HTMLSelectionObject_iface_tids[] = { 0 }; static dispex_static_data_t HTMLSelectionObject_dispex = { + L"MSSelection", NULL, IHTMLSelectionObject_tid, /* FIXME: We have a test for that, but it doesn't expose IHTMLSelectionObject2 iface. */ HTMLSelectionObject_iface_tids diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index d7d8ce5..56e18d0 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -895,6 +895,7 @@ static const tid_t HTMLXMLHttpRequest_iface_tids[] = { 0 }; static dispex_static_data_t HTMLXMLHttpRequest_dispex = { + L"XMLHttpRequest", &HTMLXMLHttpRequest_event_target_vtbl.dispex_vtbl, DispHTMLXMLHttpRequest_tid, HTMLXMLHttpRequest_iface_tids, @@ -1066,6 +1067,7 @@ static const tid_t HTMLXMLHttpRequestFactory_iface_tids[] = { 0 }; static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { + L"Function", &HTMLXMLHttpRequestFactory_dispex_vtbl, IHTMLXMLHttpRequestFactory_tid, HTMLXMLHttpRequestFactory_iface_tids -- 2.31.1
[View Less]
3
34
0
0
[PATCH v4] wininet: Allow up to 4K for response headers.
by Hans Leidekker
07 Oct '21
07 Oct '21
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> v4: Use a static buffer in the test. Fix patch subject. LevelHead includes a Header value that is > 3K in length which causes a crash after linking your account. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47505
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/wininet/internet.h | 2 +- dlls/wininet/tests/http.c | 47
…
[View More]
+++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index e9d68e2c2d9..b361c0d1b4d 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -462,7 +462,7 @@ void free_authorization_cache(void) DECLSPEC_HIDDEN; void init_winsock(void) DECLSPEC_HIDDEN; -#define MAX_REPLY_LEN 0x5B4 +#define MAX_REPLY_LEN 0x1000 /* Used for debugging - maybe need to be shared in the Wine debugging code ? */ typedef struct diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index ae95b4399e0..d1d7e678853 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -2410,6 +2410,17 @@ static DWORD CALLBACK server_thread(LPVOID param) static const char headmsg[] = "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n0123456789"; send(c, headmsg, sizeof(headmsg)-1, 0); } + if (strstr(buffer, "GET /test_large_header")) + { + static const char allokmsg[] = "HTTP/1.1 200 OK\r\nServer: winetest\r\n"; + char header[4000 + sizeof("wine-header: ") - 1]; + + memset(header, 'A', sizeof(header)); + memcpy(header, "wine-header: ", sizeof("wine-header: ") - 1); + send(c, allokmsg, sizeof(allokmsg) - 1, 0); + send(c, header, sizeof(header), 0); + send(c, "\r\n\r\n", 4, 0); + } if (strstr(buffer, "GET /test_conn_close")) { static const char conn_close_response[] = "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\nsome content"; @@ -3616,6 +3627,41 @@ static void test_not_modified(int port) InternetCloseHandle(ses); } +static void test_large_header(int port) +{ + HINTERNET ses, con, req; + BOOL ret; + DWORD size, index, error; + char buffer[13]; + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL, "InternetOpen failed\n"); + + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed\n"); + + req = HttpOpenRequestA(con, NULL, "/test_large_header", NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + SetLastError(0xdeadbeef); + ret = HttpSendRequestW(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); + test_status_code(req, 200); + + index = 0; + size = sizeof(buffer); + strcpy(buffer, "wine-header"); + ret = HttpQueryInfoA(req, HTTP_QUERY_CUSTOM, buffer, &size, &index); + error = GetLastError(); + ok(!ret, "HttpQueryInfoA succeeded\n"); + ok(error == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", error); + ok(size == 4001, "got %u\n", size); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); +} + static void test_conn_close(int port) { HINTERNET session, connection, req; @@ -6190,6 +6236,7 @@ static void test_http_connection(void) test_options(si.port); test_no_content(si.port); test_not_modified(si.port); + test_large_header(si.port); test_conn_close(si.port); test_no_cache(si.port); test_cache_read_gzipped(si.port); -- 2.30.2
[View Less]
2
1
0
0
[PATCH v2 1/2] xinput1_3: Destroy controllers when ReadFile fails and I/O is not pending.
by Rémi Bernon
07 Oct '21
07 Oct '21
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- v2: Don't move the xinput controller list initial enumeration. I changed that after adding the start event, not completely sure why, but it actually introduces a race condition. Supersedes: 216570-216571 dlls/xinput1_3/main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 81d11e5d38f..f3ad7d1d360 100644 --- a/dlls/xinput1_3/main.c +++ b/
…
[View More]
dlls/xinput1_3/main.c @@ -331,9 +331,14 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO return ERROR_SUCCESS; } +static void controller_destroy(struct xinput_controller *controller); + static void controller_enable(struct xinput_controller *controller) { + ULONG report_len = controller->hid.caps.InputReportByteLength; + char *report_buf = controller->hid.input_report_buf; XINPUT_VIBRATION state = controller->vibration; + BOOL ret; if (controller->enabled) return; if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); @@ -341,8 +346,9 @@ static void controller_enable(struct xinput_controller *controller) memset(&controller->hid.read_ovl, 0, sizeof(controller->hid.read_ovl)); controller->hid.read_ovl.hEvent = controller->hid.read_event; - ReadFile(controller->device, controller->hid.input_report_buf, controller->hid.caps.InputReportByteLength, NULL, &controller->hid.read_ovl); - SetEvent(update_event); + ret = ReadFile(controller->device, report_buf, report_len, NULL, &controller->hid.read_ovl); + if (!ret && GetLastError() != ERROR_IO_PENDING) controller_destroy(controller); + else SetEvent(update_event); } static void controller_disable(struct xinput_controller *controller) @@ -554,6 +560,7 @@ static void read_controller_state(struct xinput_controller *controller) NTSTATUS status; USAGE buttons[11]; ULONG i, button_length, value; + BOOL ret; if (!GetOverlappedResult(controller->device, &controller->hid.read_ovl, &read_len, TRUE)) { @@ -635,7 +642,8 @@ static void read_controller_state(struct xinput_controller *controller) controller->state = state; memset(&controller->hid.read_ovl, 0, sizeof(controller->hid.read_ovl)); controller->hid.read_ovl.hEvent = controller->hid.read_event; - ReadFile(controller->device, controller->hid.input_report_buf, controller->hid.caps.InputReportByteLength, NULL, &controller->hid.read_ovl); + ret = ReadFile(controller->device, report_buf, report_len, NULL, &controller->hid.read_ovl); + if (!ret && GetLastError() != ERROR_IO_PENDING) controller_destroy(controller); } LeaveCriticalSection(&controller->crit); } -- 2.33.0
[View Less]
2
3
0
0
[PATCH 1/2] xinput1_3: Destroy controllers when ReadFile fails and I/O is not pending.
by Rémi Bernon
07 Oct '21
07 Oct '21
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- These should help with some inconsistent hotplugging behavior in xinput, PATCH 2 is adapted from a Proton patch. dlls/xinput1_3/main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 81d11e5d38f..f3ad7d1d360 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -331,9 +331,14 @@ static DWORD HID_set_state(struct xinput_controller
…
[View More]
*controller, XINPUT_VIBRATIO return ERROR_SUCCESS; } +static void controller_destroy(struct xinput_controller *controller); + static void controller_enable(struct xinput_controller *controller) { + ULONG report_len = controller->hid.caps.InputReportByteLength; + char *report_buf = controller->hid.input_report_buf; XINPUT_VIBRATION state = controller->vibration; + BOOL ret; if (controller->enabled) return; if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); @@ -341,8 +346,9 @@ static void controller_enable(struct xinput_controller *controller) memset(&controller->hid.read_ovl, 0, sizeof(controller->hid.read_ovl)); controller->hid.read_ovl.hEvent = controller->hid.read_event; - ReadFile(controller->device, controller->hid.input_report_buf, controller->hid.caps.InputReportByteLength, NULL, &controller->hid.read_ovl); - SetEvent(update_event); + ret = ReadFile(controller->device, report_buf, report_len, NULL, &controller->hid.read_ovl); + if (!ret && GetLastError() != ERROR_IO_PENDING) controller_destroy(controller); + else SetEvent(update_event); } static void controller_disable(struct xinput_controller *controller) @@ -554,6 +560,7 @@ static void read_controller_state(struct xinput_controller *controller) NTSTATUS status; USAGE buttons[11]; ULONG i, button_length, value; + BOOL ret; if (!GetOverlappedResult(controller->device, &controller->hid.read_ovl, &read_len, TRUE)) { @@ -635,7 +642,8 @@ static void read_controller_state(struct xinput_controller *controller) controller->state = state; memset(&controller->hid.read_ovl, 0, sizeof(controller->hid.read_ovl)); controller->hid.read_ovl.hEvent = controller->hid.read_event; - ReadFile(controller->device, controller->hid.input_report_buf, controller->hid.caps.InputReportByteLength, NULL, &controller->hid.read_ovl); + ret = ReadFile(controller->device, report_buf, report_len, NULL, &controller->hid.read_ovl); + if (!ret && GetLastError() != ERROR_IO_PENDING) controller_destroy(controller); } LeaveCriticalSection(&controller->crit); } -- 2.33.0
[View Less]
2
2
0
0
[PATCH v2 1/2] dinput: Remove "stub!" from HID joystick IDirectInputDevice8_EnumCreatedEffectObjects.
by Rémi Bernon
07 Oct '21
07 Oct '21
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- v2: Resending the first two patches, to remove some leftover code from PATCH 2, other patches should still apply cleanly on top. Supersedes: 216557-216558 dlls/dinput/joystick_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2ef01ac6ace..d2aa352b6e2 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1195,7 +1195,7 @@
…
[View More]
static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8 struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick_effect *effect, *next; - FIXME( "iface %p, callback %p, context %p, flags %#x stub!\n", iface, callback, context, flags ); + TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); if (!callback) return DIERR_INVALIDPARAM; if (flags) return DIERR_INVALIDPARAM; -- 2.33.0
[View Less]
1
1
0
0
[PATCH 01/11] dinput: Remove "stub!" from HID joystick IDirectInputDevice8_EnumCreatedEffectObjects.
by Rémi Bernon
07 Oct '21
07 Oct '21
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput/joystick_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2ef01ac6ace..d2aa352b6e2 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1195,7 +1195,7 @@ static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8 struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface );
…
[View More]
struct hid_joystick_effect *effect, *next; - FIXME( "iface %p, callback %p, context %p, flags %#x stub!\n", iface, callback, context, flags ); + TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); if (!callback) return DIERR_INVALIDPARAM; if (flags) return DIERR_INVALIDPARAM; -- 2.33.0
[View Less]
1
10
0
0
[PATCH] configure: No longer disable iphlpapi in a Windows build.
by Huw Davies
07 Oct '21
07 Oct '21
Signed-off-by: Huw Davies <huw(a)codeweavers.com> --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4497e98e7bb..39fb1eabc4b 100644 --- a/configure.ac +++ b/configure.ac @@ -723,7 +723,6 @@ case $host_os in [LDDLLFLAGS="-Wl,--disable-stdcall-fixup"]) ;; esac dnl Disable modules that can't be used on Windows - enable_iphlpapi=${enable_iphlpapi:-no} enable_mountmgr_sys=${
…
[View More]
enable_mountmgr_sys:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no} -- 2.23.0
[View Less]
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
78
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
Results per page:
10
25
50
100
200