From 05e55edd82eb818c3945ccd4e27c28690ddc4f7c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 17 Apr 2008 20:33:47 +0200 Subject: [PATCH] kernel32: Create the windows and system directories if necessary. --- dlls/kernel32/process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 8d040bdf111..fe523d6825b 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -715,12 +715,12 @@ static void init_windows_dirs(void) DIR_System = buffer; } - if (GetFileAttributesW( DIR_Windows ) == INVALID_FILE_ATTRIBUTES) - MESSAGE( "Warning: the specified Windows directory %s is not accessible.\n", - debugstr_w(DIR_Windows) ); - if (GetFileAttributesW( DIR_System ) == INVALID_FILE_ATTRIBUTES) - MESSAGE( "Warning: the specified System directory %s is not accessible.\n", - debugstr_w(DIR_System) ); + 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() ); TRACE_(file)( "WindowsDir = %s\n", debugstr_w(DIR_Windows) ); TRACE_(file)( "SystemDir = %s\n", debugstr_w(DIR_System) );