From 8d686fb6861ca3cf99f18da4339afd102f876750 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 22 Jul 2015 19:35:34 +0000 Subject: [PATCH] [COMDLG32] Sync with Wine Staging 1.7.47. CORE-9924 svn path=/trunk/; revision=68555 --- reactos/dll/win32/comdlg32/cdlg.h | 2 +- reactos/dll/win32/comdlg32/cdlg32.c | 8 ++++ reactos/dll/win32/comdlg32/comdlg32_ros.diff | 40 ++++++++++++-------- reactos/dll/win32/comdlg32/filedlg.c | 5 ++- reactos/dll/win32/comdlg32/itemdlg.c | 27 ++++++------- reactos/media/doc/README.WINE | 2 +- 6 files changed, 50 insertions(+), 34 deletions(-) diff --git a/reactos/dll/win32/comdlg32/cdlg.h b/reactos/dll/win32/comdlg32/cdlg.h index 8d36cf8d6df..4ad1fafa596 100644 --- a/reactos/dll/win32/comdlg32/cdlg.h +++ b/reactos/dll/win32/comdlg32/cdlg.h @@ -62,7 +62,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); #include "resource.h" /* Common dialogs implementation globals */ -#define COMDLG32_Atom ((ATOM)0xa000) /* MS uses this one to identify props */ +#define COMDLG32_Atom MAKEINTATOM(0xa000) /* MS uses this one to identify props */ extern HINSTANCE COMDLG32_hInstance DECLSPEC_HIDDEN; diff --git a/reactos/dll/win32/comdlg32/cdlg32.c b/reactos/dll/win32/comdlg32/cdlg32.c index e0aca77147c..2a1a621411f 100644 --- a/reactos/dll/win32/comdlg32/cdlg32.c +++ b/reactos/dll/win32/comdlg32/cdlg32.c @@ -268,7 +268,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) */ HRESULT WINAPI DllRegisterServer(void) { +#ifdef __REACTOS__ return E_FAIL; // FIXME: __wine_register_resources(COMDLG32_hInstance); +#else + return __wine_register_resources(COMDLG32_hInstance); +#endif } /*********************************************************************** @@ -276,7 +280,11 @@ HRESULT WINAPI DllRegisterServer(void) */ HRESULT WINAPI DllUnregisterServer(void) { +#ifdef __REACTOS__ return E_FAIL; // FIXME: __wine_unregister_resources(COMDLG32_hInstance); +#else + return __wine_unregister_resources(COMDLG32_hInstance); +#endif } #endif /* Win 7 */ diff --git a/reactos/dll/win32/comdlg32/comdlg32_ros.diff b/reactos/dll/win32/comdlg32/comdlg32_ros.diff index dceaf5b2fdb..a3a3685e56a 100644 --- a/reactos/dll/win32/comdlg32/comdlg32_ros.diff +++ b/reactos/dll/win32/comdlg32/comdlg32_ros.diff @@ -1,6 +1,6 @@ -diff -prudN e:\Wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c ---- e:\Wine\dlls\comdlg32/cdlg32.c 2013-10-26 22:24:27.508648000 +0100 -+++ e:\reactos\dll\win32\comdlg32/cdlg32.c 2014-03-05 11:46:06.260510700 +0100 +diff -pudN e:\wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c +--- e:\wine\dlls\comdlg32/cdlg32.c 2015-02-21 17:13:08.621542200 +0100 ++++ e:\reactos\dll\win32\comdlg32/cdlg32.c 2015-07-21 09:48:05.584922500 +0100 @@ -174,6 +157,8 @@ DWORD WINAPI CommDlgExtendedError(void) return 0; /* we never set an error, so there isn't one */ } @@ -10,27 +10,33 @@ diff -prudN e:\Wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32. /************************************************************************* * Implement the CommDlg32 class factory * -@@ -283,7 +268,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSI +@@ -283,7 +268,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSI */ HRESULT WINAPI DllRegisterServer(void) { -- return __wine_register_resources(COMDLG32_hInstance); ++#ifdef __REACTOS__ + return E_FAIL; // FIXME: __wine_register_resources(COMDLG32_hInstance); ++#else + return __wine_register_resources(COMDLG32_hInstance); ++#endif } /*********************************************************************** -@@ -291,5 +276,7 @@ HRESULT WINAPI DllRegisterServer(void) +@@ -291,5 +280,11 @@ HRESULT WINAPI DllRegisterServer(void) */ HRESULT WINAPI DllUnregisterServer(void) { -- return __wine_unregister_resources(COMDLG32_hInstance); ++#ifdef __REACTOS__ + return E_FAIL; // FIXME: __wine_unregister_resources(COMDLG32_hInstance); ++#else + return __wine_unregister_resources(COMDLG32_hInstance); ++#endif } + +#endif /* Win 7 */ -diff -prudN e:\Wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/comdlg32.spec ---- e:\Wine\dlls\comdlg32/comdlg32.spec 2011-09-16 23:22:36.026770600 +0100 +diff -pudN e:\wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/comdlg32.spec +--- e:\wine\dlls\comdlg32/comdlg32.spec 2015-02-21 17:13:08.621542200 +0100 +++ e:\reactos\dll\win32\comdlg32/comdlg32.spec 2012-02-15 22:32:22.456422900 +0100 @@ -3,9 +3,9 @@ @ stdcall ChooseFontA(ptr) @@ -45,11 +51,10 @@ diff -prudN e:\Wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/co @ stdcall FindTextA(ptr) @ stdcall FindTextW(ptr) @ stdcall GetFileTitleA(str ptr long) - -diff -prudN e:\Wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c ---- e:\Wine\dlls\comdlg32/itemdlg.c 2013-10-26 22:24:27.515652700 +0100 -+++ e:\reactos\dll\win32\comdlg32/itemdlg.c 2013-10-15 19:32:27.803008200 +0100 -@@ -18,6 +18,8 @@ +diff -pudN e:\wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c +--- e:\wine\dlls\comdlg32/itemdlg.c 2015-04-05 20:44:56.807083800 +0100 ++++ e:\reactos\dll\win32\comdlg32/itemdlg.c 2015-07-21 09:56:34.329021000 +0100 +@@ -18,10 +18,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ @@ -58,7 +63,12 @@ diff -prudN e:\Wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdl #include #define COBJMACROS -@@ -3660,3 +3662,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn + #define NONAMELESSUNION ++#define NONAMELESSSTRUCT + + #include "windef.h" + #include "winbase.h" +@@ -3847,3 +3850,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn { return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE); } diff --git a/reactos/dll/win32/comdlg32/filedlg.c b/reactos/dll/win32/comdlg32/filedlg.c index 543832aed61..ecd89c77115 100644 --- a/reactos/dll/win32/comdlg32/filedlg.c +++ b/reactos/dll/win32/comdlg32/filedlg.c @@ -2567,10 +2567,11 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) filterSearchIndex[0] = '\0'; } + /* find the file extension by searching for the first dot in filterExt */ /* strip the * or anything else from the extension, "*.abc" becomes "abc" */ /* if the extension is invalid or contains a glob, ignore it */ - filterSearchIndex = PathFindExtensionW(filterExt); - if (*filterSearchIndex++ && !strchrW(filterSearchIndex, '*') && !strchrW(filterSearchIndex, '?')) + filterSearchIndex = strchrW(filterExt, '.'); + if (filterSearchIndex++ && !strchrW(filterSearchIndex, '*') && !strchrW(filterSearchIndex, '?')) { strcpyW(filterExt, filterSearchIndex); } diff --git a/reactos/dll/win32/comdlg32/itemdlg.c b/reactos/dll/win32/comdlg32/itemdlg.c index 1b566086b66..2a0d3553c98 100644 --- a/reactos/dll/win32/comdlg32/itemdlg.c +++ b/reactos/dll/win32/comdlg32/itemdlg.c @@ -1228,7 +1228,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This) /************************************************************************** * Window related functions. */ -static SIZE update_layout(FileDialogImpl *This) +static void update_layout(FileDialogImpl *This) { HDWP hdwp; HWND hwnd; @@ -1236,21 +1236,19 @@ static SIZE update_layout(FileDialogImpl *This) RECT cancel_rc, open_rc; RECT filetype_rc, filename_rc, filenamelabel_rc; RECT toolbar_rc, ebrowser_rc, customctrls_rc; - int missing_width, missing_height; static const UINT vspacing = 4, hspacing = 4; - SIZE ret; + static const UINT min_width = 320, min_height = 200; - GetClientRect(This->dlg_hwnd, &dialog_rc); - - missing_width = max(0, 320 - dialog_rc.right); - missing_height = max(0, 200 - dialog_rc.bottom); - - if(missing_width || missing_height) + if (!GetClientRect(This->dlg_hwnd, &dialog_rc)) { - TRACE("Missing (%d, %d)\n", missing_width, missing_height); - ret.cx = missing_width; - ret.cy = missing_height; - return ret; + TRACE("Invalid dialog window, not updating layout\n"); + return; + } + + if(dialog_rc.right < min_width || dialog_rc.bottom < min_height) + { + TRACE("Dialog size (%d, %d) too small, not updating layout\n", dialog_rc.right, dialog_rc.bottom); + return; } /**** @@ -1402,8 +1400,7 @@ static SIZE update_layout(FileDialogImpl *This) else ERR("Failed to position dialog controls.\n"); - ret.cx = 0; ret.cy = 0; - return ret; + return; } static HRESULT init_explorerbrowser(FileDialogImpl *This) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index ea84c970462..347577b0dc7 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -56,7 +56,7 @@ reactos/dll/win32/cabinet # Synced to WineStaging-1.7.37 reactos/dll/win32/clusapi # Synced to WineStaging-1.7.37 reactos/dll/win32/comcat # Synced to WineStaging-1.7.37 reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.47 -reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.37 +reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.47 reactos/dll/win32/compstui # Synced to WineStaging-1.7.37 reactos/dll/win32/credui # Synced to WineStaging-1.7.37 reactos/dll/win32/crypt32 # Synced to WineStaging-1.7.47