Zhiyi Zhang : comctl32/taskdialog: Move TASKDIALOGCONFIG pointer in struct taskdialog_info.

Alexandre Julliard julliard at winehq.org
Fri May 18 16:53:13 CDT 2018


Module: wine
Branch: master
Commit: 1c6e1ff807b721c5e06c1ba73eb314e51f58a56e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1c6e1ff807b721c5e06c1ba73eb314e51f58a56e

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Fri May 18 17:21:54 2018 +0800

comctl32/taskdialog: Move TASKDIALOGCONFIG pointer in struct taskdialog_info.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/taskdialog.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c
index ef90efc..6471eac 100644
--- a/dlls/comctl32/taskdialog.c
+++ b/dlls/comctl32/taskdialog.c
@@ -84,8 +84,7 @@ struct taskdialog_template_desc
 struct taskdialog_info
 {
     HWND hwnd;
-    PFTASKDIALOGCALLBACK callback;
-    LONG_PTR callback_data;
+    const TASKDIALOGCONFIG *taskconfig;
 };
 
 static void pixels_to_dialogunits(const struct taskdialog_template_desc *desc, LONG *width, LONG *height)
@@ -520,8 +519,10 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
 
 static HRESULT taskdialog_notify(struct taskdialog_info *dialog_info, UINT notification, WPARAM wparam, LPARAM lparam)
 {
-    return dialog_info->callback ? dialog_info->callback(dialog_info->hwnd, notification, wparam, lparam,
-            dialog_info->callback_data) : S_OK;
+    const TASKDIALOGCONFIG *taskconfig = dialog_info->taskconfig;
+    return taskconfig->pfCallback
+               ? taskconfig->pfCallback(dialog_info->hwnd, notification, wparam, lparam, taskconfig->lpCallbackData)
+               : S_OK;
 }
 
 static void taskdialog_on_button_click(struct taskdialog_info *dialog_info, WORD command_id)
@@ -590,8 +591,7 @@ HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *taskconfig, int *butto
     if (!taskconfig || taskconfig->cbSize != sizeof(TASKDIALOGCONFIG))
         return E_INVALIDARG;
 
-    dialog_info.callback = taskconfig->pfCallback;
-    dialog_info.callback_data = taskconfig->lpCallbackData;
+    dialog_info.taskconfig = taskconfig;
 
     template = create_taskdialog_template(taskconfig);
     ret = (short)DialogBoxIndirectParamW(taskconfig->hInstance, template, taskconfig->hwndParent,




More information about the wine-cvs mailing list