Commit graph

810 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 99614febad
[USER32] Add ImeWnd_OnImeSystem (#4327)
- Add WM_IME_SYSTEM message handling of the IME window.
- Modify immtable.h.
CORE-11700
2022-01-31 21:20:08 +09:00
Katayama Hirofumi MZ 173fca6ed6 [NTUSER] UserIsDBCSEnabled: Vietnamese doesn't use DBCS
CORE-11700
2022-01-31 09:33:19 +09:00
Katayama Hirofumi MZ fbab1914a6
[USER32] Don't delay-load-link to imm32.dll (#4328)
Reduce binary size.
- Don't directly call the IMM32 functions. Use IMM_FN instead.
- Modify CMakeLists.txt to unlink imm32.dll.
CORE-11700
2022-01-31 09:30:47 +09:00
Katayama Hirofumi MZ d735373e46 [USER32] Improve RegisterIMEClass function
CORE-11700
2022-01-31 04:21:45 +09:00
Katayama Hirofumi MZ c339105b0d
[NTUSER] Implement GetSystemMetrics.SM_DBCSENABLED (#4317)
- Add UserIsDBCSEnabled helper function.
- Support SM_DBCSENABLED value of GetSystemMetrics function.
CORE-11700
2022-01-30 11:23:22 +09:00
Katayama Hirofumi MZ df8c74e78b
[INCLUDE] Rename <ddk/imm.h> as <ddk/immdev.h> (#4321)
- Rename <ddk/imm.h> as <ddk/immdev.h>.
- Delete sdk/include/reactos/wine/imm.h (this header is confusing and nonsense).
- Changes related to it.
CORE-11700
2022-01-30 09:38:04 +09:00
Hermès Bélusca-Maïto 3b76aa5d19
[CONCFG] Rewrite the InitTTFontCache() registry enumeration loop. 2022-01-30 01:02:09 +01:00
Hermès Bélusca-Maïto f650cbdb68
[CONCFG] IsValidConsoleFont(): Validate font against charset corresponding to selected code page. 2022-01-30 01:02:04 +01:00
Hermès Bélusca-Maïto 1530a678a8
[CONCFG:FONT] Add SAL annotations. 2022-01-30 01:01:58 +01:00
Katayama Hirofumi MZ 3fc83b4361
[USER32] Implement ImeWnd_OnImeControl (#4320)
- Add IMC_GETCONVERSIONMODE, IMC_GETSENTENCEMODE, IMC_GETOPENSTATUS, IMC_GETSOFTKBDPOS, and IMC_SETSOFTKBDPOS macros into <ddk/imm.h>.
- Implement WM_IME_CONTROL message handling of the IME window.
CORE-11700
2022-01-29 10:35:48 +09:00
Katayama Hirofumi MZ 82136b3ee4
[USER32] Implement ImeWnd_OnImeNotify (#4318)
- Modify CMakeLists.txt to include <ddk/imm.h>
- Implement WM_IME_NOTIFY message handling of the IME window.
CORE-11700
2022-01-28 19:21:21 +09:00
Katayama Hirofumi MZ 23bb27037d
[USER32] Implement User32CreateImeUI (#4316)
Implementing Japanese input...
- Add User32CreateImeUIWindow, User32GetImeShowStatus, User32SendImeUIMessage, User32UpdateImcOfImeUI, User32SetImeWindowOfImc and User32NotifyOpenStatus helper functions.
- Add WM_IME_SELECT, WM_IME_COMPOSITION, WM_IME_STARTCOMPOSITION and WM_IME_ENDCOMPOSITION message handling of the IME window.
- Rename ImeWnd_OnDestroy as User32DestroyImeUIWindow.
- Rename CheckIMCForWindow as User32CanSetImeWindowToImc.
- Improve ImeWnd_OnCreate function.
CORE-11700
2022-01-27 21:19:37 +09:00
Katayama Hirofumi MZ fc62d268d2
[USER32] Implement WM_CREATE of IME window (#4314)
Implement handling of WM_CREATE and WM_DESTROY messages of the IME window.
CORE-11700
2022-01-27 07:30:11 +09:00
Katayama Hirofumi MZ 9c8167e90a
[NTUSER] Implement NtUserGetAppImeLevel and NtUserSetAppImeLevel (#4313)
- Add AtomImeLevel atom.
- Modify NtUserSetAppImeLevel prototype.
- Implement NtUserGetAppImeLevel and NtUserSetAppImeLevel functions.
CORE-11700
2022-01-27 07:29:19 +09:00
Katayama Hirofumi MZ 1cad26ad08 [USER32] Fix uninitialized cbTotal
CORE-18025
2022-01-26 08:14:59 +09:00
Katayama Hirofumi MZ 5972c0c18b [USER32] Fix release build C4700 CORE-16287 2022-01-25 21:57:47 +09:00
Katayama Hirofumi MZ 0360abb796
[USER32] Follow-up of #4262 (a47590c) (#4312)
Display icons/cursors correctly without hungup. CORE-16287
2022-01-25 20:41:00 +09:00
Katayama Hirofumi MZ 41b87158ff
[NTUSER] Improve NtUserGetThreadState (#4300)
- Improve enum ThreadStateRoutines.
- Improve NtUserGetThreadState function.
- Improve CLIENTIMC structure.
- Improve imm32 code.
CORE-17732
2022-01-20 11:49:27 +09:00
Julio Carchi 292e6a429f
[NTUSER] Initialize correctly CaretWidth value. (#4297) CORE-13984 CORE-14359 CORE-16624
Fixes:
CORE-13984 LibreOffice Writer shows no blinking caret
CORE-14359 Apache Open Office 4.1.2 SWriter - no blinking Caret
CORE-16624 KVIRC, no blinking caret in configuration edit controls
2022-01-18 00:36:49 +01:00
Katayama Hirofumi MZ ce6da820a4
[NTUSER] Implement NtUserBuildHimcList (#4286)
- Add UserBuildHimcList helper function.
- Implement NtUserBuildHimcList function.
CORE-11700
2022-01-16 09:56:18 +09:00
Katayama Hirofumi MZ 2250ce80f3
[USER32] Adjust the threshold in CascadeWindows (#4283)
Improve the threshold of CascadeWindows function not to make the windows too small.
2022-01-16 09:54:44 +09:00
Hermès Bélusca-Maïto 1ffe431827
[CONSRV] Trivially implement TuiSetCodePage(). CORE-17601 2022-01-15 17:41:36 +01:00
Hermès Bélusca-Maïto 9f201d462d
[BLUE][CONSRV][USETUP] Completely remove support for CAB font extraction from driver, and move it to CONSRV, much like what was done for USETUP.
Addendum to aaa416d3 and 2391e31c.
2022-01-15 17:41:36 +01:00
Hermès Bélusca-Maïto ac2494994b
[CONSRV] Stub out support for terminal-level changing of output code page.
CORE-17601
2022-01-15 17:41:34 +01:00
Chan Chilung 171a920680
[TRANSLATION] Update Chinese Traditional (zh-TW) translation (#4154)
- Added translation for:
  - [W32TIME]
  - [MODE]
  - [TIMEOUT]
  - [MODEMUI]
  - [ARPING]
  - [FRAGINATOR]
  - and more
- Updated existing translation
- [WINNLS] Update cht (zh-TW) and zhh (zh-HK)
- [DOC] Update rules in Chinese translation notes.txt
- Wine translation sync

Some of the punctuation use in WIne has been converted to half-width,
so the punctuation will no longer synced.
2022-01-14 20:22:46 +03:00
Katayama Hirofumi MZ 2ea30b2ed3 [USERSRV][TRANSLATION] Improve Japanese (ja-JP.rc) 2022-01-13 14:09:03 +09:00
Katayama Hirofumi MZ 48827cf6c5 [NTUSER] Follow-up of #4277 (ea1353e)
According to ThFabba, NtUserSetThreadLayoutHandles returns zero.
CORE-11700
2022-01-13 10:41:03 +09:00
Katayama Hirofumi MZ ea1353e4be
[NTUSER] Implement NtUserSetThreadLayoutHandles (#4277)
- Modify NtUserSetThreadLayoutHandles prototype.
- Implement NtUserSetThreadLayoutHandles function.
CORE-11700
2022-01-12 14:48:20 +09:00
Katayama Hirofumi MZ 28959a2dfd [NTUSER] Follow-up of #4271 (36740ca)
- Delete the excessive comments.
- Delete the debugging leftover.
CORE-11700
2022-01-12 14:08:10 +09:00
Katayama Hirofumi MZ 1f44693657
[NTUSER] Implement NtUserSetImeInfoEx (#4276)
- Modify NtUserSetImeInfoEx prototype.
- Add UserSetImeInfoEx helper function.
- Implement NtUserSetImeInfoEx function.
CORE-11700
2022-01-12 12:07:31 +09:00
Katayama Hirofumi MZ 36740ca981
[NTUSER][IMM32] Implement NtUserGetImeInfoEx (#4271)
- Add UserGetImeInfoEx helper function.
- Implement NtUserGetImeInfoEx function by using UserGetImeInfoEx.
- Fix imm32.ImmGetImeInfoEx.
- Modify enum IMEINFOEXCLASS.
CORE-11700
2022-01-12 12:06:24 +09:00
Doug Lyons a47590c9cf
[USER32] Improve icon extraction to handle RIFF formats and Fix crash (#4262)
- Add handling for 'RIFF' formats (for animated cursors). This makes explorer able to display animated cursors.
- Fix crash in extracting icons/cursors.
CORE-16287
2022-01-12 08:03:44 +09:00
Katayama Hirofumi MZ 8e8f61989a
[NTUSER] Plan A: UserDereferenceObject in UserCreateInputContext (#4247)
- Call UserDereferenceObject function in UserCreateInputContext.
- Don't call UserDereferenceObject against input context at the other places.
CORE-11700
2022-01-05 08:15:32 +09:00
Stanislav Motylkov 27955da7ee
[WIN32K:NTUSER] Fix one more reference leak
Addendum to d5deacd9 and 2a2f8dbe. CORE-11700
2022-01-04 03:12:12 +03:00
Thomas Faber 2a2f8dbebd
[WIN32K:NTUSER] Fix reference leak 2022-01-03 13:25:09 -05:00
Katayama Hirofumi MZ 757bed81b1
[NTUSER] Fix KVM and VBox tests (#4235)
KVM and VBox tests was failing since d5deacd
- Check NULL at UserFreeInputContext and UserDestroyInputContext functions.
- Move UserMarkObjectDestroy into the UserDestroyInputContext function.
CORE-11700
2022-01-02 01:40:11 +09:00
Katayama Hirofumi MZ d5deacd903
[NTUSER] Implement NtUserCreateInputContext (#4230)
- Modify NtUserCreateInputContext prototype.
- Add UserCreateInputContext helper function.
- Implement NtUserCreateInputContext function by using UserCreateInputContext.
- Call UserCreateInputContext(0) in InitThreadCallback function to create the default input context.
CORE-11700
2022-01-01 20:59:00 +09:00
Katayama Hirofumi MZ ba3affe5f7
[NTUSER] Implement NtUserUpdateInputContext (#4228)
- Modify NtUserUpdateInputContext prototype.
- Implement NtUserUpdateInputContext function.
- Add enum UPDATE_INPUT_CONTEXT (UIC_*) to undocuser.h.
CORE-11700
2022-01-01 20:57:51 +09:00
Katayama Hirofumi MZ cdf3b5e85a
[NTUSER] Implement NtUserQueryInputContext (#4227)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
- Modify NtUserQueryInputContext prototype.
- Implement NtUserQueryInputContext function.
- Add enum QUERY_INPUT_CONTEXT (QIC_*) to undocuser.h.
CORE-11700
2022-01-01 20:56:50 +09:00
Katayama Hirofumi MZ fcc222c28a
[NTUSER] Implement NtUserDisableThreadIme (#4216)
CORE-11700
2021-12-31 10:20:53 +09:00
Chan Chilung 81db5e1da8
[TRANSLATION] Add Hong Kong Chinese (zh-HK) translation - Part 1 (#3941)
Converted from Cantonese to HK-Style Written Chinese.

Also assign zh-HK translations to the ReactOS Chinese
translation team in the CODEOWNERS file.

Reviewed-by: He Yang <1160386205@qq.com>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2021-12-30 00:40:57 +03:00
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
Jérôme Gardou 515d83a883 [WIN32K] On init, start by initializing NtUser stuff
Allocate gpsi (Global Server Info) after initializing & grabbing Userlock
2021-08-03 23:13:19 +02:00
Katayama Hirofumi MZ 89cb8a38b3
[IMM32] Rewrite ImmEnumInputContext (#3859)
- Rewrite ImmEnumInputContext function.
- Modify NtUserBuildHimcList.
CORE-11700
2021-07-31 15:45:07 +09:00
Timo Kreuzer 204626f793 [WIN32K] Fix uninitialized variable 2021-07-27 14:44:14 +02:00
Katayama Hirofumi MZ ecb0c0963d
[IMM32] Imm(Lock|Unlock)ImeDpi and ImmSetOpenStatus (#3830)
- Add IMEDPI structure to ntuser.h.
- Implement ImmLockImeDpi/ImmUnlockImeDpi functions.
- Rewrite ImmSetOpenStatus function.
- Modify some NTUSER function prototypes.
- Modify imm32.spec.
CORE-11700
2021-07-25 11:57:57 +09:00
Timo Kreuzer 5d8e834897 [REACTOS] Fix a number of MSVC warnings 2021-07-23 22:03:48 +02:00
Timo Kreuzer 77e891b8ab [WIN32K] Check if a graphics device already exists before trying to add it
This avoids DPRINTs alleging a failure to open a device.
Also improve another DPRINT.
2021-07-15 08:32:46 +02:00
Katayama Hirofumi MZ 92393a7517
[IMM32] Add some candidate handlings (#3799)
- Implement ImmGetCandidateListA and ImmGetCandidateListW, by using newly added ImmGetCandidateListAW function.
- Implement ImmLockClientImc and ImmUnlockClientImc functions.
- Modify imm32.spec.
- Remove #ifdef's.
CORE-11700
2021-07-11 09:48:15 +09:00
Hervé Poussineau 0f6b9664cd [WIN32K] HACK: create a DC on all display devices and display wallpaper 2021-07-10 16:27:44 +02:00
Hervé Poussineau 6739fb1bc3 [WIN32K] Move detection of available display devices a new fonction EngpUpdateGraphicsDeviceList
- rewrite InitVideo() to call this new function
- also call it at the start of UserEnumDisplayDevices, to detect new potential devices
2021-07-10 16:27:44 +02:00
Jérôme Gardou 813d9cd2cc [WIN32K:NTUSER] Do not pass NULL keyboard layout to IntToUnicodeEx
There's an ASSERT on that
2021-06-29 11:49:20 +02:00
Katayama Hirofumi MZ 59d4c11203
[WIN32SS][NTUSER] ShowWindow.SW_MINIMIZE should show window (#3700)
- user32!ShowWindow.SW_MINIMIZE should show the window.
- Fix the return value of ShowWindow function on invalid parameter.
CORE-15669
2021-06-01 11:11:23 +09:00
Katayama Hirofumi MZ 32b0cf6fc6
[WIN32SS][NTUSER] Improve HSHELL_WINDOWCREATED condition (#3697)
Modify the condition of generating HSHELL_WINDOWCREATED, especially on WS_CHILD window style. CORE-15669
2021-05-31 13:08:06 +09:00
Timo Kreuzer d07203ecb7 [WIN32K][USER32] Change mechanism for storing dialog info pointer
DLGWINDOWEXTRA is 30 (both on win32 and win64). This has storage for the following entries: DWLP_MSGRESULT (0), DWLP_DLGPROC (8), DWLP_USER (16)
We used to store the dialog info pointer using SetWindowLongPtr (DWLP_ROS_DIALOGINFO == DWLP_USER+sizeof(ULONG_PTR) == 24), which was fine on win32, but failed on win64, since there wasn't enough space left (24 + 8 = 32 > 30).
Rewrite the way the DLGINFO pointer is stored, by adding an additional field to the WND structure and set it using NtUserxSetDialogPointer (which is what it is for).
Also fix too small cbWndExtra for the button class.
2021-05-28 08:26:36 +02:00
Jérôme Gardou 3adf450867 [REACTOS] Addendum to 5c7ce4475e - Fix MSVC 2015 build
Put data into PAGEDATA or INITDATA sections
Keep section declaration for prototypes

CORE-17540
2021-05-12 11:04:29 +02:00
Hermès Bélusca-Maïto f9aca9f7d2
[CONSRV] wcwidth.c: Fix out-of-range comparisons Clang warnings for wchar_t's, that are only 2 bytes long on NT. (#3619)
CORE-17545

win32ss/user/winsrv/consrv/frontends/wcwidth.c:203:30: warning: result of comparison of constant 262141 with expression of type 'wchar_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x30000 && ucs <= 0x3fffd)));
                         ~~~ ^  ~~~~~~~
win32ss/user/winsrv/consrv/frontends/wcwidth.c:203:12: warning: result of comparison of constant 196608 with expression of type 'wchar_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x30000 && ucs <= 0x3fffd)));
       ~~~ ^  ~~~~~~~
win32ss/user/winsrv/consrv/frontends/wcwidth.c:202:30: warning: result of comparison of constant 196605 with expression of type 'wchar_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x20000 && ucs <= 0x2fffd) ||
                         ~~~ ^  ~~~~~~~
win32ss/user/winsrv/consrv/frontends/wcwidth.c:202:12: warning: result of comparison of constant 131072 with expression of type 'wchar_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x20000 && ucs <= 0x2fffd) ||
       ~~~ ^  ~~~~~~~
2021-05-05 17:24:13 +02:00
Hermès Bélusca-Maïto 9a93d2fe3a
[CONSRV] Fix uninitialized variables warnings detected by Clang. (#3619)
CORE-17545

Fix 3 warnings:

win32ss/user/winsrv/consrv/alias.c:648:16: warning: variable 'Status' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (CurEntry)
               ^~~~~~~~
win32ss/user/winsrv/consrv/alias.c:693:12: note: uninitialized use occurs here
    return Status;
           ^~~~~~

win32ss/user/winsrv/consrv/alias.c:715:9: warning: variable 'Status' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (Header)
        ^~~~~~
win32ss/user/winsrv/consrv/alias.c:727:12: note: uninitialized use occurs here
    return Status;
           ^~~~~~

win32ss/user/winsrv/consrv/alias.c:771:16: warning: variable 'Status' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (RootHeader)
               ^~~~~~~~~~
win32ss/user/winsrv/consrv/alias.c:807:12: note: uninitialized use occurs here
    return Status;
2021-05-05 17:24:12 +02:00
Jérôme Gardou e470b58376 [REACTOS] Explicitly link against pseh & include pseh headers in a few places 2021-04-28 13:10:23 +02:00
George Bișoc ffea5152e6
[WIN32SS][NTUSER] Fix an integer underflow within scrollbar info setting
Thanks goes to I_Kill_Bugs for the patch (and partly to Kyle Katarn for the PR) and Hermes for tweaking the patch code. Had to make a commit myself as the PR author's account is deleted.

Signed-off by: I_Kill_Bugs (original patch author)
Signed-off by: Kyle Katarn <contact@kcsoftwares.com>
Signed-off by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2021-04-25 15:56:39 +02:00
Tibor Lajos Füzi ea04edce2d [TRANSLATION] Add/update Hungarian translation for solitaire, spider solitaire, rapps, usetup, cpl/timedate, shell32, user32 2021-04-14 16:16:24 +02:00
Chan Chilung 6a31fe6ca7
[TRANSLATION][INF] Update Chinese Traditional (zh-TW) translation (#3468)
- Add / improve Chinese Traditional Translations for INFs.

- Name changing (removed Aobi in my name)

Add Chinese Traditional translation for:
- cmdutils/at
- cmdutils/comp
- hotplug.cpl
- rosapps' sysutils/ctm

Chinese Traditional (zh-TW) translation update for:
- cmdutils/find
- cmdutils/help
- cmdutils/label
- cmdutils/whoami
- mspaint
- shutdown
- taskmgr
- diskpart
- format
- appwiz.cpl
- input.cpl
- powercfg.cpl
- shimgvw
- user32
2021-03-09 16:51:37 +01:00
George Bișoc b00ecdcab9
Replace my E-mail with the ReactOS org one (#3475)
From now on for ReactOS related contributions only the organization e-mail shall be used and also reverse the order of my real full name.
2021-02-22 18:26:55 +03:00
Serge Gautherie cb5d610a73
[CONSRV] SetConWndConsoleLeaderCID(): Check must be before dereferencing (#3451)
Addendum to f12e601.
2021-02-10 18:55:19 +01:00
Jérôme Gardou f12e6016b6 [CONSRV] Set 0 as a console leader PID/TID when unsetting it.
Instead of whatever is behind the NULL pointer.
2021-02-10 17:48:30 +01:00
Victor Perevertkin 46ca069e42
[XDK] Remove UNREFERENCE_LOCAL_VARIABLE macro
Change UNREFERENCED_PARAMETER to (VOID)P to support const parameters
2021-01-19 00:15:02 +03:00
Jérôme Gardou b96e88894a [CMAKE] Turn import libs into regular C static libs
Embed msvcrtex into libmsvcrt

Idea taken from Thomas Faber
2020-12-28 12:13:30 +01:00
Hermès Bélusca-Maïto 89f36bcfc8
[CONSRV] Less hardcoded magic values. 2020-12-27 00:52:01 +01:00
Dmitry Borisov bc90cbbb88
[WIN32K:NTUSER] Fix gradient caption bars with low color depth (#3338)
This fixes a problem when the window title bar is dithered down
to the 16- or 256-color palette. See also commit 0705f30.
2020-12-20 23:12:30 +03:00
Joachim Henze 449a341786 [WIN32SS] Trim EOL white-space
Addendum to 0.4.15-dev-1457-g 870aa1254f
2020-12-19 17:51:37 +01:00
Joachim Henze 870aa1254f [WIN32SS] Fix BSOD 0x1E nullptr deref via Git-bash CORE-16586
Thanks to the patches author Doug Lyons!
2020-12-19 17:47:33 +01:00
Jérôme Gardou 484e959c29 [USER32] Properly save EBX in the wndproc wrapper 2020-12-09 10:00:35 +01:00
Victor Perevertkin 5c7ce4475e
[REACTOS] Cleanup INIT and some PAGE section allocations
- Change INIT_FUNCTION and INIT_SECTION to CODE_SEG("INIT") and DATA_SEG("INIT") respectively
- Remove INIT_FUNCTION from function prototypes
- Remove alloc_text pragma calls as they are not needed anymore
2020-11-02 21:45:31 +03:00
Doug Lyons 8081ba9332
[WIN32SS] Repaint the whole window frame on some style bits set (#3199)
This fixes the ReactOS Calculator buttons disappearing in CORE-16827
2020-10-24 22:35:45 +03:00
Katayama Hirofumi MZ 58b0558f94
[NTUSER] Fix Shell Hook HSHELL_WINDOWCREATED (#3294)
Fix Shell Hook and reduce failures of shell32_apitest ShellHook testcase. Fix the condition of notifying shell hook HSHELL_WINDOWCREATED in ntuser/winpos.c. CORE-17330
2020-10-13 16:37:52 +09:00
Katayama Hirofumi MZ f341e60fbe [USER32] Mute 'Imm Api Table Init 2' spam
CORE-11700
2020-09-26 11:13:43 +09:00
Katayama Hirofumi MZ 33fe4333f4
[USER32] Load IMM table (#3215)
Implement the IMM function table in module user32.dll. CORE-11700
File immtable.h is located at win32ss/user/user32/include, that is a list of the DEFINE_IMM_ENTRY macro calls.
2020-09-23 21:42:54 +09:00
Serge Gautherie 889b077b23
[REACTOS] *.spec: Fix some function/parameter types (#3154) 2020-09-20 19:21:11 +02:00
Katayama Hirofumi MZ ab115e30fe
[IMM32][INCLUDE] Add immtable.h and modify imm32.spec (#3207)
- Add immtable.h header into win32ss/user/user32/misc/.
- Modify imm32.spec file.
CORE-11700
2020-09-19 22:47:40 +09:00
Serge Gautherie 345ad55319
[BROWSEUI][USER32] Explicitly use MAKEINTRESOURCEW() for consistency (#3192) 2020-09-15 14:56:51 +03:00
Serge Gautherie a04831677e
[PROGMAN][CRT][USER32] Do not use LoadLibraryEx() NT6+ flags (#3152)
CORE-12004
2020-09-13 23:42:09 +02:00
Kyle Katarn f07ace6aa2
[RAPPS][CONSRV] French translation update (#3160)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-13 23:12:52 +02:00
Katayama Hirofumi MZ 8396cf8696 [CONSRV] Improve Japanese (ja-JP) translation 2020-09-13 16:50:15 +09:00
chirsz cd2eaf1e51
[CONSRV] Improve zh-CN translation (#3157)
The new word is more in line with PRC people's usage habits, and it
is actually used in the Simplified Chinese translation of Windows.
2020-09-12 18:23:05 +02:00
Kyle Katarn 9f428f5522
[NTUSER] Demote ERR to TRACE, also some minor corrections (#3132) 2020-09-05 17:59:10 +03:00
Katayama Hirofumi MZ dce62240f1
[NTUSER] Improve SPI_SETWORKAREA setting (#3061)
CORE-12018, CORE-7237
2020-08-20 11:31:57 +09:00
Katayama Hirofumi MZ 81f28d454a
[NTUSER] Set ERROR_INVALID_WINDOW_HANDLE when PostMessage failed (#3059)
Set the last error code ERROR_INVALID_WINDOW_HANDLE when user32!PostMessage failed with destroyed window.
CORE-12124
2020-08-18 05:32:44 +09:00
Aobi Chan CL 860b45aca1
[USERINIT][WINLOGON][USER32][USERSRV] Update Traditional Chinese (Taiwan) translation (#3018) 2020-08-16 15:13:55 +03:00
Omer Itzic S a6946307fc
[USERSRV] Update Hebrew translation (#3010)
Co-authored-by: Baruch Rutman <peterooch@gmail.com>
2020-08-15 22:57:07 +03:00
Katayama Hirofumi MZ 4b038ec8b7
[IMM32][NTUSER] Add ImmGetImeInfoEx (#3035)
- Add the definition of imm32!ImmGetImeInfoEx function.
- Add IMEINFOEXCLASS and IS_IME_HKL into "ntuser.h".
- Modify NtUserGetImeInfoEx function prototype.
CORE-11700
2020-08-12 06:03:29 +09:00
Katayama Hirofumi MZ 047da7e632
[NTUSER] Add more QUERY_WINDOW_* values (#3034)
Add QUERY_WINDOW_* constant values for NtUserQueryWindow funciton. CORE-11700
2020-08-12 06:01:22 +09:00
Katayama Hirofumi MZ ec9d277d59
[IMM32][NTUSER] Implement ImmGetHotKey (#3025)
CORE-11700
- Implement imm32!ImmGetHotKey function.
- Modify NtUserGetImeHotKey function.
- Add LPHKL typedef into <imm.h> header.
2020-08-09 22:41:11 +09:00
Nguyen Trung Khanh ff50b0db2e
[NTUSER] Fix stack memory disclosure in NtUserBuildPropList (#3023)
Fix structure alignment cause to stack memory disclosure in NtUserBuildPropList.
2020-08-08 14:05:22 +09:00
Jose Carlos Jesus 62e52c7237
[USER32][NTUSER] Fix wrong return from LB_GETLISTBOXINFO (#2168)
And is now consistent with comctl32 and Wine too...
2020-07-04 15:11:10 +02:00
Nguyen Trung Khanh a279b1d2c6
[WIN32K:NTUSER] Zero allocated memory in IntCbAllocateMemory.
This avoids disclosing pool contents to user mode when not all members
of the respective structure are initialized or when there is padding.

In co_IntCallWindowProc, also zero the stack buffer since this can
be passed to user mode as well, and contains padding.
2020-06-24 09:15:27 +02:00
James Tabor f6d2b34ad0 [NtUser] Fix MSVC_x64 Build
Attempt to fix.
2020-06-18 11:55:13 -05:00
James Tabor 06e01c8968 [NtUser] Fix Crash in Win32k
Use strict thread and desktop verifying. See CORE-15092 and CORE-17133.
2020-06-18 11:06:31 -05:00
Serge Gautherie 95e5877027
[USER32] MDIClientWndProc_common(): Properly sync to old Wine (#2843)
No impact.

Missed part of
fb6304119a

Detected by Cppcheck: identicalInnerCondition.
Addendum to 303ece2421 (r72520).
2020-06-01 12:14:38 +03:00
Serge Gautherie 938df97b54
[WIN32K:NTUSER] NC_IconForWindow(): Remove redundant if() (#2842)
No impact.

Detected by Cppcheck: identicalInnerCondition.
Addendum to 98060c28c8 (r60622).
2020-05-26 20:25:39 +02:00
Julen Urizar Compains 546862babc
[TRANSLATION] Update Spanish, and add Basque translation (#2667)
Add/update translation for:
charmap_new, logoff, mspaint, notepad, usetup, welcome,
hotplug.cpl, sysdm.cpl, aclui.dll, comctl32.dll, comdlg32.dll,
hhctrl.ocx, kernel32.dll, msi.dll, oledlg.dll, shell32.dll,
tapiui.dll, themeui.dll, wininet.dll, winmm.dll, wldap32.dll,
winsrv.dll.
2020-05-17 18:46:36 +02:00
Katayama Hirofumi MZ 97ccef7761
[WIN32SS] Fix DrawTextExWorker extent for Spotify (#2759)
CORE-16747
2020-05-11 18:32:47 +09:00
Katayama Hirofumi MZ 413d722628
Revert "Revert "[COMCTL32][USER32] Fix radio button regression (#2146)" (#2753)" (#2758)
This reverts commit 66b0a48a75.
2020-05-09 15:32:15 +09:00
Katayama Hirofumi MZ 66b0a48a75
Revert "[COMCTL32][USER32] Fix radio button regression (#2146)" (#2753)
This reverts commit 2d4d3f5fce.

Reverts #2146. I think #2135 (e329e83) and #2146 (2d4d3f5) are my mistakes.
CORE-16552, CORE-16747
2020-05-09 11:30:11 +09:00
Jose Carlos Jesus ad591d0269 [USER32] Fixed issue with thumb scrolling on IDC_PICKICON_LIST 2020-04-30 18:58:20 +02:00
Jose Carlos Jesus d0a6727637 [USER32] Fixed scrolling by mouse wheel issue 2020-04-30 18:58:20 +02:00
Jose Carlos Jesus a4483d79da [USER32] Fixed scrolling issue in Change Icon dialog. CORE-16163 2020-04-30 18:58:20 +02:00
Mark Jansen dd8f30f879
[WIN32K] Allocate a buffer for a classname that is too long 2020-04-27 12:54:10 +02:00
Hermès Bélusca-Maïto 73064a7602
[WIN32SS] Fix formatting only. 2020-04-26 19:32:21 +02:00
Serge Gautherie c2dbc18660 [USER32] EDIT_WM_KillFocus(): Restore Wine code, #ifdef'ed out
Use '#ifdef __REACTOS__' for WINESYNC'ed code.

Partially reverts 71ab0b5d4c.
CORE-10266
2020-04-26 17:48:41 +02:00
Joachim Henze 87f6c82d85 [WIN32SS] CORE-16738 Comment an assert
It popped up 2-3 times for me during several
months of ros usage and I could continue without
noticing any side effects.
Giannis who once added it, was ok with commenting it.

His words:
This assertion isn't something fatal,
the worst thing that can happen from continuing on it would be
to make the thread get awake more times than it should.
2020-04-21 23:26:47 +02:00
James Tabor b9d6c5869d [Win32SS] Fix Send and Post Parameters for WM_DEVICECHANGE
For CORE-16492. See CORE-7447.

See 43197e6641
2020-04-19 18:40:59 -05:00
Victor Perevertkin 7e069ccdb2
[CMAKE] Replace custom functions to built-in ones
add_target_compile_definitions -> target_compile_definitions
add_target_compile_flags -> target_compile_options
add_target_include_directories -> target_include_directories
2020-04-16 15:59:38 +03:00
Hermès Bélusca-Maïto c05df38e86
[CONSRV] Move process-initialization-specific functions from handle.c into console.c .
- Move ConSrvInitHandlesTable() & rename it ConSrvInitProcessHandles()
  since its purpose is to initialize the standard input, output and
  error handles for a console process.

- Move ConSrvAllocateConsole(), ConSrvInheritConsole() and
  ConSrvRemoveConsole().
2020-04-14 01:19:48 +02:00
Hermès Bélusca-Maïto 2b64d45377
Fix build. 2020-04-13 18:13:42 +02:00
Hermès Bélusca-Maïto 83c238e490
[CONSRV] Convenience fixes.
- Simplify screen-buffers initialization.
- Get rid of this CONSOLE_SCREEN_BUFFER_VTBL virtual table.
- Move ConsoleInput to a proper header.
2020-04-13 16:22:53 +02:00
Hermès Bélusca-Maïto 9261110760
[CONSRV] Introduce a set of macros CON_API / CON_API_NOCONSOLE for wrapping around the repetitive prologue/epilogue of every console CSR API entrypoint.
All the per-API message structure unpacking and console validation done
with ConSrvGetConsole() is now automatically generated using the macros,
so that the actual implementation of each API can be done independently
of how the console object is obtained.

This could also allow reusing these API implementations with a different
mechanism for obtaining the console without changing anything in them.
2020-04-12 16:09:36 +02:00
James Tabor 7772f97241 [User32] Return Default Window Procedure for WM_DEVICECHANGE
See CORE-16492.
2020-04-11 17:58:38 -05:00
James Tabor 1e0bb66452 [User32] Implement Device Event Message handler
Need a way to send WM_DEVICECHANGE from the Service manager application.
Next step is to process it in the Client/Server Run-time Subsystem.
See CORE-16492.
2020-04-11 17:41:26 -05:00
Hermès Bélusca-Maïto 75d0346c54
[CONSRV] Finally fix CONSOLE vs. CONSRV_CONSOLE/WINSRV_CONSOLE stuff. CORE-9496
What remains to be cleared up are the ugly casts.
2020-04-11 16:27:09 +02:00
Hermès Bélusca-Maïto a3ea0a39f1
[WIN32SS] Get rid of "consrv_new".
Any new features/architectural changes to the console will either be
done in separate branches, or incrementally in master within the
existing console module.
2020-04-11 15:37:27 +02:00
Mas Ahmad Muhammad b8dd046ee4
[TRANSLATION] Add and update Indonesian translations (#2506)
- CMDUTILS: attrib, label (update translation)
- USETUP (add translation)
- HOTPLUG (add translation)
- CONSRV  (update translation)
- USERSRV (update translation)
- USER32  (update translation)
- ACLUI  (update translation)
- LICCPA  (update translation)
- SUBST  (update translation)
- REGSVR32  (update translation)
- REGEDIT-CLB  (update translation)
- ACPPAGE  (update translation)
- TIMEDATE  (update translation)
- SOLITAIRE  (update translation)
- FDEBUG  (update translation)
- SYSSETUP (update translation)
2020-04-09 18:49:45 +02:00
Julen Urizar Compains f7cab5a1d4
[TRANSLATION] Multiple minor fixes and addings. (#2516)
- Applications: eventvwr, fltmgr, servman.
- rosapps: arping, CTM, fontsub, fraginator, imagesoft, systeminfo, vcdcontroltool, vgafontedit.
- CPLs: desk.cpl.
- ReactOS Setup GUI app.
- Screensavers: butterflies, maze, Starfield.
- System: NTVDM, printing/monitors/localmon; the freeze dialog in user32, the error strings in usersrv.
2020-04-09 18:13:46 +02:00
James Tabor ee3ee2a65f [User32] Fix Dialog Hang
Patch by JIRA contributor I_Kill_Bugs. See CORE-5078.

Also: https://bugs.winehq.org/show_bug.cgi?id=48749
2020-04-08 14:49:38 -05:00
James Tabor acf135d16d [Win32SS] Fix Mask for Draw Frame States
Fixes drawing of caption bar buttons.

See CORE-8808.
2020-04-05 21:11:44 -05:00
James Tabor 568b6d0558 [NTUser] Fix Strings and Format to Hooks
Allocate heap instead of data segment to be used for callbacks on user side.
Move and correct initial hook call out setup. Use it in more than one hook call.

This fixes issues with strings out of alignment and use of kernel pointers.

See CORE-13907 and CORE-16769. KsStudio still needs retested.

Small wow update.
2020-04-03 03:58:29 -05:00
jimtabor 915a5764a9 [Win32SS] Form Sanity to Hook Callbacks
Fix WH_CALLWNDPROC/RET data to user hook calls. See CORE-13019 and CORE-13907.
2020-03-28 14:18:14 -05:00
jimtabor d8add40e89 [User32] Fix null return.
See CORE-16769.
2020-03-28 14:03:15 -05:00
Timo Kreuzer 4860aa645c [WINSRV] Use DIB section for frame buffer bitmap 2020-03-22 12:05:05 +01:00
Katayama Hirofumi MZ 8c5308b5e8
[USER32] Relax conditions for creating MDI windows (#2454)
The creation conditions of MDI window was too strict. CORE-15633
2020-03-20 07:38:33 +09:00
Joachim Henze 8bb9434d3e [WIN32SS] Fix regression CORE-16721
"Scrolling by pressing the scrollbar arrows does not draw the arrows as pressed"
Fixed by a patch of JIRA-user 'I_kill_bugs'. Thank you very much!

The regression was introduced by 0.4.11-dev-586-g
929a2c6637
(which itself aimed to fix CORE-13986,
but not CORE-13918 as erroneously stated in commit comment)

I intend to port this back into 0.4.13-RC later.
2020-03-12 22:55:04 +01:00
Hermès Bélusca-Maïto b596a2cc31
[USER32] Fix crash in Edit control. CORE-16727
The #ifdef prevents setting the variable, es, to NULL, which lead to an illegal access.
This didn't match dll/comctl32/edit.c .

Patch by 'I_Kill_Bugs' contributor.
2020-03-06 20:02:03 +01:00
JoachimHenze 848d7ec633
[NTUSER] Fix ShellHook notifications when creating/activating windows (#2396) 2020-03-05 15:39:23 +01:00
Joachim Henze 00adb1a3f9 [WIN32SS] Improve Drawing Scrollbars
A very nice patch of JIRA user "I_kill_Bugs". Many many Thanks!

It addresses:
- CORE-14755 fixed, flashing scrollbar triangles (we know 131 affected apps just from rapps!)
- CORE-13931 fixed, FamiTracker invisible about-dlg
- CORE-14685 improves a bit, but is not entirely fixed
- CORE-11561 improves a bit, but is not entirely fixed
- The patch avoids unnecessary redraws, speeds up GUI interaction and NSIS install times

Jim Tabor had no complains about it, I just did some white-space-tweaks on EOL and indentation.

FTR A testbot run (not on master but on 0.4.13-RC-48-g818e5bc)
https://reactos.org/testman/compare.php?ids=71645,71666 VBox LGTM
https://reactos.org/testman/compare.php?ids=71646,71667 KVM LGTM

I felt tempted to port back, but decided to play safe and commit to master just.
2020-03-04 02:12:06 +01:00
Hermès Bélusca-Maïto e8df1a38bd
[CONSRV] Fix a corruption of the CONSRV memory when converting read input events back to ANSI.
This fixes a 6-year old copy-paste bug introduced by commit b47d51c6 (r64004).
2020-03-02 01:08:41 +01:00
Hermès Bélusca-Maïto 7babd93107
[CONSRV] Some code simplification and tidy up. 2020-03-02 01:08:41 +01:00
Hermès Bélusca-Maïto 31c13e89fe
[CONSRV] Use NtClearEvent() and NtClose() instead of the Win32 functions. 2020-03-02 01:08:40 +01:00
Hermès Bélusca-Maïto e624be1eb2
[CONSRV] Tidy up lineinput.c by moving the History* helper prototypes to a suitable header file. 2020-03-02 01:08:39 +01:00
Hermès Bélusca-Maïto 19596768cb
[CONSRV] Support history resizing from console settings and from SetConsoleHistoryInfo() server implementation.
In addition, honour the maximum number of history buffers allowed when
creating new ones.

Some implementation information has been obtained from
https://github.com/microsoft/terminal
(under MIT License).
2020-03-02 01:08:35 +01:00
Hermès Bélusca-Maïto 1d3fb3e370
[CONSRV] Fix setting the default screenbuffer and console view sizes when creating a new screenbuffer.
For more information, see:
https://docs.microsoft.com/en-us/windows/console/createconsolescreenbuffer#remarks
2020-02-23 22:43:02 +01:00
Joachim Henze 820dbfccd0 [NTUSER] Fix regression CORE-11828
Fixes symptom "mouse pointer vanishes when closing
applications via x in title-bar"

The bug in WIN32SS was unhidden by SVN r65496 == git
5c1a8109c8
, when we introduced explorer_new. The old explorer
had a workaround built within.

Many thanks to patches author James Tabor.
I intend to backport into 0.4.13RC as well.
2020-02-23 13:56:05 +01:00
Hermès Bélusca-Maïto 90d795b0bf
[CONSRV] Keep a count of input events in the console queue + code simplifications.
- Update the documentation of members of CONSOLE_INPUT_BUFFER.
- Simplify ConDrvGetConsoleNumberOfInputEvents().
- Simplify ConDrvFlushConsoleInputBuffer().
- Use also GetConsoleInputBufferMode() more often.
2020-02-22 23:27:42 +01:00
Hermès Bélusca-Maïto 570eba2a52
[KERNEL32][CONSRV] Use more often the internal ConioRectHeight/Width() and ConioIsRectEmpty() macros. 2020-02-22 21:15:58 +01:00
Hermès Bélusca-Maïto 05053b6f18
[CONSRV] ConDrvScrollConsoleScreenBuffer() fixes. (#2278)
- Reimplement ConDrvScrollConsoleScreenBuffer() with separate copy and
  fill helper functions and calculate rectangles in such a way as to
  never use X-Y coordinates pointing outside of the screen buffer.

- Add X-Y coordinates assertions in ConioCoordToPointer().
2020-02-22 19:50:18 +01:00
Hermès Bélusca-Maïto d46e054368
[CONSRV] Miscellaneous console fixes for CJK support and screenbuffer iteration. (#2278)
+ popup.c!DrawBox(): Factor out setting the attribute value.
2020-02-22 19:50:17 +01:00
Joachim Henze feb7df42b4 [WIN32SS] Fix a typo in dbg print 2020-02-22 19:40:52 +01:00
Katayama Hirofumi MZ 9199c90328
[WIN32SS][NTUSER] Fix ScrollWindowEx SW_SCROLLCHILDREN (#2327)
Based on the patch of I_Kill_Bugs of JIRA user. CORE-16687, CORE-12114
2020-02-11 20:59:14 +09:00
Hermès Bélusca-Maïto 53061a4b69
[CONSRV] Additions for the GUI frontend.
- Fix the text-copy code to handle fullwidth characters.
- Move the caret painting code to its own function.
2020-02-09 00:39:16 +01:00
Hermès Bélusca-Maïto 0d500b642b
[CONSRV] Simplify parts of code in the line-input module. 2020-02-09 00:38:32 +01:00
Hermès Bélusca-Maïto fe3d655bc0
[CONSRV] Disable the old code for scrolling via keyboard shortcuts as it is buggy. To be fixed later... 2020-02-09 00:38:31 +01:00
Hermès Bélusca-Maïto 421150d5c3
[CONSRV] Minor code cleanup. 2020-02-09 00:37:44 +01:00
Hermès Bélusca-Maïto d9cbe7dc64
[CONSRV] Fix the definitions of the Console[Input|Output]UnicodeToAnsiChar() and Console[Input|Output]AnsiToUnicodeChar() macros. 2020-02-09 00:37:44 +01:00
Hermès Bélusca-Maïto 07f8b9fe09
[CONSRV] Rephrase/complete some comments. 2020-02-09 00:37:43 +01:00
Aaron Dewes e5813c4644
Update german translation (#2291)
* Update German translations

* Update translation again

* More translations

* Some fixes in the german translation

* Some more fixes

* Little translation tweak

* Updates to 2nd review

* Little update

* Add back keyboard accel for IDS_OPENFILELOCATION.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-02-08 12:55:53 +01:00
Hermès Bélusca-Maïto b97977db9c
[USER32] Update the translations of IDS_ASK_TERMINATE. 2020-02-07 19:07:22 +01:00
Assis Duarte 567b2d79fc
[USER32] Update Brazilian-Portuguese translation (#2283) 2020-02-07 18:59:32 +01:00
Mark Jansen bbc97e964f
[WIN32SS] Demote a trace message 2020-01-29 22:58:43 +01:00
Hervé Poussineau 99f979d6e9 [WIN32SS] Replace inline by FORCEINLINE, as in other files of the module 2020-01-22 20:57:42 +01:00
Katayama Hirofumi MZ 8dc90a4c7e [WIN32SS][USERSRV] Add CSR API_NUMBER comments 2020-01-20 08:06:40 +09:00
Katayama Hirofumi MZ b41299470b
[WIN32SS][WINSRV] Fullwidth character handling Part 2 (#2240)
Follow-up of #2231. Also fix FillConsoleOutputAttribute, WriteConsoleOutputCharacterW and WriteConsoleOutputAttribute functions.
CORE-12451
2020-01-12 22:04:57 +09:00
Katayama Hirofumi MZ fa42794a3a
[WIN32SS][WINSRV] Fullwidth character handling for Asian console (#2231)
Far-East Asian language (Chinese, Japanese and Korean; CJK) needs special handling in console.
Especially a fullwidth character (mk_wcwidth_cjk(ch) == 2) needs a double width space. A fullwidth character on the console window is treated as a pair of a leading byte and a trailing byte (COMMON_LVB_LEADING_BYTE and COMMON_LVB_TRAILING_BYTE). CORE-12451
2020-01-07 15:26:58 +09:00
Katayama Hirofumi MZ f84963b0d5
[WIN32SS][WINSRV] Add CSR API_NUMBER info comments (#2192)
Add comments to improve human-readability and referencing of CSR API. CORE-12451
2019-12-31 09:21:42 +09:00
Thomas Faber ef103d7d69
[WIN32K:NTUSER] Avoid user memory access outside of SEH in NtUserEnumDisplaySettings. 2019-12-29 20:08:51 +01:00
Thomas Faber 3d81dc48a7
[WIN32K:NTUSER] Correctly capture UNICODE_STRING in NtUserEnumDisplaySettings. 2019-12-29 20:08:44 +01:00
Thomas Faber be92be2e37
[WIN32K:NTUSER] Add missing probe in NtUserGetClassName. 2019-12-29 20:08:30 +01:00
Hermès Bélusca-Maïto a8e7defb01
[WIN32SS:USER] Some minimal work and fixes concerning message queues timeouts.
CORE-15147

- Rename CLIENTTHREADINFO::tickLastMsgChecked into timeLastRead as
  documented in https://reactos.org/wiki/Techwiki:Win32k/CLIENTTHREADINFO .
  This is the last time the message queue was read.

- This is the structure member one must compare against the current tick
  count timestamp in order to heuristically determine whether a message
  queue thread is hung!! Fix MsqIsHung() in accordance, add extra debug
  logging in order to help us determining which of our code present
  regular GUI hangs, and add as well an extra "TimeOut" parameter so as
  not to hardcode a fixed value within that function but instead
  allowing its caller to specify possible different values.

- THREADINFO::timeLast is on the contrary the last message time stamp,
  and will definitively differ from CLIENTTHREADINFO::timeLastRead .
  It should only be used for information purposes!

- Accordingly, in NtUserGetThreadState()::THREADSTATE_UPTIMELASTREAD
  and in InitThreadCallback(), only (re-)initialize the timeLastRead
  member of the CLIENTTHREADINFO structure of the THREADINFO of interest.

- In co_IntPeekMessage(), update more often the timeLastRead timestamp
  whenever the current message queue has been read (but NOT timeLast!!
  That one will be updated ONLY WHEN a message is found!).

- In co_IntSendMessageTimeoutSingle() first check whether the window to
  which we send the message is being destroyed, before checking for
  queue hangs etc. Collapse the logic checks for queue hang and increase
  the hang timeout check to 4 times MSQ_HUNG (== 4 * 5 seconds) and
  display a debug trace.
2019-12-29 16:14:15 +01:00
Thomas Faber 975e117780
[WIN32K:NTUSER] Add missing parameter probe in NtUserGetClassInfo. 2019-12-29 15:22:03 +01:00
Katayama Hirofumi MZ 22f883278b
[NTUSER] Fix caret display mistake (#2180)
Take care of caret visibility. co_IntSetCaretPos function wrongly drawn the caret upon invisible caret. @Doug-Lyons did test this patch. CORE-15661
2019-12-26 19:08:01 +09:00
Katayama Hirofumi MZ dfa3065e19
[CONSRV] Preparation for Asian console support (#2171)
Make preparation for console support of Chinese, Japanese and Korean (CJK) codepages. CORE-12451
- Add consrv/frontends/wcwidth.c.
- Add GuiPaintTextModeBufferCJK function.
2019-12-25 23:35:01 +09:00
Katayama Hirofumi MZ 9ce12f0b4c
[BOOTDATA][NTUSER] Fix some system parameters (#2162)
CORE-16547
- Add IconTitleWrap registry value.
- Modify gspv.dwMenuShowDelay initial value.
- Initialize gspv.bFastTaskSwitch as TRUE.
2019-12-25 18:12:43 +09:00
Hermès Bélusca-Maïto 18a51dc7f5
[VIDEOPRT][WIN32K] Use a Windows-compatible way of communicating the 'BaseVideo' state from VIDEOPRT to WIN32K.
This is done by creating the volatile key
\Registry\Machine\System\CurrentControlSet\Control\GraphicsDrivers\BaseVideo .

Also cache during first initialization of VIDEOPRT the state of the boot
options BASEVIDEO and NOVESA, so that they can be readily retrieved later
(for example, in VideoPortIsNoVesa()).
2019-12-24 13:51:20 +01:00
Katayama Hirofumi MZ eba2d5d30a
[BOOTDATA][NTUSER] Fix GetSystemMetrics values (#2137)
Fix user32!GetSystemMetrics values. CORE-16547
SM_MENUDROPALIGNMENT and SM_CXSMSIZE
2019-12-21 22:38:49 +09:00
Katayama Hirofumi MZ 2af9e7dfac
[USER32] Add ICO_ExtractIconExW RetPtr NULL check (#2149)
CORE-16557
2019-12-16 20:37:23 +09:00
Hermès Bélusca-Maïto bfd8a84865
[BLUE] Improve initialization and interfacing with INBV.
CORE-15901

This fixes display reset transition when an external module acquired
INBV ownership and then released it, similarly to what was done in
commit 0ad65796 for VIDEOPRT.

For this a backup screenbuffer is used to store the contents of the
screen just before an INBV screen acquire transition, and these contents
are restored when it is detected that INBV ownership has been released.
Also, the active text font associated with the active console code-page
is restored, as well as the cursor state and shape.

In addition, any user of BLUE.SYS is now required to explicitly issue
a new IOCTL_CONSOLE_RESET_SCREEN to either enable or disable the screen.
This allows avoiding nasty unwanted screen mode switches when a handle
to the \Device\BlueScreen device is opened but no screen mode switch was
actually wanted - This "fixes" this annoyance on ReactOS and Windows,
when these are running witha VGA-compatible video driver and one wants
to look at properties of the \Device\BlueScreen device using
Sysinternals' WinObj.

Following this, we don't need to check anymore for explicit INBV
ownership by issuing calls to InbvCheckDisplayOwnership(), but instead
we check whether the screen has beeen manually enabled using the
aforementioned IOCTL. This partly supersedes commit 8b553a4b, and allows
fixing the second bug, namely that if we start ReactOS without the
/NOGUIBOOT option (and thus, INBV is active during boot), USETUP would
not show up anything because BLUE.SYS wouldn't display anything on screen.
See CORE-15901.

[USETUP][CONSRV] Call IOCTL_CONSOLE_RESET_SCREEN to tell BlueScreen device to enable the screen.
2019-12-15 03:37:52 +01:00
Doug Lyons c917c442ad [CONSRV] Fix for console windows shrinking on Minimize and Restore (#2014)
CORE-14200
2019-12-14 16:51:49 +01:00
Katayama Hirofumi MZ 2d4d3f5fce
[COMCTL32][USER32] Fix radio button regression (#2146)
PR #2135 (e329e83) caused radiobutton regression. This PR will fix it.
- Clear DT_BOTTOM | DT_VCENTER flags upon calculating the button text height.
CORE-16552
2019-12-10 11:07:56 +09:00
jimtabor d447b41198 Merge branch 'master' of https://github.com/reactos/reactos 2019-12-09 11:19:18 -06:00
jimtabor 5214a38fd0 [Win32SS] Fix Opaque Text Fade while in Desktop Startup
See CORE-16498.
2019-12-09 11:18:32 -06:00
Katayama Hirofumi MZ e329e83857
[WIN32SS][COMCTL32] Improve button text position (#2135)
Improve DrawText function especially DT_CALCRECT and DT_VCENTER. CORE-15478
2019-12-09 21:16:28 +09:00
Katayama Hirofumi MZ 1793dcc864
[NTUSER] Improve loading settings (SystemParamtersInfo) (#2139)
Fix SPI_GETSCREENSAVETIMEOUT, SPI_GETKEYBOARDSPEED and SPI_GETKEYBOARDDELAY values. CORE-16547
2019-12-09 10:50:04 +09:00
Joachim Henze bd149e8a11 [CONSRV] Speed up console txt output CORE-16187
By demoting good-path DPRINT1 to DPRINT.
HBelusca agreed.

The more important commit to solve CORE-16187 has
been done beforehand in 0.4.14-dev-553-g
1dcdb4c2d0
2019-12-07 18:35:06 +01:00
Katayama Hirofumi MZ 007f32a223
[WIN32SS][WINSRV] Do CJK font choose workaround (#2134)
Don't choose Asian charset font if there is no preferred font for CJK. CORE-12451
2019-12-06 22:18:51 +09:00
Katayama Hirofumi MZ 1dcdb4c2d0
[WIN32SS][WINSRV] Optimize console background drawing (#2132)
Console needs speed. This PR will optimize drawing of console.
- Set NULL to the background brush.
- Skip WM_ERASEBKGND.
2019-12-05 20:19:00 +09:00
Hermès Bélusca-Maïto 0ad65796bb
[WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV.
CORE-12149

VIDEOPRT:
=========

Improve interfacing with INBV, so as to detect when an external module
acquired INBV display ownership, and whether ownership is being released
later on. (This does NOT rely on hooking!)

For this purpose we improve the IntVideoPortResetDisplayParameters(Ex)
callback that gets registered with an InbvNotifyDisplayOwnershipLost()
call during initialization, and we add a monitoring thread.

The callback is called whenever an external module calls
InbvAcquireDisplayOwnership(), for example the bugcheck code or the KDBG
debugger in SCREEN mode. When this happens, a flag that tells the
monitoring thread to start monitoring INBV is set (ReactOS-specific),
and the display adapters get reset with HwResetHw() (as done on Windows).

Due to the fact that this INBV callback can be called at *ANY* IRQL, we
cannot use dispatcher synchronization mechanisms such as events to tell
the INBV monitoring thread to start its operations, so we need to rely
instead on a flag to be set. And, since INBV doesn't provide with any
proper callback/notification system either, we need to actively monitor
its state by pooling. To reduce the load on the system the monitoring
thread performs 1-second waits between each check for the flag set by
the INBV callback, and during checking the INBV ownership status.

When the INBV ownership is detected to be released by an external module,
the INBV callback is re-registered (this is *MANDATORY* since the
external module has called InbvNotifyDisplayOwnershipLost() with a
different callback parameter!), and then we callout to Win32k for
re-enabling the display.

This has the virtue of correctly resetting the display once the KDBG
debugger in SCREEN mode is being exited, and fixes CORE-12149 .

The following additional fixes were needed:

VIDEOPRT & WIN32K:
==================

Remove the registration with INBV that was previously done in a ReactOS-
specific hacked IRP_MJ_WRITE call; it is now done correctly during the
video device opening done by EngpRegisterGraphicsDevice() in the VIDEOPRT's
IRP_MJ_CREATE handler, as done on Windows.

WIN32K:
=======

- Stub the VideoPortCallout() support, for VIDEOPRT -> WIN32 callbacks.
  This function gets registered with VIDEOPRT through an
  IOCTL_VIDEO_INIT_WIN32K_CALLBACKS call in EngpRegisterGraphicsDevice().

- Only partially implement the 'VideoFindAdapterCallout' case, that just
  re-enables the primary display by refreshing it (using the new function
  UserRefreshDisplay()).

VIDEOPRT:
=========

- PVIDEO_WIN32K_CALLOUT is an NTAPI (stdcall) callback.

- In the IntVideoPortResetDisplayParameters(Ex) callback, reset all the
  "resettable" adapters registered in the HwResetAdaptersList list.
  We thus get rid of the global ResetDisplayParametersDeviceExtension.

- Make the IntVideoPortResetDisplayParameters(Ex) callback slightly more
  robust (using SEH) against potential HwResetListEntry list corruption
  or invalid DriverExtension->InitializationData.HwResetHw() that would
  otherwise trigger a BSOD, and this would be disastrous since that
  callback is precisely called when INBV is acquired, typically when the
  BSOD code initializes the display for displaying its information...

Extras:
- Validate the IrpStack->MajorFunction in IntVideoPortDispatchDeviceControl()
  and implement IRP_MJ_SHUTDOWN handling. Stub out the other IOCTLs that
  are handled by VIDEOPRT only (and not by the miniports).

- VIDEOPRT doesn't require IRP_MJ_INTERNAL_DEVICE_CONTROL (unused).

- Implement IOCTL_VIDEO_PREPARE_FOR_EARECOVERY that just resets the
  display to standard VGA 80x25 text mode.
2019-12-02 02:33:20 +01:00
Hermès Bélusca-Maïto 0ad90f83d3
[WIN32K] Code formatting. 2019-11-25 00:41:49 +01:00
Katayama Hirofumi MZ 141cf04239
[NTUSER] Fix condition of HSHELL_WINDOWCREATED (#2046)
CORE-15655
If the owner window doesn't exist or is invisible or has WS_EX_TOOLWINDOW style, HSHELL_WINDOWCREATED regards the window a non-owned window. You can watch the shell hook information by using CORE-15655 ShellHookChecker.zip.
2019-11-19 17:54:23 +09:00
Katayama Hirofumi MZ fa264251a7 [USER32] Check whether the window is minimized upon SM_REPOSITION CORE-16490 2019-11-19 10:32:06 +09:00
Katayma Hirofumi MZ f981a68ee0 [USER32] Improve DM_REPOSITION CORE-16490 2019-11-16 12:52:40 +09:00
Katayma Hirofumi MZ 657887adf4 [USER32] Fix DM_REPOSITION (rc.bottom minus 4) 2019-11-16 11:21:16 +09:00
Katayama Hirofumi MZ 8249d2a3fa
[USER32] Implement DM_REPOSITION message (#2020)
DM_REPOSITION is dialog message that can reposition the dialog to the workarea when the dialog is partially/entirely in outside of the workarea. CORE-16490
2019-11-16 09:51:16 +09:00
Katayama Hirofumi MZ 462b1b7444
[NTUSER] Support MK_SHIFT/MK_CONTROL of mouse messages (#2038)
Upon mouse message generation, The states of Shift key and/or Ctrl key must be used. If Shift key is pressed, it enables MK_SHIFT flag of the mouse message. If Ctrl key is pressed, it enables MK_CONTROL flag of the mouse message. CORE-16279
2019-11-16 09:49:49 +09:00
Joachim Henze 19fbdda95c [WIN32SS] Prevent disabled scrollbars being clickable CORE-15557
Thanks to JIRA user 'I_Kill_Bugs.

VBox: https://reactos.org/testman/compare.php?ids=69671,69747
KVM: https://reactos.org/testman/compare.php?ids=69672,69748
2019-11-09 15:50:50 +01:00
James Tabor 34b4b96461 [User32] Properly handle WM_CTLCOLOR* messages.
Patch by Fabian Maurer : Properly handle WM_CTLCOLOR* messages.

See CORE-15560 and
fbec0ba9ee
.

Added support for module versions.
2019-11-06 21:43:00 -06:00
Hermès Bélusca-Maïto 3b2f158593
[NTOS][CLASS2][FFS][WIN32SS] Fix some pool tags so that they correctly appear in pool dump lists.
Reminder: in the code they are defined using reverse byte order
(Windows/ReactOS are little-endian OSes).
2019-11-01 19:12:27 +01:00
Katayama Hirofumi MZ b3033b81a4
[WIN32SS][NTUSER][USER32] Fix menu checkmarks (#2009)
CORE-16470
The checkmarks of menu were black boxes. This PR will fix drawing.
- Don't change background mode.
2019-11-01 09:52:18 +09:00
Joachim Henze 9e14a762d5 [WIN32SS] Fix last user visible parts of regression CORE-10855
When Themesvc was disabled, some Window titlebar
frames were drawn too thin until the window
was actively resized in y by the user.

That and similar symptoms started to show up after SVN r68904 ==
6dfa71c487

Many thanks to patches author Doug Lyons.

We leave the ticket unresolved still due to explicit request of
James Tabor, who wants to continue working in that context.

I will merge that back into 0.4.13RCs as well.
2019-10-25 00:42:01 +02:00
Mark Jansen e1984d03b4
[WIN32K:menu] Use signed types for negative values...
CORE-16306
2019-10-12 16:19:58 +02:00
Joachim Henze 96ef605f4b [WIN32SS] Fix regression CORE-16393
Symptom "cmd did not hide the taskbar anymore when switching to fullscreen"

It regressed by SVN r75407 == git
09ab5ea7ed

VBox LGTM https://reactos.org/testman/compare.php?ids=69295,69297
 KVM LGTM https://reactos.org/testman/compare.php?ids=69296,69298

Many thanks to the patches author James Tabor.
2019-10-11 23:21:39 +02:00
James Tabor 1f78e8ec47 [Win32SS] Support Module Versioning.
Set the appropriate flags supporting versions of software modules.
Fix arguments for getting desktop DC.
2019-09-24 17:40:18 -05:00
James Tabor c57d4d7b9e [User32|Tests] Sync Port Wine Combo Controls.
Need to cross check these changes with WINE ComCtl32 before you PANIC
HACK!!!!

Not in order:
Piotr Caban : Remove unneeded RECT parameter from CBPaintText helper.
              Don't invalidate ComboBox on CB_SETCURSEL message.
Don't invalidate ComboBox on LBN_SELCHANGE and
LBN_SELCANCEL.
              Add more CB_SETCURSEL tests on ComboBox.
              Redraw combo text field even if it's empty.
Let ComboBox edit control handle the redraw even if
CBF_NOREDRAW is set.
Don't do the painting if combobox is not visible in
CBPaintText.

Dmitry Timoshkov : Don't force a combobox repaint on WM_SIZE.

This breaks z-order based painting and causes side effects
for
applications that during the WM_PAINT processing reference
internal
             data associated with a not fully initialized window.
Ref :
2d9e3236ea

Fabian Maurer : Set listbox popup height correctly and add tests.

                Properly set dropdown height.

             Now that user32 and comctl32 combo are separated,
             this won't lead to a regression anymore
             Ref :
3d0be0bad8
             Info by Sebastian Lackner Ref:
f0fc034997

Nikolay Sivov : Remove some misleading TODOs and confusing comments.
2019-09-21 08:47:56 -05:00
Katayama Hirofumi MZ 81e27f0be7
[WIN32SS][NTUSER] Fix hit test position of popup menu
The submenu of desktop popup menu was erroneously shown at first right click.
- Fix the hit test position that was modified by window style change.
CORE-16382
2019-09-21 18:21:17 +09:00
Stanislav Motylkov b16ca9cd65 [WIN32SS][NTUSER] Fix debug print in winpos.c (#1893) 2019-09-12 15:53:29 +02:00
Jose Carlos Jesus d5dca45e51 [WIN32SS][USER][EXPLORER] Add/Update portuguese translation (#1882) 2019-08-26 21:01:41 +02:00
Joachim Henze 4193b8d8ac [WIN32SS] WindowSnap must not affect the taskbar
This fixes regression CORE-16289 where we could not longer
move the taskbar at a different than default location,
as WindowSnap would interfere.

Many Thanks to the patches author Doug Lyons.

Eventually the heuristic that we use here to identify the
taskbar via used window-styles could be improved later.
Theoretically possible that it bails out on some other windows.

The regression was introduced by 0.4.12-dev-373-g
7e396787ed
2019-08-20 12:07:56 +02:00
Timo Kreuzer 21c9f2a488 [WIN32K] InitVideo() should return NTSTATUS, so return STATUS_SUCCESS instead of 1 2019-08-15 18:04:57 +02:00
Katayama Hirofumi MZ b863ecc33f
[WIN32SS][NTUSER] Fix menu drawing after style change (#1821)
There were menu drawing regression after 03adec8141.
This PR will fix it. CORE-16244

- We don't have to draw the frame manually because of WS_EX_DLGMODALFRAME extended style.
- We don't need the margins (MENU_TOP_MARGIN and MENU_BOTTOM_MARGIN) in the client area any more because the client area doesn't contain the frame width.
- Use GetSystemMetrics(SM_CXDLGFRAME) and GetSystemMetrics(SM_CYDLGFRAME) for frame width.
2019-08-11 07:46:14 +09:00
Katayama Hirofumi MZ 03adec8141 [WIN32SS][NTUSER] Fix popup menu freezing 2019-08-10 15:40:32 +09:00
Katayama Hirofumi MZ 0749a868fc
[WIN32SS][NTUSER] Fix popup menu window styles (#1814)
Fix the class style, the window style and the extended style of the popup menu window. CORE-16244
2019-08-10 08:33:25 +09:00
Mark Jansen 6948764b21
[WIN32SS] Ensure the last menu item is not accidentally selected when a system menu is off-screen
CORE-16297
2019-08-08 19:51:28 +02:00
Mark Jansen 84e263ceb2
[WIN32SS] Do not propagate TPM_VERTICAL to sub-menus
With this change we can remove the workaround from the off-screen
menus dropping below their parent.
Many thanks to Joachim for his help debugging / testing this.

CORE-16297
2019-08-08 19:51:28 +02:00
Mark Jansen 1c8cdaa470
[WIN32SS] Fix tray popup menus stuck to the bottom of the screen
Dedicated to Joachim
CORE-16297
2019-08-08 19:51:28 +02:00
Mark Jansen 33f77af348
[WIN32SS] Fix off-screen menu's dropping below their parent 2019-08-08 19:51:28 +02:00
Mark Jansen 3cbdcc6363
[WIN32SS] For application menu's, only exclude the menu item,
not the entire window.
Because the application menu is part of the application window,
this would lead to bad results.
2019-08-08 19:51:15 +02:00
Katayama Hirofumi MZ 65e4efd475
[WIN32SS][NTUSER] Fix MENU_DrawScrollArrows (#1753)
Fix drawing the menu scrolling arrows. CORE-13211
2019-08-08 13:56:23 +09:00
Mark Jansen b5c6af459c
[WIN32SS] Exclude the entire menu from overlapping, not just the menu item
CORE-15863
2019-08-06 21:17:47 +02:00
Mark Jansen 7c45a646e9
[WIN32SS] Iteratively mutate menu flags until we find a 'best fit'
CORE-15863
2019-08-06 21:17:47 +02:00
Mark Jansen a59df3858c
[WIN32SS] Rewrite MENU_ShowPopup to take the exclude rectangle into account
CORE-15863
2019-08-06 21:17:35 +02:00
Katayama Hirofumi MZ 4414f45cc0
[WIN32SS][NTUSER] Fix default menu item font weight (#1804)
CORE-16294
We had added "Arial Black" font, so a request for heavy weight font will be realized as it is. This PR will fix font weight (FW_*) calculation of default menu items.
2019-08-05 23:16:01 +09:00
Katayama Hirofumi MZ 6642dbc470
[WIN32SS][NTGDI][NTUSER] Make gusLanguageID USHORT (#1776)
Every language ID is an unsigned integer.

- Make gusLanguageID unsigned.
- Make the return value type of UserGetLanguageID unsigned.
2019-07-31 22:24:01 +09:00
Hermès Bélusca-Maïto 8831328081 [USER32] Fix build after 51d031cc ; addendum to f21871fb (r69249) and cf98f01e (r72650). CORE-10194 2019-07-29 01:38:43 +02:00
Hermès Bélusca-Maïto 51d031cc5d
[USER32] Use the correct __REACTOS__ define. 2019-07-29 00:33:20 +02:00
Timo Kreuzer 08c6d21e1f [REACTOS] Fix warning C4146: unary minus operator applied to unsigned type, result still unsigned 2019-07-27 11:21:28 +02:00
Katayama Hirofumi MZ 1e91a1690d
[USER32][NTUSER] Fix menu arrow drawing (of DrawFrameControl) (#1752)
CORE-13211
user32!DrawFrameControl drawed invalid menu arrow when the width is shorter than the height.

- Use the squared rectangle.
- Draw it in the transparent background mode.
- Save the old background mode of HDC.

This PR will fix UltraISO's bug.
2019-07-25 01:40:33 +09:00
Katayama Hirofumi MZ c17a8770a3
[USER32] Switch to only one window (Alt+Tab) (#1718)
Fix app switcher (Alt+Tab)'s behavior when there is only one app window. CORE-16176
2019-07-07 09:05:10 +09:00
jimtabor a8d6e12bc1 [User32] Sync Port Wine.
Patch :
Nikolay Sivov : Use correct brush color for centered image background.
Nikolay Sivov : Remove confusing comments.
2019-06-28 22:22:49 -05:00
jimtabor 65a814203f [User32] Sync Port Wine.
Patch :
Vijay Kiran Kamuju : Add DlgDirList wildcard checks.
Nikolay Sivov : Fix setting negative dialog item ids.
Alistair Leslie-Hughes : Don't reset focus if current dialog is a child.
Dmitry Timoshkov : If there is no dialog controls to set focus to then
set focus to dialog itself.
Zhiyi Zhang : Send notification for the focused button in
IsDialogMessage().
Huw Davies : Avoid using the comma operator in a while condition.

Patch skipped : a525631920d74e9d797f38305b89e63aed1c5c41 : Scale dialog
base units based on DPI awareness.
2019-06-28 21:52:04 -05:00
Hermès Bélusca-Maïto 78d20a9b3a
[WIN32K] Fix spelling typo. 2019-06-23 02:12:23 +02:00
Joachim Henze 1158c24194 [WIN32SS] Fix multiple scrollbar redraw issues
This fixes:
- CORE-15911 "Scrollbars do not dissapear when Maximizing and not needed"
- CORE-10617 "ListView corrupt scrollbar upon resizing the column-header"

and will appease regression:
- CORE-15429 "Uninitialized scrollbars in 'My Computer'"

By applying clientFix.patch from CORE-15911 contributed by JIRA-user 'I_Kill_Bugs'.

https://reactos.org/testman/compare.php?ids=66723,66729

Earlier I already committed this fix into 0.4.12-RC-9-g
5ac548544f
2019-06-22 22:27:23 +02:00
jimtabor 8c7705eb5d [Win32SS] Complete Print Driver Callbacks
This callback works. Haven't commit the rest yet. Still thinking about
the data packets types and shapes. Using wordpad to test this. It works,
loads and unloads due to incomplete driver support and no PDEV. It
crashes in ComCtl32 while loading a text file. When this gets committed
without a solution, the code will be commented out.
2019-06-22 12:02:51 -05:00
James Tabor 40c42305c3 [Win32SS] Add Driver Callback
Add user driver callback to be used later on.
2019-06-21 13:10:03 -05:00
Mark Jansen 04712d418c
[WIN32K] Use KeStackAttachProcess 2019-06-15 21:26:41 +02:00
Mark Jansen 97d1590914
[WIN32K] Attach to the target process before unhooking
CORE-16083
2019-06-15 21:26:41 +02:00
Mark Jansen 7a3937ddaf
[WIN32K] Fix indenting in IntRemoveHook 2019-06-15 21:26:35 +02:00
Joachim Henze 3cc50cedaf [WIN32SS][NTUSER] Addendum to 0.4.12-dev-956-g0197c4f CORE-15893
Aims PixelPerfection for a regression that was introduced by
0.4.12-dev-954-g
1f619b2781

and then improved already by
0.4.12-dev-956-g
0197c4f875

The tweaking got ack of Jim Tabor. Test results:
https://reactos.org/testman/compare.php?ids=68026,68029
2019-06-10 15:33:31 +02:00
Serge Gautherie 7804cf035a [USER32] RegisterClipboardFormatA(): Enable a SetLastError() (#1612) 2019-06-05 18:15:02 +02:00
Serge Gautherie 38db074491 Misc addendum to CORE-14271 (#1529)
* [ADVAPI32] Simplify RtlCreateUnicodeStringFromAsciiz() return value check

RtlCreateUnicodeStringFromAsciiz() returns a BOOLEAN, not a BOOL.

No functional change.

Addendum to
CORE-14271

* [USER32] Simplify RtlCreateUnicodeStringFromAsciiz() return value check

RtlCreateUnicodeStringFromAsciiz() returns a BOOLEAN, not a UINT.

Also, add a FIXME.

No functional change.

Addendum to
CORE-14271

* [USER32] Simplify RegisterClipboardFormatA/W() a bit

No functional change.

* [UDFS] Simplify SeSinglePrivilegeCheck() return value check

No functional change.

Addendum to
CORE-14271
2019-06-04 16:56:33 +02:00
Katayama Hirofumi MZ a73c17fcd9
Revert "[USER32] Make App Switcher use the owner window's icon (#1299)" (#1605)
This reverts commit 484943d04f.
2019-06-03 08:47:43 +09:00
Katayama Hirofumi MZ f7fc10c17c
[WIN32SS][USER32] Fix Task Switcher more (#1602)
This PR will fix task switcher (Alt+Tab) as Win2k3. It became more reliable. CORE-15653
c.f. Raymond Chen's article: http://blogs.msdn.com/b/oldnewthing/archive/2007/10/08/5351207.aspx
2019-06-02 19:17:50 +09:00
James Tabor 931c72fde5 [NtUser] Fix Clipboard Synthesized Returns
Add supported for Meta file synthesized renderings.
See CORE-12143.
2019-06-01 07:23:58 -05:00
jimtabor 73558e94df [User32] Fix Clipboard Meta Test Results
Fix meta data handle returns.
2019-05-31 22:59:29 -05:00
jimtabor da264743e1 [Win32SS] Support Clipboard Metafile
Major fix ups and plugging in missing code changes. Handle code is from
another project currently being developed for ReactOS.
See CORE-12143
2019-05-31 21:44:17 -05:00
Katayama Hirofumi MZ 1010f3796e
[USER32] Fix behavior of Task Switcher (Alt+Tab) (#1591)
Task Switcher didn't correctly behave on the windows with WS_EX_APPWINDOW extended style. CORE-15653
2019-05-31 17:02:47 +09:00
Hermès Bélusca-Maïto 5ca9c9c138
[CONSRV] Minor code cleanup. 2019-05-26 00:00:39 +02:00
Katayama Hirofumi MZ cba1a2f742 [WIN32SS][NTUSER] Fix msvc-x64 build 2019-05-23 08:32:41 +09:00
jimtabor 0f29b3faa7 [NtUser] Fix setting screen size.
Back set change size to the server information metrics.

Fixes CORE-15477. Still more work is required.

Patch based on reactosfanboy original patch.
2019-05-21 16:24:52 -05:00
Hermès Bélusca-Maïto c4e2826c73
[CONSOLE][CONCFG][CONSRV] Provide support for specified additional TrueType fonts + bugfixes.
CORE-12451 CORE-13182 CORE-13196

- CONSOLE: Initialize the additional TrueType fonts cache.
  * Fix the font preview when a TrueType font has been selected.
  * Refresh the available fonts and the font preview when the selected
    code page is changed (Work In Progress), or when the OS pool of
    font resources has changed (WM_FONTCHANGE message).

- CONCFG: Implement support for the additional TrueType fonts cache:
  the contents of the cache is enumerated under the registry key
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont

  * Add helper functions and macros.
  * In CreateConsoleFontEx(), set the mandatory font pitch&family flags
    and remove those that we do not support.
  * In IsValidConsoleFont2(), update the validity checks and the
    documentation links.

- CONSRV: Load/refresh the additional TrueType fonts cache when needed.
2019-05-19 23:10:41 +02:00
jimtabor 2161dd85dc [NtUser] Fix Paint Messages
This is a HACK for forcing painting of non client areas. Paint code
seems very restricted.

See CORE-7166 & CORE-15934.
2019-05-13 11:31:58 -05:00
Hermès Bélusca-Maïto 2ebda0e3d0
[CONSOLE.CPL] Fix the console screen preview when selecting TrueType fonts.
CORE-13182 CORE-13196

- Use the correct character height & width.
- Additions: use StringCch*() when initializing the dialog title.

[CONSRV:CONCFG] Minor fixes.

- When retrieving font characteristics in ConCfgReadUserSettings(),
  check for NULL/zero values that indicate that we should use default
  ones instead.
- Rename 'dwNumSubKeys' into 'dwNumValues'.
2019-05-05 01:20:19 +02:00
Hermès Bélusca-Maïto 0aed8b09a4
[CONSRV] Cache the console window system menu handle; simplify its initialization code. 2019-04-28 21:47:55 +02:00
Serge Gautherie cf48f8bf8a [REACTOS] Replace remnant legacy SPIF_SENDWININICHANGE by SPIF_SENDCHANGE (#1526)
No functional change otherwise.
2019-04-28 21:19:42 +02:00
Andrew Boyarshin 458a26ab76
[WIN32SS:NTUSER] Use the 2nd parameter of NtUserGetThreadDesktop() as fallback. (#1065)
- The 2nd parameter is already passed in user-mode by GetThreadDesktop().
  It is then used by NtUserGetThreadDesktop() as a fallback for console
  threads.

- Lookup and validate the thread by using the IntTID2PTI() helper.
- Don't reference the desktop with too many access rights.
- Get rid of the old-school DECLARE_RETURN() & co. macros.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2019-04-28 19:27:45 +02:00
Hermès Bélusca-Maïto d70848b8b7
[WINSRV] Implement SrvGetThreadConsoleDesktop(). CORE-13470
It retrieves the handle to the desktop assigned to the specified
thread belonging to a console application, which is going to be
where the input thread of this console is.
2019-04-28 02:50:38 +02:00
Bernhard Feichtinger f5471b7b4b
[NTOS][USERSRV] Silence noisy debug output. 2019-04-22 17:41:17 +02:00
jimtabor feb9c045cf [NtGDI] Update Region code
Wine Sync/Port and update for Regions. See CORE-15906.
2019-04-17 14:43:24 -05:00
Katayama Hirofumi MZ 94a42d43b5
[WIN32SS][NTUSER] Fix message time (#1259)
Fix CORE-15565 and make #1245 GetMessageTime testcase successful. CORE-15565
- Erase MsqCalculateMessageTime function.
- Use (DWORD)EngGetTickCount() instead.
- Ghosting is temporarily disabled.
2019-04-12 07:56:04 +09:00
jimtabor cfdf36e442 [NtUser] Fix Theme Non Client Painting.
See CORE-7166 & CORE-15934.
2019-04-10 20:52:01 -05:00
Maxim Smirnov ffb4b674c7 [FONT] Fix FontSmoothing 2019-04-07 01:42:29 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Adam Słaboń 7047aa80ef [TRANSLATION] Polish translation update
Polish translation update for calc, fltmc, magnify, notepad, osk, sndvol32, usetup, fdebug, appwiz, mmsys, sysdm, acppage, ziplfdr, browseui, cryptui, jscript, shell32, themeui and inf. Added translation for cyrptext, vcdcontroltool, and (not yet complete) getuname.
2019-04-05 10:34:10 +02:00
jimtabor 0197c4f875 [NtUser] Fix maximizing to window edge
Cover up the edge of the frame while maximizing the window to desktop.
Fixes CORE-15893.
2019-03-27 17:39:04 -05:00
jimtabor 1f619b2781 [Win32SS] Fix maximized window positioning.
Fix CORE-5177 TaskMgr and ProcExp possionong when maximized.
2019-03-26 15:56:57 -05:00
Stanislav Motylkov 36230bb214 [USER32] Edit: Fix caret and scroll position
Based on patch by JIRA contributor 'I_Kill_Bugs'. CORE-15780
2019-03-24 23:26:20 +01:00
Hermès Bélusca-Maïto 048c8c1605
[USER32] Add support for navigating a group of radio buttons using a keyboard.
Import Wine commit:
b1b8fb77be

"user32: Add support for navigating a group of radio buttons using a keyboard.
The patch approximates the behaviour observed in the message tests
but still doesn't make the message tests pass without failures.
"
by Dmitry Timoshkov.
See bug report https://bugs.winehq.org/show_bug.cgi?id=16845
2019-03-24 17:23:33 +01:00
Hermès Bélusca-Maïto 780f2ba215
[USER32][COMCTL32] Move the auto radio button group logic from BM_SETCHECK to WM_LBUTTONUP handler.
CORE-8526

Import Wine commit:
96d0af52eb

"user32: Move the auto radio button group logic from BM_SETCHECK to WM_LBUTTONUP handler.
This patch also changes the logic to get the control style with WM_GETDLGCODE
instead of GetWindowLong to make the message test pass.
"
by Dmitry Timoshkov.
See bug report https://bugs.winehq.org/show_bug.cgi?id=42010

- (ReactOS-only) Fix also the corresponding logic in COMCTL32.
2019-03-24 17:23:24 +01:00
Stanislav Motylkov 40dab7d5e5 [USER32] Edit: Fix rectangle overflow when inserting characters
Based on patch by JIRA contributor 'I_Kill_Bugs'. CORE-11475
2019-03-23 15:52:43 +01:00
jimtabor 68df5a50e6 [NtUser] Support SWP_FRAMECHANGED
Implement SWP_FRAMECHANGED support for non-changing window to force a
redraw.

Patch dedicated to Katayama Hirofumi MZ.
2019-03-18 17:28:33 -05:00
jimtabor bc534efbc5 [User32] Support WM_COPYGLOBALDATA
Implement support for WM_COPYGLOBALDATA. Needs more tests.

Tested DropTest from CORE-15836.
2019-03-13 12:16:52 -05:00
Timo Kreuzer ba893e1172 [WIN32K] Keep a reference on an ETHREAD while THREADINFO exists 2019-03-10 11:14:40 +01:00
Mark Jansen d7ae8690ab
[WIN32K:NTUSER] Do not try to reposition an off-screen menu as if it were a popup menu
CORE-15733
2019-02-16 15:45:46 +01:00
Hermès Bélusca-Maïto 7bbf8ae688
[WIN32SS:NTUSER] Bugcheck in case two mandatory initialization steps are not fulfilled.
- Bugcheck VIDEO_DRIVER_INIT_FAILURE in case initializing video fails.
- Bugcheck WIN32K_INIT_OR_RIT_FAILURE (Windows-compatible) in case
  the USER subsystem version does not match.
2019-02-10 22:44:24 +01:00
Katayama Hirofumi MZ 484943d04f
[USER32] Make App Switcher use the owner window's icon (#1299)
CORE-15672
2019-01-24 22:41:42 +09:00
Katayama Hirofumi MZ 687eba26f3
[USER32] Fix AppSwitcher (Alt+Tab) (#1296)
CORE-15653
2019-01-23 22:44:11 +09:00
Mark Jansen e022d8d7cb
[WIN32SS] Require at least the amount of extra memory, not the exact amount
This fixes Civ II trying to create scrollbars based on 'native' scrollbars.
2019-01-21 22:25:29 +01:00
Katayama Hirofumi MZ efe4605177
[WIN32SS][NTUSER] Fix caret position of Ghostscript (#1271)
CORE-13934, CORE-15656
2019-01-20 23:11:54 +09:00
Denis Malikov 37af78775d [WIN32SS:NTUSER] Fix Window-snap madness (#1246)
Desktop window was treated as possible to resize.
Fix for 7e396787

CORE-15624
2019-01-19 23:05:19 +01:00
Katayama Hirofumi MZ d0d909245f
[WIN32SS][NTUSER] Refactor PR #1226 (#1266)
Refactoring of #1226. CORE-12845
2019-01-19 23:56:33 +09:00
Katayama Hirofumi MZ 87bfbb3ec7 [WIN32SS][NTUSER] Fix PostTimeMessage message time 2019-01-16 22:59:36 +02:00
Denis Malikov 7e396787ed [WIN32SS:NTUSER] Implement "Window Snap" feature (#1226)
Implemented the following actions: stick the window on the left/right or maximize it,
with the following shortcuts:
 - Win key + Arrows;
 - drag to left/right screen border;
 - double-click on top/bottom.

CORE-12845
2019-01-15 14:36:41 +01:00
Mark Jansen 007ec0310c [WIN32K:NTUSER] Fix a case where the menu was off-screen on the other side
Found by Denis Malikov
CORE-15001
CORE-9037
2019-01-15 14:34:53 +02:00
Katayama Hirofumi MZ 1a4732703c
[WIN32SS][USER32] Make IsHungAppWindow check FNID (#1245)
CORE-11944
2019-01-15 20:32:23 +09:00
Katayama Hirofumi MZ 9285bd19de
[WIN32SS][USER32] Ghost is a hung window (#1244)
IsHungAppWindow(a ghost window) == TRUE. CORE-11944
2019-01-15 19:40:34 +09:00
Katayama Hirofumi MZ 8ca854251a
[WIN32SS][NTUSER] Don't freeze Task Bar in switching the app (#1243)
This avoids taskbar hung up.
2019-01-15 13:45:28 +09:00
Mark Jansen d2626f0c2a
[WIN32K:NTUSER] Find a better position for a menu that is off-screen
Previously, we would just stick the menu on the edge of the screen.
We should actually try to flip the menu around the point of origin,
and only when that fails move it to the edge of the screen.
CORE-15001
CORE-9037
2019-01-10 19:55:39 +01:00
Thomas Faber b2dcb8e0d8
[WIN32K:NTUSER] Avoid dereferencing a null pointer in NC_DoNCPaint. CORE-15569 2019-01-08 11:27:33 +01:00
Luo Yufan 95564d5e30 [TRANSLATION] Update Chinese translation. (#1223)
[CLIPBRD][SOLITAIRE][RAPPS][REGEDIT][WINHLP32][WORDPAD][FDEBUG][SYSDM][BROWSEUI][DEVMGR][IEFRAME][OLEDLG][SHELL32][SYSSETUP][INF][WINFILE][NTVDM][USER32]
2019-01-07 00:35:11 +09:00
Baruch Rutman 123a7c80e0
[NTUSER] Fix SetProcessDefaultLayout() (#1013)
- Add a check in co_UserCreateWindowEx() for parentless windows,
  that checks the default layout direction; if it's LAYOUT_RTL
  add the WS_EX_LAYOUTRTL flag to the extended window styles.

- Make the internal routine accepting also LAYOUT_LTR as a value for SetProcessDefaultLayout().
  Limit receiving value to LAYOUT_ORIENTATIONMASK (and not just LAYOUT_RTL)
  or LAYOUT_LTR, as per written in:
  https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdefaultlayout

Now all the applications that call SetProcessDefaultLayout() to mirror the layout get mirrored.
This is based on Wine.
2019-01-06 04:35:51 +01:00
Hermès Bélusca-Maïto ca24df9c85
[WIN32SS:NTUSER] Completely update the metrics in co_IntInitializeDesktopGraphics().
This change is similar to what is done in UserChangeDisplaySettings()
after changing screen video mode.

This allows e.g. having windows to be correctly maximized during
2nd-stage GUI setup. To compare and reproduce during 2nd-stage GUI
setup, open cmd.exe (Shift-F10) and from there a GUI app, e.g.
regedit.exe, and maximize it. Observe the limits used by the window.
2019-01-05 16:42:16 +01:00
David Quintana 01e5cb0c04
Resource file strings cleanup (#581)
[CMDUTILS/AT] Fix missing translation strings in certain files.
[NOTEPAD] Fix SUBLANG code to brazillian.
[RAPPS] Fix missing translation strings in certain files.
[FDEBUG] Fix translation string ID.
[CPL/INPUT] Fix missing translation strings in certain files.
[ACPPAGE] Fix incorrect resource IDs.
[NETSHELL] Fix incorrect resource IDs.
[DEVMGR] Fix missing translation strings in certain files.
[LSASRV] Fix missing translation strings in certain files.
[RASDLG] Fix missing translation strings in certain files.
[SHELL32] Fix missing translation strings and incorrect resource IDs.
[TAPIUI] Fix missing translation strings in certain files.
[WINFILE] Fix incorrect resource IDs.
[NTVDM] Fix missing translation strings in certain files.
[USERSRV] Fix missing translation strings in certain files.
[BROWSEUI] One more missing string.
[FLTMC] Fix missing translation strings in certain files.

Detected using the TransDiffer tool (early alpha).
This doesn't include everything anymore, but I wanted to get the PR out of the way.
2019-01-05 15:44:16 +01:00
Giannis Adamopoulos b3399c68e9 [WINSRV] ConSrvConnect: Always store the control dispatcher routine
This shouldn't be used only for console applications but can potentially be used by any application to receive shutdown notifications.
MSDN provides more information in the documentation for SetConsoleCtrlHandler. Our services.exe also expect to receive shutdown notifications in this way.
2019-01-04 19:38:36 +02:00
Giannis Adamopoulos cb2dcc0a2f [WINSRV] usersrv: Fix a wrong debug print 2019-01-04 19:30:17 +02:00
Giannis Adamopoulos 8ebff93b35 [WINSRV] usersrv: Don't terminate processes with no top level windows
Consrv will handle these.
2019-01-04 13:29:26 +02:00
Giannis Adamopoulos cc710885d0 [WINSRV] usersrv: remove wrong dead code and fix indentation 2019-01-04 13:29:26 +02:00
Giannis Adamopoulos 4bef6f5913 [WINSRV] consrv: Implement terminating console processes on shutdown
Also stub handling non-console, non-gui processes.
2019-01-04 13:29:26 +02:00
Giannis Adamopoulos 0a80b77e76 [WINSRV] usersrv: Simplify sanity checks in UserClientShutdown
UserClientShutdown will never be called for csrss so we don't need to have a check for that. The existing check was broken and wasn't doing anything anyway.
Handle processing winlogon by doing nothing so that consrv won't be bothered about it.
2019-01-04 13:29:26 +02:00
Katayama Hirofumi MZ dfa23b60ec [USER32] Let App Switcher activate only one window (#1214) 2019-01-03 16:34:58 +01:00
Hermès Bélusca-Maïto 333ce14dad
[WIN32SS] Try to recover display when changing the display mode fails for whatever reason.
This helps when e.g. changing the resolution on the Dell Latitude D531,
which reports that it supports large resolutions (e.g. 1920x1440x32 and
others larger than 1024x768x32) but fails to apply these.
This usually happens because PDEVOBJ_pSurface(), and more precisely
ppdev->pldev->pfn.EnableSurface(), fails for these resolutions.

- PDEVOBJ_bSwitchMode(): Set the new video mode, or restore the original
  one in case of failure + release the allocated ppdevTmp if previous
  calls fail. Also unlock in reverse order of locking order.

- UserChangeDisplaySettings(): In case PDEVOBJ_pSurface() fails (but has
  reverted the original video mode), we still need to refresh the
  display since the display may have been messed up.
2019-01-02 21:12:22 +01:00
Hermès Bélusca-Maïto fb4a6e38c7
[WIN32SS:NTUSER] Remove some hardcoded buffer sizes + number of chars vs. bytes mixup. 2019-01-02 21:12:21 +01:00
Hermès Bélusca-Maïto cc3fbfefac
[WIN32SS:NTUSER] Minor whitespace formatting. 2019-01-02 21:12:20 +01:00
Giannis Adamopoulos 60448f83fb [NTUSER] Fix a few tests related to desktops and window stations
- NtUserOpenInputDesktop: Don't crash if there is no input desktop yet
- NtUserOpenInputDesktop: Fail if the process doesn't belong to the interactive window station
- NtUserCreateWindowStation: Clear error on success
- DesktopWindowProc: Use UserOpenInputDesktop to get a handle to the input desktop
2019-01-02 17:15:40 +02:00
Julio Carchi 1e141573e4 [TRANSLATION] Spanish translations (#944) 2019-01-02 12:01:44 +01:00
Timo Kreuzer 71fefa32db
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
2018-12-30 12:19:11 +01:00
Thomas Faber e3c8002dfc
[WIN32K:NTUSER] Reference menus owned by a popup menu. CORE-15504 2018-12-30 00:25:01 +01:00