Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
c5de0253
Commit
c5de0253
authored
Mar 14, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of the remaining registry configuration parameters.
parent
cf2f1421
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
173 deletions
+10
-173
config
documentation/samples/config
+0
-8
wine.conf.man
documentation/wine.conf.man
+0
-33
registry.c
misc/registry.c
+10
-132
No files found.
documentation/samples/config
View file @
c5de0253
...
...
@@ -138,14 +138,6 @@ WINE REGISTRY Version 2
;"SnoopExclude" = "RtlEnterCriticalSection;RtlLeaveCriticalSection"
;"SpyExclude" = "WM_SIZE;WM_TIMER;"
[registry]
;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
; Where to find the global registries
;"GlobalRegistryDir" = "/etc";
; Global registries (stored in /etc)
"LoadGlobalRegistryFiles" = "Y"
[Clipboard]
"UsePrimary" = "0"
...
...
documentation/wine.conf.man
View file @
c5de0253
...
...
@@ -40,17 +40,6 @@ are listed below.
.PP
.B [wine]
.br
.I format: """windows""=""<directory>"""
.br
default: "C:\\\\WINDOWS"
.br
Used to specify where Wine is supposed to have its Windows directory
(which is an essential part of a Windows environment); make sure to double
the backslashes.
In case of e.g. C:\\WINDOWS, with drive C: being configured as
/home/user/wine_c, the /home/user/wine_c/WINDOWS directory would be used for
this.
.PP
.I format: """GraphicsDriver""=""<x11drv|ttydrv>"""
.br
default: "x11drv"
...
...
@@ -202,28 +191,6 @@ Used to specify which functions will be included in the snoop debug log.
For Relay and Snoop <dllname>.* includes or excludes the whole dll. Exclude
entries have priority over Include entries.
.PP
.B [Registry]
.br
.I format: """LoadGlobalRegistryFiles""=""<boolean>"""
.br
Global registries (stored in /etc)
.PP
.I format: """LoadHomeRegistryFiles""=""<boolean>"""
.br
Home registries (stored in ~user/.wine/)
.PP
.I format: """WritetoHomeRegistryFiles""=""<boolean>"""
.br
TRY to write all changes to the home registry files
.PP
.I format: """LoadWindowsRegistryFiles""=""<boolean>"""
.br
Load Windows registry from the current Windows directory.
.PP
booleans: Y/y/T/t/1 are true, N/n/F/f/0 are false.
.br
Defaults are read all, write to home files.
.PP
.B [Network]
.br
.I format: """UseDnsComputerName""=""<boolean>"""
...
...
misc/registry.c
View file @
c5de0253
...
...
@@ -67,21 +67,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
reg
);
#define SAVE_GLOBAL_REGBRANCH_USER_DEFAULT "/wine.userreg"
#define SAVE_GLOBAL_REGBRANCH_LOCAL_MACHINE "/wine.systemreg"
#define MAX_PATHNAME_LEN 1024
#define IS_OPTION_FALSE(ch) \
((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
/******************************************************************************
*
_
allocate_default_keys [Internal]
* allocate_default_keys [Internal]
* Registry initialisation, allocates some default keys.
*/
static
void
_
allocate_default_keys
(
void
)
static
ULONG
allocate_default_keys
(
void
)
{
static
const
WCHAR
StatDataW
[]
=
{
'D'
,
'y'
,
'n'
,
'D'
,
'a'
,
't'
,
'a'
,
'\\'
,
'P'
,
'e'
,
'r'
,
'f'
,
'S'
,
't'
,
'a'
,
't'
,
's'
,
'\\'
,
...
...
@@ -93,11 +84,10 @@ static void _allocate_default_keys(void)
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'l'
,
'o'
,
'n'
,
'e'
,
0
};
HKEY
hkey
;
ULONG
dispos
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
TRACE
(
"(void)
\n
"
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nameW
;
...
...
@@ -106,7 +96,9 @@ static void _allocate_default_keys(void)
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
StatDataW
);
if
(
!
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
))
NtClose
(
hkey
);
if
(
!
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
&
dispos
))
NtClose
(
hkey
);
if
(
dispos
==
REG_OPENED_EXISTING_KEY
)
return
dispos
;
/* someone else already loaded the registry */
RtlInitUnicodeString
(
&
nameW
,
ConfigManagerW
);
if
(
!
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
))
NtClose
(
hkey
);
...
...
@@ -114,45 +106,8 @@ static void _allocate_default_keys(void)
/* this key is generated when the nt-core booted successfully */
RtlInitUnicodeString
(
&
nameW
,
Clone
);
if
(
!
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
))
NtClose
(
hkey
);
}
/* load the registry file in wine format [Internal] */
static
void
load_wine_registry
(
HKEY
hkey
,
LPCSTR
fn
)
{
WCHAR
*
buffer
;
HANDLE
file
;
DWORD
len
;
UNICODE_STRING
name
;
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
fn
,
-
1
,
NULL
,
0
);
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
fn
,
-
1
,
buffer
,
len
);
RtlInitUnicodeString
(
&
name
,
buffer
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
0
;
attr
.
ObjectName
=
&
name
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
!
NtOpenFile
(
&
file
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
))
{
SERVER_START_REQ
(
load_registry
)
{
req
->
hkey
=
hkey
;
req
->
file
=
file
;
wine_server_call
(
req
);
}
SERVER_END_REQ
;
CloseHandle
(
file
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
dispos
;
}
...
...
@@ -501,25 +456,10 @@ static void convert_environment( HKEY hkey_current_user )
/* load all registry (native and global and home) */
void
SHELL_LoadRegistry
(
void
)
{
HKEY
hkey_
local_machine
,
hkey_users
,
hkey_users_default
,
hkey_current_user
,
hkey_config
;
HKEY
hkey_
current_user
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
DWORD
count
;
ULONG
dispos
;
BOOL
res
;
char
tmp
[
1024
];
static
const
WCHAR
MachineW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
UserW
[]
=
{
'U'
,
's'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
DefaultW
[]
=
{
'.'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
0
};
static
const
WCHAR
RegistryW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
0
};
static
const
WCHAR
load_global_reg_filesW
[]
=
{
'L'
,
'o'
,
'a'
,
'd'
,
'G'
,
'l'
,
'o'
,
'b'
,
'a'
,
'l'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
static
const
WCHAR
GlobalRegistryDirW
[]
=
{
'G'
,
'l'
,
'o'
,
'b'
,
'a'
,
'l'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
'D'
,
'i'
,
'r'
,
0
};
TRACE
(
"(void)
\n
"
);
...
...
@@ -530,70 +470,12 @@ void SHELL_LoadRegistry( void )
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
UserW
);
NtCreateKey
(
&
hkey_users
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
&
dispos
);
dispos
=
allocate_default_keys
();
if
(
dispos
==
REG_OPENED_EXISTING_KEY
)
{
/* someone else already loaded the registry */
NtClose
(
hkey_users
);
return
;
}
return
;
/* someone else already loaded the registry */
RtlInitUnicodeString
(
&
nameW
,
MachineW
);
NtCreateKey
(
&
hkey_local_machine
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
);
attr
.
RootDirectory
=
hkey_users
;
RtlInitUnicodeString
(
&
nameW
,
DefaultW
);
if
(
NtCreateKey
(
&
hkey_users_default
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
))
{
ERR
(
"Cannot create HKEY_USERS/.Default
\n
"
);
ExitProcess
(
1
);
}
RtlOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
hkey_current_user
);
_allocate_default_keys
();
attr
.
RootDirectory
=
0
;
RtlInitUnicodeString
(
&
nameW
,
RegistryW
);
if
(
NtOpenKey
(
&
hkey_config
,
KEY_ALL_ACCESS
,
&
attr
))
hkey_config
=
0
;
/* load global registry if required */
res
=
TRUE
;
RtlInitUnicodeString
(
&
nameW
,
load_global_reg_filesW
);
if
(
!
NtQueryValueKey
(
hkey_config
,
&
nameW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
count
))
{
WCHAR
*
str
=
(
WCHAR
*
)((
KEY_VALUE_PARTIAL_INFORMATION
*
)
tmp
)
->
Data
;
res
=
!
IS_OPTION_FALSE
(
str
[
0
]);
}
if
(
res
)
{
/* load global registry files (stored in /etc/wine) */
char
*
p
,
configfile
[
MAX_PATHNAME_LEN
];
/* Override ETCDIR? */
configfile
[
0
]
=
0
;
RtlInitUnicodeString
(
&
nameW
,
GlobalRegistryDirW
);
if
(
!
NtQueryValueKey
(
hkey_config
,
&
nameW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
count
))
{
WCHAR
*
str
=
(
WCHAR
*
)((
KEY_VALUE_PARTIAL_INFORMATION
*
)
tmp
)
->
Data
;
RtlUnicodeToMultiByteN
(
configfile
,
sizeof
(
configfile
),
NULL
,
str
,
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
));
}
if
(
configfile
[
0
]
!=
'/'
)
strcpy
(
configfile
,
ETCDIR
);
TRACE
(
"GlobalRegistryDir is '%s'.
\n
"
,
configfile
);
/* Load the global HKU hive directly from sysconfdir */
p
=
configfile
+
strlen
(
configfile
);
strcpy
(
p
,
SAVE_GLOBAL_REGBRANCH_USER_DEFAULT
);
load_wine_registry
(
hkey_users
,
configfile
);
/* Load the global machine defaults directly from sysconfdir */
strcpy
(
p
,
SAVE_GLOBAL_REGBRANCH_LOCAL_MACHINE
);
load_wine_registry
(
hkey_local_machine
,
configfile
);
}
/* load home registries */
SERVER_START_REQ
(
load_user_registries
)
...
...
@@ -612,9 +494,5 @@ void SHELL_LoadRegistry( void )
convert_drive_types
();
convert_environment
(
hkey_current_user
);
NtClose
(
hkey_users_default
);
NtClose
(
hkey_current_user
);
NtClose
(
hkey_users
);
NtClose
(
hkey_local_machine
);
NtClose
(
hkey_config
);
}
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