Commit 643538a8 authored by Alexandre Julliard's avatar Alexandre Julliard

winevulkan: Return result through NtCallbackReturn for the debug callbacks.

parent bcda5979
......@@ -602,15 +602,19 @@ void WINAPI vkFreeCommandBuffers(VkDevice device, VkCommandPool cmd_pool, uint32
}
}
static BOOL WINAPI call_vulkan_debug_report_callback( struct wine_vk_debug_report_params *params, ULONG size )
static NTSTATUS WINAPI call_vulkan_debug_report_callback( void *args, ULONG size )
{
return params->user_callback(params->flags, params->object_type, params->object_handle, params->location,
params->code, params->layer_prefix, params->message, params->user_data);
struct wine_vk_debug_report_params *params = args;
VkBool32 ret = params->user_callback(params->flags, params->object_type, params->object_handle, params->location,
params->code, params->layer_prefix, params->message, params->user_data);
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
static BOOL WINAPI call_vulkan_debug_utils_callback( struct wine_vk_debug_utils_params *params, ULONG size )
static NTSTATUS WINAPI call_vulkan_debug_utils_callback( void *args, ULONG size )
{
return params->user_callback(params->severity, params->message_types, &params->data, params->user_data);
struct wine_vk_debug_utils_params *params = args;
VkBool32 ret = params->user_callback(params->severity, params->message_types, &params->data, params->user_data);
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
......
......@@ -118,7 +118,6 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB
struct wine_debug_utils_messenger *object;
void *ret_ptr;
ULONG ret_len;
VkBool32 result;
unsigned int i;
TRACE("%i, %u, %p, %p\n", severity, message_types, callback_data, user_data);
......@@ -166,12 +165,11 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB
params.data.pObjects = object_name_infos;
/* applications should always return VK_FALSE */
result = KeUserModeCallback( NtUserCallVulkanDebugUtilsCallback, &params, sizeof(params),
&ret_ptr, &ret_len );
KeUserModeCallback( NtUserCallVulkanDebugUtilsCallback, &params, sizeof(params), &ret_ptr, &ret_len );
free(object_name_infos);
return result;
if (ret_len == sizeof(VkBool32)) return *(VkBool32 *)ret_ptr;
return VK_FALSE;
}
static VkBool32 debug_report_callback_conversion(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT object_type,
......@@ -207,8 +205,9 @@ static VkBool32 debug_report_callback_conversion(VkDebugReportFlagsEXT flags, Vk
if (!params.object_handle)
params.object_type = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
return KeUserModeCallback( NtUserCallVulkanDebugReportCallback, &params, sizeof(params),
&ret_ptr, &ret_len );
KeUserModeCallback( NtUserCallVulkanDebugReportCallback, &params, sizeof(params), &ret_ptr, &ret_len );
if (ret_len == sizeof(VkBool32)) return *(VkBool32 *)ret_ptr;
return VK_FALSE;
}
static void wine_vk_physical_device_free(struct wine_phys_dev *phys_dev)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment