Huw Davies : commdlg: Pass the 16-bit structure to the WM_INITDIALOG hook.

Alexandre Julliard julliard at winehq.org
Tue Jan 11 15:45:36 CST 2022


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Jan 11 14:00:36 2022 +0000

commdlg: Pass the 16-bit structure to the WM_INITDIALOG hook.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52356
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/commdlg.dll16/filedlg.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/commdlg.dll16/filedlg.c b/dlls/commdlg.dll16/filedlg.c
index 4fa62c15d6c..0a4dad4a37a 100644
--- a/dlls/commdlg.dll16/filedlg.c
+++ b/dlls/commdlg.dll16/filedlg.c
@@ -482,6 +482,12 @@ static UINT_PTR CALLBACK call_hook_proc( WNDPROC16 hook, HWND hwnd, UINT msg, WP
     case WM_ACTIVATEAPP:
         ret = call_hook16( hook, hwnd, msg, wp, HTASK_16( lp ));
         break;
+    case WM_INITDIALOG:
+        {
+            OPENFILENAMEA *ofn = (OPENFILENAMEA *)lp;
+            ret = call_hook16( hook, hwnd, msg, wp, ofn->lCustData );
+            break;
+        }
     default:
         ret = call_hook16( hook, hwnd, msg, wp, lp );
         break;
@@ -591,7 +597,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn ) /* [in/out] address of structure w
     ofn32.nFileOffset       = lpofn->nFileOffset;
     ofn32.nFileExtension    = lpofn->nFileExtension;
     ofn32.lpstrDefExt       = MapSL( lpofn->lpstrDefExt );
-    ofn32.lCustData         = lpofn->lCustData;
+    ofn32.lCustData         = ofn; /* See WM_INITDIALOG in the hook proc */
     ofn32.lpfnHook          = dummy_hook;  /* this is to force old 3.1 dialog style */
 
     if (lpofn->Flags & OFN_ENABLETEMPLATE)




More information about the wine-cvs mailing list