Commit 95c9dee3 authored by Alexandre Julliard's avatar Alexandre Julliard

wineboot: Keep config directory path in Unicode.

parent e87c84f5
...@@ -160,21 +160,21 @@ done: ...@@ -160,21 +160,21 @@ done:
} }
/* print the config directory in a more Unix-ish way */ /* print the config directory in a more Unix-ish way */
static const char *prettyprint_configdir(void) static const WCHAR *prettyprint_configdir(void)
{ {
static char buffer[MAX_PATH]; static WCHAR buffer[MAX_PATH];
WCHAR *path = _wgetenv( wineconfigdirW ); WCHAR *p, *path = _wgetenv( wineconfigdirW );
char *p;
if (!WideCharToMultiByte( CP_UNIXCP, 0, path, -1, buffer, ARRAY_SIZE(buffer), NULL, NULL )) lstrcpynW( buffer, path, ARRAY_SIZE(buffer) );
strcpy( buffer + ARRAY_SIZE(buffer) - 4, "..." ); if (lstrlenW( wineconfigdirW ) >= ARRAY_SIZE(buffer) )
lstrcpyW( buffer + ARRAY_SIZE(buffer) - 4, L"..." );
if (!strncmp( buffer, "\\??\\unix\\", 9 )) if (!wcsncmp( buffer, L"\\??\\unix\\", 9 ))
{ {
for (p = buffer + 9; *p; p++) if (*p == '\\') *p = '/'; for (p = buffer + 9; *p; p++) if (*p == '\\') *p = '/';
return buffer + 9; return buffer + 9;
} }
else if (!strncmp( buffer, "\\??\\Z:\\", 7 )) else if (!wcsncmp( buffer, L"\\??\\Z:\\", 7 ))
{ {
for (p = buffer + 6; *p; p++) if (*p == '\\') *p = '/'; for (p = buffer + 6; *p; p++) if (*p == '\\') *p = '/';
return buffer + 6; return buffer + 6;
...@@ -1064,18 +1064,9 @@ static INT_PTR CALLBACK wait_dlgproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ...@@ -1064,18 +1064,9 @@ static INT_PTR CALLBACK wait_dlgproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp
static HWND show_wait_window(void) static HWND show_wait_window(void)
{ {
const char *config_dir = prettyprint_configdir(); HWND hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0,
WCHAR *name; wait_dlgproc, (LPARAM)prettyprint_configdir() );
HWND hwnd;
DWORD len;
len = MultiByteToWideChar( CP_UNIXCP, 0, config_dir, -1, NULL, 0 );
name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_UNIXCP, 0, config_dir, -1, name, len );
hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0,
wait_dlgproc, (LPARAM)name );
ShowWindow( hwnd, SW_SHOWNORMAL ); ShowWindow( hwnd, SW_SHOWNORMAL );
HeapFree( GetProcessHeap(), 0, name );
return hwnd; return hwnd;
} }
...@@ -1227,13 +1218,13 @@ static void update_wineprefix( BOOL force ) ...@@ -1227,13 +1218,13 @@ static void update_wineprefix( BOOL force )
if (!inf_path) if (!inf_path)
{ {
WINE_MESSAGE( "wine: failed to update %s, wine.inf not found\n", prettyprint_configdir() ); WINE_MESSAGE( "wine: failed to update %s, wine.inf not found\n", debugstr_w( config_dir ));
return; return;
} }
if ((fd = _wopen( inf_path, O_RDONLY )) == -1) if ((fd = _wopen( inf_path, O_RDONLY )) == -1)
{ {
WINE_MESSAGE( "wine: failed to update %s with %s: %s\n", WINE_MESSAGE( "wine: failed to update %s with %s: %s\n",
prettyprint_configdir(), debugstr_w(inf_path), strerror(errno) ); debugstr_w(config_dir), debugstr_w(inf_path), strerror(errno) );
goto done; goto done;
} }
fstat( fd, &st ); fstat( fd, &st );
...@@ -1263,7 +1254,7 @@ static void update_wineprefix( BOOL force ) ...@@ -1263,7 +1254,7 @@ static void update_wineprefix( BOOL force )
install_root_pnp_devices(); install_root_pnp_devices();
update_user_profile(); update_user_profile();
WINE_MESSAGE( "wine: configuration in '%s' has been updated.\n", prettyprint_configdir() ); WINE_MESSAGE( "wine: configuration in %s has been updated.\n", debugstr_w(prettyprint_configdir()) );
} }
done: done:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment