Commit graph

453 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 8ea93d2ab2
[REACTOS] Standardize <imm.h> and <immdev.h> (#6493)
Improve header compatibility and
code quality.
JIRA issue: CORE-19268
- Improve <imm.h> and <immdev.h>
  compatibility by correctly choosing
  the items.
- Use <immdev.h> instead of
  <ddk/immdev.h>.
- Move INPUTCONTEXTDX, IMEINFOEX,
  IMEDPI, and CLIENTIMC into
  <imm32_undoc.h>.
- Adapt to these changes.
2024-02-13 20:33:14 +09:00
Katayama Hirofumi MZ 9a9b22aac1
[NTUSER] Check class name existence on IntGetAtomFromStringOrAtom (#6184)
Based on I_Kill_Bugs' class_error.patch.
JIRA issue: CORE-13422, CORE-7531, CORE-18639
2024-01-10 08:01:37 +09:00
Thamatip Chitpong 90ed686209
[NTUSER] Use UserHMGetHandle macro (#6244)
Use UserHMGetHandle macro everywhere instead of obj->head.h for consistency.
2024-01-05 07:16:44 +07:00
Thamatip Chitpong f74a2aac8c
[NTUSER] Add UserHMSetHandle macro (#6164) 2023-12-24 23:42:15 +07:00
Thamatip Chitpong 986809c719
[NTUSER] menu.c: Fix readability after commit 1df52257
Add comments for default return value.
2023-12-22 00:22:07 +07:00
Thamatip Chitpong 979551e33e
[NTUSER] accelerator.c: Fix readability after commit 95657698
Add comments for default return value.
2023-12-22 00:01:02 +07:00
Thamatip Chitpong 26f8b97886
[NTUSER] window.c: Fix readability after commit 3f5fd1d0
Add comments for default return value.
2023-12-21 23:49:03 +07:00
Thamatip Chitpong 533d877aaf
[NTUSER] Remove RETURN() macro (#6194)
Remove macro definition and the remaining uses.
RETURN() macro is just a wrapper for goto, most of the time it makes the code more complicated than using goto directly.
2023-12-21 11:10:46 +07:00
Thamatip Chitpong 1df5225708
[NTUSER] menu.c: Don't use RETURN() macro (#6185)
Also remove parentheses around return value.
2023-12-18 12:04:57 +07:00
Thamatip Chitpong 95657698e7
[NTUSER] accelerator.c: Don't use RETURN() macro (#6166) 2023-12-17 17:22:58 +07:00
Thamatip Chitpong 3f5fd1d09e
[NTUSER] window.c: Don't use RETURN() macro (#6150) 2023-12-14 14:36:38 +00:00
Katayama Hirofumi MZ 0bfa0cd0d2
[NTGDI] Fix PatBlt with negative values (#6038)
When I am implementing the IME soft keyboard (#6021 and #6036),
I noticed an issue with PatBlt function.

- Fix the rectangle coordinates when the value was
  negative in NtGdiPatBlt function.
- Fix NC_DrawFrame function.
- Fix UserDrawWindowFrame function.

CORE-19334
2023-11-26 11:46:42 +09:00
Timo Kreuzer 83e1193fb2 [WIN32K] Fix alignment checks in NtUserSetInformationThread
Fixes random failures on x64.
2023-11-10 19:42:13 +02:00
Egor Ananyin 64997887eb
[NTUSER] Fix system menu mouse handing (#5822)
Add a check for the system menu opened from the app icon.
Fixes CORE-19258
2023-11-01 23:11:46 +00:00
Katayama Hirofumi MZ 25b7447818
[SETUPLIB][NTUSER] Toggle input language/layout on Alt+Shift / Ctrl+Shift (#5839)
- Respect the toggle key settings.
- Change the hot key settings in 
  base/setup/lib/mui.c.
- Revert IntDefWindowProc function about
  Alt+Shift handling.
- Delete some code in
  co_IntProcessKeyboardMessage for Alt+Shift
  handling.
- Add IntGetNextKL, IntLanguageToggle, and
  IntCheckLanguageToggle helper functions.
- Modify ProcessKeyEvent and
  UserGetLanguageToggle functions to
  support [Left Alt]+Shift and Ctrl+Shift.
- Improve WM_INPUTLANGCHANGEREQUEST
  handling.
- Message handling shouldn't access kbswitch
  directly.
CORE-10667
2023-10-31 22:37:49 +09:00
Katayama Hirofumi MZ ad12c6cdea
[NTUSER] Disable SC_MOVE if WS_MAXIMIZE or WS_MINIMIZE (#5855)
Based on KRosUser's scmove.patch.
- Check also WS_MINIMIZE window style to
  determine to disable SC_MOVE system command.
CORE-19272
2023-10-31 06:50:00 +09:00
Egor Ananyin e2d3aa7f4a
[NTUSER] Remove a wrong check in MENU_MouseMove (#5736)
This check doesn't seem to be correct in modern ReactOS. Furthermore, it
actually hadn't been working for a long time until it was uncovered by
the recent system menu changes.

Reverts a hack introduced in 17a315285 (r72517), fixes CORE-19170.
The initial bug described in CORE-2338 is not observed.
2023-10-16 19:10:52 +03:00
Timo Kreuzer 4661bc006d [WIN32K] Prevent dereferencing NULL pointer
Initialize a window's ThreadListEntry as an empty list on creation and only remove the window from the list on destruction, when the entry is not an empty list. Previously the window creation could fail before the list entry was initialized and the window would get destroyed after that, resulting in a NULL pointer dereference.
2023-09-21 23:45:31 +03:00
Timo Kreuzer 8650eac76c [WIN32K] Do not try to free a unicode string that is an int-resource 2023-09-17 10:40:19 +03:00
Katayama Hirofumi MZ bcd916bd4e
[NTUSER] Error of co_UserCreateWindowEx should display class name (#5682)
The error messsage of co_UserCreateWindowEx
was unfriendly to the debugger.
Show the window class name by using "%wZ" in
co_UserCreateWindowEx.
2023-09-12 06:16:05 +09:00
Thomas Faber f9212e4a72
[WIN32K:NTUSER] Avoid TOCTOU in ProbeAndCaptureUnicodeStringOrAtom. 2023-09-09 17:50:49 -04:00
Julio Carchi 4976fba59e
[NTUSER] Reduce debug logging spam (#5661)
Silence two of the most debug log spammers in co_MsqSendMessage()
and in co_IntProcessMouseMessage() by demoting ERR to WARN.
2023-09-09 22:28:19 +03:00
Egor Ananyin 3ae0ccdccb [NTUSER] Set correct lParam for WM_(UN)INITMENUPOPUP (#5573)
This is needed to allow apps to detect whether the opened menu is
a system menu or a user menu. CORE-19061
2023-08-24 16:33:03 +02:00
Andriy Shevchenko 2ea03b5b22
[REACTOS] Fix typos in comments (#5591)
Fixing typos in code comments enhances code readability and comprehension for developers and collaborators.
2023-08-22 16:20:29 +03:00
Joachim Henze 49dbc8fbbb [NTUSER] Whitspace-fixes winpos.c
I just can't stand that whitespace-diff at those 2 if-conditions any longer,
which was introduced into co_WinPosSetWindowPos() by
0.4.13-dev-8-g cfdf36e442
Everytime I port something back, I don't know where to put that diff temporarily.
And I don't want to make the older branches worse as well.
So finally squeeze it out at right-hand-side in master head.
2023-08-20 01:41:28 +02:00
Serge Gautherie 728d5736d9
[NTUSER][USER32] Remove 4 remnant defines (#5572)
IS_SYSTEM_MENU():
"moved" to ntuser on 6dfa71c (r68904).

IS_SYSTEM_POPUP():
uselessly added on 6fc29cc (r8195).

IS_BITMAP_ITEM():
uses removed on 07b6ddc (r23221).
uselessly copied to ntuser on 6dfa71c (r68904).
2023-08-15 18:13:27 +02:00
Carl J. Bialorucki c64103d55f
[NTUSER] Fix SPI_SETFONTSMOOTHING behavior (#5526)
CORE-19092

Fixes the behavior of the SPI_SETFONTSMOOTHING system parameter. This also
fixes a bug when trying to select "Use the following method to smooth edges
of screen fonts" in desk.cpl.

Instead of checking if uiParam is equal to two, treat uiParam as a Boolean
that sets font smoothing on or off. This is the correct behavior according
to Microsoft documentation.
Use SpiStoreSzInt method instead of SpiStoreSz to store the value in the registry.
2023-08-10 17:10:51 +02:00
Andrew Dent 72ea2d4c26
[REACTOS] Spelling fixes (#5534)
Fix spellings / hyphenation: `unassociate` ; `read-only` ; `double-click`
2023-08-09 11:48:07 +02:00
Joachim Henze 6b7efb331c [NTUSER] co_IntSendMessageWithCallBack: Formatting only, no functional changes
e.g. wrong indentation.
Want to port something back here, and the slight tweaking allows master to remain
in sync with previous releases.
2023-07-30 21:39:10 +02:00
Jérôme Gardou 1599d7b794 [NTUSER] Always reference a window when using it as parent/child etc.
CORE-18811
2023-07-24 23:29:38 +02:00
Thamatip Chitpong c7e4c3a8e9
[NTUSER] NtUserWaitForInputIdle: Fix unhandled exception BSOD 0x1E (#5391)
Fix CLIENTINFO usermode pointer access once again.
Based on a patch by Michael Fritscher from CORE-10017.
Addendum to 7052282507 (r68702).

CORE-18728 CORE-19014
2023-07-02 20:30:30 +03:00
Serge Gautherie 38560761ce
[WIN32K:NTUSER] Add ASSERT() on "linking window to itself" (#4749)
Addendum to ee0511b (0.4.10-dev-323).
CORE-18132
2023-07-02 13:19:06 +02:00
George Bișoc 0f9be53985
[WIN32K:NTUSER] Fix an unintialized user's token variable case
And remove the "!NT_SUCCESS(Status)" check which is excessive, the expected
status will always be STATUS_BUFFER_TOO_SMALL anyway. This should fix
some compilation warnings spotted by GCC. Courtesy goes to Hermes for letting
me know of these warnings.
2023-06-11 18:14:02 +02:00
Oleg Dubinskiy 114bc2b96e
[NTGDI][NTUSER] Load DirectX graphics driver at system startup (#4551)
CORE-18221

Load the DirectX graphics kernel driver (dxg.sys) by win32k at WINSRV
initialization time, in NtUserInitialize(). Keep it always loaded in
memory, as on Windows, instead of loading it only by DirectX dlls.

This fixes the problem of acessing this driver: we need only to call
DxDdEnableDirectDraw() and do other stuff when DirectDraw/Direct3D is
required by anything. In other cases, it is called from win32k PDEV
functions when changing display mode (as in Windows). Since it's used
by other things too, it needs to be always loaded.

Otherwise, if it's not loaded, its APIs are not accessible when needed,
and execution fails.

For example, it fixes display mode change problem in VMWare, when a
new mode fails to be applied. Indeed, when it manages DirectDraw stuff,
it calls DXG routines, and therefore fails if dxg.sys isn't loaded
in memory at this moment.

- Implement InitializeGreCSRSS() initialization routine, that initializes
  supplemental NTGDI/GRE data once CSRSS and WINSRV are loaded:
  * Call DxDdStartupDxGraphics() inside it, which loads dxg.sys.
  * Additionally, move fonts and language ID initialization there, from
   win32k!DriverEntry. Confirmed by analysis on Windows.

- Call InitializeGreCSRSS() in NtUserInitialize() main initialization routine
  (called by WINSRV initialization).

Moved to NTGDI from previously NTUSER place:

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2023-06-11 13:44:56 +02:00
Timo Kreuzer 8f9ef68ea7
[WIN32K][WIN32U] Fix system call ids (#5287)
- Delete the win32ksvc-ros.h file, which was not used
- Use a separate file for x64 (based on 2k3 x64 free)
- Delete w32ksvc.db. It's unused since ages.
2023-05-28 16:19:50 +03:00
Timo Kreuzer 2b8c1b0dac [WIN32K] Fix WindowExtra for some server-side classes
These values are based on apitest results.
2023-05-25 18:56:02 +03:00
Timo Kreuzer 05cd3406e7 [USER32] Fix SetWindowWord/Long
These must use the corresponding NtUserSetWindowWord/Long function and cannot use NtUserSetWindowLongPtr, otherwise the function can fail, when there is only space for a LONG, but not for a LONG_PTR at the specified offset.
2023-05-25 18:56:02 +03:00
Katayama Hirofumi MZ d8946e20cb
[NTUSER] Implement THREADSTATE_CHECKCONIME (#5272)
- Add THREADSTATE_CHECKCONIME handling in NtUserGetThreadState function.
CORE-11700
2023-05-10 20:24:21 +09:00
Katayama Hirofumi MZ 4aff629302
[IMM32][NTUSER][SDK] Add ImmCallImeConsoleIME (#5271)
- Add <jpnvkeys.h>.
- Add imm32!ImmCallImeConsoleIME.
CORE-11700
2023-05-10 14:04:01 +09:00
Katayama Hirofumi MZ 2d31b06c67
[NTUSER] Remember old KL for Chinese IMEs (#5266)
The Chinese user uses Ctrl+Space key combination to switch between the IME keyboard and the non-IME keyboard. To enable Ctrl+Space, the system has to remember the previous keyboard layout. In IntImmActivateLayout function, remember the previous keyboard layout (hklPrev) to switch back for Chinese IMEs. CORE-18950
2023-05-05 17:00:05 +09:00
Thamatip Chitpong 560671a784
[NTUSER] Improve MsqPostMessage (#5225)
- MsqPostMessage: Fill Message structure before InsertTailList. For style consistency.
- MsqPostMessage: Fix the use of MessageQueue variable
2023-04-24 20:11:46 +02:00
Thamatip Chitpong 77d4653164
[NTUSER] co_UserDestroyWindow: Validate window before destroying it (#5054)
Prevent the window from being destroyed twice
fixes BSOD 0x1E CORE-18821
2023-04-12 22:20:46 +02:00
Katayama Hirofumi MZ 5ff0ef403e
[NTUSER] IntImmActivateLayout: Set CI_IMMACTIVATE if not pImeWnd (#5231)
In IntImmActivateLayout function, if pImeWnd was NULL and pti->spDefaultImc was non-NULL, then set CI_IMMACTIVATE flag. CORE-11700
2023-04-09 15:19:47 +09:00
Joachim Henze 9ee9f73369
[NTUSER] Fix BSOD 0x1E nullptr deref CORE-18899 (#5212)
fix authored by JIRA-user "TANGaming". I do suspect that the possibility of that nullptr deref was introduced on the master branch by 0.4.13-dev-962-g 4193b8d. Doug Lyons signalled his "ok" regarding the fix in chat already. CORE-18899
2023-04-02 23:27:42 +09:00
Thamatip Chitpong 640e2283d4
[NTUSER] VerifyWnd: Remove pointless SEH and simplify the function (#5125) 2023-03-23 10:22:10 +01:00
Katayama Hirofumi MZ 1ef98fff3b [NTUSER] ime.c: Add parameter to ERR(...)
Follow-up of 94f22bd.
CORE-11700
2023-03-21 07:21:31 +09:00
Katayama Hirofumi MZ 94f22bda27 [NTUSER] ime.c: Add ERR(...) to the exception handlers
CORE-11700
2023-03-20 19:12:25 +09:00
Katayama Hirofumi MZ 0694b559da [NTUSER] NtUserSetImeInfoEx: Use _SEH2_YIELD
CORE-11700
2023-03-20 19:10:04 +09:00
Katayama Hirofumi MZ ed5098b2c9 [NTUSER] NtUserGetImeInfoEx: Use _SEH2_YIELD
CORE-11700
2023-03-20 19:08:38 +09:00
Katayama Hirofumi MZ ef20cc081f [NTUSER] NtUserBuildHimcList: Use _SEH2_YIELD
CORE-11700
2023-03-20 19:06:44 +09:00