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
8f28d436
Commit
8f28d436
authored
Jul 06, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jul 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Rename set_dinput_hook and call it from the base class.
Since keyboard's acquire and unacquire don't do anything special just call the base class.
parent
deb74efc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
39 deletions
+12
-39
device.c
dlls/dinput/device.c
+5
-0
dinput_main.c
dlls/dinput/dinput_main.c
+2
-2
dinput_private.h
dlls/dinput/dinput_private.h
+1
-1
keyboard.c
dlls/dinput/keyboard.c
+4
-34
mouse.c
dlls/dinput/mouse.c
+0
-2
No files found.
dlls/dinput/device.c
View file @
8f28d436
...
...
@@ -563,7 +563,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
res
=
This
->
acquired
?
S_FALSE
:
DI_OK
;
This
->
acquired
=
1
;
if
(
res
==
DI_OK
)
{
This
->
queue_head
=
This
->
queue_tail
=
This
->
overflow
=
0
;
check_dinput_hooks
(
iface
);
}
LeaveCriticalSection
(
&
This
->
crit
);
return
res
;
...
...
@@ -581,6 +584,8 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
EnterCriticalSection
(
&
This
->
crit
);
res
=
!
This
->
acquired
?
DI_NOEFFECT
:
DI_OK
;
This
->
acquired
=
0
;
if
(
res
==
DI_OK
)
check_dinput_hooks
(
iface
);
LeaveCriticalSection
(
&
This
->
crit
);
return
res
;
...
...
dlls/dinput/dinput_main.c
View file @
8f28d436
...
...
@@ -854,12 +854,12 @@ static BOOL check_hook_thread(void)
return
hook_thread_hwnd
!=
0
;
}
HHOOK
set_dinput_hook
(
int
hook_id
,
LPVOID
proc
)
void
check_dinput_hooks
(
LPDIRECTINPUTDEVICE8A
iface
)
{
HWND
hwnd
;
EnterCriticalSection
(
&
dinput_hook_crit
);
hwnd
=
hook_thread_hwnd
;
LeaveCriticalSection
(
&
dinput_hook_crit
);
return
(
HHOOK
)
SendMessageW
(
hwnd
,
WM_USER
+
0x10
,
(
WPARAM
)
hook_id
,
(
LPARAM
)
proc
);
SendMessageW
(
hwnd
,
WM_USER
+
0x10
,
1
,
0
);
}
dlls/dinput/dinput_private.h
View file @
8f28d436
...
...
@@ -57,7 +57,7 @@ extern const struct dinput_device joystick_linuxinput_device;
extern
HINSTANCE
DINPUT_instance
;
extern
HHOOK
set_dinput_hook
(
int
hook_id
,
LPVOID
proc
);
extern
void
check_dinput_hooks
(
LPDIRECTINPUTDEVICE8A
);
typedef
void
(
*
DI_EVENT_PROC
)(
LPDIRECTINPUTDEVICE8A
,
WPARAM
,
LPARAM
);
#endif
/* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */
dlls/dinput/keyboard.c
View file @
8f28d436
...
...
@@ -287,36 +287,6 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
return
DI_OK
;
}
static
HRESULT
WINAPI
SysKeyboardAImpl_Unacquire
(
LPDIRECTINPUTDEVICE8A
iface
);
static
HRESULT
WINAPI
SysKeyboardAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
HRESULT
res
;
TRACE
(
"(%p)
\n
"
,
This
);
if
((
res
=
IDirectInputDevice2AImpl_Acquire
(
iface
))
!=
DI_OK
)
return
res
;
set_dinput_hook
(
WH_KEYBOARD_LL
,
KeyboardCallback
);
return
DI_OK
;
}
static
HRESULT
WINAPI
SysKeyboardAImpl_Unacquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
HRESULT
res
;
TRACE
(
"(this=%p)
\n
"
,
This
);
if
((
res
=
IDirectInputDevice2AImpl_Unacquire
(
iface
))
!=
DI_OK
)
return
res
;
set_dinput_hook
(
WH_KEYBOARD_LL
,
NULL
);
return
DI_OK
;
}
/******************************************************************************
* GetCapabilities : get the device capablitites
*/
...
...
@@ -442,8 +412,8 @@ static const IDirectInputDevice8AVtbl SysKeyboardAvt =
IDirectInputDevice2AImpl_EnumObjects
,
IDirectInputDevice2AImpl_GetProperty
,
IDirectInputDevice2AImpl_SetProperty
,
SysKeyboard
AImpl_Acquire
,
SysKeyboard
AImpl_Unacquire
,
IDirectInputDevice2
AImpl_Acquire
,
IDirectInputDevice2
AImpl_Unacquire
,
SysKeyboardAImpl_GetDeviceState
,
IDirectInputDevice2AImpl_GetDeviceData
,
IDirectInputDevice2AImpl_SetDataFormat
,
...
...
@@ -484,8 +454,8 @@ static const IDirectInputDevice8WVtbl SysKeyboardWvt =
IDirectInputDevice2WImpl_EnumObjects
,
XCAST
(
GetProperty
)
IDirectInputDevice2AImpl_GetProperty
,
XCAST
(
SetProperty
)
IDirectInputDevice2AImpl_SetProperty
,
XCAST
(
Acquire
)
SysKeyboard
AImpl_Acquire
,
XCAST
(
Unacquire
)
SysKeyboard
AImpl_Unacquire
,
XCAST
(
Acquire
)
IDirectInputDevice2
AImpl_Acquire
,
XCAST
(
Unacquire
)
IDirectInputDevice2
AImpl_Unacquire
,
XCAST
(
GetDeviceState
)
SysKeyboardAImpl_GetDeviceState
,
XCAST
(
GetDeviceData
)
IDirectInputDevice2AImpl_GetDeviceData
,
XCAST
(
SetDataFormat
)
IDirectInputDevice2AImpl_SetDataFormat
,
...
...
dlls/dinput/mouse.c
View file @
8f28d436
...
...
@@ -398,7 +398,6 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
/* Install our mouse hook */
if
(
This
->
base
.
dwCoopLevel
&
DISCL_EXCLUSIVE
)
ShowCursor
(
FALSE
);
/* hide cursor */
set_dinput_hook
(
WH_MOUSE_LL
,
dinput_mouse_hook
);
/* Get the window dimension and find the center */
GetWindowRect
(
This
->
base
.
win
,
&
rect
);
...
...
@@ -433,7 +432,6 @@ static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
if
((
res
=
IDirectInputDevice2AImpl_Unacquire
(
iface
))
!=
DI_OK
)
return
res
;
set_dinput_hook
(
WH_MOUSE_LL
,
NULL
);
if
(
This
->
base
.
dwCoopLevel
&
DISCL_EXCLUSIVE
)
ShowCursor
(
TRUE
);
/* show cursor */
...
...
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