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
998b9d86
Commit
998b9d86
authored
Oct 28, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement SetProperty DIPROP_APPDATA using enum_objects.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8847de46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
28 deletions
+9
-28
device.c
dlls/dinput/device.c
+9
-27
hid.c
dlls/dinput8/tests/hid.c
+0
-1
No files found.
dlls/dinput/device.c
View file @
998b9d86
...
...
@@ -580,22 +580,6 @@ failed:
return
DIERR_OUTOFMEMORY
;
}
static
int
verify_offset
(
const
DataFormat
*
df
,
int
offset
)
{
int
i
;
if
(
!
df
->
offsets
)
return
-
1
;
for
(
i
=
df
->
wine_df
->
dwNumObjs
-
1
;
i
>=
0
;
i
--
)
{
if
(
df
->
offsets
[
i
]
==
offset
)
return
offset
;
}
return
-
1
;
}
static
int
id_to_object
(
LPCDIDATAFORMAT
df
,
int
id
)
{
int
i
;
...
...
@@ -1320,6 +1304,8 @@ static HRESULT WINAPI dinput_device_SetProperty( IDirectInputDevice8W *iface, co
{
struct
set_object_property_params
params
=
{.
iface
=
iface
,
.
header
=
header
,
.
property
=
LOWORD
(
guid
)};
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
DWORD
object_mask
=
DIDFT_AXIS
|
DIDFT_BUTTON
|
DIDFT_POV
;
DIDEVICEOBJECTINSTANCEW
instance
;
DIPROPHEADER
filter
;
HRESULT
hr
;
...
...
@@ -1421,18 +1407,14 @@ static HRESULT WINAPI dinput_device_SetProperty( IDirectInputDevice8W *iface, co
case
(
DWORD_PTR
)
DIPROP_APPDATA
:
{
const
DIPROPPOINTER
*
value
=
(
const
DIPROPPOINTER
*
)
header
;
int
offset
=
-
1
;
int
user_offset
;
if
(
header
->
dwSize
!=
sizeof
(
DIPROPPOINTER
))
return
DIERR_INVALIDPARAM
;
if
(
header
->
dwHow
==
DIPH_BYID
)
offset
=
id_to_offset
(
&
impl
->
data_format
,
header
->
dwObj
);
else
if
(
header
->
dwHow
==
DIPH_BYOFFSET
)
offset
=
verify_offset
(
&
impl
->
data_format
,
header
->
dwObj
);
else
return
DIERR_UNSUPPORTED
;
if
(
offset
==
-
1
)
return
DIERR_OBJECTNOTFOUND
;
if
(
!
set_app_data
(
impl
,
offset
,
value
->
uData
))
return
DIERR_OUTOFMEMORY
;
if
(
header
->
dwHow
==
DIPH_DEVICE
)
return
DIERR_UNSUPPORTED
;
hr
=
impl
->
vtbl
->
enum_objects
(
iface
,
&
filter
,
object_mask
,
find_object
,
&
instance
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
hr
==
DIENUM_CONTINUE
)
return
DIERR_OBJECTNOTFOUND
;
if
((
user_offset
=
id_to_offset
(
&
impl
->
data_format
,
instance
.
dwType
))
<
0
)
return
DIERR_OBJECTNOTFOUND
;
if
(
!
set_app_data
(
impl
,
user_offset
,
value
->
uData
))
return
DIERR_OUTOFMEMORY
;
return
DI_OK
;
}
default:
...
...
dlls/dinput8/tests/hid.c
View file @
998b9d86
...
...
@@ -4794,7 +4794,6 @@ static void test_simple_joystick(void)
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
ok
(
hr
==
DI_OK
,
"SetProperty DIPROP_APPDATA returned %#x
\n
"
,
hr
);
prop_dword
.
dwData
=
0xdeadbeef
;
...
...
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