mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
server: Create the windows directories at startup if necessary.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c0f693f6fc
commit
156965eae9
2 changed files with 8 additions and 12 deletions
|
@ -1125,28 +1125,16 @@ done:
|
|||
|
||||
/***********************************************************************
|
||||
* init_windows_dirs
|
||||
*
|
||||
* Create the windows and system directories if necessary.
|
||||
*/
|
||||
static void init_windows_dirs(void)
|
||||
{
|
||||
static const WCHAR default_syswow64W[] = {'C',':','\\','w','i','n','d','o','w','s',
|
||||
'\\','s','y','s','w','o','w','6','4',0};
|
||||
|
||||
if (!CreateDirectoryW( DIR_Windows, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
|
||||
ERR( "directory %s could not be created, error %u\n",
|
||||
debugstr_w(DIR_Windows), GetLastError() );
|
||||
if (!CreateDirectoryW( DIR_System, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
|
||||
ERR( "directory %s could not be created, error %u\n",
|
||||
debugstr_w(DIR_System), GetLastError() );
|
||||
|
||||
if (is_win64 || is_wow64) /* SysWow64 is always defined on 64-bit */
|
||||
{
|
||||
DIR_SysWow64 = default_syswow64W;
|
||||
memcpy( winevdm, default_syswow64W, sizeof(default_syswow64W) - sizeof(WCHAR) );
|
||||
if (!CreateDirectoryW( DIR_SysWow64, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
|
||||
ERR( "directory %s could not be created, error %u\n",
|
||||
debugstr_w(DIR_SysWow64), GetLastError() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1866,6 +1866,14 @@ void init_registry(void)
|
|||
/* start the periodic save timer */
|
||||
set_periodic_save_timer();
|
||||
|
||||
/* create windows directories */
|
||||
|
||||
if (!mkdir( "drive_c/windows", 0777 ))
|
||||
{
|
||||
mkdir( "drive_c/windows/system32", 0777 );
|
||||
if (prefix_type == PREFIX_64BIT) mkdir( "drive_c/windows/syswow64", 0777 );
|
||||
}
|
||||
|
||||
/* go back to the server dir */
|
||||
if (fchdir( server_dir_fd ) == -1) fatal_error( "chdir to server dir: %s\n", strerror( errno ));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue