Sebastian Lackner : server: Allow to create win32 prefix when directory already exists.
Alexandre Julliard
julliard at winehq.org
Mon Dec 19 13:10:37 CST 2016
Module: wine
Branch: stable
Commit: d56dbbb39ebe3f9795b07e57683cc2cd1662afae
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d56dbbb39ebe3f9795b07e57683cc2cd1662afae
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Wed Sep 21 15:24:38 2016 +0200
server: Allow to create win32 prefix when directory already exists.
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 808619b72d1524df2c576ed5faac67dd2093c0f3)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/ntdll/server.c | 11 -----------
server/registry.c | 8 +++++++-
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 356d631..25c6473 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -1139,17 +1139,6 @@ static void setup_config_dir(void)
mkdir( config_dir, 0777 );
if (chdir( config_dir ) == -1) fatal_perror( "chdir to %s\n", config_dir );
- if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" ))
- {
- /* force creation of a 32-bit prefix */
- int fd = open( "system.reg", O_WRONLY | O_CREAT | O_EXCL, 0666 );
- if (fd != -1)
- {
- static const char regfile[] = "WINE REGISTRY Version 2\n\n#arch=win32\n";
- write( fd, regfile, sizeof(regfile) - 1 );
- close( fd );
- }
- }
MESSAGE( "wine: created the configuration directory '%s'\n", config_dir );
}
diff --git a/server/registry.c b/server/registry.c
index a3c1390..65126c3 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -1791,6 +1791,7 @@ void init_registry(void)
WCHAR *current_user_path;
struct unicode_str current_user_str;
struct key *key, *hklm, *hkcu;
+ char *p;
/* switch to the config dir */
@@ -1807,7 +1808,12 @@ void init_registry(void)
fatal_error( "could not create Machine registry key\n" );
if (!load_init_registry_from_file( "system.reg", hklm ))
- prefix_type = sizeof(void *) > sizeof(int) ? PREFIX_64BIT : PREFIX_32BIT;
+ {
+ if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" ))
+ prefix_type = PREFIX_32BIT;
+ else
+ prefix_type = sizeof(void *) > sizeof(int) ? PREFIX_64BIT : PREFIX_32BIT;
+ }
else if (prefix_type == PREFIX_UNKNOWN)
prefix_type = PREFIX_32BIT;
More information about the wine-cvs
mailing list