Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7bf36ad3
Commit
7bf36ad3
authored
Oct 24, 1999
by
Nathaniel
Committed by
Alexandre Julliard
Oct 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved registry isolation possibilities.
parent
68944c20
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
76 deletions
+88
-76
registry.c
misc/registry.c
+73
-73
wine.ini
wine.ini
+15
-3
No files found.
misc/registry.c
View file @
7bf36ad3
...
...
@@ -753,33 +753,27 @@ static void SHELL_SaveRegistryBranch(HKEY hkey, int all)
{
char
*
fn
,
*
home
,
*
tmp
;
/* Find out what to save to, get from config file */
BOOL
writeToHome
=
PROFILE_GetWineIniBool
(
"registry"
,
"WritetoHomeRegistries"
,
1
);
BOOL
writeToAlt
=
PROFILE_GetWineIniBool
(
"registry"
,
"WritetoAltRegistries"
,
1
);
/* FIXME: does this check apply to all keys written below ? */
if
(
!
(
home
=
getenv
(
"HOME"
)))
{
ERR_
(
reg
)(
"Failed to get homedirectory of UID %ld.
\n
"
,(
long
)
getuid
());
return
;
}
/* HKEY_LOCAL_MACHINE contains the HKEY_CLASSES_ROOT branch */
if
(
hkey
==
HKEY_CLASSES_ROOT
)
hkey
=
HKEY_LOCAL_MACHINE
;
if
(
hkey
==
HKEY_CLASSES_ROOT
)
hkey
=
HKEY_LOCAL_MACHINE
;
switch
(
hkey
)
{
case
HKEY_CURRENT_USER
:
{
int
usedCfgUser
=
0
;
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"Registry"
,
"UserFileNam
e"
,
""
,
if
(
writeToAlt
&&
PROFILE_GetWineIniString
(
"registry"
,
"AltCurrentUserFil
e"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
_savereg
(
lookup_hkey
(
HKEY_CURRENT_USER
),
fn
,
all
);
usedCfgUser
=
1
;
}
free
(
fn
);
if
(
usedCfgUser
!=
1
)
if
(
home
&&
writeToHome
)
{
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_CURRENT_USER
)
+
2
);
...
...
@@ -803,22 +797,16 @@ static void SHELL_SaveRegistryBranch(HKEY hkey, int all)
free
(
tmp
);
free
(
fn
);
}
}
break
;
case
HKEY_LOCAL_MACHINE
:
{
int
usedCfgLM
=
0
;
/* Try first saving according to the defined location in .winerc */
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"Registry"
,
"LocalMachineFileName"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
if
(
writeToAlt
&&
PROFILE_GetWineIniString
(
"Registry"
,
"AltLocalMachineFile"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
_savereg
(
lookup_hkey
(
HKEY_LOCAL_MACHINE
),
fn
,
all
);
usedCfgLM
=
1
;
}
free
(
fn
);
if
(
usedCfgLM
!=
1
)
if
(
home
&&
writeToHome
)
{
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_LOCAL_MACHINE
)
+
2
);
...
...
@@ -838,17 +826,24 @@ static void SHELL_SaveRegistryBranch(HKEY hkey, int all)
free
(
tmp
);
free
(
fn
);
}
}
break
;
case
HKEY_USERS
:
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
writeToAlt
&&
PROFILE_GetWineIniString
(
"Registry"
,
"AltUserFile"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
_savereg
(
lookup_hkey
(
HKEY_LOCAL_MACHINE
),
fn
,
all
);
free
(
fn
);
if
(
home
&&
writeToHome
)
{
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_LOCAL_USERS_DEFAULT
)
+
2
);
strcpy
(
fn
,
home
);
strcat
(
fn
,
WINE_PREFIX
"/"
SAVE_LOCAL_USERS_DEFAULT
);
tmp
=
(
char
*
)
xmalloc
(
strlen
(
fn
)
+
strlen
(
".tmp"
)
+
1
);
strcpy
(
tmp
,
fn
);
strcat
(
tmp
,
".tmp"
);
strcpy
(
tmp
,
fn
);
strcat
(
tmp
,
".tmp"
);
if
(
_savereg
(
lookup_hkey
(
HKEY_USERS
),
tmp
,
FALSE
))
{
if
(
-
1
==
rename
(
tmp
,
fn
))
{
perror
(
"rename tmp registry"
);
...
...
@@ -857,9 +852,11 @@ static void SHELL_SaveRegistryBranch(HKEY hkey, int all)
}
free
(
tmp
);
free
(
fn
);
}
break
;
default:
ERR_
(
reg
)(
"unknown/invalid key handle !
\n
"
);
break
;
}
}
...
...
@@ -1958,13 +1955,18 @@ void SHELL_LoadRegistry( void )
HKU
=
lookup_hkey
(
HKEY_USERS
);
HKLM
=
lookup_hkey
(
HKEY_LOCAL_MACHINE
);
if
(
PROFILE_GetWineIniBool
(
"registry"
,
"LoadWindowsRegistryFiles"
,
1
))
{
/* Load windows 3.1 entries */
_w31_loadreg
();
/* Load windows 95 entries */
_w95_loadreg
(
"C:
\\
system.1st"
,
HKLM
);
_w95_loadreg
(
"system.dat"
,
HKLM
);
_w95_loadreg
(
"user.dat"
,
HKU
);
}
if
(
PROFILE_GetWineIniBool
(
"registry"
,
"LoadGlobalRegistryFiles"
,
1
))
{
/*
* Load the global HKU hive directly from sysconfdir
*/
...
...
@@ -1974,46 +1976,26 @@ void SHELL_LoadRegistry( void )
* Load the global machine defaults directly form sysconfdir
*/
_wine_loadreg
(
HKLM
,
SAVE_LOCAL_MACHINE_DEFAULT
,
0
);
}
/*
* Load the user saved registries
*/
if
((
home
=
getenv
(
"HOME"
)))
if
(
!
(
home
=
getenv
(
"HOME"
)))
WARN_
(
reg
)(
"Failed to get homedirectory of UID %ld.
\n
"
,(
long
)
getuid
());
else
if
(
PROFILE_GetWineIniBool
(
"registry"
,
"LoadHomeRegistryFiles"
,
0
))
{
/*
* Load user's personal versions of global HKU/.Default keys
*/
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_LOCAL_USERS_DEFAULT
)
+
2
);
strcpy
(
fn
,
home
);
strcat
(
fn
,
WINE_PREFIX
"/"
SAVE_LOCAL_USERS_DEFAULT
);
_wine_loadreg
(
HKU
,
fn
,
REG_OPTION_TAINTED
);
free
(
fn
);
/*
* Load HKCU, attempt to get the registry location from the config
* file first, if exist, load and keep going.
*/
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"Registry"
,
"UserFileName"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
_wine_loadreg
(
HKCU
,
fn
,
0
);
}
free
(
fn
);
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_CURRENT_USER
)
+
2
);
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_CURRENT_USER
)
+
2
);
strcpy
(
fn
,
home
);
strcat
(
fn
,
WINE_PREFIX
"/"
SAVE_CURRENT_USER
);
_wine_loadreg
(
HKCU
,
fn
,
REG_OPTION_TAINTED
);
...
...
@@ -2023,31 +2005,48 @@ void SHELL_LoadRegistry( void )
* Load HKLM, attempt to get the registry location from the config
* file first, if exist, load and keep going.
*/
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"Registry"
,
"LocalMachineFileName"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
_wine_loadreg
(
HKLM
,
fn
,
0
);
}
free
(
fn
);
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_LOCAL_MACHINE
)
+
2
);
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_LOCAL_MACHINE
)
+
2
);
strcpy
(
fn
,
home
);
strcat
(
fn
,
WINE_PREFIX
"/"
SAVE_LOCAL_MACHINE
);
_wine_loadreg
(
HKLM
,
fn
,
REG_OPTION_TAINTED
);
free
(
fn
);
}
else
/*
* Load HKCU, get the registry location from the config
* file, if exist, load and keep going.
*/
if
(
PROFILE_GetWineIniBool
(
"registry"
,
"LoadAltRegistryFiles"
,
1
))
{
WARN_
(
reg
)(
"Failed to get homedirectory of UID %ld.
\n
"
,(
long
)
getuid
());
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"registry"
,
"AltCurrentUserFile"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
_wine_loadreg
(
HKCU
,
fn
,
REG_OPTION_TAINTED
);
}
free
(
fn
);
/*
* Load HKU, get the registry location from the config
* file, if exist, load and keep going.
*/
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"registry"
,
"AltUserFile"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
_wine_loadreg
(
HKU
,
fn
,
REG_OPTION_TAINTED
);
}
free
(
fn
);
/*
* Load HKLM, get the registry location from the config
* file, if exist, load and keep going.
*/
fn
=
xmalloc
(
MAX_PATHNAME_LEN
);
if
(
PROFILE_GetWineIniString
(
"registry"
,
"AltLocalMachineFile"
,
""
,
fn
,
MAX_PATHNAME_LEN
-
1
))
{
_wine_loadreg
(
HKLM
,
fn
,
REG_OPTION_TAINTED
);
}
free
(
fn
);
}
/*
...
...
@@ -2056,10 +2055,11 @@ void SHELL_LoadRegistry( void )
*/
RegCreateKey16
(
HKEY_USERS
,
".Default"
,
&
hkey
);
lpkey
=
lookup_hkey
(
hkey
);
if
(
!
lpkey
)
if
(
!
lpkey
)
{
WARN_
(
reg
)(
"Could not create global user default key
\n
"
);
else
}
else
{
_copy_registry
(
lpkey
,
HKCU
);
}
RegCloseKey
(
hkey
);
...
...
@@ -2074,7 +2074,7 @@ void SHELL_LoadRegistry( void )
_flush_registry
(
HKU
);
/* Reload user's local HKU hive */
if
(
home
)
if
(
home
&&
PROFILE_GetWineIniBool
(
"registry"
,
"LoadHomeRegistryFiles"
,
1
)
)
{
fn
=
(
char
*
)
xmalloc
(
strlen
(
home
)
+
strlen
(
WINE_PREFIX
)
+
strlen
(
SAVE_LOCAL_USERS_DEFAULT
)
+
2
);
...
...
wine.ini
View file @
7bf36ad3
...
...
@@ -125,12 +125,24 @@ LPT3:=/dev/lp3
[spy]
Exclude
=
WM_SIZE;WM_TIMER;
[
R
egistry]
[
r
egistry]
; Paths must be given in /dir/dir/file.reg format.
; Wine will not understand dos file names here...
;UserFileName=xxx ; alternate registry file name (user.reg)
;LocalMachineFileName=xxx ; (system.reg)
AltCurrentUserFile
=
; alternate registry file name: HKCU
AltUserFile= ; alternate registry file name: HKU
AltLocalMachineFile
=
; alternate registry file name: HKLM
;These are all booleans. Y/y/T/t/1 are true, N/n/F/f/0 are false.
;Defaults are read all, write to Home and Alt
;Note: it is pointless to specify alt files and neither load nor write to them.
LoadGlobalRegistryFiles
=
Y ; Global registries (stored in /etc)
LoadHomeRegistryFiles
=
Y ; Home registries (stored in ~user/.wine/)
LoadWindowsRegistryFiles
=
Y ; Windows registries in windows path, above
LoadAltRegistryFiles
=
Y ; Load above registries.
WritetoHomeRegitsryFiles
=
Y ; TRY to write all changes to home registries
WritetoAltRegistryFiles
=
Y ; TRY to write all changes to alt registries
[Tweak.Layout]
;; WineLook=xxx (supported styles are 'Win31'(default), 'Win95', 'Win98')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment