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
c69c9b55
Commit
c69c9b55
authored
Jan 04, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Return DIERR_UNSUPPORTED for properties with old dinput version.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bef9b8a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
device.c
dlls/dinput/device.c
+13
-0
joystick8.c
dlls/dinput/tests/joystick8.c
+1
-15
No files found.
dlls/dinput/device.c
View file @
c69c9b55
...
...
@@ -909,6 +909,19 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con
{
switch
(
LOWORD
(
guid
))
{
case
(
DWORD_PTR
)
DIPROP_VIDPID
:
case
(
DWORD_PTR
)
DIPROP_TYPENAME
:
case
(
DWORD_PTR
)
DIPROP_USERNAME
:
case
(
DWORD_PTR
)
DIPROP_KEYNAME
:
case
(
DWORD_PTR
)
DIPROP_LOGICALRANGE
:
case
(
DWORD_PTR
)
DIPROP_PHYSICALRANGE
:
case
(
DWORD_PTR
)
DIPROP_APPDATA
:
if
(
impl
->
dinput
->
dwVersion
<
0x0800
)
return
DIERR_UNSUPPORTED
;
break
;
}
switch
(
LOWORD
(
guid
))
{
case
(
DWORD_PTR
)
DIPROP_INSTANCENAME
:
case
(
DWORD_PTR
)
DIPROP_KEYNAME
:
case
(
DWORD_PTR
)
DIPROP_PRODUCTNAME
:
...
...
dlls/dinput/tests/joystick8.c
View file @
c69c9b55
...
...
@@ -870,7 +870,6 @@ static void test_simple_joystick( DWORD version )
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_VIDPID
,
NULL
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"GetProperty returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_VIDPID
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_INVALIDPARAM
),
"GetProperty DIPROP_VIDPID returned %#x
\n
"
,
hr
);
prop_dword
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
)
-
1
;
...
...
@@ -880,7 +879,6 @@ static void test_simple_joystick( DWORD version )
prop_dword
.
dwData
=
0xdeadbeef
;
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_VIDPID
,
&
prop_dword
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_OK
),
"GetProperty DIPROP_VIDPID returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
...
...
@@ -925,7 +923,6 @@ static void test_simple_joystick( DWORD version )
ok
(
!
wcscmp
(
prop_string
.
wsz
,
expect_vidpid_str
),
"got type %s
\n
"
,
debugstr_w
(
prop_string
.
wsz
)
);
}
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_NOEFFECT
),
"GetProperty DIPROP_USERNAME returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_NOEFFECT
)
...
...
@@ -972,7 +969,6 @@ static void test_simple_joystick( DWORD version )
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_RANGE
,
&
prop_range
.
diph
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"GetProperty DIPROP_RANGE returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_KEYNAME
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_INVALIDPARAM
),
"GetProperty DIPROP_KEYNAME returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_LOGICALRANGE
,
&
prop_range
.
diph
);
...
...
@@ -1003,7 +999,6 @@ static void test_simple_joystick( DWORD version )
prop_string
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_string
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_KEYNAME
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_OK
),
"GetProperty DIPROP_KEYNAME returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
...
...
@@ -1042,7 +1037,6 @@ static void test_simple_joystick( DWORD version )
ok
(
prop_range
.
lMin
==
0
,
"got %d expected %d
\n
"
,
prop_range
.
lMin
,
0
);
ok
(
prop_range
.
lMax
==
65535
,
"got %d expected %d
\n
"
,
prop_range
.
lMax
,
65535
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_LOGICALRANGE
,
&
prop_range
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_OK
),
"GetProperty DIPROP_LOGICALRANGE returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
...
...
@@ -1051,7 +1045,6 @@ static void test_simple_joystick( DWORD version )
ok
(
prop_range
.
lMax
==
56
,
"got %d expected %d
\n
"
,
prop_range
.
lMax
,
56
);
}
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_PHYSICALRANGE
,
&
prop_range
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_OK
),
"GetProperty DIPROP_PHYSICALRANGE returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
...
...
@@ -1624,11 +1617,9 @@ static void test_simple_joystick( DWORD version )
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_RANGE
,
&
prop_range
.
diph
);
ok
(
hr
==
DI_OK
,
"SetProperty DIPROP_RANGE returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_LOGICALRANGE
,
&
prop_range
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_ACQUIRED
),
"SetProperty DIPROP_LOGICALRANGE returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_PHYSICALRANGE
,
&
prop_range
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_ACQUIRED
),
"SetProperty DIPROP_PHYSICALRANGE returned %#x
\n
"
,
hr
);
...
...
@@ -1683,7 +1674,6 @@ static void test_simple_joystick( DWORD version )
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_VIDPID
,
NULL
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetProperty returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_VIDPID
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_INVALIDPARAM
),
"SetProperty DIPROP_VIDPID returned %#x
\n
"
,
hr
);
...
...
@@ -1691,7 +1681,6 @@ static void test_simple_joystick( DWORD version )
prop_dword
.
diph
.
dwObj
=
0
;
prop_dword
.
dwData
=
0xdeadbeef
;
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_VIDPID
,
&
prop_dword
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_READONLY
),
"SetProperty DIPROP_VIDPID returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_GUIDANDPATH
,
&
prop_guid_path
.
diph
);
...
...
@@ -1714,11 +1703,9 @@ static void test_simple_joystick( DWORD version )
debugstr_w
(
prop_string
.
wsz
)
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_TYPENAME
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_READONLY
),
"SetProperty DIPROP_TYPENAME returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_string
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_READONLY
),
"SetProperty DIPROP_USERNAME returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_FFLOAD
,
&
prop_dword
.
diph
);
...
...
@@ -1738,7 +1725,7 @@ static void test_simple_joystick( DWORD version )
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
todo_wine
_if
(
version
>=
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DIERR_ACQUIRED
),
"SetProperty DIPROP_APPDATA returned %#x
\n
"
,
hr
);
...
...
@@ -1893,7 +1880,6 @@ static void test_simple_joystick( DWORD version )
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
prop_pointer
.
uData
=
0xfeedcafe
;
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine_if
(
version
<
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_OK
),
"SetProperty DIPROP_APPDATA returned %#x
\n
"
,
hr
);
...
...
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