From da5d24be89d1d9476563f53a7131b3a718a83e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 26 May 2005 21:02:35 +0000 Subject: [PATCH] Sync to Wine-20050524: Alexandre Julliard - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Don't convert the template name to Unicode, it's not used by the dialog anyway. Clear the window property on WM_DESTROY. Michael Jung - Use IShellFolder::GetDisplayNameOf instead of SHGetPathFromIDList to be able to browse shell namespace extensions. svn path=/trunk/; revision=15532 --- reactos/lib/comdlg32/Makefile.in | 2 +- reactos/lib/comdlg32/commdlg.spec | 1 - reactos/lib/comdlg32/filedlg.c | 8 +++- reactos/lib/comdlg32/filedlgbrowser.c | 3 +- reactos/lib/comdlg32/fontdlg.c | 12 +---- reactos/lib/comdlg32/generic.c | 63 --------------------------- 6 files changed, 11 insertions(+), 78 deletions(-) delete mode 100644 reactos/lib/comdlg32/generic.c diff --git a/reactos/lib/comdlg32/Makefile.in b/reactos/lib/comdlg32/Makefile.in index 7a34e9d1a3e..13851c30559 100644 --- a/reactos/lib/comdlg32/Makefile.in +++ b/reactos/lib/comdlg32/Makefile.in @@ -3,6 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = comdlg32.dll +IMPORTLIB = libcomdlg32.$(IMPLIBEXT) IMPORTS = shell32 shlwapi comctl32 winspool user32 gdi32 kernel32 ntdll EXTRALIBS = -luuid @@ -22,7 +23,6 @@ C_SRCS16 = \ filedlg16.c \ finddlg.c \ fontdlg16.c \ - generic.c \ printdlg16.c SPEC_SRCS16 = commdlg.spec diff --git a/reactos/lib/comdlg32/commdlg.spec b/reactos/lib/comdlg32/commdlg.spec index 283ac4b5920..165c64ac02e 100644 --- a/reactos/lib/comdlg32/commdlg.spec +++ b/reactos/lib/comdlg32/commdlg.spec @@ -24,4 +24,3 @@ #29 pascal DWLBSUBCLASS exported, shared data #30 pascal DWUPARROWHACK exported, shared data #31 pascal DWOKSUBCLASS exported, shared data -32 pascal DllEntryPoint(long word word word long word) COMMDLG_DllEntryPoint diff --git a/reactos/lib/comdlg32/filedlg.c b/reactos/lib/comdlg32/filedlg.c index 41dd83ffde0..e1722de3ab2 100644 --- a/reactos/lib/comdlg32/filedlg.c +++ b/reactos/lib/comdlg32/filedlg.c @@ -1835,7 +1835,13 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_w(lpszTemp), lpsf); - if(lstrlenW(lpwstrTemp)==2) PathAddBackslashW(lpwstrTemp); + /* append a backslash to drive letters */ + if(lstrlenW(lpwstrTemp)==2 && lpwstrTemp[1] == ':' && + ((lpwstrTemp[0] >= 'a' && lpwstrTemp[0] <= 'z') || + (lpwstrTemp[0] >= 'A' && lpwstrTemp[0] <= 'Z'))) + { + PathAddBackslashW(lpwstrTemp); + } dwAttributes = SFGAO_FOLDER; if(SUCCEEDED(IShellFolder_ParseDisplayName(lpsf, hwnd, NULL, lpwstrTemp, &dwEaten, &pidl, &dwAttributes))) diff --git a/reactos/lib/comdlg32/filedlgbrowser.c b/reactos/lib/comdlg32/filedlgbrowser.c index e4ae8bd2704..51bca31262b 100644 --- a/reactos/lib/comdlg32/filedlgbrowser.c +++ b/reactos/lib/comdlg32/filedlgbrowser.c @@ -776,7 +776,8 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowse else { /* Tell the dialog that the user selected a file */ - hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L); + PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L); + hRes = S_OK; } /* Free memory used by pidl */ diff --git a/reactos/lib/comdlg32/fontdlg.c b/reactos/lib/comdlg32/fontdlg.c index 8237f1edae9..829c89bcc4e 100644 --- a/reactos/lib/comdlg32/fontdlg.c +++ b/reactos/lib/comdlg32/fontdlg.c @@ -1024,18 +1024,15 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcfw) { LPCHOOSEFONTA lpcfa; - LPCSTR lpTemplateName; LPSTR lpszStyle; LPLOGFONTA lpLogFonta; int len; lpcfa = GetPropW(hwnd, strWineFontData_a); lpLogFonta = lpcfa->lpLogFont; - lpTemplateName = lpcfa->lpTemplateName; lpszStyle = lpcfa->lpszStyle; memcpy(lpcfa, lpcfw, sizeof(CHOOSEFONTA)); lpcfa->lpLogFont = lpLogFonta; - lpcfa->lpTemplateName = lpTemplateName; lpcfa->lpszStyle = lpszStyle; memcpy(lpcfa->lpLogFont, lpcfw->lpLogFont, sizeof(LOGFONTA)); WideCharToMultiByte(CP_ACP, 0, lpcfw->lpLogFont->lfFaceName, @@ -1047,9 +1044,9 @@ LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpc HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle); } - HeapFree(GetProcessHeap(), 0, (LPBYTE)lpcfw->lpTemplateName); HeapFree(GetProcessHeap(), 0, lpcfw->lpLogFont); HeapFree(GetProcessHeap(), 0, lpcfw); + SetPropW(hwnd, strWineFontData, 0); return TRUE; } @@ -1141,13 +1138,6 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, lpcfw->lpszStyle, len); } - if((lpcfa->Flags & CF_ENABLETEMPLATE) && lpcfa->lpTemplateName) { - len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, -1, NULL, 0); - lpcfw->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, - -1, (LPWSTR)lpcfw->lpTemplateName, len); - } - if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcfw)) { TRACE("CFn_WMInitDialog returned FALSE\n"); diff --git a/reactos/lib/comdlg32/generic.c b/reactos/lib/comdlg32/generic.c deleted file mode 100644 index e54df203041..00000000000 --- a/reactos/lib/comdlg32/generic.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * COMMDLG/COMDLG32 functions - * - * Copyright 1994 Martin Ayotte - * Copyright 1996 Albrecht Kleine - * Copyright 1998,1999 Bertho Stultiens - * Copyright 1999 Klaas van Gend - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "commdlg.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(commdlg); - -#include "cdlg.h" -#include "cdlg16.h" - -/*********************************************************************** - * DllEntryPoint [COMMDLG.32] - * - * Initialization code for the COMMDLG DLL - * - * RETURNS: - */ -BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2) -{ - TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2); - return TRUE; -} - - -/*********************************************************************** - * CommDlgExtendedError16 [COMMDLG.26] - * - * Get the last error value if a commdlg function fails. - * RETURNS - * Current error value which might not be valid - * if a previous call succeeded. - */ -DWORD WINAPI CommDlgExtendedError16(void) -{ - return CommDlgExtendedError(); -}