Dmitry Timoshkov : kernel32: Explicitly treat the current working directory name as a unix one.
Alexandre Julliard
julliard at winehq.org
Fri Dec 4 09:11:30 CST 2009
Module: wine
Branch: master
Commit: 2536bfd1d8ee90bf0e59706145ee0e8da6a7be7b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2536bfd1d8ee90bf0e59706145ee0e8da6a7be7b
Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date: Fri Dec 4 19:39:19 2009 +0800
kernel32: Explicitly treat the current working directory name as a unix one.
---
dlls/kernel32/process.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 83d3f6c..08ac255 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -829,14 +829,16 @@ static void init_current_directory( CURDIR *cur_dir )
if (pwd)
{
- WCHAR *dirW;
- int lenW = MultiByteToWideChar( CP_UNIXCP, 0, pwd, -1, NULL, 0 );
- if ((dirW = HeapAlloc( GetProcessHeap(), 0, lenW * sizeof(WCHAR) )))
+ ANSI_STRING unix_name;
+ UNICODE_STRING nt_name;
+ RtlInitAnsiString( &unix_name, pwd );
+ if (!wine_unix_to_nt_file_name( &unix_name, &nt_name ))
{
- MultiByteToWideChar( CP_UNIXCP, 0, pwd, -1, dirW, lenW );
- RtlInitUnicodeString( &dir_str, dirW );
- RtlSetCurrentDirectory_U( &dir_str );
- RtlFreeUnicodeString( &dir_str );
+ UNICODE_STRING dos_path;
+ /* skip the \??\ prefix, nt_name is 0 terminated */
+ RtlInitUnicodeString( &dos_path, nt_name.Buffer + 4 );
+ RtlSetCurrentDirectory_U( &dos_path );
+ RtlFreeUnicodeString( &nt_name );
}
}
More information about the wine-cvs
mailing list