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
625fefca
Commit
625fefca
authored
Jan 09, 2011
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jan 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: COM cleanup - use helper function instead of direct typecast in mouse.
parent
fc023b96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
mouse.c
dlls/dinput/mouse.c
+21
-12
No files found.
dlls/dinput/mouse.c
View file @
625fefca
...
...
@@ -78,6 +78,15 @@ struct SysMouseImpl
WARP_MOUSE
warp_override
;
};
static
inline
SysMouseImpl
*
impl_from_IDirectInputDevice8A
(
IDirectInputDevice8A
*
iface
)
{
return
(
SysMouseImpl
*
)
iface
;
}
static
inline
SysMouseImpl
*
impl_from_IDirectInputDevice8W
(
IDirectInputDevice8W
*
iface
)
{
return
(
SysMouseImpl
*
)
iface
;
}
static
int
dinput_mouse_hook
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
);
const
GUID
DInput_Wine_Mouse_GUID
=
{
/* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */
...
...
@@ -289,7 +298,7 @@ const struct dinput_device mouse_device = {
static
int
dinput_mouse_hook
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
)
{
MSLLHOOKSTRUCT
*
hook
=
(
MSLLHOOKSTRUCT
*
)
lparam
;
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
DWORD
dwCoop
;
int
wdata
=
0
,
inst_id
=
-
1
,
ret
;
...
...
@@ -412,7 +421,7 @@ static BOOL dinput_window_check(SysMouseImpl* This) {
*/
static
HRESULT
WINAPI
SysMouseAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
RECT
rect
;
POINT
point
;
HRESULT
res
;
...
...
@@ -482,9 +491,9 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
*/
static
HRESULT
WINAPI
SysMouseAImpl_Unacquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
HRESULT
res
;
TRACE
(
"(this=%p)
\n
"
,
This
);
if
((
res
=
IDirectInputDevice2AImpl_Unacquire
(
iface
))
!=
DI_OK
)
return
res
;
...
...
@@ -514,7 +523,7 @@ static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
static
HRESULT
WINAPI
SysMouseAImpl_GetDeviceState
(
LPDIRECTINPUTDEVICE8A
iface
,
DWORD
len
,
LPVOID
ptr
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
if
(
This
->
base
.
acquired
==
0
)
return
DIERR_NOTACQUIRED
;
...
...
@@ -555,7 +564,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState(
static
HRESULT
WINAPI
SysMouseAImpl_GetDeviceData
(
LPDIRECTINPUTDEVICE8A
iface
,
DWORD
dodsize
,
LPDIDEVICEOBJECTDATA
dod
,
LPDWORD
entries
,
DWORD
flags
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
HRESULT
res
;
res
=
IDirectInputDevice2AImpl_GetDeviceData
(
iface
,
dodsize
,
dod
,
entries
,
flags
);
...
...
@@ -582,11 +591,11 @@ static HRESULT WINAPI SysMouseAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface,
REFGUID
rguid
,
LPDIPROPHEADER
pdiph
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
TRACE
(
"(%p) %s,%p
\n
"
,
This
,
debugstr_guid
(
rguid
),
pdiph
);
_dump_DIPROPHEADER
(
pdiph
);
if
(
IS_DIPROP
(
rguid
))
{
switch
(
LOWORD
(
rguid
))
{
case
(
DWORD_PTR
)
DIPROP_GRANULARITY
:
{
...
...
@@ -629,7 +638,7 @@ static HRESULT WINAPI SysMouseAImpl_GetCapabilities(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIDEVCAPS
lpDIDevCaps
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
DIDEVCAPS
devcaps
;
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
lpDIDevCaps
);
...
...
@@ -712,7 +721,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceInfo(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIDEVICEINSTANCEA
pdidi
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
)
;
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
pdidi
);
if
(
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCEA
))
{
...
...
@@ -727,7 +736,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceInfo(
static
HRESULT
WINAPI
SysMouseWImpl_GetDeviceInfo
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIDEVICEINSTANCEW
pdidi
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
)
;
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
pdidi
);
if
(
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCEW
))
{
...
...
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