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
bbff1238
Commit
bbff1238
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 JoyConfig8Impl_GetConfig.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5726c77f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
61 deletions
+10
-61
dinput_main.c
dlls/dinput/dinput_main.c
+10
-31
dinput_private.h
dlls/dinput/dinput_private.h
+0
-11
joystick_hid.c
dlls/dinput/joystick_hid.c
+0
-7
keyboard.c
dlls/dinput/keyboard.c
+0
-6
mouse.c
dlls/dinput/mouse.c
+0
-6
No files found.
dlls/dinput/dinput_main.c
View file @
bbff1238
...
...
@@ -74,13 +74,6 @@ static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8W(IDirectInpu
return
CONTAINING_RECORD
(
iface
,
IDirectInputDeviceImpl
,
IDirectInputDevice8W_iface
);
}
static
const
struct
dinput_device
*
dinput_devices
[]
=
{
&
mouse_device
,
&
keyboard_device
,
&
joystick_hid_device
,
};
HINSTANCE
DINPUT_instance
;
static
HWND
di_em_win
;
...
...
@@ -927,10 +920,11 @@ static HRESULT WINAPI JoyConfig8Impl_DeleteType(IDirectInputJoyConfig8 *iface, L
static
HRESULT
WINAPI
JoyConfig8Impl_GetConfig
(
IDirectInputJoyConfig8
*
iface
,
UINT
id
,
LPDIJOYCONFIG
info
,
DWORD
flags
)
{
DIDEVICEINSTANCEW
instance
=
{.
dwSize
=
sizeof
(
DIDEVICEINSTANCEW
)};
IDirectInputImpl
*
di
=
impl_from_IDirectInputJoyConfig8
(
iface
);
unsigned
int
i
=
0
;
UINT
found
=
0
;
int
i
,
j
;
HRESULT
r
;
HRESULT
hr
;
FIXME
(
"(%p)->(%d, %p, 0x%08x): semi-stub!
\n
"
,
iface
,
id
,
info
,
flags
);
...
...
@@ -941,29 +935,14 @@ static HRESULT WINAPI JoyConfig8Impl_GetConfig(IDirectInputJoyConfig8 *iface, UI
X
(
DIJC_CALLOUT
)
#undef X
/* Enumerate all joysticks in order */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
);
i
++
)
do
{
if
(
!
dinput_devices
[
i
]
->
enum_device
)
continue
;
for
(
j
=
0
,
r
=
S_OK
;
SUCCEEDED
(
r
);
j
++
)
{
DIDEVICEINSTANCEW
dev
;
dev
.
dwSize
=
sizeof
(
dev
);
if
((
r
=
dinput_devices
[
i
]
->
enum_device
(
DI8DEVCLASS_GAMECTRL
,
0
,
&
dev
,
di
->
dwVersion
,
j
))
==
S_OK
)
{
/* Only take into account the chosen id */
if
(
found
==
id
)
{
if
(
flags
&
DIJC_GUIDINSTANCE
)
info
->
guidInstance
=
dev
.
guidInstance
;
return
DI_OK
;
}
found
+=
1
;
}
}
}
hr
=
hid_joystick_enum_device
(
DI8DEVCLASS_GAMECTRL
,
0
,
&
instance
,
di
->
dwVersion
,
i
++
);
if
(
hr
!=
DI_OK
)
continue
;
if
(
flags
&
DIJC_GUIDINSTANCE
)
info
->
guidInstance
=
instance
.
guidInstance
;
/* Only take into account the chosen id */
if
(
found
++
==
id
)
return
DI_OK
;
}
while
(
SUCCEEDED
(
hr
));
return
DIERR_NOMOREITEMS
;
}
...
...
dlls/dinput/dinput_private.h
View file @
bbff1238
...
...
@@ -52,13 +52,6 @@ struct IDirectInputImpl
extern
const
IDirectInput7AVtbl
dinput7_a_vtbl
DECLSPEC_HIDDEN
;
extern
const
IDirectInput8AVtbl
dinput8_a_vtbl
DECLSPEC_HIDDEN
;
/* Function called by all devices that Wine supports */
struct
dinput_device
{
const
char
*
name
;
HRESULT
(
*
enum_device
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
);
HRESULT
(
*
create_device
)(
IDirectInputImpl
*
dinput
,
REFGUID
rguid
,
IDirectInputDevice8W
**
out
);
};
extern
HRESULT
mouse_enum_device
(
DWORD
type
,
DWORD
flags
,
DIDEVICEINSTANCEW
*
instance
,
DWORD
version
,
int
index
);
extern
HRESULT
mouse_create_device
(
IDirectInputImpl
*
dinput
,
const
GUID
*
guid
,
IDirectInputDevice8W
**
out
);
extern
HRESULT
keyboard_enum_device
(
DWORD
type
,
DWORD
flags
,
DIDEVICEINSTANCEW
*
instance
,
DWORD
version
,
int
index
);
...
...
@@ -72,10 +65,6 @@ struct DevicePlayer {
struct
list
entry
;
};
extern
const
struct
dinput_device
mouse_device
DECLSPEC_HIDDEN
;
extern
const
struct
dinput_device
keyboard_device
DECLSPEC_HIDDEN
;
extern
const
struct
dinput_device
joystick_hid_device
DECLSPEC_HIDDEN
;
extern
void
dinput_hooks_acquire_device
(
LPDIRECTINPUTDEVICE8W
iface
);
extern
void
dinput_hooks_unacquire_device
(
LPDIRECTINPUTDEVICE8W
iface
);
extern
int
dinput_mouse_hook
(
IDirectInputDevice8W
*
iface
,
WPARAM
wparam
,
LPARAM
lparam
);
...
...
dlls/dinput/joystick_hid.c
View file @
bbff1238
...
...
@@ -1867,13 +1867,6 @@ failed:
return
hr
;
}
const
struct
dinput_device
joystick_hid_device
=
{
"Wine HID joystick driver"
,
hid_joystick_enum_device
,
hid_joystick_create_device
,
};
static
HRESULT
WINAPI
hid_joystick_effect_QueryInterface
(
IDirectInputEffect
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
...
...
dlls/dinput/keyboard.c
View file @
bbff1238
...
...
@@ -204,12 +204,6 @@ HRESULT keyboard_create_device( IDirectInputImpl *dinput, const GUID *guid, IDir
return
DI_OK
;
}
const
struct
dinput_device
keyboard_device
=
{
"Wine keyboard driver"
,
keyboard_enum_device
,
keyboard_create_device
};
static
HRESULT
keyboard_poll
(
IDirectInputDevice8W
*
iface
)
{
check_dinput_events
();
...
...
dlls/dinput/mouse.c
View file @
bbff1238
...
...
@@ -153,12 +153,6 @@ HRESULT mouse_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirect
return
DI_OK
;
}
const
struct
dinput_device
mouse_device
=
{
"Wine mouse driver"
,
mouse_enum_device
,
mouse_create_device
};
/******************************************************************************
* SysMouseA (DInput Mouse support)
*/
...
...
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