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
6e92d382
Commit
6e92d382
authored
Jun 13, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed registry access functions to use more meaningful names.
parent
f231ef56
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
40 deletions
+40
-40
appdefaults.c
programs/winecfg/appdefaults.c
+4
-4
audio.c
programs/winecfg/audio.c
+2
-2
driveui.c
programs/winecfg/driveui.c
+6
-6
libraries.c
programs/winecfg/libraries.c
+4
-4
winecfg.c
programs/winecfg/winecfg.c
+4
-4
winecfg.h
programs/winecfg/winecfg.h
+8
-8
x11drvdlg.c
programs/winecfg/x11drvdlg.c
+12
-12
No files found.
programs/winecfg/appdefaults.c
View file @
6e92d382
...
...
@@ -40,7 +40,7 @@ static void update_comboboxes(HWND dialog)
char
*
winver
;
/* retrieve the registry values */
winver
=
get
(
keypath
(
"Version"
),
"Windows"
,
""
);
winver
=
get
_reg_key
(
keypath
(
"Version"
),
"Windows"
,
""
);
/* empty winver means use automatic mode (ie the builtin dll linkage heuristics) */
WINE_TRACE
(
"winver is %s
\n
"
,
*
winver
!=
'\0'
?
winver
:
"null (automatic mode)"
);
...
...
@@ -279,7 +279,7 @@ static void on_remove_app_click(HWND dialog)
assert
(
selection
!=
0
);
/* user cannot click this button when "default settings" is selected */
section
[
strlen
(
section
)]
=
'\0'
;
/* remove last backslash */
set
(
section
,
NULL
,
NULL
);
/* delete the section */
set
_reg_key
(
section
,
NULL
,
NULL
);
/* delete the section */
ListView_DeleteItem
(
listview
,
selection
);
ListView_SetItemState
(
listview
,
selection
-
1
,
LVIS_SELECTED
|
LVIS_FOCUSED
,
LVIS_SELECTED
|
LVIS_FOCUSED
);
...
...
@@ -296,12 +296,12 @@ static void on_winver_change(HWND dialog)
if
(
selection
==
0
)
{
WINE_TRACE
(
"automatic/default selected so removing current setting
\n
"
);
set
(
keypath
(
"Version"
),
"Windows"
,
NULL
);
set
_reg_key
(
keypath
(
"Version"
),
"Windows"
,
NULL
);
}
else
{
WINE_TRACE
(
"setting Version
\\
Windows key to value '%s'
\n
"
,
ver
[
selection
-
1
].
szVersion
);
set
(
keypath
(
"Version"
),
"Windows"
,
ver
[
selection
-
1
].
szVersion
);
set
_reg_key
(
keypath
(
"Version"
),
"Windows"
,
ver
[
selection
-
1
].
szVersion
);
}
/* enable the apply button */
...
...
programs/winecfg/audio.c
View file @
6e92d382
...
...
@@ -55,7 +55,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
{
if
(
!
strcmp
(
pAudioDrv
->
szDriver
,
drivername
))
{
set
(
"Winmm"
,
"Drivers"
,
(
char
*
)
pAudioDrv
->
szDriver
);
set
_reg_key
(
"Winmm"
,
"Drivers"
,
(
char
*
)
pAudioDrv
->
szDriver
);
SendMessage
(
GetParent
(
hDlg
),
PSM_CHANGED
,
(
WPARAM
)
hDlg
,
0
);
/* enable apply button */
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_DRIVER
,
CB_SETCURSEL
,
(
WPARAM
)
i
,
0
);
...
...
@@ -66,7 +66,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
static
void
initAudioDlg
(
HWND
hDlg
)
{
char
*
curAudioDriver
=
get
(
"Winmm"
,
"Drivers"
,
"winealsa.drv"
);
char
*
curAudioDriver
=
get
_reg_key
(
"Winmm"
,
"Drivers"
,
"winealsa.drv"
);
const
AUDIO_DRIVER
*
pAudioDrv
=
NULL
;
int
i
;
...
...
programs/winecfg/driveui.c
View file @
6e92d382
...
...
@@ -310,14 +310,14 @@ static int fill_drives_list(HWND dialog)
static
void
on_options_click
(
HWND
dialog
)
{
if
(
IsDlgButtonChecked
(
dialog
,
IDC_SHOW_DIRSYM_LINK
)
==
BST_CHECKED
)
set
(
"wine"
,
"ShowDirSymLinks"
,
"Y"
);
set
_reg_key
(
"wine"
,
"ShowDirSymLinks"
,
"Y"
);
else
set
(
"wine"
,
"ShowDIrSymLinks"
,
"N"
);
set
_reg_key
(
"wine"
,
"ShowDIrSymLinks"
,
"N"
);
if
(
IsDlgButtonChecked
(
dialog
,
IDC_SHOW_DOT_FILES
)
==
BST_CHECKED
)
set
(
"wine"
,
"ShowDotFiles"
,
"Y"
);
set
_reg_key
(
"wine"
,
"ShowDotFiles"
,
"Y"
);
else
set
(
"wine"
,
"ShowDotFiles"
,
"N"
);
set
_reg_key
(
"wine"
,
"ShowDotFiles"
,
"N"
);
}
static
void
on_add_click
(
HWND
dialog
)
...
...
@@ -684,10 +684,10 @@ static void init_listview_columns(HWND dialog)
static
void
load_drive_options
(
HWND
dialog
)
{
if
(
!
strcmp
(
get
(
"wine"
,
"ShowDirSymLinks"
,
"N"
),
"Y"
))
if
(
!
strcmp
(
get
_reg_key
(
"wine"
,
"ShowDirSymLinks"
,
"N"
),
"Y"
))
CheckDlgButton
(
dialog
,
IDC_SHOW_DIRSYM_LINK
,
BST_CHECKED
);
if
(
!
strcmp
(
get
(
"wine"
,
"ShowDotFiles"
,
"N"
),
"Y"
))
if
(
!
strcmp
(
get
_reg_key
(
"wine"
,
"ShowDotFiles"
,
"N"
),
"Y"
))
CheckDlgButton
(
dialog
,
IDC_SHOW_DOT_FILES
,
BST_CHECKED
);
}
...
...
programs/winecfg/libraries.c
View file @
6e92d382
...
...
@@ -201,7 +201,7 @@ static void load_library_settings(HWND dialog)
const
char
*
label
;
struct
dll
*
dll
;
value
=
get
(
keypath
(
"DllOverrides"
),
*
p
,
NULL
);
value
=
get
_reg_key
(
keypath
(
"DllOverrides"
),
*
p
,
NULL
);
label
=
mode_to_label
(
string_to_mode
(
value
));
...
...
@@ -273,7 +273,7 @@ static void set_dllmode(HWND dialog, DWORD id)
WINE_TRACE
(
"Setting %s to %s
\n
"
,
dll
->
name
,
str
);
SendMessage
(
GetParent
(
dialog
),
PSM_CHANGED
,
0
,
0
);
set
(
keypath
(
"DllOverrides"
),
dll
->
name
,
str
);
set
_reg_key
(
keypath
(
"DllOverrides"
),
dll
->
name
,
str
);
load_library_settings
(
dialog
);
/* ... and refresh */
}
...
...
@@ -292,7 +292,7 @@ static void on_add_click(HWND dialog)
WINE_TRACE
(
"Adding %s as native, builtin"
,
buffer
);
SendMessage
(
GetParent
(
dialog
),
PSM_CHANGED
,
0
,
0
);
set
(
keypath
(
"DllOverrides"
),
buffer
,
"native,builtin"
);
set
_reg_key
(
keypath
(
"DllOverrides"
),
buffer
,
"native,builtin"
);
load_library_settings
(
dialog
);
...
...
@@ -313,7 +313,7 @@ static void on_remove_click(HWND dialog)
SendDlgItemMessage
(
dialog
,
IDC_DLLS_LIST
,
LB_DELETESTRING
,
sel
,
0
);
SendMessage
(
GetParent
(
dialog
),
PSM_CHANGED
,
0
,
0
);
set
(
keypath
(
"DllOverrides"
),
dll
->
name
,
NULL
);
set
_reg_key
(
keypath
(
"DllOverrides"
),
dll
->
name
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
dll
->
name
);
HeapFree
(
GetProcessHeap
(),
0
,
dll
);
...
...
programs/winecfg/winecfg.c
View file @
6e92d382
...
...
@@ -236,7 +236,7 @@ static void free_setting(struct setting *setting)
* If already in the list, the contents as given there will be
* returned. You are expected to HeapFree the result.
*/
char
*
get
(
const
char
*
path
,
const
char
*
name
,
const
char
*
def
)
char
*
get
_reg_key
(
const
char
*
path
,
const
char
*
name
,
const
char
*
def
)
{
struct
list
*
cursor
;
struct
setting
*
s
;
...
...
@@ -277,7 +277,7 @@ char *get(const char *path, const char *name, const char *def)
*
* These values will be copied when necessary.
*/
void
set
(
const
char
*
path
,
const
char
*
name
,
const
char
*
value
)
void
set
_reg_key
(
const
char
*
path
,
const
char
*
name
,
const
char
*
value
)
{
struct
list
*
cursor
;
struct
setting
*
s
;
...
...
@@ -440,9 +440,9 @@ char **enumerate_values(char *path)
* returns true if the given key/value pair exists in the registry or
* has been written to.
*/
BOOL
exists
(
const
char
*
path
,
const
char
*
name
)
BOOL
reg_key_
exists
(
const
char
*
path
,
const
char
*
name
)
{
char
*
val
=
get
(
path
,
name
,
NULL
);
char
*
val
=
get
_reg_key
(
path
,
name
,
NULL
);
if
(
val
)
{
...
...
programs/winecfg/winecfg.h
View file @
6e92d382
...
...
@@ -40,17 +40,17 @@
extern
char
*
current_app
;
/* NULL means editing global settings */
/* Use get
and set to alter registry settings. The changes made through set
won't be committed to the registry until process_all_settings is called,
however get will still return accurate information.
/* Use get
_reg_key and set_reg_key to alter registry settings. The changes made through
set_reg_key
won't be committed to the registry until process_all_settings is called,
however get
_reg_key
will still return accurate information.
You are expected to
release the result of get. The parameters to set
will
be copied, so
releas
e them too when necessary.
You are expected to
HeapFree the result of get_reg_key. The parameters to set_reg_key
will
be copied, so
fre
e them too when necessary.
*/
void
set
(
const
char
*
path
,
const
char
*
name
,
const
char
*
value
);
char
*
get
(
const
char
*
path
,
const
char
*
name
,
const
char
*
def
);
BOOL
exists
(
const
char
*
path
,
const
char
*
name
);
void
set
_reg_key
(
const
char
*
path
,
const
char
*
name
,
const
char
*
value
);
char
*
get
_reg_key
(
const
char
*
path
,
const
char
*
name
,
const
char
*
def
);
BOOL
reg_key_
exists
(
const
char
*
path
,
const
char
*
name
);
void
apply
(
void
);
char
**
enumerate_values
(
char
*
path
);
...
...
programs/winecfg/x11drvdlg.c
View file @
6e92d382
...
...
@@ -44,7 +44,7 @@ static void update_gui_for_desktop_mode(HWND dialog) {
updating_ui
=
TRUE
;
/* do we have desktop mode enabled? */
if
(
exists
(
keypath
(
"x11drv"
),
"Desktop"
))
if
(
reg_key_
exists
(
keypath
(
"x11drv"
),
"Desktop"
))
{
char
*
buf
,
*
bufindex
;
CheckDlgButton
(
dialog
,
IDC_ENABLE_DESKTOP
,
BST_CHECKED
);
...
...
@@ -54,7 +54,7 @@ static void update_gui_for_desktop_mode(HWND dialog) {
enable
(
IDC_DESKTOP_SIZE
);
enable
(
IDC_DESKTOP_BY
);
buf
=
get
(
keypath
(
"x11drv"
),
"Desktop"
,
"640x480"
);
buf
=
get
_reg_key
(
keypath
(
"x11drv"
),
"Desktop"
,
"640x480"
);
bufindex
=
strchr
(
buf
,
'x'
);
if
(
bufindex
)
{
*
bufindex
=
0
;
...
...
@@ -99,7 +99,7 @@ static void init_dialog (HWND dialog)
SendDlgItemMessage
(
dialog
,
IDC_SCREEN_DEPTH
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
"24 bit"
);
SendDlgItemMessage
(
dialog
,
IDC_SCREEN_DEPTH
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
"32 bit"
);
/* is this valid? */
buf
=
get
(
keypath
(
"x11drv"
),
"ScreenDepth"
,
"24"
);
buf
=
get
_reg_key
(
keypath
(
"x11drv"
),
"ScreenDepth"
,
"24"
);
if
(
strcmp
(
buf
,
"8"
)
==
0
)
SendDlgItemMessage
(
dialog
,
IDC_SCREEN_DEPTH
,
CB_SETCURSEL
,
0
,
0
);
else
if
(
strcmp
(
buf
,
"16"
)
==
0
)
...
...
@@ -115,14 +115,14 @@ static void init_dialog (HWND dialog)
SendDlgItemMessage
(
dialog
,
IDC_DESKTOP_WIDTH
,
EM_LIMITTEXT
,
RES_MAXLEN
,
0
);
SendDlgItemMessage
(
dialog
,
IDC_DESKTOP_HEIGHT
,
EM_LIMITTEXT
,
RES_MAXLEN
,
0
);
buf
=
get
(
keypath
(
"x11drv"
),
"DXGrab"
,
"Y"
);
buf
=
get
_reg_key
(
keypath
(
"x11drv"
),
"DXGrab"
,
"Y"
);
if
(
IS_OPTION_TRUE
(
*
buf
))
CheckDlgButton
(
dialog
,
IDC_DX_MOUSE_GRAB
,
BST_CHECKED
);
else
CheckDlgButton
(
dialog
,
IDC_DX_MOUSE_GRAB
,
BST_UNCHECKED
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
buf
=
get
(
keypath
(
"x11drv"
),
"DesktopDoubleBuffered"
,
"Y"
);
buf
=
get
_reg_key
(
keypath
(
"x11drv"
),
"DesktopDoubleBuffered"
,
"Y"
);
if
(
IS_OPTION_TRUE
(
*
buf
))
CheckDlgButton
(
dialog
,
IDC_DOUBLE_BUFFER
,
BST_CHECKED
);
else
...
...
@@ -154,7 +154,7 @@ static void set_from_desktop_edits(HWND dialog) {
new
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
width
)
+
strlen
(
height
)
+
2
/* x + terminator */
);
sprintf
(
new
,
"%sx%s"
,
width
,
height
);
set
(
keypath
(
"x11drv"
),
"Desktop"
,
new
);
set
_reg_key
(
keypath
(
"x11drv"
),
"Desktop"
,
new
);
HeapFree
(
GetProcessHeap
(),
0
,
width
);
HeapFree
(
GetProcessHeap
(),
0
,
height
);
...
...
@@ -167,7 +167,7 @@ static void on_enable_desktop_clicked(HWND dialog) {
if
(
IsDlgButtonChecked
(
dialog
,
IDC_ENABLE_DESKTOP
)
==
BST_CHECKED
)
{
set_from_desktop_edits
(
dialog
);
}
else
{
set
(
keypath
(
"x11drv"
),
"Desktop"
,
NULL
);
set_reg_key
(
keypath
(
"x11drv"
),
"Desktop"
,
NULL
);
}
update_gui_for_desktop_mode
(
dialog
);
...
...
@@ -181,23 +181,23 @@ static void on_screen_depth_changed(HWND dialog) {
if
(
updating_ui
)
return
;
*
spaceIndex
=
'\0'
;
set
(
keypath
(
"x11drv"
),
"ScreenDepth"
,
newvalue
);
set
_reg_key
(
keypath
(
"x11drv"
),
"ScreenDepth"
,
newvalue
);
HeapFree
(
GetProcessHeap
(),
0
,
newvalue
);
}
static
void
on_dx_mouse_grab_clicked
(
HWND
dialog
)
{
if
(
IsDlgButtonChecked
(
dialog
,
IDC_DX_MOUSE_GRAB
)
==
BST_CHECKED
)
set
(
keypath
(
"x11drv"
),
"DXGrab"
,
"Y"
);
set_reg_key
(
keypath
(
"x11drv"
),
"DXGrab"
,
"Y"
);
else
set
(
keypath
(
"x11drv"
),
"DXGrab"
,
"N"
);
set_reg_key
(
keypath
(
"x11drv"
),
"DXGrab"
,
"N"
);
}
static
void
on_double_buffer_clicked
(
HWND
dialog
)
{
if
(
IsDlgButtonChecked
(
dialog
,
IDC_DOUBLE_BUFFER
)
==
BST_CHECKED
)
set
(
keypath
(
"x11drv"
),
"DesktopDoubleBuffered"
,
"Y"
);
set_reg_key
(
keypath
(
"x11drv"
),
"DesktopDoubleBuffered"
,
"Y"
);
else
set
(
keypath
(
"x11drv"
),
"DesktopDoubleBuffered"
,
"N"
);
set_reg_key
(
keypath
(
"x11drv"
),
"DesktopDoubleBuffered"
,
"N"
);
}
INT_PTR
CALLBACK
...
...
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