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
49c66a3a
Commit
49c66a3a
authored
May 26, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Check IDirectInputDevice2AImpl_GetObjectInfo error codes.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2fac2e6b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
8 deletions
+30
-8
device.c
dlls/dinput/device.c
+6
-6
joystick.c
dlls/dinput/joystick.c
+7
-1
mouse.c
dlls/dinput/mouse.c
+7
-1
device.c
dlls/dinput/tests/device.c
+10
-0
No files found.
dlls/dinput/device.c
View file @
49c66a3a
...
...
@@ -1457,9 +1457,9 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
DIDEVICEOBJECTINSTANCEW
didoiW
;
HRESULT
res
;
if
(
!
pdidoi
||
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEA
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3A
)
))
if
(
!
pdidoi
)
return
E_POINTER
;
if
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEA
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3A
))
return
DIERR_INVALIDPARAM
;
didoiW
.
dwSize
=
sizeof
(
didoiW
);
...
...
@@ -1492,9 +1492,9 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
TRACE
(
"(%p) %d(0x%08x) -> %p
\n
"
,
This
,
dwHow
,
dwObj
,
pdidoi
);
if
(
!
pdidoi
||
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEW
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3W
)
))
if
(
!
pdidoi
)
return
E_POINTER
;
if
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEW
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3W
))
return
DIERR_INVALIDPARAM
;
switch
(
dwHow
)
...
...
dlls/dinput/joystick.c
View file @
49c66a3a
...
...
@@ -580,12 +580,18 @@ HRESULT WINAPI JoystickAGenericImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8A iface,
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
HRESULT
res
;
DIDEVICEOBJECTINSTANCEW
didoiW
;
DWORD
dwSize
=
pdidoi
->
dwSize
;
DWORD
dwSize
;
if
(
!
pdidoi
)
return
E_POINTER
;
if
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEA
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3A
))
return
DIERR_INVALIDPARAM
;
didoiW
.
dwSize
=
sizeof
(
didoiW
);
res
=
JoystickWGenericImpl_GetObjectInfo
(
IDirectInputDevice8W_from_impl
(
This
),
&
didoiW
,
dwObj
,
dwHow
);
if
(
res
!=
DI_OK
)
return
res
;
dwSize
=
pdidoi
->
dwSize
;
memset
(
pdidoi
,
0
,
pdidoi
->
dwSize
);
memcpy
(
pdidoi
,
&
didoiW
,
FIELD_OFFSET
(
DIDEVICEOBJECTINSTANCEW
,
tszName
));
pdidoi
->
dwSize
=
dwSize
;
...
...
dlls/dinput/mouse.c
View file @
49c66a3a
...
...
@@ -802,12 +802,18 @@ static HRESULT WINAPI SysMouseAImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8A iface,
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
HRESULT
res
;
DIDEVICEOBJECTINSTANCEW
didoiW
;
DWORD
dwSize
=
pdidoi
->
dwSize
;
DWORD
dwSize
;
if
(
!
pdidoi
)
return
E_POINTER
;
if
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEA
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3A
))
return
DIERR_INVALIDPARAM
;
didoiW
.
dwSize
=
sizeof
(
didoiW
);
res
=
SysMouseWImpl_GetObjectInfo
(
IDirectInputDevice8W_from_impl
(
This
),
&
didoiW
,
dwObj
,
dwHow
);
if
(
res
!=
DI_OK
)
return
res
;
dwSize
=
pdidoi
->
dwSize
;
memset
(
pdidoi
,
0
,
pdidoi
->
dwSize
);
memcpy
(
pdidoi
,
&
didoiW
,
FIELD_OFFSET
(
DIDEVICEOBJECTINSTANCEW
,
tszName
));
pdidoi
->
dwSize
=
dwSize
;
...
...
dlls/dinput/tests/device.c
View file @
49c66a3a
...
...
@@ -158,6 +158,16 @@ static void test_object_info(IDirectInputDeviceA *device, HWND hwnd)
hr
=
IDirectInputDevice_GetDeviceData
(
device
,
sizeof
(
buffer
[
0
]),
buffer
,
&
cnt
,
0
);
ok
(
hr
==
DI_OK
,
"GetDeviceData() failed: %08x
\n
"
,
hr
);
hr
=
IDirectInputDevice_GetObjectInfo
(
device
,
NULL
,
16
,
DIPH_BYOFFSET
);
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice_GetObjectInfo returned %08x, expected %08x
\n
"
,
hr
,
E_POINTER
);
obj_info
.
dwSize
=
1
;
hr
=
IDirectInputDevice_GetObjectInfo
(
device
,
&
obj_info
,
16
,
DIPH_BYOFFSET
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice_GetObjectInfo returned %08x, expected %08x
\n
"
,
hr
,
DIERR_INVALIDPARAM
);
obj_info
.
dwSize
=
0xdeadbeef
;
hr
=
IDirectInputDevice_GetObjectInfo
(
device
,
&
obj_info
,
16
,
DIPH_BYOFFSET
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice_GetObjectInfo returned %08x, expected %08x
\n
"
,
hr
,
DIERR_INVALIDPARAM
);
/* No need to test devices without axis */
obj_info
.
dwSize
=
sizeof
(
obj_info
);
hr
=
IDirectInputDevice_GetObjectInfo
(
device
,
&
obj_info
,
16
,
DIPH_BYOFFSET
);
...
...
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