Re: unicode & wine internals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Pouech wrote:
wine_get_unix_file_name is now a unicode function
patch attached this time
A+

--
Eric Pouech
Name:          wgufn
ChangeLog:     made wine_get_unix_file_name take a unicode string pointer
License:       X11
GenDate:       2003/12/07 10:41:05 UTC
ModifiedFiles: dlls/gdi/printdrv.c dlls/kernel/kernel32.spec dlls/winedos/dosconf.c files/dos_fs.c include/winbase.h programs/winemenubuilder/winemenubuilder.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/gdi/printdrv.c,v
retrieving revision 1.35
diff -u -u -r1.35 printdrv.c
--- dlls/gdi/printdrv.c	17 Nov 2003 20:31:30 -0000	1.35
+++ dlls/gdi/printdrv.c	6 Dec 2003 20:40:26 -0000
@@ -511,6 +511,7 @@
     else
     {
 	char buffer[MAX_PATH];
+        WCHAR psCmdPW[MAX_PATH];
 
         TRACE("Just assume it's a file\n");
 
@@ -518,7 +519,8 @@
          * The file name can be dos based, we have to find its
          * Unix correspondant file name
          */
-	wine_get_unix_file_name(psCmdP, buffer, sizeof(buffer));
+        MultiByteToWideChar(CP_ACP, 0, psCmdP, -1, psCmdPW, MAX_PATH);
+	wine_get_unix_file_name(psCmdPW, buffer, sizeof(buffer));
 
         if ((fd = open(buffer, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0)
         {
Index: dlls/kernel/kernel32.spec
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/kernel/kernel32.spec,v
retrieving revision 1.120
diff -u -u -r1.120 kernel32.spec
--- dlls/kernel/kernel32.spec	25 Nov 2003 01:51:07 -0000	1.120
+++ dlls/kernel/kernel32.spec	7 Dec 2003 09:31:21 -0000
@@ -1132,7 +1132,7 @@
 @ varargs __wine_call_from_16_regs()
 
 # Unix files
-@ stdcall wine_get_unix_file_name(str ptr long)
+@ stdcall wine_get_unix_file_name(wstr ptr long)
 
 # Init code
 @ cdecl __wine_kernel_init()
Index: dlls/winedos/dosconf.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winedos/dosconf.c,v
retrieving revision 1.3
diff -u -u -r1.3 dosconf.c
--- dlls/winedos/dosconf.c	17 Nov 2003 20:31:30 -0000	1.3
+++ dlls/winedos/dosconf.c	6 Dec 2003 21:05:25 -0000
@@ -456,13 +456,14 @@
 DOSCONF *DOSCONF_GetConfig(void)
 {
     HKEY hkey;
-    CHAR filename[MAX_PATH];
+    WCHAR filename[MAX_PATH];
+    static const WCHAR configW[] = {'c','o','n','f','i','g','.','s','y','s',0};
 
     if (DOSCONF_loaded)
         return &DOSCONF_config;
 
     /* default value */
-    strcpy( filename, "*" );
+    filename[0] = '*'; filename[1] = '\0';
 
     if (!RegOpenKeyA(HKEY_LOCAL_MACHINE, 
                      "Software\\Wine\\Wine\\Config\\wine", 
@@ -471,11 +472,11 @@
         DWORD type;
         DWORD count = sizeof(filename);
 
-        RegQueryValueExA(hkey, "config.sys", 0, &type, filename, &count);
+        RegQueryValueExW(hkey, configW, 0, &type, (LPBYTE)filename, &count);
         RegCloseKey(hkey);
     }
 
-    if (strcmp(filename, "*") && *filename != '\0')
+    if ((filename[0] != '*' || filename[1] != '\0') && *filename != '\0')
     {
         CHAR fullname[MAX_PATH];
 
@@ -492,7 +493,7 @@
         {
             WARN( "Couldn't open config.sys file given as %s in"
                   " configuration file, section [wine]!\n", 
-                  filename );
+                  debugstr_w(filename) );
         }
     }
 
Index: files/dos_fs.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/files/dos_fs.c,v
retrieving revision 1.143
diff -u -u -r1.143 dos_fs.c
--- files/dos_fs.c	27 Nov 2003 00:59:36 -0000	1.143
+++ files/dos_fs.c	7 Dec 2003 10:24:07 -0000
@@ -1697,15 +1697,12 @@
  *           wine_get_unix_file_name (KERNEL32.@) Not a Windows API
  *
  * Return the full Unix file name for a given path.
- * FIXME: convert dos file name to unicode
  */
-BOOL WINAPI wine_get_unix_file_name( LPCSTR dos, LPSTR buffer, DWORD len )
+BOOL WINAPI wine_get_unix_file_name( LPCWSTR dosW, LPSTR buffer, DWORD len )
 {
     BOOL ret;
     DOS_FULL_NAME path;
-    WCHAR dosW[MAX_PATHNAME_LEN];
 
-    MultiByteToWideChar(CP_ACP, 0, dos, -1, dosW, MAX_PATHNAME_LEN);
     ret = DOSFS_GetFullName( dosW, FALSE, &path );
     if (ret && len)
     {
Index: include/winbase.h
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/include/winbase.h,v
retrieving revision 1.203
diff -u -u -r1.203 winbase.h
--- include/winbase.h	26 Nov 2003 04:11:56 -0000	1.203
+++ include/winbase.h	7 Dec 2003 08:58:53 -0000
@@ -1868,7 +1868,7 @@
 
 /* Wine internal functions */
 
-BOOL        WINAPI wine_get_unix_file_name( LPCSTR dos, LPSTR buffer, DWORD len );
+BOOL        WINAPI wine_get_unix_file_name( LPCWSTR dos, LPSTR buffer, DWORD len );
 
 
 /* a few optimizations for i386/gcc */
Index: programs/winemenubuilder/winemenubuilder.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/programs/winemenubuilder/winemenubuilder.c,v
retrieving revision 1.7
diff -u -u -r1.7 winemenubuilder.c
--- programs/winemenubuilder/winemenubuilder.c	15 Oct 2003 03:35:54 -0000	1.7
+++ programs/winemenubuilder/winemenubuilder.c	6 Dec 2003 21:57:56 -0000
@@ -325,9 +325,11 @@
 /* get the Unix file name for a given path, allocating the string */
 inline static char *get_unix_file_name( const char *dos )
 {
+    WCHAR dosW[MAX_PATH];
     char buffer[MAX_PATH], *ret;
 
-    if (!wine_get_unix_file_name( dos, buffer, sizeof(buffer) )) return NULL;
+    MultiByteToWideChar(CP_ACP, 0, dos, -1, dosW, MAX_PATH);
+    if (!wine_get_unix_file_name( dosW, buffer, sizeof(buffer) )) return NULL;
     ret = HeapAlloc( GetProcessHeap(), 0, lstrlenA( buffer ) + 1 );
     lstrcpyA( ret, buffer );
     return ret;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux