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
256f35dc
Commit
256f35dc
authored
Mar 20, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Initialize device object format when creating devices.
parent
b75bd86e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
17 deletions
+23
-17
dinput.c
dlls/dinput/dinput.c
+0
-6
joystick_hid.c
dlls/dinput/joystick_hid.c
+8
-6
keyboard.c
dlls/dinput/keyboard.c
+7
-2
mouse.c
dlls/dinput/mouse.c
+8
-3
No files found.
dlls/dinput/dinput.c
View file @
256f35dc
...
...
@@ -299,12 +299,6 @@ static HRESULT WINAPI dinput7_CreateDeviceEx( IDirectInput7W *iface, const GUID
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
=
dinput_device_init_device_format
(
device
)))
{
IDirectInputDevice8_Release
(
device
);
return
hr
;
}
hr
=
IDirectInputDevice8_QueryInterface
(
device
,
iid
,
out
);
IDirectInputDevice8_Release
(
device
);
return
hr
;
...
...
dlls/dinput/joystick_hid.c
View file @
256f35dc
...
...
@@ -2022,12 +2022,6 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
list_init
(
&
impl
->
effect_list
);
hr
=
E_OUTOFMEMORY
;
preparsed
=
(
struct
hid_preparsed_data
*
)
impl
->
preparsed
;
size
=
preparsed
->
input_caps_count
*
sizeof
(
struct
object_properties
);
if
(
!
(
object_properties
=
calloc
(
1
,
size
)))
goto
failed
;
impl
->
base
.
object_properties
=
object_properties
;
enum_objects
(
impl
,
&
filter
,
DIDFT_AXIS
|
DIDFT_POV
,
init_object_properties
,
NULL
);
size
=
impl
->
caps
.
InputReportByteLength
;
if
(
!
(
buffer
=
malloc
(
size
)))
goto
failed
;
impl
->
input_report_buf
=
buffer
;
...
...
@@ -2087,6 +2081,14 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
impl
->
base
.
caps
.
dwFFDriverVersion
=
1
;
}
preparsed
=
(
struct
hid_preparsed_data
*
)
impl
->
preparsed
;
size
=
preparsed
->
input_caps_count
*
sizeof
(
struct
object_properties
);
if
(
!
(
object_properties
=
calloc
(
1
,
size
)))
goto
failed
;
impl
->
base
.
object_properties
=
object_properties
;
enum_objects
(
impl
,
&
filter
,
DIDFT_AXIS
|
DIDFT_POV
,
init_object_properties
,
NULL
);
if
(
FAILED
(
hr
=
dinput_device_init_device_format
(
&
impl
->
base
.
IDirectInputDevice8W_iface
)))
goto
failed
;
*
out
=
&
impl
->
base
.
IDirectInputDevice8W_iface
;
return
DI_OK
;
...
...
dlls/dinput/keyboard.c
View file @
256f35dc
...
...
@@ -188,6 +188,7 @@ HRESULT keyboard_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instan
HRESULT
keyboard_create_device
(
struct
dinput
*
dinput
,
const
GUID
*
guid
,
IDirectInputDevice8W
**
out
)
{
struct
keyboard
*
impl
;
HRESULT
hr
;
TRACE
(
"dinput %p, guid %s, out %p.
\n
"
,
dinput
,
debugstr_guid
(
guid
),
out
);
...
...
@@ -202,12 +203,16 @@ HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirect
impl
->
base
.
caps
.
dwDevType
=
impl
->
base
.
instance
.
dwDevType
;
impl
->
base
.
caps
.
dwFirmwareRevision
=
100
;
impl
->
base
.
caps
.
dwHardwareRevision
=
100
;
if
(
dinput
->
dwVersion
>=
0x0800
)
impl
->
base
.
use_raw_input
=
TRUE
;
if
(
dinput
->
dwVersion
>=
0x0800
)
impl
->
base
.
use_raw_input
=
TRUE
;
if
(
FAILED
(
hr
=
dinput_device_init_device_format
(
&
impl
->
base
.
IDirectInputDevice8W_iface
)))
goto
failed
;
*
out
=
&
impl
->
base
.
IDirectInputDevice8W_iface
;
return
DI_OK
;
failed:
IDirectInputDevice_Release
(
&
impl
->
base
.
IDirectInputDevice8W_iface
);
return
hr
;
}
static
HRESULT
keyboard_poll
(
IDirectInputDevice8W
*
iface
)
...
...
dlls/dinput/mouse.c
View file @
256f35dc
...
...
@@ -107,6 +107,7 @@ HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInp
struct
mouse
*
impl
;
HKEY
hkey
,
appkey
;
WCHAR
buffer
[
20
];
HRESULT
hr
;
TRACE
(
"dinput %p, guid %s, out %p
\n
"
,
dinput
,
debugstr_guid
(
guid
),
out
);
...
...
@@ -122,6 +123,7 @@ HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInp
impl
->
base
.
caps
.
dwFirmwareRevision
=
100
;
impl
->
base
.
caps
.
dwHardwareRevision
=
100
;
impl
->
base
.
dwCoopLevel
=
DISCL_NONEXCLUSIVE
|
DISCL_BACKGROUND
;
if
(
dinput
->
dwVersion
>=
0x0800
)
impl
->
base
.
use_raw_input
=
TRUE
;
/* One object_properties per axis */
impl
->
base
.
object_properties
=
calloc
(
3
,
sizeof
(
struct
object_properties
)
);
...
...
@@ -132,6 +134,8 @@ HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInp
}
IDirectInputDevice8_EnumObjects
(
&
impl
->
base
.
IDirectInputDevice8W_iface
,
init_object_properties
,
impl
,
DIDFT_RELAXIS
);
if
(
FAILED
(
hr
=
dinput_device_init_device_format
(
&
impl
->
base
.
IDirectInputDevice8W_iface
)))
goto
failed
;
get_app_key
(
&
hkey
,
&
appkey
);
if
(
!
get_config_key
(
hkey
,
appkey
,
L"MouseWarpOverride"
,
buffer
,
sizeof
(
buffer
)
))
{
...
...
@@ -141,11 +145,12 @@ HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInp
if
(
appkey
)
RegCloseKey
(
appkey
);
if
(
hkey
)
RegCloseKey
(
hkey
);
if
(
dinput
->
dwVersion
>=
0x0800
)
impl
->
base
.
use_raw_input
=
TRUE
;
*
out
=
&
impl
->
base
.
IDirectInputDevice8W_iface
;
return
DI_OK
;
failed:
IDirectInputDevice_Release
(
&
impl
->
base
.
IDirectInputDevice8W_iface
);
return
hr
;
}
void
dinput_mouse_rawinput_hook
(
IDirectInputDevice8W
*
iface
,
WPARAM
wparam
,
LPARAM
lparam
,
RAWINPUT
*
ri
)
...
...
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