Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- 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
December 2019
- 73 participants
- 1394 messages
[PATCH vkd3d v2 5/5] vkd3d: Add cubic null resource.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index cd181bc..62e8c44 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2589,33 +2589,51 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
case D3D12_SRV_DIMENSION_TEXTURE1D:
vk_image = null_resources->vk_1d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE1DARRAY:
vk_image = null_resources->vk_1d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2D:
vk_image = null_resources->vk_2d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2DARRAY:
vk_image = null_resources->vk_2d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2DMS:
vk_image = null_resources->vk_2dms_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY:
vk_image = null_resources->vk_2dms_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE3D:
vk_image = null_resources->vk_3d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D;
+ vkd3d_desc.layer_count = 1;
+ break;
+
+ case D3D12_SRV_DIMENSION_TEXTURECUBE:
+ vk_image = null_resources->vk_2d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_CUBE;
+ vkd3d_desc.layer_count = 6;
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY:
+ vk_image = null_resources->vk_2d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;
+ vkd3d_desc.layer_count = 6;
break;
default:
@@ -2629,7 +2647,6 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
vkd3d_desc.miplevel_idx = 0;
vkd3d_desc.miplevel_count = 1;
vkd3d_desc.layer_idx = 0;
- vkd3d_desc.layer_count = 1;
vkd3d_desc.components.r = VK_COMPONENT_SWIZZLE_ZERO;
vkd3d_desc.components.g = VK_COMPONENT_SWIZZLE_ZERO;
vkd3d_desc.components.b = VK_COMPONENT_SWIZZLE_ZERO;
@@ -4134,7 +4151,7 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
goto fail;
/* 2D SRV */
- if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, false,
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 6, false,
&null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
goto fail;
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 4/5] vkd3d: Add 3D null resources.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 36 ++++++++++++++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 6 ++++++
2 files changed, 42 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 3ca29a2..cd181bc 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2613,6 +2613,11 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
break;
+ case D3D12_SRV_DIMENSION_TEXTURE3D:
+ vk_image = null_resources->vk_3d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D;
+ break;
+
default:
FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
return;
@@ -2829,6 +2834,11 @@ static void vkd3d_create_null_uav(struct d3d12_desc *descriptor,
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
break;
+ case D3D12_UAV_DIMENSION_TEXTURE3D:
+ vk_image = null_resources->vk_3d_storage_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D;
+ break;
+
default:
FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
return;
@@ -3950,6 +3960,10 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2dms_image,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+ /* transition 3D SRV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_3d_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+
if ((vr = VK_CALL(vkEndCommandBuffer(vk_command_buffer))) < 0)
{
WARN("Failed to end command buffer, vr %d.\n", vr);
@@ -4134,6 +4148,16 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
&null_resources->vk_2d_storage_image, &null_resources->vk_2d_storage_image_memory)))
goto fail;
+ /* 3D SRV */
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE3D, 1, false,
+ &null_resources->vk_3d_image, &null_resources->vk_3d_image_memory)))
+ goto fail;
+
+ /* 3D UAV */
+ if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE3D,
+ &null_resources->vk_3d_storage_image, &null_resources->vk_3d_storage_image_memory)))
+ goto fail;
+
/* set Vulkan object names */
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_buffer,
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, "NULL buffer");
@@ -4157,6 +4181,12 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 2DMS SRV memory");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_storage_image,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D UAV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_3d_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 3D SRV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_3d_image_memory,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 3D SRV memory");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_3d_storage_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 3D UAV image");
if (!use_sparse_resources)
{
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_storage_buffer_memory,
@@ -4199,5 +4229,11 @@ void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources,
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_storage_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_storage_image_memory, NULL));
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_3d_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_3d_image_memory, NULL));
+
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_3d_storage_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_3d_storage_image_memory, NULL));
+
memset(null_resources, 0, sizeof(*null_resources));
}
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 58a9ce0..5b44a49 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1071,6 +1071,12 @@ struct vkd3d_null_resources
VkImage vk_2dms_image;
VkDeviceMemory vk_2dms_image_memory;
+
+ VkImage vk_3d_image;
+ VkDeviceMemory vk_3d_image_memory;
+
+ VkImage vk_3d_storage_image;
+ VkDeviceMemory vk_3d_storage_image_memory;
};
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 3/5] vkd3d: Add 2D multisampled null resources.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 25 +++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 3 +++
2 files changed, 28 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 271b881..3ca29a2 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2604,6 +2604,15 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
break;
+ case D3D12_SRV_DIMENSION_TEXTURE2DMS:
+ vk_image = null_resources->vk_2dms_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY:
+ vk_image = null_resources->vk_2dms_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ break;
+
default:
FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
return;
@@ -3937,6 +3946,10 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_image,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+ /* transition 2DMS SRV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2dms_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+
if ((vr = VK_CALL(vkEndCommandBuffer(vk_command_buffer))) < 0)
{
WARN("Failed to end command buffer, vr %d.\n", vr);
@@ -4111,6 +4124,11 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
&null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
goto fail;
+ /* 2DMS SRV */
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, true,
+ &null_resources->vk_2dms_image, &null_resources->vk_2dms_image_memory)))
+ goto fail;
+
/* 2D UAV */
if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
&null_resources->vk_2d_storage_image, &null_resources->vk_2d_storage_image_memory)))
@@ -4133,6 +4151,10 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D SRV image");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_image_memory,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 2D SRV memory");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2dms_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2DMS SRV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2dms_image_memory,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 2DMS SRV memory");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_storage_image,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D UAV image");
if (!use_sparse_resources)
@@ -4171,6 +4193,9 @@ void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources,
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_image_memory, NULL));
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2dms_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2dms_image_memory, NULL));
+
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_storage_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_storage_image_memory, NULL));
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index c23667d..58a9ce0 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1068,6 +1068,9 @@ struct vkd3d_null_resources
VkImage vk_2d_storage_image;
VkDeviceMemory vk_2d_storage_image_memory;
+
+ VkImage vk_2dms_image;
+ VkDeviceMemory vk_2dms_image_memory;
};
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 2/5] vkd3d: Add 1D null resources.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 51 ++++++++++++++++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 6 +++++
2 files changed, 57 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index ab4df8e..271b881 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2586,6 +2586,15 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
}
return;
+ case D3D12_SRV_DIMENSION_TEXTURE1D:
+ vk_image = null_resources->vk_1d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D;
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURE1DARRAY:
+ vk_image = null_resources->vk_1d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ break;
+
case D3D12_SRV_DIMENSION_TEXTURE2D:
vk_image = null_resources->vk_2d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
@@ -2793,6 +2802,15 @@ static void vkd3d_create_null_uav(struct d3d12_desc *descriptor,
}
return;
+ case D3D12_UAV_DIMENSION_TEXTURE1D:
+ vk_image = null_resources->vk_1d_storage_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D;
+ break;
+ case D3D12_UAV_DIMENSION_TEXTURE1DARRAY:
+ vk_image = null_resources->vk_1d_storage_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ break;
+
case D3D12_UAV_DIMENSION_TEXTURE2D:
vk_image = null_resources->vk_2d_storage_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
@@ -3890,6 +3908,10 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
if (use_sparse_resources)
{
+ /* transition 1D UAV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_1d_storage_image,
+ VK_IMAGE_LAYOUT_GENERAL, vk_procs);
+
/* transition 2D UAV image */
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_storage_image,
VK_IMAGE_LAYOUT_GENERAL, vk_procs);
@@ -3900,10 +3922,17 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
VK_CALL(vkCmdFillBuffer(vk_command_buffer,
null_resource->vk_storage_buffer, 0, VK_WHOLE_SIZE, 0x00000000));
+ /* clear 1D UAV image */
+ vkd3d_clear_null_ua_image(vk_command_buffer, null_resource->vk_1d_storage_image, vk_procs);
+
/* clear 2D UAV image */
vkd3d_clear_null_ua_image(vk_command_buffer, null_resource->vk_2d_storage_image, vk_procs);
}
+ /* transition 1D SRV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_1d_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+
/* transition 2D SRV image */
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_image,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
@@ -4067,6 +4096,16 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
&heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_storage_buffer_memory, NULL, NULL)))
goto fail;
+ /* 1D SRV */
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE1D, 1, false,
+ &null_resources->vk_1d_image, &null_resources->vk_1d_image_memory)))
+ goto fail;
+
+ /* 1D UAV */
+ if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE1D,
+ &null_resources->vk_1d_storage_image, &null_resources->vk_1d_storage_image_memory)))
+ goto fail;
+
/* 2D SRV */
if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, false,
&null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
@@ -4084,6 +4123,12 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL memory");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_storage_buffer,
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, "NULL UAV buffer");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_1d_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 1D SRV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_1d_image_memory,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 1D SRV memory");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_1d_storage_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 1D UAV image");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_image,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D SRV image");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_image_memory,
@@ -4117,6 +4162,12 @@ void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources,
VK_CALL(vkDestroyBuffer(device->vk_device, null_resources->vk_storage_buffer, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_storage_buffer_memory, NULL));
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_1d_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_1d_image_memory, NULL));
+
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_1d_storage_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_1d_storage_image_memory, NULL));
+
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_image_memory, NULL));
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 0c031d2..c23667d 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1057,6 +1057,12 @@ struct vkd3d_null_resources
VkBuffer vk_storage_buffer;
VkDeviceMemory vk_storage_buffer_memory;
+ VkImage vk_1d_image;
+ VkDeviceMemory vk_1d_image_memory;
+
+ VkImage vk_1d_storage_image;
+ VkDeviceMemory vk_1d_storage_image_memory;
+
VkImage vk_2d_image;
VkDeviceMemory vk_2d_image_memory;
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 1/5] vkd3d: Use helper functions for null resource initialisation.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
v2: Don't use sparse binding for the 1D texture.
---
libs/vkd3d/resource.c | 240 ++++++++++++++++++++++++------------------
1 file changed, 139 insertions(+), 101 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index f40d986..ab4df8e 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -3770,12 +3770,72 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
return S_OK;
}
+static void vkd3d_transition_null_image(VkCommandBuffer vk_command_buffer, VkImage vk_image,
+ VkImageLayout new_layout, const struct vkd3d_vk_device_procs *vk_procs)
+{
+ VkImageMemoryBarrier barrier;
+
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.pNext = NULL;
+ barrier.srcAccessMask = 0;
+ barrier.dstAccessMask = 0;
+ barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ barrier.newLayout = new_layout;
+ barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.image = vk_image;
+ barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ barrier.subresourceRange.baseMipLevel = 0;
+ barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
+ barrier.subresourceRange.baseArrayLayer = 0;
+ barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+
+ VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0,
+ 0, NULL, 0, NULL, 1, &barrier));
+}
+
+static void vkd3d_clear_null_ua_image(VkCommandBuffer vk_command_buffer, VkImage vk_image,
+ const struct vkd3d_vk_device_procs *vk_procs)
+{
+ static const VkClearColorValue clear_color = {{0}};
+ VkImageSubresourceRange range;
+ VkImageMemoryBarrier barrier;
+
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.pNext = NULL;
+ barrier.srcAccessMask = 0;
+ barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
+ barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
+ barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.image = vk_image;
+ barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ barrier.subresourceRange.baseMipLevel = 0;
+ barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
+ barrier.subresourceRange.baseArrayLayer = 0;
+ barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+
+ VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
+ 0, NULL, 0, NULL, 1, &barrier));
+
+ range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ range.baseMipLevel = 0;
+ range.levelCount = 1;
+ range.baseArrayLayer = 0;
+ range.layerCount = 1;
+
+ VK_CALL(vkCmdClearColorImage(vk_command_buffer, vk_image,
+ VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range));
+}
+
static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_resource,
struct d3d12_device *device)
{
const bool use_sparse_resources = device->vk_info.sparse_properties.residencyNonResidentStrict;
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
- static const VkClearColorValue clear_color = {{0}};
VkCommandBufferAllocateInfo command_buffer_info;
VkCommandPool vk_command_pool = VK_NULL_HANDLE;
VkCommandPoolCreateInfo command_pool_info;
@@ -3783,8 +3843,6 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
VkCommandBufferBeginInfo begin_info;
VkCommandBuffer vk_command_buffer;
VkFence vk_fence = VK_NULL_HANDLE;
- VkImageSubresourceRange range;
- VkImageMemoryBarrier barrier;
VkFenceCreateInfo fence_info;
struct vkd3d_queue *queue;
VkSubmitInfo submit_info;
@@ -3833,24 +3891,8 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
if (use_sparse_resources)
{
/* transition 2D UAV image */
- barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = 0;
- barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
- barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.image = null_resource->vk_2d_storage_image;
- barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- barrier.subresourceRange.baseMipLevel = 0;
- barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
- barrier.subresourceRange.baseArrayLayer = 0;
- barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
-
- VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0,
- 0, NULL, 0, NULL, 1, &barrier));
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_storage_image,
+ VK_IMAGE_LAYOUT_GENERAL, vk_procs);
}
else
{
@@ -3859,54 +3901,12 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
null_resource->vk_storage_buffer, 0, VK_WHOLE_SIZE, 0x00000000));
/* clear 2D UAV image */
- barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
- barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
- barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.image = null_resource->vk_2d_storage_image;
- barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- barrier.subresourceRange.baseMipLevel = 0;
- barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
- barrier.subresourceRange.baseArrayLayer = 0;
- barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
-
- VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
- 0, NULL, 0, NULL, 1, &barrier));
-
- range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- range.baseMipLevel = 0;
- range.levelCount = 1;
- range.baseArrayLayer = 0;
- range.layerCount = 1;
-
- VK_CALL(vkCmdClearColorImage(vk_command_buffer,
- null_resource->vk_2d_storage_image, VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range));
+ vkd3d_clear_null_ua_image(vk_command_buffer, null_resource->vk_2d_storage_image, vk_procs);
}
/* transition 2D SRV image */
- barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = 0;
- barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
- barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.image = null_resource->vk_2d_image;
- barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- barrier.subresourceRange.baseMipLevel = 0;
- barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
- barrier.subresourceRange.baseArrayLayer = 0;
- barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
-
- VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0,
- 0, NULL, 0, NULL, 1, &barrier));
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
if ((vr = VK_CALL(vkEndCommandBuffer(vk_command_buffer))) < 0)
{
@@ -3956,6 +3956,75 @@ done:
return hresult_from_vk_result(vr);
}
+static HRESULT vkd3d_create_null_sr_texture(struct d3d12_device *device, D3D12_RESOURCE_DIMENSION dimension,
+ unsigned int array_size, bool is_multisampled, VkImage *vk_image, VkDeviceMemory *vk_memory)
+{
+ D3D12_HEAP_PROPERTIES heap_properties;
+ D3D12_RESOURCE_DESC resource_desc;
+ HRESULT hr;
+
+ memset(&heap_properties, 0, sizeof(heap_properties));
+ heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT;
+
+ resource_desc.Dimension = dimension;
+ resource_desc.Alignment = 0;
+ resource_desc.Width = 1;
+ resource_desc.Height = 1;
+ resource_desc.DepthOrArraySize = array_size;
+ resource_desc.MipLevels = 1;
+ resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
+ resource_desc.SampleDesc.Count = is_multisampled ? 4 : 1;
+ resource_desc.SampleDesc.Quality = 0;
+ resource_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ resource_desc.Flags = is_multisampled ? D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET : D3D12_RESOURCE_FLAG_NONE;
+
+ if (FAILED(hr = vkd3d_create_image(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, NULL, vk_image)))
+ return hr;
+ if (FAILED(hr = vkd3d_allocate_image_memory(device, *vk_image,
+ &heap_properties, D3D12_HEAP_FLAG_NONE, vk_memory, NULL, NULL)))
+ return hr;
+
+ return S_OK;
+}
+
+static HRESULT vkd3d_create_null_ua_texture(struct d3d12_device *device, D3D12_RESOURCE_DIMENSION dimension,
+ VkImage *vk_image, VkDeviceMemory *vk_memory)
+{
+ bool use_sparse_resources;
+ D3D12_HEAP_PROPERTIES heap_properties;
+ D3D12_RESOURCE_DESC resource_desc;
+ HRESULT hr;
+
+ use_sparse_resources = device->vk_info.sparse_properties.residencyNonResidentStrict
+ && dimension != D3D12_RESOURCE_DIMENSION_TEXTURE1D;
+
+ memset(&heap_properties, 0, sizeof(heap_properties));
+ heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT;
+
+ resource_desc.Dimension = dimension;
+ resource_desc.Alignment = 0;
+ resource_desc.Width = 1;
+ resource_desc.Height = 1;
+ resource_desc.DepthOrArraySize = 1;
+ resource_desc.MipLevels = 1;
+ resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
+ resource_desc.SampleDesc.Count = 1;
+ resource_desc.SampleDesc.Quality = 0;
+ resource_desc.Layout = use_sparse_resources
+ ? D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE : D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
+
+ if (FAILED(hr = vkd3d_create_image(device, use_sparse_resources ? NULL : &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, NULL, vk_image)))
+ return hr;
+ if (!use_sparse_resources && FAILED(hr = vkd3d_allocate_image_memory(device, *vk_image,
+ &heap_properties, D3D12_HEAP_FLAG_NONE, vk_memory, NULL, NULL)))
+ return hr;
+
+ return S_OK;
+}
+
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
struct d3d12_device *device)
{
@@ -4002,44 +4068,13 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
goto fail;
/* 2D SRV */
- resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
- resource_desc.Alignment = 0;
- resource_desc.Width = 1;
- resource_desc.Height = 1;
- resource_desc.DepthOrArraySize = 1;
- resource_desc.MipLevels = 1;
- resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
- resource_desc.SampleDesc.Count = 1;
- resource_desc.SampleDesc.Quality = 0;
- resource_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
- resource_desc.Flags = D3D12_RESOURCE_FLAG_NONE;
-
- if (FAILED(hr = vkd3d_create_image(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
- &resource_desc, NULL, &null_resources->vk_2d_image)))
- goto fail;
- if (FAILED(hr = vkd3d_allocate_image_memory(device, null_resources->vk_2d_image,
- &heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_2d_image_memory, NULL, NULL)))
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, false,
+ &null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
goto fail;
/* 2D UAV */
- resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
- resource_desc.Alignment = 0;
- resource_desc.Width = 1;
- resource_desc.Height = 1;
- resource_desc.DepthOrArraySize = 1;
- resource_desc.MipLevels = 1;
- resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
- resource_desc.SampleDesc.Count = 1;
- resource_desc.SampleDesc.Quality = 0;
- resource_desc.Layout = use_sparse_resources
- ? D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE : D3D12_TEXTURE_LAYOUT_UNKNOWN;
- resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
-
- if (FAILED(hr = vkd3d_create_image(device, use_sparse_resources ? NULL : &heap_properties, D3D12_HEAP_FLAG_NONE,
- &resource_desc, NULL, &null_resources->vk_2d_storage_image)))
- goto fail;
- if (!use_sparse_resources && FAILED(hr = vkd3d_allocate_image_memory(device, null_resources->vk_2d_storage_image,
- &heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_2d_storage_image_memory, NULL, NULL)))
+ if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
+ &null_resources->vk_2d_storage_image, &null_resources->vk_2d_storage_image_memory)))
goto fail;
/* set Vulkan object names */
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 0/5] vkd3d: Add more null resources.
by Conor McCarthy
An attempt to create a null resource view of an unsupported type leaves
the descriptor uninitialised without having any means of indicating
that an error occurred. Hitman 2 uses all of these view types.
Conor McCarthy (5):
vkd3d: Use helper functions for null resource initialisation.
vkd3d: Add 1D null resources.
vkd3d: Add 2D multisampled null resources.
vkd3d: Add 3D null resources.
vkd3d: Add cubic null resource.
libs/vkd3d/resource.c | 363 +++++++++++++++++++++++++++----------
libs/vkd3d/vkd3d_private.h | 15 ++
2 files changed, 280 insertions(+), 98 deletions(-)
--
2.24.0
Dec. 12, 2019
Re: [PATCH 8/8] strmbase: Get rid of the "vtbl" parameter to strmbase_sink_init().
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61993
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
error: patch failed: dlls/qcap/avico.c:272
error: patch failed: dlls/qcap/avimux.c:1500
error: patch failed: dlls/qedit/samplegrabber.c:473
error: patch failed: dlls/winegstreamer/gstdemux.c:1502
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
error: patch failed: dlls/qcap/avico.c:272
error: patch failed: dlls/qcap/avimux.c:1500
error: patch failed: dlls/qedit/samplegrabber.c:473
error: patch failed: dlls/winegstreamer/gstdemux.c:1502
Task: Patch failed to apply
Dec. 12, 2019
Re: [PATCH 7/8] wineqtdecoder: Use base sink streaming methods.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61992
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
Dec. 12, 2019
Re: [PATCH 6/8] winegstreamer: Use base sink streaming methods.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61991
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
Dec. 12, 2019
[PATCH 8/8] strmbase: Get rid of the "vtbl" parameter to strmbase_sink_init().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/avico.c | 24 +-------
dlls/qcap/avimux.c | 23 +-------
dlls/qcap/smartteefilter.c | 23 +-------
dlls/qedit/samplegrabber.c | 24 +-------
dlls/strmbase/pin.c | 101 +++++++++++++++++++-------------
dlls/strmbase/renderer.c | 25 +-------
dlls/strmbase/transform.c | 27 +--------
dlls/winegstreamer/gstdemux.c | 34 ++---------
dlls/wineqtdecoder/qtsplitter.c | 25 +-------
include/wine/strmbase.h | 25 +-------
10 files changed, 73 insertions(+), 258 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index ecda162be86..53b8526f449 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -272,27 +272,6 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
AVICompressorPropertyBag_Save
};
-static const IPinVtbl AVICompressorInputPinVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{
AVICompressor *This = impl_from_strmbase_pin(base);
@@ -517,8 +496,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
- strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl,
- &compressor->filter, sink_name, &sink_ops, NULL);
+ strmbase_sink_init(&compressor->sink, &compressor->filter, sink_name, &sink_ops, NULL);
strmbase_source_init(&compressor->source, &compressor->filter, source_name, &source_ops);
*phr = S_OK;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index c17d91322bf..e402479fb17 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1500,27 +1500,6 @@ static inline AviMux* impl_from_in_IPin(IPin *iface)
return impl_from_strmbase_filter(pin->filter);
}
-static const IPinVtbl AviMuxIn_PinVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BasePinImpl_NewSegment
-};
-
static inline AviMuxIn* AviMuxIn_from_IAMStreamControl(IAMStreamControl *iface)
{
return CONTAINING_RECORD(iface, AviMuxIn, IAMStreamControl_iface);
@@ -1825,7 +1804,7 @@ static HRESULT create_input_pin(AviMux *avimux)
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- strmbase_sink_init(&object->pin, &AviMuxIn_PinVtbl, &avimux->filter, name, &sink_ops, NULL);
+ strmbase_sink_init(&object->pin, &avimux->filter, name, &sink_ops, NULL);
object->pin.IMemInputPin_iface.lpVtbl = &AviMuxIn_MemInputPinVtbl;
object->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl;
object->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl;
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c
index e1fcea55f91..5339cb5134f 100644
--- a/dlls/qcap/smartteefilter.c
+++ b/dlls/qcap/smartteefilter.c
@@ -81,27 +81,6 @@ static const struct strmbase_filter_ops filter_ops =
.filter_destroy = smart_tee_destroy,
};
-static const IPinVtbl SmartTeeFilterInputVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{
SmartTeeFilter *This = impl_from_strmbase_pin(base);
@@ -358,7 +337,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
memset(object, 0, sizeof(*object));
strmbase_filter_init(&object->filter, outer, &CLSID_SmartTee, &filter_ops);
- strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, inputW, &sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, inputW, &sink_ops, NULL);
hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
&IID_IMemAllocator, (void **)&object->sink.pAllocator);
if (FAILED(hr))
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c
index 91b8d9dce64..bbd43e79bfd 100644
--- a/dlls/qedit/samplegrabber.c
+++ b/dlls/qedit/samplegrabber.c
@@ -473,28 +473,6 @@ static const IMemInputPinVtbl IMemInputPin_VTable =
SampleGrabber_IMemInputPin_ReceiveCanBlock,
};
-static const IPinVtbl sink_vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static inline SG_Impl *impl_from_sink_pin(struct strmbase_pin *iface)
{
return CONTAINING_RECORD(iface, SG_Impl, sink.pin);
@@ -663,7 +641,7 @@ HRESULT SampleGrabber_create(IUnknown *outer, void **out)
obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable;
obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable;
- strmbase_sink_init(&obj->sink, &sink_vtbl, &obj->filter, L"In", &sink_ops, NULL);
+ strmbase_sink_init(&obj->sink, &obj->filter, L"In", &sink_ops, NULL);
strmbase_source_init(&obj->source, &obj->filter, L"Out", &source_ops);
obj->mtype.majortype = GUID_NULL;
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index f36e147b849..42d86eae170 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -82,7 +82,7 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind
return VFW_S_NO_MORE_ITEMS;
}
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
+static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
HRESULT hr;
@@ -107,19 +107,19 @@ HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
return S_OK;
}
-ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
+static ULONG WINAPI pin_AddRef(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_AddRef(&pin->filter->IBaseFilter_iface);
}
-ULONG WINAPI BasePinImpl_Release(IPin *iface)
+static ULONG WINAPI pin_Release(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_Release(&pin->filter->IBaseFilter_iface);
}
-HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
+static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin)
{
struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr;
@@ -145,7 +145,7 @@ HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
return hr;
}
-HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
{
struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr;
@@ -171,7 +171,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt
return hr;
}
-HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
+static HRESULT WINAPI pin_QueryPinInfo(IPin *iface, PIN_INFO *info)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -184,7 +184,7 @@ HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
+static HRESULT WINAPI pin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -195,7 +195,7 @@ HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
+static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -209,7 +209,7 @@ HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
{
struct strmbase_pin *This = impl_from_IPin(iface);
@@ -219,7 +219,7 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
return (This->pFuncsTable->pin_query_accept(This, pmt) == S_OK ? S_OK : S_FALSE);
}
-HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
+static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
AM_MEDIA_TYPE mt;
@@ -235,7 +235,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me
return enum_media_types_create(pin, enum_media_types);
}
-HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin)
+static HRESULT WINAPI pin_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
{
struct strmbase_pin *This = impl_from_IPin(iface);
@@ -244,14 +244,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin,
return E_NOTIMPL; /* to tell caller that all input pins connected to all output pins */
}
-HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
-{
- TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
- iface, debugstr_time(start), debugstr_time(stop), rate);
-
- return S_OK;
-}
-
/*** OutputPin implementation ***/
static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
@@ -420,26 +412,33 @@ static HRESULT WINAPI source_EndFlush(IPin *iface)
return E_UNEXPECTED;
}
+static HRESULT WINAPI source_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+{
+ TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
+ iface, debugstr_time(start), debugstr_time(stop), rate);
+ return S_OK;
+}
+
static const IPinVtbl source_vtbl =
{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
+ pin_QueryInterface,
+ pin_AddRef,
+ pin_Release,
source_Connect,
source_ReceiveConnection,
source_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
+ pin_ConnectedTo,
+ pin_ConnectionMediaType,
+ pin_QueryPinInfo,
+ pin_QueryDirection,
+ pin_QueryId,
+ pin_QueryAccept,
+ pin_EnumMediaTypes,
+ pin_QueryInternalConnections,
source_EndOfStream,
source_BeginFlush,
source_EndFlush,
- BasePinImpl_NewSegment,
+ source_NewSegment,
};
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This,
@@ -617,14 +616,14 @@ static struct strmbase_sink *impl_sink_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface);
}
-HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
+static HRESULT WINAPI sink_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
{
ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt);
return E_UNEXPECTED;
}
-HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
PIN_DIRECTION pindirReceive;
@@ -678,7 +677,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
return hr;
}
-HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin *iface)
+static HRESULT WINAPI sink_Disconnect(IPin *iface)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -711,7 +710,7 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
return IPin_EndOfStream( pin );
}
-HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
+static HRESULT WINAPI sink_EndOfStream(IPin *iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr = S_OK;
@@ -736,7 +735,7 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
return IPin_BeginFlush( pin );
}
-HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
+static HRESULT WINAPI sink_BeginFlush(IPin *iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -759,7 +758,7 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused)
return IPin_EndFlush( pin );
}
-HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
+static HRESULT WINAPI sink_EndFlush(IPin * iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -789,7 +788,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data)
return IPin_NewSegment(pin, args->tStart, args->tStop, args->rate);
}
-HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+static HRESULT WINAPI sink_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
newsegmentargs args;
@@ -807,6 +806,28 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
return SendFurther(pin, deliver_newsegment, &args);
}
+static const IPinVtbl sink_vtbl =
+{
+ pin_QueryInterface,
+ pin_AddRef,
+ pin_Release,
+ sink_Connect,
+ sink_ReceiveConnection,
+ sink_Disconnect,
+ pin_ConnectedTo,
+ pin_ConnectionMediaType,
+ pin_QueryPinInfo,
+ pin_QueryDirection,
+ pin_QueryId,
+ pin_QueryAccept,
+ pin_EnumMediaTypes,
+ pin_QueryInternalConnections,
+ sink_EndOfStream,
+ sink_BeginFlush,
+ sink_EndFlush,
+ sink_NewSegment,
+};
+
/*** IMemInputPin implementation ***/
static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface)
@@ -938,11 +959,11 @@ static const IMemInputPinVtbl MemInputPin_Vtbl =
MemInputPin_ReceiveCanBlock
};
-void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator)
{
memset(pin, 0, sizeof(*pin));
- pin->pin.IPin_iface.lpVtbl = vtbl;
+ pin->pin.IPin_iface.lpVtbl = &sink_vtbl;
pin->pin.filter = filter;
pin->pin.dir = PINDIR_INPUT;
lstrcpyW(pin->pin.name, name);
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 3c9692029dd..3fd8af2c1c2 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -40,28 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
}
-static const IPinVtbl BaseRenderer_InputPin_Vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index)
{
struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
@@ -441,8 +419,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown
filter->pFuncsTable = ops;
- strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter,
- sink_name, &sink_ops, NULL);
+ strmbase_sink_init(&filter->sink, &filter->filter, sink_name, &sink_ops, NULL);
hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface,
TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition);
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 13e7be21789..6082a142dc9 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -26,8 +26,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
static const WCHAR wcsInputPinName[] = {'I','n',0};
static const WCHAR wcsOutputPinName[] = {'O','u','t',0};
-static const IPinVtbl TransformFilter_InputPin_Vtbl;
-
static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
return CONTAINING_RECORD(iface, TransformFilter, filter);
@@ -407,8 +405,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
filter->pFuncsTable = func_table;
ZeroMemory(&filter->pmt, sizeof(filter->pmt));
- strmbase_sink_init(&filter->sink, &TransformFilter_InputPin_Vtbl, &filter->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&filter->sink, &filter->filter, wcsInputPinName, &sink_ops, NULL);
strmbase_source_init(&filter->source, &filter->filter, wcsOutputPinName, &source_ops);
filter->source_IQualityControl_iface.lpVtbl = &source_qc_vtbl;
@@ -458,25 +455,3 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
CoTaskMemFree(pTf);
return E_FAIL;
}
-
-static const IPinVtbl TransformFilter_InputPin_Vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 1eae0dae9af..3945d9da8fa 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -97,7 +97,6 @@ const char* media_quark_string = "media-sample";
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const IMediaSeekingVtbl GST_Seeking_Vtbl;
-static const IPinVtbl GST_InputPin_Vtbl;
static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *name);
@@ -1502,8 +1501,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, wcsInputPinName, &sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = gstdecoder_init_gst;
@@ -1967,27 +1965,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static const IPinVtbl GST_InputPin_Vtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cb_list_cond = PTHREAD_COND_INITIALIZER;
struct list cb_list = LIST_INIT(cb_list);
@@ -2235,8 +2212,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &wave_parser_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &wave_parser_sink_ops, NULL);
object->init_gst = wave_parser_init_gst;
*phr = S_OK;
@@ -2339,8 +2315,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &avi_splitter_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &avi_splitter_sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = avi_splitter_init_gst;
*phr = S_OK;
@@ -2475,8 +2450,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &mpeg_splitter_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &mpeg_splitter_sink_ops, NULL);
object->IAMStreamSelect_iface.lpVtbl = &stream_select_vtbl;
object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL);
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 4bb99a0305a..4c5dee89d8d 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -171,7 +171,6 @@ typedef struct QTSplitter {
HANDLE splitterThread;
} QTSplitter;
-static const IPinVtbl QT_InputPin_Vtbl;
static const IBaseFilterVtbl QT_Vtbl;
static const IMediaSeekingVtbl QT_Seeking_Vtbl;
@@ -418,8 +417,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
- strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&This->pInputPin.pin, &This->filter, wcsInputPinName, &sink_ops, NULL);
InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@@ -1027,27 +1025,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static const IPinVtbl QT_InputPin_Vtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
{
return CONTAINING_RECORD(iface, QTOutPin, pin.pin);
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index c01ef6133f4..48d7638ae16 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -103,20 +103,6 @@ struct strmbase_sink_ops
/* Base Pin */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
-LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin);
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out);
-ULONG WINAPI BasePinImpl_AddRef(IPin *iface);
-ULONG WINAPI BasePinImpl_Release(IPin *iface);
-HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin * iface);
-HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin);
-HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo);
-HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir);
-HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id);
-HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum);
-HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin);
-HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin,
IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags);
@@ -130,16 +116,7 @@ void strmbase_source_cleanup(struct strmbase_source *pin);
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_source_ops *func_table);
-/* Base Input Pin */
-HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator);
void strmbase_sink_cleanup(struct strmbase_sink *pin);
--
2.24.0
Dec. 12, 2019
[PATCH 7/8] wineqtdecoder: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 33 ++++-----------------------------
1 file changed, 4 insertions(+), 29 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 4d86b951e76..4bb99a0305a 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -1027,31 +1027,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static HRESULT WINAPI QTInPin_EndOfStream(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_BeginFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_EndFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- BasePinImpl_NewSegment(iface, tStart, tStop, dRate);
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
@@ -1067,10 +1042,10 @@ static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- QTInPin_EndOfStream,
- QTInPin_BeginFlush,
- QTInPin_EndFlush,
- QTInPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
--
2.24.0
Dec. 12, 2019
[PATCH 6/8] winegstreamer: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 36 ++++-------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index fb60d69e2ac..1eae0dae9af 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1967,34 +1967,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_BeginFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_EndFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_NewSegment(IPin *iface, REFERENCE_TIME start,
- REFERENCE_TIME stop, double rate)
-{
- FIXME("iface %p, start %s, stop %s, rate %.16e, stub!\n",
- iface, wine_dbgstr_longlong(start), wine_dbgstr_longlong(stop), rate);
-
- BasePinImpl_NewSegment(iface, start, stop, rate);
- return S_OK;
-}
-
static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
@@ -2010,10 +1982,10 @@ static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- GSTInPin_EndOfStream,
- GSTInPin_BeginFlush,
- GSTInPin_EndFlush,
- GSTInPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
--
2.24.0
Dec. 12, 2019
[PATCH 5/8] strmbase/renderer: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/renderer.c | 142 +++++++++++++++++++--------------------
1 file changed, 68 insertions(+), 74 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 7b9736ccfb2..3c9692029dd 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -40,77 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
}
-static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
-{
- struct strmbase_renderer *filter = impl_from_IPin(iface);
- IFilterGraph *graph = filter->filter.filterInfo.pGraph;
- IMediaEventSink *event_sink;
- HRESULT hr = S_OK;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&filter->csRenderLock);
- filter->eos = TRUE;
-
- if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
- &IID_IMediaEventSink, (void **)&event_sink)))
- {
- IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
- (LONG_PTR)&filter->filter.IBaseFilter_iface);
- IMediaEventSink_Release(event_sink);
- }
- RendererPosPassThru_EOS(filter->pPosition);
- SetEvent(filter->state_event);
-
- if (filter->pFuncsTable->pfnEndOfStream)
- hr = filter->pFuncsTable->pfnEndOfStream(filter);
- LeaveCriticalSection(&filter->csRenderLock);
- return hr;
-}
-
-static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface)
-{
- struct strmbase_renderer *pFilter = impl_from_IPin(iface);
- HRESULT hr;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&pFilter->filter.csFilter);
- hr = BaseInputPinImpl_BeginFlush(iface);
- if (SUCCEEDED(hr))
- {
- BaseRendererImpl_ClearPendingSample(pFilter);
- SetEvent(pFilter->flush_event);
- }
- LeaveCriticalSection(&pFilter->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
-{
- struct strmbase_renderer *pFilter = impl_from_IPin(iface);
- HRESULT hr;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&pFilter->filter.csFilter);
- EnterCriticalSection(&pFilter->csRenderLock);
- pFilter->eos = FALSE;
- hr = BaseInputPinImpl_EndFlush(iface);
- if (SUCCEEDED(hr))
- {
- QualityControlRender_Start(pFilter->qcimpl, pFilter->stream_start);
- RendererPosPassThru_ResetMediaTime(pFilter->pPosition);
- ResetEvent(pFilter->flush_event);
-
- if (pFilter->pFuncsTable->pfnEndFlush)
- hr = pFilter->pFuncsTable->pfnEndFlush(pFilter);
- }
- LeaveCriticalSection(&pFilter->csRenderLock);
- LeaveCriticalSection(&pFilter->filter.csFilter);
- return hr;
-}
-
static const IPinVtbl BaseRenderer_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
@@ -127,9 +56,9 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- BaseRenderer_InputPin_EndOfStream,
- BaseRenderer_InputPin_BeginFlush,
- BaseRenderer_InputPin_EndFlush,
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
@@ -289,6 +218,68 @@ static void sink_disconnect(struct strmbase_sink *iface)
filter->pFuncsTable->pfnBreakConnect(filter);
}
+static HRESULT sink_eos(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+ IFilterGraph *graph = filter->filter.filterInfo.pGraph;
+ IMediaEventSink *event_sink;
+ HRESULT hr;
+
+ EnterCriticalSection(&filter->csRenderLock);
+
+ filter->eos = TRUE;
+
+ if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
+ &IID_IMediaEventSink, (void **)&event_sink)))
+ {
+ IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
+ (LONG_PTR)&filter->filter.IBaseFilter_iface);
+ IMediaEventSink_Release(event_sink);
+ }
+ RendererPosPassThru_EOS(filter->pPosition);
+ SetEvent(filter->state_event);
+
+ if (filter->pFuncsTable->pfnEndOfStream)
+ hr = filter->pFuncsTable->pfnEndOfStream(filter);
+
+ LeaveCriticalSection(&filter->csRenderLock);
+ return hr;
+}
+
+static HRESULT sink_begin_flush(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+
+ EnterCriticalSection(&filter->filter.csFilter);
+
+ BaseRendererImpl_ClearPendingSample(filter);
+ SetEvent(filter->flush_event);
+
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return S_OK;
+}
+
+static HRESULT sink_end_flush(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->filter.csFilter);
+ EnterCriticalSection(&filter->csRenderLock);
+
+ filter->eos = FALSE;
+ QualityControlRender_Start(filter->qcimpl, filter->stream_start);
+ RendererPosPassThru_ResetMediaTime(filter->pPosition);
+ ResetEvent(filter->flush_event);
+
+ if (filter->pFuncsTable->pfnEndFlush)
+ hr = filter->pFuncsTable->pfnEndFlush(filter);
+
+ LeaveCriticalSection(&filter->csRenderLock);
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return hr;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
@@ -297,6 +288,9 @@ static const struct strmbase_sink_ops sink_ops =
.pfnReceive = BaseRenderer_Receive,
.sink_connect = sink_connect,
.sink_disconnect = sink_disconnect,
+ .sink_eos = sink_eos,
+ .sink_begin_flush = sink_begin_flush,
+ .sink_end_flush = sink_end_flush,
};
void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
--
2.24.0
Dec. 12, 2019
[PATCH 4/8] strmbase/transform: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/transform.c | 120 ++++++++++++++++++--------------------
1 file changed, 58 insertions(+), 62 deletions(-)
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 993e30202bc..13e7be21789 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -229,6 +229,56 @@ static void sink_disconnect(struct strmbase_sink *iface)
filter->pFuncsTable->pfnBreakConnect(filter, PINDIR_INPUT);
}
+static HRESULT sink_eos(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+
+ if (filter->source.pin.peer)
+ return IPin_EndOfStream(filter->source.pin.peer);
+ return VFW_E_NOT_CONNECTED;
+}
+
+static HRESULT sink_begin_flush(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->filter.csFilter);
+ if (filter->pFuncsTable->pfnBeginFlush)
+ hr = filter->pFuncsTable->pfnBeginFlush(filter);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_BeginFlush(filter->source.pin.peer);
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return hr;
+}
+
+static HRESULT sink_end_flush(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->filter.csFilter);
+ if (filter->pFuncsTable->pfnEndFlush)
+ hr = filter->pFuncsTable->pfnEndFlush(filter);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_EndFlush(filter->source.pin.peer);
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return hr;
+}
+
+static HRESULT sink_new_segment(struct strmbase_sink *iface,
+ REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ if (filter->pFuncsTable->pfnNewSegment)
+ hr = filter->pFuncsTable->pfnNewSegment(filter, start, stop, rate);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_NewSegment(filter->source.pin.peer, start, stop, rate);
+ return hr;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
@@ -237,6 +287,10 @@ static const struct strmbase_sink_ops sink_ops =
.pfnReceive = TransformFilter_Input_Receive,
.sink_connect = sink_connect,
.sink_disconnect = sink_disconnect,
+ .sink_eos = sink_eos,
+ .sink_begin_flush = sink_begin_flush,
+ .sink_end_flush = sink_end_flush,
+ .sink_new_segment = sink_new_segment,
};
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
@@ -405,64 +459,6 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
return E_FAIL;
}
-static HRESULT WINAPI TransformFilter_InputPin_EndOfStream(IPin * iface)
-{
- TransformFilter *filter = impl_from_sink_IPin(iface);
-
- TRACE("iface %p.\n", iface);
-
- if (filter->source.pin.peer)
- return IPin_EndOfStream(filter->source.pin.peer);
- return VFW_E_NOT_CONNECTED;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_BeginFlush(IPin * iface)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("(%p)->()\n", iface);
-
- EnterCriticalSection(&pTransform->filter.csFilter);
- if (pTransform->pFuncsTable->pfnBeginFlush)
- hr = pTransform->pFuncsTable->pfnBeginFlush(pTransform);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_BeginFlush(iface);
- LeaveCriticalSection(&pTransform->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_EndFlush(IPin * iface)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("(%p)->()\n", iface);
-
- EnterCriticalSection(&pTransform->filter.csFilter);
- if (pTransform->pFuncsTable->pfnEndFlush)
- hr = pTransform->pFuncsTable->pfnEndFlush(pTransform);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_EndFlush(iface);
- LeaveCriticalSection(&pTransform->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
- iface, debugstr_time(tStart), debugstr_time(tStop), dRate);
-
- if (pTransform->pFuncsTable->pfnNewSegment)
- hr = pTransform->pFuncsTable->pfnNewSegment(pTransform, tStart, tStop, dRate);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_NewSegment(iface, tStart, tStop, dRate);
- return hr;
-}
-
static const IPinVtbl TransformFilter_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
@@ -479,8 +475,8 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl =
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- TransformFilter_InputPin_EndOfStream,
- TransformFilter_InputPin_BeginFlush,
- TransformFilter_InputPin_EndFlush,
- TransformFilter_InputPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
--
2.24.0
Dec. 12, 2019
[PATCH 3/8] strmbase: Introduce callbacks for streaming events.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/pin.c | 12 ++++++++++++
include/wine/strmbase.h | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 3dd00b27ccc..f36e147b849 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -718,6 +718,9 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
TRACE("(%p)->()\n", This);
+ if (This->pFuncsTable->sink_eos)
+ return This->pFuncsTable->sink_eos(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
if (This->flushing)
hr = S_FALSE;
@@ -739,6 +742,9 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
HRESULT hr;
TRACE("(%p) semi-stub\n", This);
+ if (This->pFuncsTable->sink_begin_flush)
+ return This->pFuncsTable->sink_begin_flush(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
This->flushing = TRUE;
@@ -759,6 +765,9 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
HRESULT hr;
TRACE("(%p)->()\n", This);
+ if (This->pFuncsTable->sink_begin_flush)
+ return This->pFuncsTable->sink_end_flush(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
This->flushing = FALSE;
@@ -788,6 +797,9 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
iface, debugstr_time(start), debugstr_time(stop), rate);
+ if (pin->pFuncsTable->sink_new_segment)
+ return pin->pFuncsTable->sink_new_segment(pin, start, stop, rate);
+
args.tStart = start;
args.tStop = stop;
args.rate = rate;
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index 83ad2e0bd6e..c01ef6133f4 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -95,6 +95,10 @@ struct strmbase_sink_ops
BaseInputPin_Receive pfnReceive;
HRESULT (*sink_connect)(struct strmbase_sink *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
void (*sink_disconnect)(struct strmbase_sink *pin);
+ HRESULT (*sink_eos)(struct strmbase_sink *pin);
+ HRESULT (*sink_begin_flush)(struct strmbase_sink *pin);
+ HRESULT (*sink_end_flush)(struct strmbase_sink *pin);
+ HRESULT (*sink_new_segment)(struct strmbase_sink *pin, REFERENCE_TIME start, REFERENCE_TIME stop, double rate);
};
/* Base Pin */
--
2.24.0
Dec. 12, 2019
[PATCH 2/8] wineqtdecoder: Use base sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 189 +++++++++++---------------------
1 file changed, 65 insertions(+), 124 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index c8a34cbf95e..4d86b951e76 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -331,10 +331,73 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
+static HRESULT qt_splitter_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
+{
+ QTSplitter *filter = impl_from_strmbase_filter(iface->pin.filter);
+ ALLOCATOR_PROPERTIES props;
+ IMemAllocator *allocator;
+ HRESULT hr = S_OK;
+
+ filter->pInputPin.pReader = NULL;
+
+ if (FAILED(hr = IPin_QueryInterface(peer, &IID_IAsyncReader, (void **)&filter->pInputPin.pReader)))
+ return hr;
+
+ if (FAILED(hr = QT_Process_Movie(filter)))
+ {
+ IAsyncReader_Release(filter->pInputPin.pReader);
+ filter->pInputPin.pReader = NULL;
+ return hr;
+ }
+
+ filter->pInputPin.pAlloc = NULL;
+ props.cBuffers = 8;
+ props.cbAlign = 1;
+ props.cbBuffer = filter->outputSize + props.cbAlign;
+ props.cbPrefix = 0;
+
+ /* Some applications depend on IAsyncReader::RequestAllocator() passing a
+ * non-NULL preferred allocator. */
+ hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
+ &IID_IMemAllocator, (void **)&allocator);
+ if (FAILED(hr))
+ goto err;
+
+ hr = IAsyncReader_RequestAllocator(filter->reader, allocator, &props, &filter->alloc);
+ IMemAllocator_Release(allocator);
+ if (FAILED(hr))
+ {
+ WARN("Failed to get allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ if (FAILED(hr = IMemAllocator_Commit(filter->alloc)))
+ {
+ WARN("Failed to commit allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ return S_OK;
+err:
+ QT_RemoveOutputPins(filter);
+ IAsyncReader_Release(filter->pInputPin.pReader);
+ return hr;
+}
+
+static HRESULT qt_splitter_sink_disconnect(struct strmbase_sink *iface)
+{
+ QTSplitter *filter = impl_from_strmbase_filter(iface->pin.filter);
+
+ IMemAllocator_Decommit(filter->alloc);
+ GST_RemoveOutputPins(filter);
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = qt_splitter_sink_connect,
+ .sink_disconnect = qt_splitter_sink_disconnect,
};
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
@@ -964,128 +1027,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
-{
- HRESULT hr = S_OK;
- ALLOCATOR_PROPERTIES props;
- QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.filter);
- IMemAllocator *pAlloc;
-
- TRACE("(%p/%p)->(%p, %p)\n", This, iface, pReceivePin, pmt);
-
- EnterCriticalSection(&filter->filter.csFilter);
- This->pReader = NULL;
-
- if (This->pin.pin.peer)
- hr = VFW_E_ALREADY_CONNECTED;
- else if (IPin_QueryAccept(iface, pmt) != S_OK)
- hr = VFW_E_TYPE_NOT_ACCEPTED;
- else
- {
- PIN_DIRECTION pindirReceive;
- IPin_QueryDirection(pReceivePin, &pindirReceive);
- if (pindirReceive != PINDIR_OUTPUT)
- hr = VFW_E_INVALID_DIRECTION;
- }
-
- if (FAILED(hr))
- {
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
- }
-
- hr = IPin_QueryInterface(pReceivePin, &IID_IAsyncReader, (LPVOID *)&This->pReader);
- if (FAILED(hr))
- {
- LeaveCriticalSection(&filter->filter.csFilter);
- TRACE("Input source is not an AsyncReader\n");
- return hr;
- }
-
- LeaveCriticalSection(&filter->filter.csFilter);
- EnterCriticalSection(&filter->filter.csFilter);
- hr = QT_Process_Movie(filter);
- if (FAILED(hr))
- {
- IAsyncReader_Release(This->pReader);
- This->pReader = NULL;
- LeaveCriticalSection(&filter->filter.csFilter);
- TRACE("Unable to process movie\n");
- return hr;
- }
-
- This->pAlloc = NULL;
- props.cBuffers = 8;
- props.cbAlign = 1;
- props.cbBuffer = filter->outputSize + props.cbAlign;
- props.cbPrefix = 0;
- hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
- &IID_IMemAllocator, (LPVOID *)&pAlloc);
- if (SUCCEEDED(hr))
- {
- /* A certain IAsyncReader::RequestAllocator expects to be passed
- non-NULL preferred allocator */
- hr = IAsyncReader_RequestAllocator(This->pReader, pAlloc, &props, &This->pAlloc);
- if (FAILED(hr))
- WARN("Can't get an allocator, got %08x\n", hr);
- IMemAllocator_Release(pAlloc);
- }
-
- if (SUCCEEDED(hr))
- {
- CopyMediaType(&This->pin.mt, pmt);
- This->pin.peer = pReceivePin;
- IPin_AddRef(pReceivePin);
- hr = IMemAllocator_Commit(This->pAlloc);
- }
- else
- {
- QT_RemoveOutputPins(filter);
- if (This->pReader)
- IAsyncReader_Release(This->pReader);
- This->pReader = NULL;
- if (This->pAlloc)
- IMemAllocator_Release(This->pAlloc);
- This->pAlloc = NULL;
- }
- TRACE("Size: %i\n", props.cbBuffer);
- LeaveCriticalSection(&filter->filter.csFilter);
-
- return hr;
-}
-
-static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
-{
- HRESULT hr;
- QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.pin.filter);
- FILTER_STATE state;
- TRACE("()\n");
-
- hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
- EnterCriticalSection(&filter->filter.csFilter);
- if (This->pin.pin.peer)
- {
- QTSplitter *Parser = impl_from_strmbase_filter(This->pin.pin.filter);
-
- if (SUCCEEDED(hr) && state == State_Stopped)
- {
- IMemAllocator_Decommit(This->pAlloc);
- IPin_Disconnect(This->pin.pin.peer);
- IPin_Release(This->pin.pin.peer);
- This->pin.pin.peer = NULL;
- hr = QT_RemoveOutputPins(Parser);
- }
- else
- hr = VFW_E_NOT_STOPPED;
- }
- else
- hr = S_FALSE;
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
-}
-
static HRESULT WINAPI QTInPin_EndOfStream(IPin *iface)
{
FIXME("iface %p, stub!\n", iface);
@@ -1116,8 +1057,8 @@ static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- QTInPin_ReceiveConnection,
- QTInPin_Disconnect,
+ BaseInputPinImpl_ReceiveConnection,
+ BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
--
2.24.0
Dec. 12, 2019
[PATCH 1/8] wineqtdecoder: Store the sink as a strmbase_sink structure.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 43 ++++++++++++++-------------------
1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index d861110f5f1..c8a34cbf95e 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -138,7 +138,7 @@ typedef struct QTOutPin {
} QTOutPin;
typedef struct QTInPin {
- struct strmbase_pin pin;
+ struct strmbase_sink pin;
GUID subType;
IAsyncReader *pReader;
@@ -199,7 +199,7 @@ static inline QTSplitter *impl_from_IBaseFilter( IBaseFilter *iface )
static inline QTInPin *impl_from_IPin(IPin *iface)
{
- return CONTAINING_RECORD(iface, QTInPin, pin.IPin_iface);
+ return CONTAINING_RECORD(iface, QTInPin, pin.pin.IPin_iface);
}
/*
@@ -211,7 +211,7 @@ static struct strmbase_pin *qt_splitter_get_pin(struct strmbase_filter *base, un
QTSplitter *filter = impl_from_strmbase_filter(base);
if (index == 0)
- return &filter->pInputPin.pin;
+ return &filter->pInputPin.pin.pin;
else if (index == 1)
{
if (filter->pVideo_Pin)
@@ -232,18 +232,15 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
EnterCriticalSection(&filter->csReceive);
/* Don't need to clean up output pins, disconnecting input pin will do that */
+ if (filter->pInputPin.pin.pin.peer)
+ IPin_Disconnect(filter->pInputPin.pin.pin.peer);
- if (filter->pInputPin.pin.peer)
- IPin_Disconnect(filter->pInputPin.pin.peer);
-
- FreeMediaType(&filter->pInputPin.pin.mt);
if (filter->pInputPin.pAlloc)
IMemAllocator_Release(filter->pInputPin.pAlloc);
filter->pInputPin.pAlloc = NULL;
if (filter->pInputPin.pReader)
IAsyncReader_Release(filter->pInputPin.pReader);
filter->pInputPin.pReader = NULL;
- filter->pInputPin.pin.IPin_iface.lpVtbl = NULL;
if (filter->pQTMovie)
{
@@ -274,6 +271,7 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
filter->csReceive.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->csReceive);
+ strmbase_sink_cleanup(&filter->pInputPin.pin);
strmbase_filter_cleanup(&filter->filter);
CoTaskMemFree(filter);
@@ -333,10 +331,10 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
-static const BasePinFuncTable sink_ops =
+static const struct strmbase_sink_ops sink_ops =
{
- .pin_query_accept = sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
@@ -357,6 +355,8 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
+ strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter,
+ wcsInputPinName, &sink_ops, NULL);
InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@@ -366,13 +366,6 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
This->aSession = NULL;
This->runEvent = CreateEventW(NULL, 0, 0, NULL);
- This->pInputPin.pin.dir = PINDIR_INPUT;
- This->pInputPin.pin.filter = &This->filter;
- lstrcpynW(This->pInputPin.pin.name, wcsInputPinName, ARRAY_SIZE(This->pInputPin.pin.name));
- This->pInputPin.pin.IPin_iface.lpVtbl = &QT_InputPin_Vtbl;
- This->pInputPin.pin.peer = NULL;
- This->pInputPin.pin.pFuncsTable = &sink_ops;
-
*phr = S_OK;
return &This->filter.IUnknown_inner;
}
@@ -984,7 +977,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
EnterCriticalSection(&filter->filter.csFilter);
This->pReader = NULL;
- if (This->pin.peer)
+ if (This->pin.pin.peer)
hr = VFW_E_ALREADY_CONNECTED;
else if (IPin_QueryAccept(iface, pmt) != S_OK)
hr = VFW_E_TYPE_NOT_ACCEPTED;
@@ -1066,22 +1059,22 @@ static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
{
HRESULT hr;
QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.filter);
+ QTSplitter *filter = impl_from_strmbase_filter(This->pin.pin.filter);
FILTER_STATE state;
TRACE("()\n");
hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
EnterCriticalSection(&filter->filter.csFilter);
- if (This->pin.peer)
+ if (This->pin.pin.peer)
{
- QTSplitter *Parser = impl_from_strmbase_filter(This->pin.filter);
+ QTSplitter *Parser = impl_from_strmbase_filter(This->pin.pin.filter);
if (SUCCEEDED(hr) && state == State_Stopped)
{
IMemAllocator_Decommit(This->pAlloc);
- IPin_Disconnect(This->pin.peer);
- IPin_Release(This->pin.peer);
- This->pin.peer = NULL;
+ IPin_Disconnect(This->pin.pin.peer);
+ IPin_Release(This->pin.pin.peer);
+ This->pin.pin.peer = NULL;
hr = QT_RemoveOutputPins(Parser);
}
else
--
2.24.0
Dec. 12, 2019
Re: [PATCH 2/2] msado15: Add _Command stub interface
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61985
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
error: patch failed: dlls/msado15/tests/msado15.c:444
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
error: patch failed: dlls/msado15/tests/msado15.c:444
Task: Patch failed to apply
Dec. 12, 2019
Re: [PATCH 1/2] msado15: Add ISupportErrorInfo support to _Connection
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61984
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
Task: Patch failed to apply
Dec. 12, 2019
[PATCH 2/2] msado15: Add _Command stub interface
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/Makefile.in | 1 +
dlls/msado15/command.c | 388 +++++++++++++++++++++++++++++++
dlls/msado15/main.c | 5 +
dlls/msado15/msado15_classes.idl | 8 +
dlls/msado15/msado15_private.h | 1 +
dlls/msado15/tests/msado15.c | 28 +++
6 files changed, 431 insertions(+)
create mode 100644 dlls/msado15/command.c
diff --git a/dlls/msado15/Makefile.in b/dlls/msado15/Makefile.in
index 604f9ff018..9852e0863d 100644
--- a/dlls/msado15/Makefile.in
+++ b/dlls/msado15/Makefile.in
@@ -4,6 +4,7 @@ IMPORTS = oleaut32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
+ command.c \
connection.c \
main.c \
recordset.c \
diff --git a/dlls/msado15/command.c b/dlls/msado15/command.c
new file mode 100644
index 0000000000..9856b52e91
--- /dev/null
+++ b/dlls/msado15/command.c
@@ -0,0 +1,388 @@
+/*
+ * Copyright 2019 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#define COBJMACROS
+#include "objbase.h"
+#include "msado15_backcompat.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+#include "msado15_private.h"
+#include "msado15_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(msado);
+
+struct command
+{
+ _Command Command_iface;
+
+ LONG ref;
+};
+
+
+static inline struct command *impl_from_Command(_Command *iface)
+{
+ return CONTAINING_RECORD(iface, struct command, Command_iface);
+}
+
+static HRESULT WINAPI command_QueryInterface(_Command *iface, REFIID riid, void **out)
+{
+ struct command *command = impl_from_Command(iface);
+ TRACE("(%p)->(%s, %p)\n", command, debugstr_guid(riid), out);
+
+ *out = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IDispatch) ||
+ IsEqualIID(riid, &IID__ADO) ||
+ IsEqualIID(riid, &IID_Command15) ||
+ IsEqualIID(riid, &IID_Command25) ||
+ IsEqualIID(riid, &IID__Command))
+ {
+ *out = iface;
+ }
+ else
+ {
+ FIXME("interface %s not implemented\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+ }
+
+ _Command_AddRef(iface);
+ return S_OK;
+}
+
+static ULONG WINAPI command_AddRef(_Command *iface)
+{
+ struct command *command = impl_from_Command(iface);
+ TRACE("(%p)\n", command);
+
+ return InterlockedIncrement(&command->ref);
+}
+
+static ULONG WINAPI command_Release(_Command *iface)
+{
+ struct command *command = impl_from_Command(iface);
+ LONG ref;
+
+ TRACE("(%p)\n", command);
+
+ ref = InterlockedDecrement(&command->ref);
+ if (!ref)
+ heap_free(command);
+
+ return ref;
+}
+
+static HRESULT WINAPI command_GetTypeInfoCount(_Command *iface, UINT *pctinfo)
+{
+ struct command *command = impl_from_Command(iface);
+ TRACE("(%p)->()\n", command);
+
+ *pctinfo = 1;
+ return S_OK;
+}
+
+static HRESULT WINAPI command_GetTypeInfo(_Command *iface, UINT iTInfo, LCID lcid, ITypeInfo **typeinfo)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%u %u %p)\n", command, iTInfo, lcid, typeinfo);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_GetIDsOfNames(_Command *iface, REFIID riid, LPOLESTR *rgszNames,
+ UINT cNames, LCID lcid, DISPID *rgDispId)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s %p %u %u %p)\n", command, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_Invoke(_Command *iface, DISPID dispIdMember, REFIID riid,
+ LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
+ UINT *puArgErr)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", command, dispIdMember, debugstr_guid(riid),
+ lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Properties(_Command *iface, Properties **props)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, props);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_ActiveConnection(_Command *iface, _Connection **connection)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, connection);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_putref_ActiveConnection(_Command *iface, _Connection *connection)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, connection);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_ActiveConnection(_Command *iface, VARIANT connection)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->()\n", command);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandText(_Command *iface, BSTR *text)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, text);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_CommandText(_Command *iface, BSTR text)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s)\n", command, debugstr_w(text));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandTimeout(_Command *iface, LONG *timeout)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, timeout);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_CommandTimeout(_Command *iface, LONG timeout)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, timeout);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Prepared(_Command *iface, VARIANT_BOOL *prepared)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, prepared);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_Prepared(_Command *iface, VARIANT_BOOL prepared)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, prepared);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_Execute(_Command *iface, VARIANT *recordsaffected, VARIANT *parameters,
+ LONG options, _Recordset **recordset)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p %p %d %p)\n", command, recordsaffected, parameters, options, recordset);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_CreateParameter(_Command *iface, BSTR name, DataTypeEnum type,
+ ParameterDirectionEnum direction, LONG size, VARIANT value, _Parameter **parameter)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s %d %d %d %p)\n", command, debugstr_w(name), type, direction, size,
+ parameter);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Parameters(_Command *iface, Parameters **parameters)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, parameters);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_CommandType(_Command *iface, CommandTypeEnum cmdtype)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, cmdtype);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandType(_Command *iface, CommandTypeEnum *cmdtype)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, cmdtype);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Name(_Command *iface, BSTR *name)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, name);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_Name(_Command *iface, BSTR name)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s)\n", command, debugstr_w(name));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_State(_Command *iface, LONG *state)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, state);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_Cancel(_Command *iface)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->()\n", command);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_putref_CommandStream(_Command *iface, IUnknown *stream)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, stream);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandStream(_Command *iface, VARIANT *stream)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, stream);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_Dialect(_Command *iface, BSTR dialect)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s)\n", command, debugstr_w(dialect));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Dialect(_Command *iface, BSTR *dialect)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, dialect);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_NamedParameters(_Command *iface, VARIANT_BOOL namedparameters)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, namedparameters);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_NamedParameters(_Command *iface, VARIANT_BOOL *namedparameters)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, namedparameters);
+
+ return E_NOTIMPL;
+}
+
+static const struct _CommandVtbl command_vtbl =
+{
+ command_QueryInterface,
+ command_AddRef,
+ command_Release,
+ command_GetTypeInfoCount,
+ command_GetTypeInfo,
+ command_GetIDsOfNames,
+ command_Invoke,
+ command_get_Properties,
+ command_get_ActiveConnection,
+ command_putref_ActiveConnection,
+ command_put_ActiveConnection,
+ command_get_CommandText,
+ command_put_CommandText,
+ command_get_CommandTimeout,
+ command_put_CommandTimeout,
+ command_get_Prepared,
+ command_put_Prepared,
+ command_Execute,
+ command_CreateParameter,
+ command_get_Parameters,
+ command_put_CommandType,
+ command_get_CommandType,
+ command_get_Name,
+ command_put_Name,
+ command_get_State,
+ command_Cancel,
+ command_putref_CommandStream,
+ command_get_CommandStream,
+ command_put_Dialect,
+ command_get_Dialect,
+ command_put_NamedParameters,
+ command_get_NamedParameters
+};
+
+HRESULT Command_create( void **out )
+{
+ struct command *command;
+
+ TRACE("(%p)\n", out);
+
+ *out = NULL;
+
+ command = heap_alloc(sizeof(*command));
+ if (!command)
+ return E_OUTOFMEMORY;
+
+ command->Command_iface.lpVtbl = &command_vtbl;
+ command->ref = 1;
+
+ *out = &command->Command_iface;
+
+ return S_OK;
+}
diff --git a/dlls/msado15/main.c b/dlls/msado15/main.c
index 32ae252337..3115474b84 100644
--- a/dlls/msado15/main.c
+++ b/dlls/msado15/main.c
@@ -117,6 +117,7 @@ static const struct IClassFactoryVtbl msadocf_vtbl =
msadocf_LockServer
};
+static struct msadocf command_cf = { { &msadocf_vtbl }, Command_create };
static struct msadocf connection_cf = { { &msadocf_vtbl }, Connection_create };
static struct msadocf recordset_cf = { { &msadocf_vtbl }, Recordset_create };
static struct msadocf stream_cf = { { &msadocf_vtbl }, Stream_create };
@@ -142,6 +143,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
{
cf = &stream_cf.IClassFactory_iface;
}
+ else if (IsEqualGUID( clsid, &CLSID_Command ))
+ {
+ cf = &command_cf.IClassFactory_iface;
+ }
if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
return IClassFactory_QueryInterface( cf, iid, obj );
}
diff --git a/dlls/msado15/msado15_classes.idl b/dlls/msado15/msado15_classes.idl
index 5ede180240..51f8bd77db 100644
--- a/dlls/msado15/msado15_classes.idl
+++ b/dlls/msado15/msado15_classes.idl
@@ -18,6 +18,14 @@
#pragma makedep register
+[
+ threading(apartment),
+ progid("ADODB.Command.6.0"),
+ vi_progid("ADODB.Command"),
+ uuid(00000507-0000-0010-8000-00aa006d2ea4)
+]
+coclass Command { interface _Command; }
+
[
threading(apartment),
progid("ADODB.Connection.6.0"),
diff --git a/dlls/msado15/msado15_private.h b/dlls/msado15/msado15_private.h
index 7239e48b53..f6c60f0304 100644
--- a/dlls/msado15/msado15_private.h
+++ b/dlls/msado15/msado15_private.h
@@ -21,6 +21,7 @@
#define MAKE_ADO_HRESULT( err ) MAKE_HRESULT( SEVERITY_ERROR, FACILITY_CONTROL, err )
+HRESULT Command_create( void ** ) DECLSPEC_HIDDEN;
HRESULT Connection_create( void ** ) DECLSPEC_HIDDEN;
HRESULT Recordset_create( void ** ) DECLSPEC_HIDDEN;
HRESULT Stream_create( void ** ) DECLSPEC_HIDDEN;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 5a1813694b..7850c45231 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -444,6 +444,33 @@ if (0) /* Crashes on windows */
_Connection_Release(connection);
}
+static void test_Command(void)
+{
+ HRESULT hr;
+ _Command *command;
+ _ADO *ado;
+ Command15 *command15;
+ Command25 *command25;
+
+ hr = CoCreateInstance(&CLSID_Command, NULL, CLSCTX_INPROC_SERVER,
+ &IID__Command, (void**)&command);
+ ok( hr == S_OK, "got %08x\n", hr );
+
+ hr = _Command_QueryInterface(command, &IID__ADO, (void**)&ado);
+ ok( hr == S_OK, "got %08x\n", hr );
+ _ADO_Release(ado);
+
+ hr = _Command_QueryInterface(command, &IID_Command15, (void**)&command15);
+ ok( hr == S_OK, "got %08x\n", hr );
+ Command15_Release(command15);
+
+ hr = _Command_QueryInterface(command, &IID_Command25, (void**)&command25);
+ ok( hr == S_OK, "got %08x\n", hr );
+ Command25_Release(command25);
+
+ _Command_Release(command);
+}
+
START_TEST(msado15)
{
CoInitialize( NULL );
@@ -451,5 +478,6 @@ START_TEST(msado15)
test_Fields();
test_Recordset();
test_Stream();
+ test_Command();
CoUninitialize();
}
--
2.17.1
Dec. 12, 2019
[PATCH 1/2] msado15: Add ISupportErrorInfo support to _Connection
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/connection.c | 46 +++++++++++++++++++++++++++++++++++-
dlls/msado15/tests/msado15.c | 5 ++--
2 files changed, 47 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c
index 037ab52199..80d921d091 100644
--- a/dlls/msado15/connection.c
+++ b/dlls/msado15/connection.c
@@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
struct connection
{
_Connection Connection_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
LONG refs;
ObjectStateEnum state;
@@ -44,6 +45,11 @@ static inline struct connection *impl_from_Connection( _Connection *iface )
return CONTAINING_RECORD( iface, struct connection, Connection_iface );
}
+static inline struct connection *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
+{
+ return CONTAINING_RECORD(iface, struct connection, ISupportErrorInfo_iface);
+}
+
static ULONG WINAPI connection_AddRef( _Connection *iface )
{
struct connection *connection = impl_from_Connection( iface );
@@ -64,13 +70,18 @@ static ULONG WINAPI connection_Release( _Connection *iface )
static HRESULT WINAPI connection_QueryInterface( _Connection *iface, REFIID riid, void **obj )
{
- TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
+ struct connection *connection = impl_from_Connection( iface );
+ TRACE( "%p, %s, %p\n", connection, debugstr_guid(riid), obj );
if (IsEqualGUID( riid, &IID__Connection ) || IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ))
{
*obj = iface;
}
+ else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &connection->ISupportErrorInfo_iface;
+ }
else
{
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
@@ -339,12 +350,45 @@ static const struct _ConnectionVtbl connection_vtbl =
connection_Cancel
};
+static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **obj)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_QueryInterface(&connection->Connection_iface, riid, obj);
+}
+
+static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_AddRef(&connection->Connection_iface);
+}
+
+static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_Release(&connection->Connection_iface);
+}
+
+static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ FIXME("(%p)->(%s)\n", connection, debugstr_guid(riid));
+ return S_FALSE;
+}
+
+static const struct ISupportErrorInfoVtbl support_error_vtbl = {
+ SupportErrorInfo_QueryInterface,
+ SupportErrorInfo_AddRef,
+ SupportErrorInfo_Release,
+ SupportErrorInfo_InterfaceSupportsErrorInfo
+};
+
HRESULT Connection_create( void **obj )
{
struct connection *connection;
if (!(connection = heap_alloc( sizeof(*connection) ))) return E_OUTOFMEMORY;
connection->Connection_iface.lpVtbl = &connection_vtbl;
+ connection->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
connection->refs = 1;
connection->state = adStateClosed;
connection->timeout = 30;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 4ef4762ac6..5a1813694b 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -414,9 +414,8 @@ static void test_Connection(void)
ok(hr == E_NOINTERFACE, "Unexpected IRunnableObject interface\n");
hr = _Connection_QueryInterface(connection, &IID_ISupportErrorInfo, (void**)&errorinfo);
- todo_wine ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
- if (hr == S_OK)
- ISupportErrorInfo_Release(errorinfo);
+ ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
+ ISupportErrorInfo_Release(errorinfo);
if (0) /* Crashes on windows */
{
--
2.17.1
Dec. 12, 2019
Re: win32 on macOS
by Ken Thomases
Hi Fabian,
On Dec 11, 2019, at 12:51 PM, Fabian Maurer <dark.shadow4(a)web.de> wrote:
>
> is there any documentation on how the CodeWeavers solution for 32bit
> Applications on Catalina works?
> I'm interested in the technical details of this miracle, but there don't seem
> to be many details out there. What I found was either on the superficial
> level, or a bunch of speculation.
Our solution involves a custom version of the Clang compiler as well as modifications to Wine. It also relies on a new feature of macOS Catalina to allow the creation of 32-bit code segments in a 64-bit process. Our modified versions of Wine and Clang/LLVM are included in our source tarball at <https://www.codeweavers.com/products/more-information/source>. We hope to have a more convenient approach to sharing and collaborating on this in the future.
The custom compiler has a number of features that support building 32-on-64-bit Wine. These features are enabled when you compile with the "-mwine32" architecture option (as opposed to -m32 or -m64). "-mwine32" is a variant of -m64 with additional functionality:
* It knows about both 32- and 64-bit pointers.
* It knows about 32-bit Microsoft calling conventions (cdecl32, stdcall32, thiscall32, fastcall32).
* It will automatically generate 32-to-64-bit thunks for functions with such 32-bit calling conventions.
* A function pointer whose pointee type has a 32-bit calling convention is assumed to point to 32-bit code. When calling through such a pointer, the compiler automatically generates the appropriate 64-to-32-bit thunk. Taking the address of a function with a 32-bit calling convention will yield a pointer to the 32-to-64-bit thunk the compiler generated. As an optimization, the compiler-generated 32-to-64-bit thunks have a recognizable signature and the call-site code can check that to skip the 64-to-32-to-64-bit thunking that would otherwise occur.
* It has a notion of "local" include paths and thus local (Wine) headers vs. external/system headers. It uses this to apply certain defaults to types from external/system headers.
* It defines the macro __i386_on_x86_64__.
Now for some of the nitty-gritty details:
The compiler has a concept of "address spaces", the normal 64-bit one (called, somewhat confusingly, "default" and a 32-bit one (called "ptr32"). It maintains a current implicit stack address space, a current implicit storage address space, and a current implicit pointer address space.
The implicit stack address space tells the compiler where a stack variable lives. The type of the address-of operator applied to a stack variable is a pointer of the appropriate size. If the variable is in the 32-bit address space, then the resulting pointer is 32 bits in size. If it's in the 64-bit address space, the address is a 64-bit pointer. The same thing happens when an array on the stack decays to a pointer.
By default, when compiling with -mwine32, the implicit stack address space is the 32-bit address space. There's a command-line option, -mstack64, to override that.
The compiler does not control where the stack actually is at runtime. So, it's Wine's responsibility to make sure that threads which run code compiled with the 32-bit stack address space actually have their stack in the low 4GB of the process's virtual memory.
The implicit storage address space tells the compiler where static data and code live. So, if you take the address of a static variable or a function, you get a pointer type of the appropriate size. Similarly for string literals.
By default, when compiling with -mwine32, the implicit storage address space is the 32-bit address space. That can be overridden with the command-line option -mstorage-address-space={default | ptr32}. Furthermore, it can be altered in code using:
#pragma clang storage_addr_space({default | ptr32})
#pragma clang storage_addr_space(push, {default | ptr32})
#pragma clang storage_addr_space(pop)
When an external/system header is #include'd, it's as though the content were surrounded by
#pragma clang storage_addr_space(push, default)
…
#pragma clang storage_addr_space(pop)
So, all of the declarations and definitions in such headers are in the default (64-bit) address space.
Again, the compiler does not actually control where in the process's virtual memory a module gets loaded. It's Wine's responsibility to ensure that modules with code compiled with the 32-bit storage address space is actually loaded in the low 4GB.
The implicit pointer address space governs the size of declared pointers.
When a typedef, struct, or union is defined, the pointer address space that's current at the time is remembered. Later, if a pointer to such a type is declared, the pointer is in that remembered address space. So, for example, a Win32 type such as CREATESTRUCTW will be defined in the ptr32 pointer address space, therefore "CREATESTRUCTW *cs" will be a 32-bit pointer. A system type such as struct stat will be defined in the default (64-bit) pointer address space, so "struct stat *st" will be a 64-bit pointer.
A pointer type can be decorated with the __ptr32 or __ptr64 keyword to explicitly declare its size, overriding the logic above. For example, "CREATESTRUCTW * __ptr64 cs" will be a 64-bit pointer.
If neither of the above apply, the pointer's size is dictated by the current implicit pointer address space. So, for "int *foo", foo is a 32-bit pointer if the implicit pointer address space is ptr32, or a 64-bit pointer if it's default.
The implicit pointer address space is "default" (64-bit), by default. This can be overridden with the command-line option "-mdefault-address-space={default | ptr32}". Furthermore, it can be altered in code using:
#pragma clang default_addr_space({default | ptr32})
#pragma clang default_addr_space(push, {default | ptr32})
#pragma clang default_addr_space(pop)
And, again, external/system headers are processed as though their content were surrounded by:
#pragma clang default_addr_space(push, default)
…
#pragma clang default_addr_space(pop)
A big potential source of problems with 32- and 64-bit pointers is accidental truncation by assigning a 64-bit pointer to a 32-bit pointer. So, such assignment is prohibited. Even a normal cast is not enough to allow it. Only a special cast syntax can enable shortening a pointer: foo = (__addrspace Type)bar.
Another potential source of problems is when casting a pointer type to a smaller integer type or casting an integer type to a smaller pointer type. There's a new set of warnings for that (which 32-on-64-bit Wine promotes to errors). There's another special cast syntax to suppress the warning for a specific conversion: foo = (__truncate Type)bar.
The 32-bit calling conventions can be applied to a function type using __attribute__(({cdecl32 | stdcall32 | thiscall32 | fastcall32})). These calling conventions are slightly tweaked for 64-bit code. None of them are callee-pop; they assume the caller will clean up the arguments pushed to the stack. Since 32-bit callers of stdcall32, thiscall32, or fastcall32 functions will have assumed the callee cleans up, that job falls to the 32-to-64-bit thunks the compiler generates. Also, the generated 64-bit code expects 12 extra bytes on the stack between the return address and the stack arguments. (This makes the thunks simpler and more efficient.)
The name of the 32-to-64-bit thunk generated for such a function is <prefix>_thunk_<function name>. The prefix defaults to "__i386_on_x86_64" but that can be overridden with the command-line option "-minterop64-32-thunk-prefix=<whatever>". Wine sets that to "wine", so the thunk name is wine_thunk_<function_name>.
If the code already supplies a definition of a symbol with that name, the compiler treats that as a custom thunk (or alternative 32-bit implementation) and doesn't auto-generate a thunk of its own.
The generated thunks (both 32-to-64-bit and 64-to-32-bit) need to know the code segment selector to use. The compiler assumes two unsigned short variables are defined whose values are those selectors. By default, the variable names are __i386_on_x86_64_cs32 and __i386_on_x86_64_cs64, but those can be overridden with "-minterop64-32-cs32-name=<name>" and "-minterop64-32-cs64-name=<name>". Wine uses "wine_32on64_cs32" and "wine_32on64_cs64". Those variables are defined and initialized in libwine.
Speaking of code segments, the big thing that Catalina provides that enables this all to work is the ability to create 32-bit code segments in a 64-bit process. For that, they enabled the use of i386_set_ldt() in 64-bit processes. The big caveat though, is that this functionality is restricted by System Integrity Protection (SIP). For now, your best bet to get this working for yourself is to disable SIP. (CrossOver doesn't require that, but the mechanism by which we accomplish that is in flux internally to Apple. When it settles down, I'll update this thread.)
All of that in place, the rest of the work was modifying Wine to use this compiler and OS functionality. That largely consisted of fixing the compilation errors resulting from the interfacing of system libraries (using 64-bit pointers) and Win32 APIs (using 32-bit pointers). Also, everywhere there was an architecture dependency had to be reviewed and possibly altered. That, of course, includes all assembly language code.
As long as this email is, I'm sure I've forgotten or glossed over some stuff. Feel free to ask questions.
Cheers,
Ken
Dec. 12, 2019
[PATCH 9/9] dmcompos: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmcompos/chordmap.c | 4 +-
dlls/dmcompos/composer.c | 1 +
dlls/dmcompos/dmcompos_main.c | 265 +------------------------------
dlls/dmcompos/dmcompos_private.h | 22 ---
dlls/dmcompos/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmcompos/dmobject.h | 14 +-
6 files changed, 258 insertions(+), 295 deletions(-)
diff --git a/dlls/dmcompos/chordmap.c b/dlls/dmcompos/chordmap.c
index 5296970b56..c58857e04c 100644
--- a/dlls/dmcompos/chordmap.c
+++ b/dlls/dmcompos/chordmap.c
@@ -129,7 +129,9 @@ static HRESULT WINAPI chord_IDirectMusicObject_ParseDescriptor(IDirectMusicObjec
desc->guidClass = CLSID_DirectMusicChordMap;
desc->dwValidData |= DMUS_OBJ_CLASS;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (desc));
+ TRACE("returning descriptor:\n");
+ dump_DMUS_OBJECTDESC(desc);
+
return S_OK;
}
diff --git a/dlls/dmcompos/composer.c b/dlls/dmcompos/composer.c
index f2d826020d..9fbe1689c6 100644
--- a/dlls/dmcompos/composer.c
+++ b/dlls/dmcompos/composer.c
@@ -18,6 +18,7 @@
*/
#include "dmcompos_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c
index 3428a58b91..b8b3c5d6d2 100644
--- a/dlls/dmcompos/dmcompos_main.c
+++ b/dlls/dmcompos/dmcompos_main.c
@@ -33,6 +33,7 @@
#include "dmusici.h"
#include "dmcompos_private.h"
+#include "dmobject.h"
#include "rpcproxy.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
@@ -213,267 +214,3 @@ HRESULT WINAPI DllUnregisterServer(void)
*
*
*/
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion(const DMUS_VERSION *version)
-{
- if (!version)
- return "'null'";
- return wine_dbg_sprintf("'%hu,%hu,%hu,%hu'",
- HIWORD(version->dwVersionMS), LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
-
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++)
- {
- if ((flags & names[i].val) || /* standard flag*/
- ((!flags) && (!names[i].val))) { /* zero value only */
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- return wine_dbg_sprintf("%s", buffer);
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* dump whole DMUS_OBJECTDESC struct */
-const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- char buffer[1024] = "", *ptr = &buffer[0];
-
- ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
- ptr += sprintf(ptr, " - dwSize = %d\n", pDesc->dwSize);
- ptr += sprintf(ptr, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = FIXME\n");
- if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
-
- return wine_dbg_sprintf("%s", buffer);
- } else {
- return wine_dbg_sprintf("(NULL)");
- }
-}
diff --git a/dlls/dmcompos/dmcompos_private.h b/dlls/dmcompos/dmcompos_private.h
index 1958c27378..98796875b8 100644
--- a/dlls/dmcompos/dmcompos_private.h
+++ b/dlls/dmcompos/dmcompos_private.h
@@ -65,26 +65,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMCOMPOS_PRIVATE_H */
diff --git a/dlls/dmcompos/dmobject.c b/dlls/dmcompos/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmcompos/dmobject.c
+++ b/dlls/dmcompos/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmcompos/dmobject.h b/dlls/dmcompos/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmcompos/dmobject.h
+++ b/dlls/dmcompos/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
--
2.23.0
Dec. 12, 2019
[PATCH 8/9] dmime: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmime/dmime_main.c | 1 +
dlls/dmime/dmobject.c | 247 ++++++++++++++++++++++++++++++-
dlls/dmime/dmobject.h | 14 +-
dlls/dmime/dmutils.c | 302 +-------------------------------------
dlls/dmime/dmutils.h | 26 ----
dlls/dmime/performance.c | 1 +
dlls/dmime/segmentstate.c | 1 +
7 files changed, 257 insertions(+), 335 deletions(-)
diff --git a/dlls/dmime/dmime_main.c b/dlls/dmime/dmime_main.c
index 37302ff0eb..1749bbe69d 100644
--- a/dlls/dmime/dmime_main.c
+++ b/dlls/dmime/dmime_main.c
@@ -34,6 +34,7 @@
#include "dmusici.h"
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
diff --git a/dlls/dmime/dmobject.c b/dlls/dmime/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmime/dmobject.c
+++ b/dlls/dmime/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmime/dmobject.h b/dlls/dmime/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmime/dmobject.h
+++ b/dlls/dmime/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmime/dmutils.c b/dlls/dmime/dmutils.c
index cd955fd8a5..a61fd5a463 100644
--- a/dlls/dmime/dmutils.c
+++ b/dlls/dmime/dmutils.c
@@ -39,9 +39,9 @@
#include "dmusics.h"
#include "dmutils.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
-WINE_DECLARE_DEBUG_CHANNEL(dmime);
static HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) {
@@ -161,303 +161,3 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-static const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc)
-{
- if (!TRACE_ON(dmime))
- return;
-
- if (pDesc) {
- TRACE_(dmime)("DMUS_OBJECTDESC (%p):", pDesc);
- TRACE_(dmime)(" - dwSize = 0x%08X\n", pDesc->dwSize);
- TRACE_(dmime)(" - dwValidData = 0x%08X ( %s)\n", pDesc->dwValidData, debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS)
- TRACE_(dmime)(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
- TRACE_(dmime)(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE)
- TRACE_(dmime)(" - ftDate = %s\n", debugstr_filetime (&pDesc->ftDate));
- if (pDesc->dwValidData & DMUS_OBJ_VERSION)
- TRACE_(dmime)(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME)
- TRACE_(dmime)(" - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
- TRACE_(dmime)(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
- TRACE_(dmime)(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY)
- TRACE_(dmime)(" - llMemLength = 0x%s - pbMemData = %p\n", wine_dbgstr_longlong(pDesc->llMemLength),
- pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM)
- TRACE_(dmime)(" - pStream = %p\n", pDesc->pStream);
- }
-}
diff --git a/dlls/dmime/dmutils.h b/dlls/dmime/dmutils.h
index 7242746031..913bccfabd 100644
--- a/dlls/dmime/dmutils.h
+++ b/dlls/dmime/dmutils.h
@@ -32,30 +32,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
*/
extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
-/**
- * Debug utilities
- */
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-
-/* dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMUTILS_H */
diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c
index 399b9b9919..615a3f8b14 100644
--- a/dlls/dmime/performance.c
+++ b/dlls/dmime/performance.c
@@ -19,6 +19,7 @@
*/
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c
index b1b176ca5c..edd7ed70f0 100644
--- a/dlls/dmime/segmentstate.c
+++ b/dlls/dmime/segmentstate.c
@@ -18,6 +18,7 @@
*/
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
--
2.23.0
Dec. 12, 2019
[PATCH 7/9] dmloader: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 1 -
dlls/dmloader/debug.c | 270 -------------------------------
dlls/dmloader/debug.h | 16 --
dlls/dmloader/dmloader_private.h | 1 +
dlls/dmloader/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmloader/dmobject.h | 14 +-
6 files changed, 254 insertions(+), 295 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index 075843ad32..005f0d7e9e 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -18,7 +18,6 @@
*/
#include "dmloader_private.h"
-#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 10ba0bce93..0d274394aa 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -20,8 +20,6 @@
#include "dmloader_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
-
/* figures out whether given FOURCC is valid DirectMusic form ID */
BOOL IS_VALID_DMFORM (FOURCC chunkID) {
if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM)
@@ -45,237 +43,6 @@ const char *resolve_STREAM_SEEK (DWORD flag) {
}
}
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
/* returns name of given error code */
const char *debugstr_dmreturn (DWORD code) {
static const flag_info codes[] = {
@@ -443,25 +210,6 @@ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t n
return ptr;
}
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
/* dump DMUS_CONTAINER flags */
static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
@@ -478,24 +226,6 @@ static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) {
return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
}
-/* Dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc)
-{
- TRACE("DMUS_OBJECTDESC (%p):\n", desc);
- TRACE(" - dwSize = %d\n", desc->dwSize);
- TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (desc->dwValidData));
- if (desc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
- if (desc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
- if (desc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = %s\n", debugstr_filetime (&desc->ftDate));
- if (desc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&desc->vVersion));
- if (desc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(desc->wszName));
- if (desc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
- if (desc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
- if (desc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
- if (desc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", desc->pStream);
-}
-
const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) {
if (pHeader) {
char buffer[1024], *ptr = buffer;
diff --git a/dlls/dmloader/debug.h b/dlls/dmloader/debug.h
index 40af340ccf..fec35cfbff 100644
--- a/dlls/dmloader/debug.h
+++ b/dlls/dmloader/debug.h
@@ -26,11 +26,6 @@ typedef struct {
const char* name;
} flag_info;
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
/* used for initialising structs */
#define DM_STRUCT_INIT(x) \
do { \
@@ -39,25 +34,14 @@ typedef struct {
} while (0)
#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
/* check whether chunkID is valid dmobject form chunk */
extern BOOL IS_VALID_DMFORM (FOURCC chunkID) DECLSPEC_HIDDEN;
/* translate STREAM_SEEK flag to string */
extern const char *resolve_STREAM_SEEK (DWORD flag) DECLSPEC_HIDDEN;
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* DMUS_VERSION struct to string conversion for debug messages */
-extern const char *debugstr_dmversion (const DMUS_VERSION *version) DECLSPEC_HIDDEN;
-/* FILETIME struct to string conversion for debug messages */
-extern const char *debugstr_filetime (const FILETIME *time) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
/* returns name of given error code */
extern const char *debugstr_dmreturn (DWORD code) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) DECLSPEC_HIDDEN;
diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h
index a8505003c7..94bb9ddf1b 100644
--- a/dlls/dmloader/dmloader_private.h
+++ b/dlls/dmloader/dmloader_private.h
@@ -40,6 +40,7 @@
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
+#include "dmobject.h"
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
diff --git a/dlls/dmloader/dmobject.c b/dlls/dmloader/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmloader/dmobject.c
+++ b/dlls/dmloader/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmloader/dmobject.h b/dlls/dmloader/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmloader/dmobject.h
+++ b/dlls/dmloader/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
--
2.23.0
Dec. 12, 2019