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
5726c77f
Commit
5726c77f
authored
Oct 26, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Call hid_joystick_enum_device directly in EnumDevicesBySemantics.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a83e6db3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
20 deletions
+10
-20
dinput_main.c
dlls/dinput/dinput_main.c
+10
-20
No files found.
dlls/dinput/dinput_main.c
View file @
5726c77f
...
...
@@ -762,7 +762,8 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
DIDEVICEINSTANCEW
didevi
;
LPDIRECTINPUTDEVICE8W
lpdid
;
DWORD
callbackFlags
;
int
i
,
j
;
unsigned
int
i
=
0
;
HRESULT
hr
;
int
device_count
=
0
;
int
remain
;
DIDEVICEINSTANCEW
*
didevis
=
0
;
...
...
@@ -772,28 +773,17 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
didevi
.
dwSize
=
sizeof
(
didevi
);
/* Enumerate all the joysticks */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
);
i
++
)
do
{
HRESULT
enumSuccess
;
if
(
!
dinput_devices
[
i
]
->
enum_device
)
continue
;
for
(
j
=
0
,
enumSuccess
=
S_OK
;
SUCCEEDED
(
enumSuccess
);
j
++
)
hr
=
hid_joystick_enum_device
(
DI8DEVCLASS_GAMECTRL
,
DIEDFL_ATTACHEDONLY
|
dwFlags
,
&
didevi
,
This
->
dwVersion
,
i
++
);
if
(
hr
!=
DI_OK
)
continue
;
if
(
should_enumerate_device
(
ptszUserName
,
dwFlags
,
&
This
->
device_players
,
&
didevi
.
guidInstance
))
{
TRACE
(
" - checking device %u ('%s')
\n
"
,
i
,
dinput_devices
[
i
]
->
name
);
/* Default behavior is to enumerate attached game controllers */
enumSuccess
=
dinput_devices
[
i
]
->
enum_device
(
DI8DEVCLASS_GAMECTRL
,
DIEDFL_ATTACHEDONLY
|
dwFlags
,
&
didevi
,
This
->
dwVersion
,
j
);
if
(
enumSuccess
==
S_OK
&&
should_enumerate_device
(
ptszUserName
,
dwFlags
,
&
This
->
device_players
,
&
didevi
.
guidInstance
))
{
device_count
++
;
didevis
=
realloc
(
didevis
,
sizeof
(
DIDEVICEINSTANCEW
)
*
device_count
);
didevis
[
device_count
-
1
]
=
didevi
;
}
device_count
++
;
didevis
=
realloc
(
didevis
,
sizeof
(
DIDEVICEINSTANCEW
)
*
device_count
);
didevis
[
device_count
-
1
]
=
didevi
;
}
}
}
while
(
SUCCEEDED
(
hr
));
remain
=
device_count
;
/* Add keyboard and mouse to remaining device count */
...
...
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