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
8ff85c08
Commit
8ff85c08
authored
Sep 24, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Sep 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Add a helper function to open configuration registry keys.
parent
319097f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
19 deletions
+38
-19
device.c
dlls/dinput/device.c
+35
-0
device_private.h
dlls/dinput/device_private.h
+1
-0
joystick_linux.c
dlls/dinput/joystick_linux.c
+2
-19
No files found.
dlls/dinput/device.c
View file @
8ff85c08
...
...
@@ -218,6 +218,41 @@ void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) {
}
/******************************************************************************
* Get the default and the app-specific config keys.
*/
BOOL
get_app_key
(
HKEY
*
defkey
,
HKEY
*
appkey
)
{
char
buffer
[
MAX_PATH
+
16
];
DWORD
len
;
*
appkey
=
0
;
/* @@ Wine registry key: HKCU\Software\Wine\DirectInput */
if
(
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
DirectInput"
,
defkey
))
*
defkey
=
0
;
len
=
GetModuleFileNameA
(
0
,
buffer
,
MAX_PATH
);
if
(
len
&&
len
<
MAX_PATH
)
{
HKEY
tmpkey
;
/* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\DirectInput */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
AppDefaults"
,
&
tmpkey
))
{
char
*
p
,
*
appname
=
buffer
;
if
((
p
=
strrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
strcat
(
appname
,
"
\\
DirectInput"
);
if
(
RegOpenKeyA
(
tmpkey
,
appname
,
appkey
))
appkey
=
0
;
RegCloseKey
(
tmpkey
);
}
}
return
*
defkey
||
*
appkey
;
}
/******************************************************************************
* Get a config key from either the app-specific or the default config
*/
DWORD
get_config_key
(
HKEY
defkey
,
HKEY
appkey
,
const
char
*
name
,
...
...
dlls/dinput/device_private.h
View file @
8ff85c08
...
...
@@ -72,6 +72,7 @@ struct IDirectInputDevice2AImpl
DataFormat
data_format
;
/* user data format and wine to user format converter */
};
extern
BOOL
get_app_key
(
HKEY
*
,
HKEY
*
);
extern
DWORD
get_config_key
(
HKEY
,
HKEY
,
const
char
*
,
char
*
,
DWORD
);
/* Routines to do DataFormat / WineFormat conversions */
...
...
dlls/dinput/joystick_linux.c
View file @
8ff85c08
...
...
@@ -269,28 +269,11 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
static
HRESULT
setup_dinput_options
(
JoystickImpl
*
device
)
{
char
buffer
[
MAX_PATH
+
16
];
HKEY
hkey
,
appkey
=
0
;
DWORD
len
;
HKEY
hkey
,
appkey
;
buffer
[
MAX_PATH
]
=
'\0'
;
/* @@ Wine registry key: HKCU\Software\Wine\DirectInput */
if
(
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
DirectInput"
,
&
hkey
))
hkey
=
0
;
len
=
GetModuleFileNameA
(
0
,
buffer
,
MAX_PATH
);
if
(
len
&&
len
<
MAX_PATH
)
{
HKEY
tmpkey
;
/* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\DirectInput */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
AppDefaults"
,
&
tmpkey
))
{
char
*
p
,
*
appname
=
buffer
;
if
((
p
=
strrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
strcat
(
appname
,
"
\\
DirectInput"
);
if
(
RegOpenKeyA
(
tmpkey
,
appname
,
&
appkey
))
appkey
=
0
;
RegCloseKey
(
tmpkey
);
}
}
get_app_key
(
&
hkey
,
&
appkey
);
/* get options */
...
...
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