Sync to Wine-20050524:
authorGé van Geldorp <ge@gse.nl>
Thu, 26 May 2005 21:02:35 +0000 (21:02 +0000)
committerGé van Geldorp <ge@gse.nl>
Thu, 26 May 2005 21:02:35 +0000 (21:02 +0000)
Alexandre Julliard <julliard@winehq.org>
- 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 <mjung@iss.tu-darmstadt.de>
- Use IShellFolder::GetDisplayNameOf instead of SHGetPathFromIDList to
  be able to browse shell namespace extensions.

svn path=/trunk/; revision=15532

reactos/lib/comdlg32/Makefile.in
reactos/lib/comdlg32/commdlg.spec
reactos/lib/comdlg32/filedlg.c
reactos/lib/comdlg32/filedlgbrowser.c
reactos/lib/comdlg32/fontdlg.c
reactos/lib/comdlg32/generic.c [deleted file]

index 7a34e9d..13851c3 100644 (file)
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@\r
 VPATH     = @srcdir@\r
 MODULE    = comdlg32.dll\r
 SRCDIR    = @srcdir@\r
 VPATH     = @srcdir@\r
 MODULE    = comdlg32.dll\r
+IMPORTLIB = libcomdlg32.$(IMPLIBEXT)\r
 IMPORTS   = shell32 shlwapi comctl32 winspool user32 gdi32 kernel32 ntdll\r
 EXTRALIBS = -luuid\r
 \r
 IMPORTS   = shell32 shlwapi comctl32 winspool user32 gdi32 kernel32 ntdll\r
 EXTRALIBS = -luuid\r
 \r
@@ -22,7 +23,6 @@ C_SRCS16 = \
        filedlg16.c \\r
        finddlg.c \\r
        fontdlg16.c \\r
        filedlg16.c \\r
        finddlg.c \\r
        fontdlg16.c \\r
-       generic.c \\r
        printdlg16.c\r
 \r
 SPEC_SRCS16 = commdlg.spec\r
        printdlg16.c\r
 \r
 SPEC_SRCS16 = commdlg.spec\r
index 283ac4b..165c64a 100644 (file)
@@ -24,4 +24,3 @@
 #29  pascal  DWLBSUBCLASS exported, shared data\r
 #30  pascal  DWUPARROWHACK exported, shared data\r
 #31  pascal  DWOKSUBCLASS exported, shared data\r
 #29  pascal  DWLBSUBCLASS exported, shared data\r
 #30  pascal  DWUPARROWHACK exported, shared data\r
 #31  pascal  DWOKSUBCLASS exported, shared data\r
-32 pascal DllEntryPoint(long word word word long word) COMMDLG_DllEntryPoint\r
index 41dd83f..e1722de 100644 (file)
@@ -1835,7 +1835,13 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
 \r
       TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_w(lpszTemp), lpsf);\r
 \r
 \r
       TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_w(lpszTemp), lpsf);\r
 \r
-      if(lstrlenW(lpwstrTemp)==2) PathAddBackslashW(lpwstrTemp);\r
+      /* append a backslash to drive letters */\r
+      if(lstrlenW(lpwstrTemp)==2 && lpwstrTemp[1] == ':' && \r
+        ((lpwstrTemp[0] >= 'a' && lpwstrTemp[0] <= 'z') ||\r
+         (lpwstrTemp[0] >= 'A' && lpwstrTemp[0] <= 'Z'))) \r
+      {\r
+        PathAddBackslashW(lpwstrTemp);\r
+      }\r
 \r
       dwAttributes = SFGAO_FOLDER;\r
       if(SUCCEEDED(IShellFolder_ParseDisplayName(lpsf, hwnd, NULL, lpwstrTemp, &dwEaten, &pidl, &dwAttributes)))\r
 \r
       dwAttributes = SFGAO_FOLDER;\r
       if(SUCCEEDED(IShellFolder_ParseDisplayName(lpsf, hwnd, NULL, lpwstrTemp, &dwEaten, &pidl, &dwAttributes)))\r
index e4ae8bd..51bca31 100644 (file)
@@ -776,7 +776,8 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowse
         else\r
        {\r
           /* Tell the dialog that the user selected a file */\r
         else\r
        {\r
           /* Tell the dialog that the user selected a file */\r
-         hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);\r
+         PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);\r
+         hRes = S_OK;\r
        }\r
 \r
         /* Free memory used by pidl */\r
        }\r
 \r
         /* Free memory used by pidl */\r
index 8237f1e..829c89b 100644 (file)
@@ -1024,18 +1024,15 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
 LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcfw)\r
 {\r
     LPCHOOSEFONTA lpcfa;\r
 LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcfw)\r
 {\r
     LPCHOOSEFONTA lpcfa;\r
-    LPCSTR lpTemplateName;\r
     LPSTR lpszStyle;\r
     LPLOGFONTA lpLogFonta;\r
     int len;\r
 \r
     lpcfa = GetPropW(hwnd, strWineFontData_a);\r
     lpLogFonta = lpcfa->lpLogFont;\r
     LPSTR lpszStyle;\r
     LPLOGFONTA lpLogFonta;\r
     int len;\r
 \r
     lpcfa = GetPropW(hwnd, strWineFontData_a);\r
     lpLogFonta = lpcfa->lpLogFont;\r
-    lpTemplateName = lpcfa->lpTemplateName;\r
     lpszStyle = lpcfa->lpszStyle;\r
     memcpy(lpcfa, lpcfw, sizeof(CHOOSEFONTA));\r
     lpcfa->lpLogFont = lpLogFonta;\r
     lpszStyle = lpcfa->lpszStyle;\r
     memcpy(lpcfa, lpcfw, sizeof(CHOOSEFONTA));\r
     lpcfa->lpLogFont = lpLogFonta;\r
-    lpcfa->lpTemplateName = lpTemplateName;\r
     lpcfa->lpszStyle = lpszStyle;\r
     memcpy(lpcfa->lpLogFont, lpcfw->lpLogFont, sizeof(LOGFONTA));\r
     WideCharToMultiByte(CP_ACP, 0, lpcfw->lpLogFont->lfFaceName,\r
     lpcfa->lpszStyle = lpszStyle;\r
     memcpy(lpcfa->lpLogFont, lpcfw->lpLogFont, sizeof(LOGFONTA));\r
     WideCharToMultiByte(CP_ACP, 0, lpcfw->lpLogFont->lfFaceName,\r
@@ -1047,9 +1044,9 @@ LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpc
         HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle);\r
     }\r
 \r
         HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle);\r
     }\r
 \r
-    HeapFree(GetProcessHeap(), 0, (LPBYTE)lpcfw->lpTemplateName);\r
     HeapFree(GetProcessHeap(), 0, lpcfw->lpLogFont);\r
     HeapFree(GetProcessHeap(), 0, lpcfw);\r
     HeapFree(GetProcessHeap(), 0, lpcfw->lpLogFont);\r
     HeapFree(GetProcessHeap(), 0, lpcfw);\r
+    SetPropW(hwnd, strWineFontData, 0);\r
 \r
     return TRUE;\r
 }\r
 \r
     return TRUE;\r
 }\r
@@ -1141,13 +1138,6 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
             MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, lpcfw->lpszStyle, len);\r
         }\r
 \r
             MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, lpcfw->lpszStyle, len);\r
         }\r
 \r
-        if((lpcfa->Flags & CF_ENABLETEMPLATE) && lpcfa->lpTemplateName) {\r
-            len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, -1, NULL, 0);\r
-            lpcfw->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));\r
-            MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName,\r
-                                -1, (LPWSTR)lpcfw->lpTemplateName, len);\r
-        }\r
-\r
         if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcfw))\r
         {\r
             TRACE("CFn_WMInitDialog returned FALSE\n");\r
         if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcfw))\r
         {\r
             TRACE("CFn_WMInitDialog returned FALSE\n");\r
diff --git a/reactos/lib/comdlg32/generic.c b/reactos/lib/comdlg32/generic.c
deleted file mode 100644 (file)
index e54df20..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*\r
- * COMMDLG/COMDLG32 functions\r
- *\r
- * Copyright 1994 Martin Ayotte\r
- * Copyright 1996 Albrecht Kleine\r
- * Copyright 1998,1999 Bertho Stultiens\r
- * Copyright 1999 Klaas van Gend\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- */\r
-\r
-#include <stdarg.h>\r
-\r
-#include "windef.h"\r
-#include "winbase.h"\r
-#include "wingdi.h"\r
-#include "winuser.h"\r
-#include "commdlg.h"\r
-#include "wine/debug.h"\r
-\r
-WINE_DEFAULT_DEBUG_CHANNEL(commdlg);\r
-\r
-#include "cdlg.h"\r
-#include "cdlg16.h"\r
-\r
-/***********************************************************************\r
- *     DllEntryPoint                   [COMMDLG.32]\r
- *\r
- *    Initialization code for the COMMDLG DLL\r
- *\r
- * RETURNS:\r
- */\r
-BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)\r
-{\r
-       TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);\r
-       return TRUE;\r
-}\r
-\r
-\r
-/***********************************************************************\r
- *     CommDlgExtendedError16                  [COMMDLG.26]\r
- *\r
- * Get the last error value if a commdlg function fails.\r
- *     RETURNS\r
- *             Current error value which might not be valid\r
- *             if a previous call succeeded.\r
- */\r
-DWORD WINAPI CommDlgExtendedError16(void)\r
-{\r
-       return CommDlgExtendedError();\r
-}\r