Alexandre Julliard : server: Create the windows directories at startup if necessary.

Alexandre Julliard julliard at winehq.org
Tue Feb 12 16:36:36 CST 2019


Module: wine
Branch: master
Commit: 156965eae9e5a5753127c35c83021016f81e0c8f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=156965eae9e5a5753127c35c83021016f81e0c8f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Feb 12 20:20:33 2019 +0100

server: Create the windows directories at startup if necessary.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/process.c | 12 ------------
 server/registry.c       |  8 ++++++++
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 26c576e..df2d0d6 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -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() );
     }
 }
 
diff --git a/server/registry.c b/server/registry.c
index 9e6815d..dffa3ac 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -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 ));
 }




More information about the wine-cvs mailing list