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
f3952a3e
Commit
f3952a3e
authored
Jan 22, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move di_em_win_wndproc function around.
parent
bf8274ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
dinput_main.c
dlls/dinput/dinput_main.c
+46
-46
No files found.
dlls/dinput/dinput_main.c
View file @
f3952a3e
...
...
@@ -127,52 +127,6 @@ static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface, DWORD
LeaveCriticalSection
(
&
impl
->
crit
);
}
static
LRESULT
WINAPI
di_em_win_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
dinput_device
*
impl
;
RAWINPUT
ri
;
UINT
size
=
sizeof
(
ri
);
int
rim
=
GET_RAWINPUT_CODE_WPARAM
(
wparam
);
TRACE
(
"%p %d %Ix %Ix
\n
"
,
hwnd
,
msg
,
wparam
,
lparam
);
if
(
msg
==
WM_INPUT
&&
(
rim
==
RIM_INPUT
||
rim
==
RIM_INPUTSINK
))
{
size
=
GetRawInputData
(
(
HRAWINPUT
)
lparam
,
RID_INPUT
,
&
ri
,
&
size
,
sizeof
(
RAWINPUTHEADER
)
);
if
(
size
==
(
UINT
)
-
1
||
size
<
sizeof
(
RAWINPUTHEADER
))
WARN
(
"Unable to read raw input data
\n
"
);
else
if
(
ri
.
header
.
dwType
==
RIM_TYPEMOUSE
)
{
EnterCriticalSection
(
&
dinput_hook_crit
);
LIST_FOR_EACH_ENTRY
(
impl
,
&
acquired_rawmouse_list
,
struct
dinput_device
,
entry
)
dinput_mouse_rawinput_hook
(
&
impl
->
IDirectInputDevice8W_iface
,
wparam
,
lparam
,
&
ri
);
LeaveCriticalSection
(
&
dinput_hook_crit
);
}
}
return
DefWindowProcW
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
void
register_di_em_win_class
(
void
)
{
WNDCLASSEXW
class
;
memset
(
&
class
,
0
,
sizeof
(
class
));
class
.
cbSize
=
sizeof
(
class
);
class
.
lpfnWndProc
=
di_em_win_wndproc
;
class
.
hInstance
=
DINPUT_instance
;
class
.
lpszClassName
=
L"DIEmWin"
;
if
(
!
RegisterClassExW
(
&
class
)
&&
GetLastError
()
!=
ERROR_CLASS_ALREADY_EXISTS
)
WARN
(
"Unable to register message window class
\n
"
);
}
static
void
unregister_di_em_win_class
(
void
)
{
if
(
!
UnregisterClassW
(
L"DIEmWin"
,
NULL
)
&&
GetLastError
()
!=
ERROR_CLASS_DOES_NOT_EXIST
)
WARN
(
"Unable to unregister message window class
\n
"
);
}
static
LRESULT
CALLBACK
input_thread_ll_hook_proc
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
dinput_device
*
impl
;
...
...
@@ -321,6 +275,52 @@ static void input_thread_update_device_list( struct input_thread_state *state )
state
->
rawinput_devices
[
0
]
=
rawinput_mouse
;
}
static
LRESULT
WINAPI
di_em_win_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
dinput_device
*
impl
;
RAWINPUT
ri
;
UINT
size
=
sizeof
(
ri
);
int
rim
=
GET_RAWINPUT_CODE_WPARAM
(
wparam
);
TRACE
(
"%p %d %Ix %Ix
\n
"
,
hwnd
,
msg
,
wparam
,
lparam
);
if
(
msg
==
WM_INPUT
&&
(
rim
==
RIM_INPUT
||
rim
==
RIM_INPUTSINK
))
{
size
=
GetRawInputData
(
(
HRAWINPUT
)
lparam
,
RID_INPUT
,
&
ri
,
&
size
,
sizeof
(
RAWINPUTHEADER
)
);
if
(
size
==
(
UINT
)
-
1
||
size
<
sizeof
(
RAWINPUTHEADER
))
WARN
(
"Unable to read raw input data
\n
"
);
else
if
(
ri
.
header
.
dwType
==
RIM_TYPEMOUSE
)
{
EnterCriticalSection
(
&
dinput_hook_crit
);
LIST_FOR_EACH_ENTRY
(
impl
,
&
acquired_rawmouse_list
,
struct
dinput_device
,
entry
)
dinput_mouse_rawinput_hook
(
&
impl
->
IDirectInputDevice8W_iface
,
wparam
,
lparam
,
&
ri
);
LeaveCriticalSection
(
&
dinput_hook_crit
);
}
}
return
DefWindowProcW
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
void
register_di_em_win_class
(
void
)
{
WNDCLASSEXW
class
;
memset
(
&
class
,
0
,
sizeof
(
class
));
class
.
cbSize
=
sizeof
(
class
);
class
.
lpfnWndProc
=
di_em_win_wndproc
;
class
.
hInstance
=
DINPUT_instance
;
class
.
lpszClassName
=
L"DIEmWin"
;
if
(
!
RegisterClassExW
(
&
class
)
&&
GetLastError
()
!=
ERROR_CLASS_ALREADY_EXISTS
)
WARN
(
"Unable to register message window class
\n
"
);
}
static
void
unregister_di_em_win_class
(
void
)
{
if
(
!
UnregisterClassW
(
L"DIEmWin"
,
NULL
)
&&
GetLastError
()
!=
ERROR_CLASS_DOES_NOT_EXIST
)
WARN
(
"Unable to unregister message window class
\n
"
);
}
static
DWORD
WINAPI
dinput_thread_proc
(
void
*
params
)
{
struct
input_thread_state
state
=
{
0
};
...
...
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