Commit a5d73ae4 authored by Alexandre Julliard's avatar Alexandre Julliard

winemac.drv: Return result through NtCallbackReturn for the drag and drop callbacks.

parent 5cd38614
......@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "macdrv_dll.h"
#include "macdrv_res.h"
#include "shellapi.h"
......@@ -209,7 +211,7 @@ NTSTATUS WINAPI macdrv_app_quit_request(void *arg, ULONG size)
}
/* quit_callback() will clean up qi */
return 0;
return STATUS_SUCCESS;
fail:
WARN("failed to allocate window list\n");
......@@ -219,7 +221,7 @@ fail:
HeapFree(GetProcessHeap(), 0, qi);
}
quit_reply(FALSE);
return 0;
return STATUS_SUCCESS;
}
/***********************************************************************
......@@ -259,13 +261,13 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
if (!res_info)
{
WARN("found no RT_GROUP_ICON resource\n");
return 0;
return STATUS_SUCCESS;
}
if (!(res_data = LoadResource(NULL, res_info)))
{
WARN("failed to load RT_GROUP_ICON resource\n");
return 0;
return STATUS_SUCCESS;
}
if (!(icon_dir = LockResource(res_data)))
......
......@@ -499,7 +499,7 @@ NTSTATUS WINAPI macdrv_dnd_query_drop(void *arg, ULONG size)
if (active_data_object) IDataObject_Release(active_data_object);
active_data_object = NULL;
last_droptarget_hwnd = NULL;
return ret;
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
......@@ -511,6 +511,7 @@ NTSTATUS WINAPI macdrv_dnd_query_exited(void *arg, ULONG size)
struct dnd_query_exited_params *params = arg;
HWND hwnd = UlongToHandle(params->hwnd);
IDropTarget *droptarget;
BOOL ret = TRUE;
TRACE("win %p\n", hwnd);
......@@ -529,8 +530,7 @@ NTSTATUS WINAPI macdrv_dnd_query_exited(void *arg, ULONG size)
if (active_data_object) IDataObject_Release(active_data_object);
active_data_object = NULL;
last_droptarget_hwnd = NULL;
return TRUE;
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
......@@ -643,5 +643,6 @@ NTSTATUS WINAPI macdrv_dnd_query_drag(void *arg, ULONG size)
}
TRACE(" -> %s\n", ret ? "TRUE" : "FALSE");
return ret ? effect : 0;
if (!ret) effect = 0;
return NtCallbackReturn( &effect, sizeof(effect), STATUS_SUCCESS );
}
......@@ -227,6 +227,8 @@ static BOOL query_drag_drop(macdrv_query *query)
HWND hwnd = macdrv_get_window_hwnd(query->window);
struct macdrv_win_data *data = get_win_data(hwnd);
struct dnd_query_drop_params params;
void *ret_ptr;
ULONG ret_len;
if (!data)
{
......@@ -240,7 +242,9 @@ static BOOL query_drag_drop(macdrv_query *query)
params.y = query->drag_drop.y + data->whole_rect.top;
params.handle = (UINT_PTR)query->drag_drop.pasteboard;
release_win_data(data);
return macdrv_client_func(client_func_dnd_query_drop, &params, sizeof(params));
if (KeUserModeCallback(client_func_dnd_query_drop, &params, sizeof(params), &ret_ptr, &ret_len))
return FALSE;
return *(BOOL *)ret_ptr;
}
/**************************************************************************
......@@ -249,8 +253,13 @@ static BOOL query_drag_drop(macdrv_query *query)
static BOOL query_drag_exited(macdrv_query *query)
{
struct dnd_query_exited_params params;
void *ret_ptr;
ULONG ret_len;
params.hwnd = HandleToUlong(macdrv_get_window_hwnd(query->window));
return macdrv_client_func(client_func_dnd_query_exited, &params, sizeof(params));
if (KeUserModeCallback(client_func_dnd_query_exited, &params, sizeof(params), &ret_ptr, &ret_len))
return FALSE;
return *(BOOL *)ret_ptr;
}
......@@ -262,6 +271,8 @@ static BOOL query_drag_operation(macdrv_query *query)
struct dnd_query_drag_params params;
HWND hwnd = macdrv_get_window_hwnd(query->window);
struct macdrv_win_data *data = get_win_data(hwnd);
void *ret_ptr;
ULONG ret_len;
DWORD effect;
if (!data)
......@@ -277,7 +288,9 @@ static BOOL query_drag_operation(macdrv_query *query)
params.handle = (UINT_PTR)query->drag_operation.pasteboard;
release_win_data(data);
effect = macdrv_client_func(client_func_dnd_query_drag, &params, sizeof(params));
if (KeUserModeCallback(client_func_dnd_query_drag, &params, sizeof(params), &ret_ptr, &ret_len))
return FALSE;
effect = *(DWORD *)ret_ptr;
if (!effect) return FALSE;
query->drag_operation.accepted_op = dropeffect_to_drag_operation(effect,
......
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