Commit graph

1290 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 75cf6920bc
[IMM32][SDK][NTUSER] Implement ImmProcessKey for Cicero (#6106)
Complete CTF IMM.
- Add CtfImeProcessCicHotkey and CtfImeSetActiveContextAlways
  to access CTF IMEs.
- Check whether Cicero is started in the current thread in ImmProcessKey.
- Call CtfImeProcessCicHotkey if necessary in ImmProcessKey.
- Modify <CtfImeTable.h>.
- Add CI_CICERO_STARTED flag to "ntuser.h".
- Fix Imm32JCloseOpen.
CORE-19268
2023-12-03 17:33:22 +09:00
Thamatip Chitpong e0c17c3f46
[DXG] Don't repeat "DXG" module name in version info 2023-12-01 08:23:13 +07:00
Katayama Hirofumi MZ 84e8ea0dd5
[USER32] Fix IsWindow by not using WNDS2_INDESTROY (#6066)
Based on I_Kill_Bugs' IsWinodw.patch.
CORE-11722, CORE-16432
2023-12-01 09:08:58 +09:00
Katayama Hirofumi MZ 931224fbe1
[IMM32][SDK][NTUSER] Implement CtfImmTIMActivate (#6041)
- Add Imm32InitTLS, Imm32AllocateTLS, Imm32GetTLS,
  Imm32GetCoInitCountSkip, Imm32IncCoInitCountSkip, and
  Imm32DecCoInitCountSkip helper functions to
  control the TLS data.
- Introduce "CoInitialize Spy" (ISPY) to manage COM
  initialization status.
- Implement CtfImmCoInitialize and CtfImmCoUninitialize.
- Implement CtfImmEnterCoInitCountSkipMode and
  CtfImmLeaveCoInitCountSkipMode.
- Implement CtfImmLastEnabledWndDestroy,
  ImmDisableTextFrameService, and CtfImmTIMActivate.
CORE-19268
2023-11-30 17:22:50 +09:00
Doug Lyons 75c67f9b51
[USER32] Fix F1'97 Demo icon not showing in explorer (#5268)
Fixes the F1'97 Demo program (a racing game) not showing an icon in explorer.
This fixes a very special kind of icons which are embedded into the
executable by ancient Watcom C/C++ compilers.
Windows XP/2k3sp2 can show that icon.
Windows Vista/7 cannot show that icon.

Due to the different behavior of the various Windows versions, we
also added a testcase for our bots to protect that functionality in the future,
we committed that test by 0.4.15-dev-7076-g c00d41d91c (#6020)

JIRA issue: CORE-10726
2023-11-27 17:02:08 +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
Katayama Hirofumi MZ 3b2fdc56bd
[IMM32][SDK][NTUSER][IMM32_WINETEST] Add CtfImmGenerateMessage (#6037)
Implementing advanced text service...

- Add CtfImmGenerateMessage function.
- Modify imm32.spec.
- Move TRANSMSG, TRANSMSGLIST etc. in
  win32ss/include/ntuser.h to <immdev.h>.
- Move win32ss/include/imetable.h to
  sdk/include/reactos/imetable.h.
- Move dll/win32/imm32/CtfImeTable.h to
  sdk/include/reactos/CtfImeTable.h.
- Fix build failure of imm32_winetest due
  to TRANSMSG redefinition.

CORE-19268
2023-11-25 22:46:00 +09:00
Hermès Bélusca-Maïto c77a5ff99b
Revert my last commits that break build.
Revert "[PSDK][AFD][VGADDI] Further build and MS PSDK compatibility fixes."
This reverts commit 99efc2ae50.

Revert "[PSDK] Sync winresrc.h with wine-8.20"
This reverts commit 3e83562aa7.

Revert "[OSK][PROGMAN] Fix resource file build."
This reverts commit 84e4ad0a82.

Revert "[PSDK] Use the new .rh files in winresrc.h"
This reverts commit f6fb7c48c9.
2023-11-23 17:20:47 +01:00
Hermès Bélusca-Maïto 99efc2ae50
[PSDK][AFD][VGADDI] Further build and MS PSDK compatibility fixes.
- windows.h:
  * should define _WINDOWS_ and _INC_WINDOWS instead of _WINDOWS_H
  * include winresrc.h if RC_INVOKED and not NOWINRES (Wine also agrees
    with that)
  * also, some .h included from there should _not_ be included if their
    respective NO*** flags are defined.

- batclass.h: Use correct _WINDOWS_ guard.

- winsnmp.h:
  * should define _INC_WINSNMP instead of _WINSNMP_H
  * use _INC_WINDOWS instead of _WINDOWS_H

- afd.h, vgaddi.h: Use the correct guards.

- winnt.rh: Define the (SUB)LANG_* exactly as they are in the winnt.h,
  otherwise we get macro redefinition compile errors.

NOTE: Ideally these .rh files should be auto-generated from their
corresponding .h files.

- afxres.h: Do not include the whole windows.h, but instead, only
  the winres.h file, and only if RC_INVOKED is defined.

NOTE: Both afxres.h and winres.h do not really belong to the PSDK,
but belong instead to MFC. The reason why we have them here is twofold:

1. Wine used to have also winres.h (from where we got ours). This is
   because the .rc resource files of some non-MFC modules were generated
   with Visual Studio, which always includes afxres.h for these, and the
   solution was to use a slightly less MFC-specific header: winres.h
   (Wine commit cb08c82244673f26842e7a0766de90f091b5a493).
   However, this winres.h has been since removed from Wine tree
   (Wine commit 197f4059ab2af5f13f9c56faa26e3b4af902f869).

2. Few of our modules either use afxres.h or winres.h in their resource
   files, and we still want to be able to compile them.
2023-11-23 16:26:30 +01:00
Hermès Bélusca-Maïto 0c2827a3f3
[USER32] Fix OEM resources compilation due to missing OBM_, OIC_, OCR_ defines...
... addendum to commits 072965eb0 and 6cdaad13b.

Due to the wrapping of these defines within an #ifdef OEMRESOURCE block
in winuser.h (for MS PSDK compatibility), these defines became unavailable
in user32.rc resource file. Thus, during user32 resources compilation,
the resource compiler fell back to the behaviour of considering these
resource IDs as literal string IDs (not numerical ones).

Thus, whenever code was trying to refer to these resources via their
numerical IDs, these resources could not be found now, rendering ReactOS
unusuable.
2023-11-23 11:39:57 +01:00
Hermès Bélusca-Maïto 0e88f0485c
[PSDK][WIN32SS] Fix WINNT in ddraw.h; remove NT_BUILD_ENVIRONMENT usage
Keep compatibility with MS PSDK ddraw.h file by using WINNT instead of
_WINNT_ in the preprocessor conditional test.
Incidentally this allows also removing those #define NT_BUILD_ENVIRONMENT
in the win32ss modules.

See commit 5fcfaf2e1 (r42346).
2023-11-22 15:46:06 +01:00
Hermès Bélusca-Maïto f5563ad22c
[WIN32SS:REACTX] Remove INTERNAL_CALL, deprecated since commit 24abf1b22 (r53467) 2023-11-22 15:46:05 +01:00
Hermès Bélusca-Maïto 6ddfe7e5dd
[WIN32K] Re-order some of the includes in pch.h
First the C headers, then the DDK followed by the Win32 PSDK ones,
only then the NDK headers, and finally the rest.
2023-11-22 15:46:00 +01:00
Serge Gautherie 24757e30e9
[NTDDRAW][NTGDI][VGADDI] Add missing \n to DPRINT() calls (#5952)
Add missing \n to DPRINT() calls and demote some DPRINT1().
2023-11-15 21:07:27 +01:00
Serge Gautherie 3fb5957de1
[NTOS:EX][CSRSRV][WIN32K] Make a few #define more explicit/strict (#5907)
- Add parentheses around macro parameters.
- Add casts on return value for the Interlocked*UL ("Unsigned Long") macros.
2023-11-13 20:55:48 +01:00
Serge Gautherie bac646f9fe
[VMX_SVGA] Demote 3 DPRINT1() and define NDEBUG (#5843)
Addendum to 486e587 (r45778).
2023-11-13 11:11:10 +01:00
Timo Kreuzer 83e1193fb2 [WIN32K] Fix alignment checks in NtUserSetInformationThread
Fixes random failures on x64.
2023-11-10 19:42:13 +02:00
Andrei Miloiu a575921e93
[LOCALMON] Update Romanian (ro-RO) translation (#5925) 2023-11-08 20:06:16 +01: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 b3194e320c
[IMM32][SDK] Add CtfAImmActivate/Deactivate functions (#5835)
- Add dll/win32/imm32/CtfImeTable.h for CTF
  IME functions.
- Implementing Imm32CheckAndApplyAppCompat,
  Imm32LoadCtfIme, and
  Imm32EnumCreateCtfICProc helper functions.
- Add CtfAImmActivate and CtfAImmDeactivate
  functions.
- s/CI_TFSDISABLED/CI_TSFDISABLED/
CORE-19268
2023-10-31 22:45:28 +09: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 0e68e27ff6 [WINSPOOL] Add a number of missing NULL checks. 2023-10-01 13:05:51 +03:00
Timo Kreuzer 02df49ebd8 [WINSPOOL] Properly copy the DEVMODE in IntFixUpDevModeNames
Otherwise the size isn't set up correctly, leading to a crash.
Fixes crash in comdl32_winetest printdlg.
2023-10-01 13:05:51 +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
Oleg Dubinskiy f4d7cccd3c
[DXGTHK] Export DriverEntry (#5607)
Export driver entry point function DriverEntry from our dxgthk.sys,
following Windows behaviur. It is exported on XP SP3 and Server 2003.
2023-09-21 14:25:21 +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
Katayama Hirofumi MZ 2a16fc5e19
[NTGDI] GetPixel's return top byte is zero if valid (#5677)
According to the results of CImage testcase,
the top byte of the GetPixel() return value is
zero if the return is a valid color.
Do bitwise-AND operation if the color value is valid.
CORE-19008
2023-09-12 05:56:36 +09:00
Joachim Henze e13ebd44c6 [USER32] Pure Whitespace sync from comctl32/combo.c, no functional change
This will make future syncs between those files much easier,
and fixes tons of mixed tab-space-indentation.

Please no whitespace nitpicks when reviewing this commit, it is a SYNC!
2023-09-11 17:57:40 +02:00
Joachim Henze d97313181e [USER32] Sync comctl32 combo.c code in context of CORE-17883 2023-09-11 17:57:40 +02: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
Timo Kreuzer 9666f00572 [WIN32K][NTOS] Fix parameter to MmMapViewOfSection
The code was passing 0 instead of SECTION_INHERIT::ViewUnmap (2). 0 isn't even a proper constant to be used here. It worked, because MmMapViewOfSection only compares against ViewShare (1) and treats everything else as ViewUnmap.
2023-09-09 12:15:24 +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
Oleg Dubinskiy a4b0899ca1
[DXGTHK] Fix EngCreateBitmap exported parameters (#5606)
Use two longs instead of one for the first parameter of EngCreateBitmap export. Make it same as win32k export.
MSDN documentation says that 1st parameter is SIZEL (SIZE) structure, which actually contains 2 longs inside. Sice it is passed by value, it needs to take enough memory when export in dxgthk and redirect to win32k (since it's actually a win32k function).
Fixes the compilation of our dxg.sys when calling dxgthk!EngCreateBitmap from it.
Found during my DirectX investigations.
2023-08-23 17:53:22 +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
Whindmar Saksit c0e443058e
[CONSRV] Only call CoUninitialize if initialized (#5582) 2023-08-18 19:06:20 +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
Hermès Bélusca-Maïto e4c4894564
[GDI32] CreateDIBSection: Remove erroneous assignation (#5502)
bmBits is only used and assigned on output. It points (holds the address)
to the array of DIB bit values. The "Bits" parameter is however a pointer
to a variable that will receive the address of that array.
So it makes no sense to initially assign bmBits to the value of the Bits
parameter...
2023-08-06 17:35:23 +02:00
Joachim Henze 53b30e3f3b [NTOSKRNL][NTGDI] Formatting addendum, no functional change
I intend to port back the combined work of Thomas Faber and Serge Gautherie in context of CORE 14271.
Both developers fixed wrong retval evaluations for SeSinglePrivilegeCheck() and RtlCreateUnicodeString().
Both functions do return a BOOLEAN, and therefore using NTSTATUS() on them is wrong.
Those bugs have been fixed at multiple places. That is long gone.

But Serge fixed his locations a bit more elegantly, without the need for additional variables.
Therefore this addendum adapts a few of Thomas locations to the improved Serge-ified style.

Yes: I intentionally used a space instead of a minus after the mentioned CORE 14271,
as I don't want that pure stylistic addendum to be linked with the initial ticket anymore.
That would be overkill.
2023-08-01 22:32:25 +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
Jérôme Gardou b3d0591e76 [USER32] Use static inline instead of inline
Fixes compilation with less optimizations
2023-07-24 23:29:38 +02:00
Katayama Hirofumi MZ 726c46d2da
[CMD][SDK][WINSRV] DIR command: Consider double-width characters (#5442)
The "dir /w" command didn't look good due to unaligned columns.
- Add sdk/include/reactos/cjkcode.h header file.
- Add ConGetTextWidthA/W helper functions.
- Add base/shell/cmd/wcwidth.c to implement ConGetTextWidthW.
- Use ConGetTextWidth in DirPrintWideList function.
- Adjust some STRING_DIR_HELP5, STRING_DIR_HELP6 and STRING_DIR_HELP8 resource strings to make the column aligned.
CORE-17591
2023-07-17 07:03:22 +09:00
Hermès Bélusca-Maïto 97277b4deb
[CONSRV] Work-around buggy WM_MOUSEMOVE events received when VBox Mouse Integration is enabled. (#5441)
CORE-8394

These caused the "Ignore-next-mouse-event" mechanism of the console
(used e.g. in QuickEdit mode for not triggering the appearance of the
context menu, etc.) to not work.

Please note that these buggy events, that arise when testing ReactOS
in VirtualBox with Mouse Integration is enabled, do not show up when
running instead Windows (2003, ...) in the same configured VM.

Addendum to commits ac51557 (r63792) and 33d8a4b (r67218).

Improved fix for the one reported in PR #5406 by contributor 'whindsaks',
as it keeps the separation between the flag that manages the working-around
of the bug, and the other flag that is used for ignoring the genuine next
mouse event that follows mouse-button-down events.
2023-07-16 19:13:14 +02:00