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
4ba54cb4
Commit
4ba54cb4
authored
Sep 24, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3: Introduce a new override registry mechanism to force dinput.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ffdcafb9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
5 deletions
+53
-5
Makefile.in
dlls/xinput1_1/Makefile.in
+1
-1
Makefile.in
dlls/xinput1_2/Makefile.in
+1
-1
Makefile.in
dlls/xinput1_3/Makefile.in
+1
-1
main.c
dlls/xinput1_3/main.c
+48
-0
Makefile.in
dlls/xinput1_4/Makefile.in
+1
-1
Makefile.in
dlls/xinput9_1_0/Makefile.in
+1
-1
No files found.
dlls/xinput1_1/Makefile.in
View file @
4ba54cb4
MODULE
=
xinput1_1.dll
PARENTSRC
=
../xinput1_3
DELAYIMPORTS
=
hid setupapi
DELAYIMPORTS
=
hid setupapi
advapi32
C_SRCS
=
\
main.c
...
...
dlls/xinput1_2/Makefile.in
View file @
4ba54cb4
MODULE
=
xinput1_2.dll
PARENTSRC
=
../xinput1_3
DELAYIMPORTS
=
hid setupapi
DELAYIMPORTS
=
hid setupapi
advapi32
C_SRCS
=
\
main.c
...
...
dlls/xinput1_3/Makefile.in
View file @
4ba54cb4
MODULE
=
xinput1_3.dll
IMPORTLIB
=
xinput
DELAYIMPORTS
=
hid setupapi
DELAYIMPORTS
=
hid setupapi
advapi32
C_SRCS
=
\
main.c
...
...
dlls/xinput1_3/main.c
View file @
4ba54cb4
...
...
@@ -394,6 +394,52 @@ failed:
return
FALSE
;
}
static
void
get_registry_keys
(
HKEY
*
defkey
,
HKEY
*
appkey
)
{
WCHAR
buffer
[
MAX_PATH
+
26
],
*
name
=
buffer
,
*
tmp
;
DWORD
len
;
HKEY
hkey
;
*
appkey
=
0
;
if
(
RegOpenKeyW
(
HKEY_CURRENT_USER
,
L"Software
\\
Wine
\\
DirectInput
\\
Joysticks"
,
defkey
))
*
defkey
=
0
;
if
(
!
(
len
=
GetModuleFileNameW
(
0
,
buffer
,
MAX_PATH
))
||
len
>=
MAX_PATH
)
return
;
if
(
!
RegOpenKeyW
(
HKEY_CURRENT_USER
,
L"Software
\\
Wine
\\
AppDefaults"
,
&
hkey
))
{
if
((
tmp
=
wcsrchr
(
name
,
'/'
)))
name
=
tmp
+
1
;
if
((
tmp
=
wcsrchr
(
name
,
'\\'
)))
name
=
tmp
+
1
;
wcscat
(
name
,
L"
\\
DirectInput
\\
Joysticks"
);
if
(
RegOpenKeyW
(
hkey
,
name
,
appkey
))
*
appkey
=
0
;
RegCloseKey
(
hkey
);
}
}
static
BOOL
device_is_overriden
(
HANDLE
device
)
{
WCHAR
name
[
MAX_PATH
],
buffer
[
MAX_PATH
];
DWORD
size
=
sizeof
(
buffer
);
BOOL
disable
=
FALSE
;
HKEY
defkey
,
appkey
;
if
(
!
HidD_GetProductString
(
device
,
name
,
MAX_PATH
))
return
FALSE
;
get_registry_keys
(
&
defkey
,
&
appkey
);
if
(
!
defkey
&&
!
appkey
)
return
FALSE
;
if
((
appkey
&&
!
RegQueryValueExW
(
appkey
,
name
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
size
))
||
(
defkey
&&
!
RegQueryValueExW
(
defkey
,
name
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
size
)))
{
if
((
disable
=
!
wcscmp
(
buffer
,
L"override"
)))
TRACE
(
"Disabling gamepad '%s' based on registry key.
\n
"
,
debugstr_w
(
name
));
}
if
(
appkey
)
RegCloseKey
(
appkey
);
if
(
defkey
)
RegCloseKey
(
defkey
);
return
disable
;
}
static
void
update_controller_list
(
void
)
{
char
buffer
[
sizeof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_W
)
+
MAX_PATH
*
sizeof
(
WCHAR
)];
...
...
@@ -437,6 +483,8 @@ static void update_controller_list(void)
else
if
(
caps
.
Usage
!=
HID_USAGE_GENERIC_GAMEPAD
&&
caps
.
Usage
!=
HID_USAGE_GENERIC_JOYSTICK
&&
caps
.
Usage
!=
HID_USAGE_GENERIC_MULTI_AXIS_CONTROLLER
)
WARN
(
"ignoring HID device, unsupported usage %04x:%04x
\n
"
,
caps
.
UsagePage
,
caps
.
Usage
);
else
if
(
device_is_overriden
(
device
))
WARN
(
"ignoring HID device, overriden for dinput
\n
"
);
else
if
(
!
controller_init
(
&
controllers
[
i
],
preparsed
,
&
caps
,
device
,
detail
->
DevicePath
))
WARN
(
"ignoring HID device, failed to initialize
\n
"
);
else
...
...
dlls/xinput1_4/Makefile.in
View file @
4ba54cb4
MODULE
=
xinput1_4.dll
PARENTSRC
=
../xinput1_3
DELAYIMPORTS
=
hid setupapi
DELAYIMPORTS
=
hid setupapi
advapi32
C_SRCS
=
\
main.c
...
...
dlls/xinput9_1_0/Makefile.in
View file @
4ba54cb4
MODULE
=
xinput9_1_0.dll
PARENTSRC
=
../xinput1_3
DELAYIMPORTS
=
hid setupapi
DELAYIMPORTS
=
hid setupapi
advapi32
C_SRCS
=
\
main.c
...
...
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