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
b1a95b96
Commit
b1a95b96
authored
Mar 22, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Keep device objects app data in the object properties.
parent
63637f24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
126 deletions
+54
-126
device.c
dlls/dinput/device.c
+53
-104
device_private.h
dlls/dinput/device_private.h
+1
-10
joystick8.c
dlls/dinput/tests/joystick8.c
+0
-12
No files found.
dlls/dinput/device.c
View file @
b1a95b96
This diff is collapsed.
Click to expand it.
dlls/dinput/device_private.h
View file @
b1a95b96
...
...
@@ -28,12 +28,6 @@
#include "wine/list.h"
#include "dinput_private.h"
typedef
struct
{
unsigned
int
offset
;
UINT_PTR
uAppData
;
}
ActionMap
;
struct
dinput_device
;
struct
hid_value_caps
;
...
...
@@ -72,6 +66,7 @@ struct object_properties
LONG
range_max
;
LONG
deadzone
;
LONG
saturation
;
UINT_PTR
app_data
;
DWORD
calibration_mode
;
DWORD
granularity
;
};
...
...
@@ -113,10 +108,6 @@ struct dinput_device
DIDATAFORMAT
device_format
;
DIDATAFORMAT
user_format
;
/* Action mapping */
int
num_actions
;
/* number of actions mapped */
ActionMap
*
action_map
;
/* array of mappings */
/* internal device callbacks */
HANDLE
read_event
;
const
struct
dinput_device_vtbl
*
vtbl
;
...
...
dlls/dinput/tests/joystick8.c
View file @
b1a95b96
...
...
@@ -917,7 +917,6 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
ok
(
prop_pointer
.
uData
==
0
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
...
...
@@ -965,23 +964,18 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
prop_pointer
.
diph
.
dwHow
=
DIPH_BYID
;
prop_pointer
.
diph
.
dwObj
=
DIDFT_ABSAXIS
|
DIDFT_MAKEINSTANCE
(
3
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DIERR_NOTFOUND
,
"GetProperty returned %#lx
\n
"
,
hr
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYID
;
prop_pointer
.
diph
.
dwObj
=
DIDFT_ABSAXIS
|
DIDFT_MAKEINSTANCE
(
2
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
6
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
8
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
prop_range
.
diph
.
dwHow
=
DIPH_BYID
;
...
...
@@ -1078,7 +1072,6 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
ok
(
objdata
[
res
].
dwData
==
expect_objdata
[
res
].
dwData
||
broken
(
objdata
[
res
].
dwData
==
-
45
&&
expect_objdata
[
res
].
dwData
==
-
43
)
/* 32-bit rounding */
,
"got dwData %+ld
\n
"
,
objdata
[
res
].
dwData
);
todo_wine_if
(
res
!=
0
&&
res
!=
3
&&
res
!=
6
)
check_member
(
objdata
[
res
],
expect_objdata
[
res
],
"%#Ix"
,
uAppData
);
winetest_pop_context
();
}
...
...
@@ -1095,9 +1088,7 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
8
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
&
c_dfDIJoystick2
);
...
...
@@ -1106,9 +1097,7 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
-
1
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
prop_range
.
diph
.
dwHow
=
DIPH_BYID
;
...
...
@@ -2705,7 +2694,6 @@ 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_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine_if
(
version
>=
0x0800
)
ok
(
hr
==
(
version
<
0x0800
?
DIERR_UNSUPPORTED
:
DI_OK
),
"GetProperty DIPROP_APPDATA returned %#lx
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
ok
(
prop_pointer
.
uData
==
0xfeedcafe
,
"got %p
\n
"
,
(
void
*
)
prop_pointer
.
uData
);
...
...
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