Commit graph

469 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 051561ed17
[NTUSER] Use call procedure handle if available (#4178)
Based on I_Kill_Bugs' patch.
- Use IsCallProcHandle to check if the procedure is a call procedure handle.
- If so, use the call procedure.
CORE-10499
2021-12-23 11:53:18 +09:00
Serge Gautherie d375b7f6c5
[WIN32K:NTUSER] Make sure to hold User Global Lock before mapping desktop heap (#4144)
Addendum to 8c098ee8d.
CORE-17890
2021-12-19 23:34:35 +01:00
Doug Lyons 7d1b50394b
[WIN32SS] Do not remove message from the Msg Queue if it is not for us. (#4129)
CORE-8217
Patch from 'I_Kill_Bugs' contributor.
2021-12-19 16:03:22 +01:00
Katayama Hirofumi MZ f643fb301b [NTUSER] Fix SwitchToThisWindow
Taskbar task buttons were not working correctly due to this bug.
CORE-17911
2021-12-17 11:38:23 +09:00
Katayama Hirofumi MZ 0b6f3eb8e4
[NTUSER][USER32] Use async way in TileWindows and CascadeWindows (#4167)
Processing asynchronously. CORE-17894
2021-12-16 09:52:02 +09:00
Katayama Hirofumi MZ 55a1c29341
[NTUSER][USER32] Simplify SwitchToThisWindow (#4153)
CORE-17894
2021-12-13 08:14:33 +09:00
Katayama Hirofumi MZ 8c9b6fdb5c
[USER32] Partially fix freezing of Task Switcher (#4148)
- Use SendMessageTimeout instead of SendMessage.
- Use SwitchToThisWindow instead of BringWindowToTop.
- Use ShowWindowAsync instead of ShowWindow.
- Use SWP_ASYNCWINDOWPOS for SetWindowPos.
CORE-17894
2021-12-10 13:37:43 +09:00
Katayama Hirofumi MZ ee3659d5d5
[NTUSER][USER32] Simplify user32.IsHungAppWindow (#4150)
Check FNID_GHOST and MsqIsHung. CORE-17894
2021-12-09 00:39:57 +09:00
Katayama Hirofumi MZ 79c926c893
[NTUSER] Implement HSHELL_RUDEAPPACTIVATE notification (#4147)
- Add IntIsWindowFullscreen function to judge whether the window is fullscreen.
- Add IntCheckFullscreen function to notify HSHELL_RUDEAPPACTIVATE if fullscreen.
- Add IntCheckFullscreen call in UpdateShellHook function.
- Add IntCheckFullscreen call in co_WinPosSetWindowPos function.
CORE-16130
2021-12-08 18:26:22 +09:00
Katayama Hirofumi MZ f606fecb0d
[NTUSER] Fix where linking newly created window is done (#4127)
Co-authored-by: I_Kill_Bugs <>
CORE-12052
2021-12-04 11:52:38 +09:00
James Tabor 9cff384c22 [User32] Add Back Break with Error Message
Add back missing break. See CORE-17856.
2021-11-27 11:35:42 -06:00
James Tabor a89844f740 [User32] Fix Copy Paste
Pointed out by otya. See CORE-17856.
2021-11-24 09:36:50 -06:00
Denis Malikov db810d8e44
[WIN32SS:NTUSER] Fix window state after restoring snapped window (#4119)
InternalPos.NormalRect is a key data for detecting whether a window was snapped.
Keeping it after restore affecting next snap actions.

CORE-16477
2021-11-23 23:34:03 +01:00
Thomas Faber 0af3689c2e
[REACTOS] Fix traces with missing arguments.
Courtesy of VS Code Analysis warning C6064:
Missing integer argument to 'DbgPrint' that corresponds to conversion specifier 'N'.
2021-11-21 12:57:35 -05:00
Julio Carchi 9c4397afdf
[USER32] GetQueueStatus() should not return 0 when passing QS_ALLINPUT flag that includes QS_RAWINPUT (#4115)
GTK applications call GetQueueStatus(QS_ALLINPUT), where QS_ALLINPUT
specifies the QS_RAWINPUT flag as well, when these are compiled for
Windows XP+, and they expect the call to succeed on this platform.

On one side, ReactOS does not currently support this flag at all, but
since it claims to be XP/2003-compatible, applications may implicitly
expect the flag to be supported by GetQueueStatus() and the function
*NOT* failing when this flag is set.
(Later GTK apps don't care and just call GetQueueStatus(QS_ALLINPUT)
that includes QS_RAWINPUT, and therefore would fail as well on e.g.
Windows 2000...)

Otherwise, an observable effect is that some versions of libgdk-win32-2.0.0.dll
enter into an infinite loop when calling GetQueueStatus(QS_ALLINPUT),
since this call always failed on ReactOS.

On the other side, however, we should honour our winetests that handle
the presence of the QS_RAWINPUT flag and behave differently accordingly.
But since we do not support QS_RAWINPUT yet, we should keep their old
behaviour where QS_RAWINPUT is unused.

Thus, in order to accomodate both sides, we don't fail the GetQueueStatus()
call, but just set the ERROR_INVALID_FLAGS last error and continue it.


This fixes CORE-15686, CORE-17551 and probably CORE-11850.
Fixes also all user32:TrackMouseEvent tests.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2021-11-20 00:45:35 +01:00
Katayama Hirofumi MZ 3d78601f39
[WIN32SS][NTUSER] Implement NtUserDestroyInputContext (#4063)
CORE-11700
2021-11-01 15:20:42 +09:00
Thomas Faber 4bc95812fd
[WIN32K] Mark default as unreachable.
Powered by clang-cl.
2021-10-29 22:06:49 -04:00
Thomas Faber 3235e35dee
[WIN32K] Remove unnecessary if in NtUserGetGUIThreadInfo.
This condition is already checked above.
Powered by clang-cl.
2021-10-29 22:06:49 -04:00
Thomas Faber 42657493ef
[WIN32K] Fix uninitialized hNewMenu use in MENU_DoNextMenu.
See also: Wine's implementation.
Powered by clang-cl.
2021-10-29 22:06:46 -04:00
Katayama Hirofumi MZ 6417b2323d
[NTUSER][USER32] Workaround tracking menu on CORE-17338 (#4048)
This prevents the tracking menu from erroneously closing itself right after it was opened in some cases.
Fixes CORE-17338 which got unhidden by 0.4.15-dev-1126-g 58b0558f94
And fixes CORE-15760 which got unhidden by SVN r74972 == git 19dd22d422

Since both symptoms look very similar but the unhiding revisions did differ,
that could mean we do have some kind of race condition here.
I guess this fix is more like a workaround. I do intend to port it back nevertheless.
2021-10-23 22:29:39 +02:00
Hermès Bélusca-Maïto 5891ab2bfd
[WIN32SS:NTUSER] Make sure to hold User Global Lock before manipulating desktops. (#4053) 2021-10-22 21:44:56 +02:00
Hermès Bélusca-Maïto 6b7b0f0c7e
[WIN32SS:NTUSER] Few formatting fixes. 2021-10-22 21:44:52 +02:00
James Tabor 83f86b8fdb [User32] Fix incorrect check.
Use Lo Word instead of Intersource check.
Fix wine user32 tests.
2021-10-19 15:29:51 -05:00
Chan Chilung 463784c5f1
[TRANSLATION] Chinese Traditional (zh-TW) translation update (#3954)
Also sync LOCALMON/UI translation with Wine.
2021-10-10 15:00:44 +03:00
Katayama Hirofumi MZ 66ef31494e
[IMM32] Implement ImmActivateLayout (#3987)
- Add IME_STATE and IME_SUBSTATE structures.
- Modify INPUTCONTEXTDX structure.
- Implement ImmActivateLayout function.
- Improve ImmDestroyContext function by using newly-defined Imm32FreeImeStates.
- Add Imm32FetchImeState, Imm32FetchImeSubState, Imm32LoadImeStateSentence, Imm32SaveImeStateSentence, and Imm32SelectLayout helper functions.
- Modify NtUserSetThreadLayoutHandles prototype.
CORE-11700
2021-10-04 07:33:15 +09:00
Katayama Hirofumi MZ 9adc538c9c
[IMM32] Rewrite ImmSetActiveContext (#3982)
- Re-implement ImmSetActiveContext function.
- Modify NtUserNotifyIMEStatus prototype.
- Improve ImmSetConversionStatus and ImmSetOpenStatus functions.
CORE-11700
2021-10-01 03:02:56 +09:00
Hermès Bélusca-Maïto 31c4c2efe9
[USER32] GetUserObjectSecurity/SetUserObjectSecurity: Just use UserSetLastNTError() in failure path. 2021-09-26 19:04:08 +02:00
Arjav Garg a602bc3550
[NTUSER] Fix UserSendKeyboardInput() KEYEVENTF_SCANCODE use case (CORE-17144) 2021-09-25 09:56:12 -04:00
Joachim Henze 222acf5a3e [NTUSER] Scrollbar.c, Avoid potential out-of-bounds-accesses in co_IntSetScrollInfo() CORE-17777
This is an addendum to
0.4.15-dev-3174-g dda9c3979e CORE-17769 and
0.4.15-dev-3147-g 3bf7e3ac13 CORE-17754 CORE-17755

We have not seen this happening in real-life yet, but some code-fragments within co_IntSetScrollInfo()
e.g. line 628 if (nBar == SB_CTL) do clearly indicate that nBar can be 2 (SB_CTL).
Some lines below we definitely must not access those 4 static arrays out of bounds then via nBar as access index!

Ftr with a bit of grepping I also found some calls like NtUserSetScrollInfo(Wnd, SB_CTL, &Info, FALSE);
e.g: in win32ss/user/user32/controls/scrollbar.c so I am pretty sure nBar == 2 can happen in practice within co_IntSetScrollInfo().

I question whether any of those reads/writes to those static arrays (or the comparisons) would make any sense on index 2,
so we should aim to eliminate them altogether in the future.
2021-09-20 03:05:05 +02:00
Joachim Henze dda9c3979e [NTUSER] Scrollbar.c, improve co_IntSetScrollInfo() CORE-17769
Fixes CORE-17769 'Rapps Listview manual resize may erroneously not draw the triangles sometimes'
This could happen for both: themed and unthemed.

CORE-17769 was a regression introduced by 0.4.14-dev-1134-g 00adb1a3f9

We don't really like the added state in form of the static variables,
but the patch works good from a pure testing-perspective.

Many Thanks to the patches author: Doug Lyons
2021-09-19 22:35:37 +02:00
Hermès Bélusca-Maïto 271556e6f8
[WIN32SS] Disable by default the dumping function. Addendum to 69f90508. 2021-09-19 00:46:56 +02:00
Hermès Bélusca-Maïto 69f905081c
[WIN32SS:NTUSER] Move the keyboard layout debugging code to a separate dump function.
And fix its obvious bugs, e.g. not checking for possible NULL pointers
for the optional keyboard layout sub-tables...
2021-09-19 00:18:04 +02:00
Katayama Hirofumi MZ df6fff78bb
[IMM32] Rewrite ImmAssociateContextEx (#3961)
- Rewrite ImmAssociateContextEx function.
- Modify NtUserAssociateInputContext prototype.
CORE-11700
2021-09-16 19:29:49 +09:00
Hermès Bélusca-Maïto 9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Doug Lyons 3bf7e3ac13
[NTUSER] Improve Themed Scrollbars by Minimizing Updates (#3953)
This fixes regressions CORE-17754 and CORE-17755 which regressed by
0.4.15-dev-3086-g 236649c626
2021-09-12 22:54:46 +02:00
Süleyman Poyraz 53221834c5
[TRANSLATION] Add and improve Turkish (tr-TR) translation (#3561)
Reviewed-by: Can Taşan <ctasan99@hotmail.com>
Reviewed-by: Ercan Ersoy <ercanersoy@ercanersoy.net>
Signed-off-by: Süleyman Poyraz <zaryob.dev@gmail.com>
2021-09-12 00:34:11 +03:00
Hermès Bélusca-Maïto 4cbc61fd02
[WIN32SS:NTUSER][USER32] NtUserProcessConnect() should return pointers in user client-space. (#3937)
- Do the kernel/server --> user/client-space pointers conversion within
  NtUserProcessConnect(), instead of having the callers of this function
  doing this job.
  This makes the behaviour Windows-compatible.

  NOTE: the gHandleEntries pointer is ReactOS-specific!

- Drop the g_ulSharedDelta global, just use instead gSharedInfo.ulSharedDelta.

- Add extra documentation aspects for NtUserProcessConnect() that are
  not yet implemented in ReactOS.
2021-09-09 16:15:12 +02:00
Doug Lyons 236649c626
[UXTHEME][NTUSER] Fix flashing of scrollbar when scrolling (#3868)
Based on a patch by I_Kill_Bugs.
2021-09-03 22:34:26 +03:00
Katayama Hirofumi MZ 4689c8ead8 [USER32][INCLUDE] Move GetImmFileName declaration from user32.h to user32p.h
From: win32ss/user/user32/include/user32.h
To: win32ss/user/user32/include/user32p.h

CORE-11700
2021-08-31 13:42:54 +09:00
Katayama Hirofumi MZ 2ab858c125
[USER32][IMM32] Improve User32InitializeImmEntryTable (#3918)
- Improve User32InitializeImmEntryTable function and related.
- Complete win32ss/user/user32/include/immtable.h table.
- Delete a hack in user32.DllMain and apply my magical tricks. This will fix some access violations in IMM32.
- Add some stubs into IMM32.
CORE-11700
2021-08-23 16:25:21 +09:00
Katayama Hirofumi MZ 10c9aa067f
[NTUSER] Improve NtUserQueryWindow (#3915)
- Improve NtUserQueryWindow function.
- Add IMC structure.
- Modify THREADINFO structure.
CORE-11700
2021-08-21 07:31:10 +09:00
Katayama Hirofumi MZ f4bc74edc3
[IMM32] ImmGenerateMessage and ImmTranslateMessage (#3914)
- Rewrite `ImmGenerateMessage` and `ImmTranslateMessage` functions.
- Rename `INPUTCONTEXTDX.bHasVKey` as `bNeedsTrans`.
- Move `TRANSMSG` structure into `ntuser.h`.
- Add `TRANSMSGLIST` structure into `ntuser.h`.
- Add `UNDETERMINESTRUCT` structure to `ddk/imm.h`.
- Modify `NtUserGetAppImeLevel` prototype.
CORE-11700
2021-08-18 08:42:12 +09:00
Jérôme Gardou c4801ab696 [WIN32K] Do not release twice the lock on error path 2021-08-06 15:18:21 +02:00
Jérôme Gardou 0bc00267df [WIN32K] Init User part after GDI one.
But Initialize user lock first thing to avoid hitting newly introduced ASSERTS

This partly reverts commit 515d83a883.
2021-08-06 10:15:02 +02:00
Katayama Hirofumi MZ 692a30a84a
[IMM32] ImmCreateContext, ImmDestroyContext, DllMain etc. (#3867)
- Rewrite ImmCreateContext, ImmDestroyContext, and DllMain functions.
- Add g_hImm32Inst, g_bClientRegd, and g_SharedInfo global variables. Delete g_dwImm32Flags (that was g_psi->dwSRVIFlags).
- Implement ImmLoadIME and ImmRegisterClient functions.
- Modify CLIENTIMC and IMEDPI structures. Move CLIENTIMC definition into ntuser.h.
- Add file win32ss/include/imetable.h.
- Rename SRVINFO_METRICS macro as SRVINFO_CICERO_ENABLED.
CORE-11700
2021-08-04 09:41:59 +09:00
Jérôme Gardou bd6fb80867 [WIN32K:NTUSER] In debug builds, enable free & tail checking when creating heaps
Actually catches bugs
2021-08-03 23:13:19 +02:00
Jérôme Gardou b783b16cef [WIN32K:USER] Fix potential use after free when painting child windows 2021-08-03 23:13:19 +02:00
Jérôme Gardou d958dc9bc2 [WIN32K:NTUSER] Assert global user lock is held exclusively when using global & desktop heaps
They're explicitly not serialized because we count on this.
2021-08-03 23:13:19 +02:00
Jérôme Gardou 8c098ee8d2 [WIN32K:NTUSER] Make sure to hold User Global Lock before unmapping desktop heap 2021-08-03 23:13:19 +02:00
Jérôme Gardou 6ec0420dc6 [WIN32K:NTUSER] Allocate & free timers under global user lock 2021-08-03 23:13:19 +02:00