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
5732347c
Commit
5732347c
authored
Sep 28, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement HID joystick DIPROP_AUTOCENTER property.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5eb65418
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
joystick_hid.c
dlls/dinput/joystick_hid.c
+15
-0
hid.c
dlls/dinput8/tests/hid.c
+0
-3
No files found.
dlls/dinput/joystick_hid.c
View file @
5732347c
...
@@ -628,6 +628,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con
...
@@ -628,6 +628,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con
lstrcpynW
(
value
->
wszPath
,
impl
->
device_path
,
MAX_PATH
);
lstrcpynW
(
value
->
wszPath
,
impl
->
device_path
,
MAX_PATH
);
return
DI_OK
;
return
DI_OK
;
}
}
case
(
DWORD_PTR
)
DIPROP_AUTOCENTER
:
if
(
header
->
dwSize
!=
sizeof
(
DIPROPDWORD
))
return
DIERR_INVALIDPARAM
;
return
DIERR_UNSUPPORTED
;
default:
default:
return
IDirectInputDevice2WImpl_GetProperty
(
iface
,
guid
,
header
);
return
IDirectInputDevice2WImpl_GetProperty
(
iface
,
guid
,
header
);
}
}
...
@@ -684,6 +687,7 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con
...
@@ -684,6 +687,7 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con
const
DIPROPHEADER
*
header
)
const
DIPROPHEADER
*
header
)
{
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, header %p
\n
"
,
iface
,
debugstr_guid
(
guid
),
header
);
TRACE
(
"iface %p, guid %s, header %p
\n
"
,
iface
,
debugstr_guid
(
guid
),
header
);
...
@@ -717,6 +721,17 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con
...
@@ -717,6 +721,17 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con
enum_objects
(
impl
,
header
,
DIDFT_AXIS
,
set_property_prop_saturation
,
(
void
*
)
header
);
enum_objects
(
impl
,
header
,
DIDFT_AXIS
,
set_property_prop_saturation
,
(
void
*
)
header
);
return
DI_OK
;
return
DI_OK
;
}
}
case
(
DWORD_PTR
)
DIPROP_AUTOCENTER
:
{
DIPROPDWORD
*
value
=
(
DIPROPDWORD
*
)
header
;
if
(
header
->
dwSize
!=
sizeof
(
DIPROPDWORD
))
return
DIERR_INVALIDPARAM
;
EnterCriticalSection
(
&
impl
->
base
.
crit
);
if
(
impl
->
base
.
acquired
)
hr
=
DIERR_ACQUIRED
;
else
if
(
value
->
dwData
>
DIPROPAUTOCENTER_ON
)
hr
=
DIERR_INVALIDPARAM
;
else
hr
=
DIERR_UNSUPPORTED
;
LeaveCriticalSection
(
&
impl
->
base
.
crit
);
return
hr
;
}
case
(
DWORD_PTR
)
DIPROP_FFLOAD
:
case
(
DWORD_PTR
)
DIPROP_FFLOAD
:
case
(
DWORD_PTR
)
DIPROP_GRANULARITY
:
case
(
DWORD_PTR
)
DIPROP_GRANULARITY
:
case
(
DWORD_PTR
)
DIPROP_VIDPID
:
case
(
DWORD_PTR
)
DIPROP_VIDPID
:
...
...
dlls/dinput8/tests/hid.c
View file @
5732347c
...
@@ -3864,7 +3864,6 @@ static void test_simple_joystick(void)
...
@@ -3864,7 +3864,6 @@ static void test_simple_joystick(void)
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_CALIBRATION
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_CALIBRATION
,
&
prop_dword
.
diph
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_GetProperty DIPROP_CALIBRATION returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_GetProperty DIPROP_CALIBRATION returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
todo_wine
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_GetProperty DIPROP_AUTOCENTER returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_GetProperty DIPROP_AUTOCENTER returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_DEADZONE
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_DEADZONE
,
&
prop_dword
.
diph
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x
\n
"
,
hr
);
...
@@ -4347,7 +4346,6 @@ static void test_simple_joystick(void)
...
@@ -4347,7 +4346,6 @@ static void test_simple_joystick(void)
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_BUFFERSIZE
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_BUFFERSIZE
,
&
prop_dword
.
diph
);
ok
(
hr
==
DIERR_ACQUIRED
,
"IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_ACQUIRED
,
"IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
todo_wine
ok
(
hr
==
DIERR_ACQUIRED
,
"IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_ACQUIRED
,
"IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x
\n
"
,
hr
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
...
@@ -4460,7 +4458,6 @@ static void test_simple_joystick(void)
...
@@ -4460,7 +4458,6 @@ static void test_simple_joystick(void)
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x
\n
"
,
hr
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x
\n
"
,
hr
);
prop_dword
.
dwData
=
0xdeadbeef
;
prop_dword
.
dwData
=
0xdeadbeef
;
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x
\n
"
,
hr
);
prop_dword
.
dwData
=
DIPROPAUTOCENTER_ON
;
prop_dword
.
dwData
=
DIPROPAUTOCENTER_ON
;
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_AUTOCENTER
,
&
prop_dword
.
diph
);
...
...
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