Commit Graph

1680 Commits

Author SHA1 Message Date
Rémi Bernon e0e3b6bc91 user32: Use WM_INPUT message hw_id as RAWINPUT handle.
This fixes the GetRawInputData regression introduced with
359ee2ecc2 where the message data couldn't
be read twice, while keeping the overwrite logic it introduced.

This also adds some SetLastError to fix some unit tests todos.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49522
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 22:24:39 +02:00
Rémi Bernon b58a899acc user32/tests: Add more GetRawInputData tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 22:24:36 +02:00
Brendan Shanks cb127e11ad user32/tests: Add more QueryDisplayConfig() tests.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-01 15:07:33 +02:00
Brendan Shanks 5fba152eea user32: Implement QueryDisplayConfig().
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-01 15:07:33 +02:00
Brendan Shanks 2e1c48f351 user32/tests: Test additional flag values with GetDisplayConfigBufferSizes().
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-01 15:07:33 +02:00
Rémi Bernon 359ee2ecc2 user32: Return failure when rawinput has been overwritten.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 21:07:37 +02:00
Rémi Bernon 3a9edf9aad user32: Implement GetRawInputBuffer.
CoD: WWII uses it to read mouse motion instead of listening to WM_INPUT
messages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 21:07:37 +02:00
Rémi Bernon 083cb5c783 user32/tests: Add GetRawInputBuffer tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 21:06:52 +02:00
Rémi Bernon 27a52d0414 server: Implement RegisterRawInputDevices RIDEV_INPUTSINK flag.
This flag allows applications to receive rawinput messages while in
background. They have to specify a target hwnd, which will receive them,
and the messages will carry a RIM_INPUTSINK wparam if the process wasn't
foreground.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Rémi Bernon 8cf7fe3b7c server: Implement RegisterRawInputDevices RIDEV_NOLEGACY flag.
This makes legacy mouse window messages such as WM_MOUSEMOVE and others,
to stop being sent, including to low-level hooks. The desktop mouse
state should still be udpated.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Rémi Bernon 57124b9905 server: Implement rawinput inter-process message dispatch.
This delivers the rawinput messages to the correct process, regardless
of where the input was received.

As for now RIDEV_INPUTSINK is still not implemented, this only fixes
the case where input is injected in a background process and where it
should not receive rawinput -as in the test- or when cursor moves over
a background window and the foreground process should have received
rawinput messages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Rémi Bernon 5daf0efbfe user32/tests: Add inter-desktop rawinput message tests.
Another thread is created to execute the tests, for SetThreadDesktop to
succeed consistently. It seems to fail spuriously if it is called from
a thread that already created some windows before.

This shows that rawinput messages may be dispatched across desktops,
but only if the subscribing process has a window in the input desktop,
and it is the foreground process (even if the target window may be in
another desktop).

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Huw Davies aec5ccfc06 server: Don't allow an empty desktop name.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Huw Davies afe3e698c5 user32/tests: Use skip() to skip tests when using a non-US keyboard.
Otherwise, under Wine, win_skip() counts as a failure.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Rémi Bernon bc282905d9 user32/tests: Add RIM_EXINPUTSINK rawinput message tests.
When RIM_EXINPUTSINK is used, messages are received in background
only if the foreground process didn't register for rawinput messages
itself.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 22:45:20 +02:00
Rémi Bernon df5d632324 user32/tests: Add inter-process rawinput message tests.
Rawinput messages are not received anymore if the foreground window is
from another process. Using RIDEV_INPUTSINK makes it possible to receive
them again, but with RIM_INPUTSINK flag.

When multiple processes register for rawinput messages, the foreground
process will receive the message, as well as any other that registerd
with RIM_INPUTSINK flag, including when the foreground process itself
did.

Currently the messages may be received correctly, but that depends on
where the input events are generated, so add another test case with
messages sent from the test process, and validate that nothing should
be received.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 22:45:17 +02:00
Rémi Bernon 8c7c0c5504 user32/tests: Add inter-thread rawinput message tests.
The rawinput messages are received on the target window if is from the
same process as the foreground window, it doesn't need to be the
foreground window itself, or use RIDEV_INPUTSINK.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 22:45:15 +02:00
Rémi Bernon 36a74a7002 user32/tests: Add basic rawinput message tests.
This tests basic functionality by injecting mouse event and checking
the number of each messages received.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 22:45:11 +02:00
Huw Davies 6e69e512d8 user32: Use a default name for winstations created or opened with no name.
The default is of the form "Service-0x<luid high>-<luid low>$" where the
luid in question is the logon session luid.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 19:31:18 +02:00
Zhiyi Zhang c4a01d0a65 winex11.drv: Use the default frequency in ChangeDisplaySettingsExW() if dmDisplayFrequency is 1.
0 or 1 in dmDisplayFrequency means to use the default frequency.

Fix Disgaea PC and Ostriv failing to launch in exclusive fullscreen mode.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-12 17:16:25 +02:00
Zhiyi Zhang 203bd057cf user32/tests: Test changing to a 1Hz display mode.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-12 17:16:25 +02:00
Zhiyi Zhang 1b33e0f72e winex11.drv: Set DM_POSITION and DM_DISPLAYORIENTATION when reporting registry display settings.
Set DM_POSITION and DM_DISPLAYORIENTATION when calling
EnumDisplaySettings(ENUM_REGISTRY_SETTINGS). DM_DISPLAYFIXEDOUTPUT
is not set because it is not necessarily reported according to tests.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 21:23:33 +02:00
Arkadiusz Hiler 65e550d265 user32: Fix NULL dereference in UnregisterDeviceNotification.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49211
Signed-off-by: Arkadiusz Hiler <arek@hiler.eu>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-27 21:09:21 +02:00
Markus Engel ace37a68b7 user32/tests: Add more tests for GetKeyState().
Signed-off-by: Markus Engel <markus_wine@familie-engel.online>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 22:03:52 +02:00
Zhiyi Zhang c69bb0342c winex11.drv: Update _NET_WM_STATE before resizing windows.
According to the Extended Window Manager Hints (EWMH) spec 1.3 regarding
_NET_WM_STATE_FULLSCREEN, "the Window Manager is responsible for
restoring the original geometry after a switch from fullscreen back to
normal window.", which means that removing _NET_WM_STATE_FULLSCREEN from
a window may cause the window to receive a ConfigureNotify event to
restore the window size, thus causing a application resize action to be
overwritten by the window managers.

Fix a game called Mugsters becomes maximized after exiting full screen.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-07 20:13:16 +02:00
Zhiyi Zhang 36b720357b user32/tests: Test restoring a full screen window with WS_THICKFRAME style.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-07 20:13:14 +02:00
Brendan Shanks 148fc1adb5 user32/tests: Test success for QueryDisplayConfig() and DisplayConfigGetDeviceInfo().
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 21:22:44 +02:00
Brendan Shanks c95adb32b8 user32/tests: Rename DisplayConfig test functions to match style.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 21:22:41 +02:00
Zhiyi Zhang 18cf85a3fc user32/tests: Test button styles.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 19:01:35 +02:00
Zhiyi Zhang f671b524f2 user32/tests: Add a trailing '\n' to some ok() calls.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 19:01:33 +02:00
Brendan Shanks b1b1399dd6 user32: Improve DisplayConfigGetDeviceInfo() stub.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:53:02 +02:00
Brendan Shanks 4e795a8d81 user32: Improve QueryDisplayConfig() stub.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:53:02 +02:00
Brendan Shanks af89ccc535 user32/tests: Add QueryDisplayConfig() and DisplayConfigGetDeviceInfo() tests.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:53:00 +02:00
Zhiyi Zhang 065690be32 user32/tests: Test EnumDisplayMonitors().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:52:33 +02:00
Zhiyi Zhang 1bb2b16042 user32/tests: Fix a ChangeDisplaySettings() test.
Overlapped monitor rectangles should be automatically
adjusted to avoid overlaps.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:52:30 +02:00
Zhiyi Zhang 4369aaae57 user32/tests: Flush messages after mode changes.
test_ChangeDisplaySettingsEx() can generate so many posted messages
for display change events that USERPostMessageLimit is reached and
ERROR_NOT_ENOUGH_QUOTA is returned for PostMessage(). Call flush_events()
after mode changes to limit message post rate.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48586
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:52:27 +02:00
Roman Pišl f04d8a270e user32/edit: Avoid division by zero in EDIT_EM_LineScroll_internal.
Signed-off-by: Roman Pišl <rpisl@seznam.cz>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 17:19:11 +02:00
Roman Pišl d5e591d3cb user32/edit: Avoid division by zero during initialization.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=19239
Signed-off-by: Roman Pišl <rpisl@seznam.cz>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 17:19:11 +02:00
Zebediah Figura 19c6524e48 user32: Also scan for mouse devices in GetRawInputDeviceList().
Halo: Spartan Strike attempts to discover input devices using rawinput. It
expects to be able to open at least one device file with a zero access mask. It
does not perform any other operations on the file.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-10 12:42:30 +02:00
Mathew Hodson a8dee2a23f user32/tests: Don't report cursor handle since it always changes.
Signed-off-by: Mathew Hodson <mathew.hodson@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:21:42 +02:00
Serge Gautherie be3cda6ec0 tests: Remove now useless forced _WIN32_WINNT defines.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-23 11:30:25 +01:00
Serge Gautherie 7770e26f2d include: Remove now useless forced _WIN32_IE defines.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-20 19:38:38 +01:00
Rémi Bernon cf2148e17c user32/tests: Add new test to validate WM_CANCELMODE message.
The ShowWindow(SW_SHOWMINIMIZED):overlapped test shows that the
message should not be sent in general. This additional test shows that
we should still send the message if a menu is active.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 22:09:32 +01:00
Serge Gautherie d0fd12b909 include: Remove now useless forced WINVER defines.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 13:15:16 +01:00
Francois Gouget a909baeb4e tests: Report all errors when failing to wait for a child process.
Report the line number where the test failed to wait for the child so
one can identify which child process did not behave as expected.
Also wait_child_process() is meant for the general case so report
all non-crash error cases as test failures so they are accounted for.
Omit the "winetest_" prefix to match the other Wine test functions and
so the underlying winetest_wait_child_process() function can be wrapped
with the usual line-capturing macros.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48651
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 10:51:44 +01:00
Serge Gautherie aa384d3642 tools: Remove 0x0501 API versions forced by winapi_test.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-13 20:10:44 +01:00
Dmitry Timoshkov 6ac2ba3e3c server: Ignore low word of a class instance when looking up for a window class.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-27 23:34:51 +01:00
Dmitry Timoshkov e2c0f51312 user32/tests: Add some tests for classes with non-zero low word instance.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-27 23:34:51 +01:00
Nikolay Sivov 56c75015c9 user32/tests: Link to activation context API directly.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-24 18:41:02 +01:00
Akihiro Sagawa e98dbf2e94 user32: Fix wsprintfW %C conversion.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-19 20:26:53 +01:00