Commit graph

1343 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 17617221ce
[MSCTFIME][SDK][USER32] Add msctfime.ime (stub) (#6141)
## Overview
1. msctfime.ime is an IME file interface
  for new-style IMEs a.k.a. "Text Input
  Processors" (TIPs).
2. msctfime.ime is loaded as old-style
  IME file at ImmLoadLayout in specific
  condition.
3. msctfime.ime communicates with
  the current TIP (This feature is not
  implemented yet).

## Proposed changes
- Add msctfime module at dll/ime/msctfime.
- The functions in this module are currently
  stub.
- Move IME file interface declarations from
  <imm.h> to <ddk/immdev.h>.
- Modify ImmNotifyIME, NotifyIME, and
  ImeProcessKey prototypes for x64
  compliance.
CORE-19360
2023-12-11 22:37:25 +09:00
Katayama Hirofumi MZ 04b1e8945b
[COMCTL32][USER32] ComboBox: Do default processing on WM_SYSKEYDOWN (#6152)
Based on KRosUser's combo.patch. Enable Alt+F4 on ComboBox.
Do default processing on WM_SYSKEYDOWN if necessary.
CORE-18231
2023-12-11 22:04:18 +09:00
Stanislav Motylkov 51f9b86cbc [REACTOS] Omit "aka" for the authors' nicknames
Based on grep query: https://git.reactos.org/?p=reactos.git&a=search&h=c00d41d91c181746563e689d3390228f703053f5&st=grep&s=+%28aka+
Dedicated to Joachim Henze - PR #5978 commit 4c7222bab3.
2023-12-03 22:08:20 +03:00
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
Hermès Bélusca-Maïto 8dd3af6d31
[CONSRV] Mouse 'signal' --> mouse 'event' 2023-07-16 19:12:00 +02:00
Andrei Miloiu 5d8aedf0e3
[USER32] Update Romanian (ro-RO) translation (#5395) 2023-07-03 22:19:43 +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
Doug Lyons 12e1919e5e
[NTGDI][GDI32] Icon fixes for Office 2000, VB6, and Hoyle Cards (#5227)
Many thanks for Simone Lombardo for pointing to the code needing attention
and providing a working proof-of-concept solution.

CORE-12377
CORE-18084
CORE-13889
2023-07-02 13:24:15 +02: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
Hermès Bélusca-Maïto 5cb2b73988
[VIDEOPRT] VideoPortGetAccessRanges: Return ERROR_MORE_DATA if there exist more device access ranges that can be returned than what is specified by NumAccessRanges. 2023-06-28 17:22:01 +02:00
Hermès Bélusca-Maïto 122eaeb6ad
[VIDEOPRT] VideoPortGetAccessRanges: Add doxygen doc, SAL annotations and minor formatting. 2023-06-28 17:22:00 +02:00
Hermès Bélusca-Maïto 61c77d1f87
[XBOXVMP] Real OG XBOX NVidia GPU exposes 3 access ranges, so retrieve them.
CORE-19011

Fix a "bug" I introduced in commit 61012eb54.
VideoPortGetAccessRanges() expects the caller to specify at least the
total number of ranges the hardware exposes, otherwise it fails with
ERROR_MORE_DATA. (Tested also with the help of Windows' videoprt.sys.)

On real original XBOX there are three:
```
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation NV2A [XGPU] [10de:02a0] (rev a1)
    Subsystem: Unknown [0000:0000]
    Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 03
    Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
    Memory at f0000000 (32-bit, prefetchable) [size=128M]
    Memory at 00000000 (32-bit, prefetchable) [size=512K]
```

Thanks to Stanislav and Daniel for tests on the real XBOX.
2023-06-28 17:21:58 +02:00
Hermès Bélusca-Maïto 3121aee56e
[VIDEOPRT] Honour NumAccessRanges == 0 / AccessRanges == NULL in VideoPortVerifyAccessRanges()
These are specified for releasing the hardware resources previously
acquired by either a previous call to VideoPortVerifyAccessRanges()
or a call to VideoPortGetAccessRanges().
2023-06-25 21:25:08 +02:00
Hermès Bélusca-Maïto de6313d89e
[VIDEOPRT] Reformat VideoPortVerifyAccessRanges()
Fix indentation, add SAL annotations and Doxygen description.
2023-06-25 21:25:07 +02:00
Hermès Bélusca-Maïto 7eca194709
[VIDEOPRT] In legacy detection, don't guess the maximum number of buses of a certain type.
Use whatever number there is on the system.
Also ensure that vpStatus is correctly initialized.
2023-06-25 21:25:07 +02:00
Oleg Dubinskiy e7ccb36b9b
[WIN32SS][NTDDRAW] Don't startup DirectX graphics each time on DirectDraw object creation (#5329)
CORE-17561, CORE-17932, CORE-18221

Do it at each system startup instead: Remove old DirectX initialization code.
It's now outdated and not needed anymore.

Previously, the corresponding hackish intEnableReactXDriver() function
did two things: load dxg.sys and enable DirectDraw.
Now loading DirectX graphics is done during WINSRV initialization, and
enabling DirectDraw is called during each (and also first) display mode
switch, as in Windows. As debug analysis proves, there are no any other
calls in NtGdiDdCreateDirectDrawObject, besides the corresponding DXG
function.
2023-06-21 18:03:27 +02:00
Oleg Dubinskiy e034377b51
[WIN32SS][ENG][NTDDRAW] Manage DirectDraw instances when switching display mode (#4519)
CORE-17932

[ENG] Implement DirectDraw management in switch display mode functions
(e.g. resolution change, color depth, display frequency etc.):

- Switch DirectDraw instances between the two PDEVs (the current one and
  the new one allocated by ourselves) by calling dxg!DxDdDynamicModeChange
  function.

- Suspend them before and resume after the display mode switch, by calling
  dxg!DxDdsuspendDirectDraw and dxg!DxDdResumeDirectDraw appropriately.

We currently don't have these functions implemented, but MS DXG has, so
it allows to properly manage DirectDraw PDEVs using this driver, similarly
to Windows.
My analysis confirms that these functions are always called in XP/2k3 on
display mode switch, even when there is no any DirectX app running at the
moment. Analyzing their prototypes show that my guesses are correct.

- Initialize hDev and dhpdev members for EDD_DIRECTDRAW_GLOBAL for newly
  created surfaces, switch them during mode change and re-initialize after
  it also. They are commonly used by DirectDraw stack.
  In addition, enable DirectDraw for old and new PDEVs, by calling
  dxg!DxDdEnableDirectDraw function.


[NTDDRAW] Additionally, fix usage of DirectDraw lock count in the PDEVOBJ
structure.

- Enable cDirectDrawDisableLocks member for storing its value, instead of
  DxDd_nCount, which is marked as ROS-specific.

- Use it in win32k!DxEngGet/SetHdevData for getting/setting DirectDraw
  count appropriately.

My analysis also shows that in Windows, the PDEVOBJ::cDirectDrawDisableLocks
method calls DxEngGetHdevData with type 8, which corresponds to our DxDd_nCount.
So there are no doubts that this member is used there.

- Rename DxEngGetHdevData_dd_count alias of type 8 to DxEngGetHdevData_dd_locks,
  to match more accurately an actual member name. Update the enumeration
  and fix all code parts appropriately.

All these changes allow to properly change display mode during executing
DirectDraw applications, when they try to switch in full-screen mode.
At least a bugcheck that happened before my changes, does no longer appear.

There are still some games that don't run correctly, as if there is no
3D acceleration (which actually exists). This requires further investigations.
2023-06-21 18:00:24 +02:00
Victor Perevertkin 38e4b859e2
[FRAMEBUFACC] Remove the driver
This is an unfinished attempt to rewrite the driver by Magnus Olsen,
dating back to 2007.
2023-06-19 13:58:46 +03:00
Victor Perevertkin cdb130420e
[FRAMEBUF_NEW] Remove the driver
It doesn't seem to be better than the current "framebuf", and has an
unfriendly license (NT4 DDK Sample).
2023-06-19 13:58:46 +03:00
Victor Perevertkin b9b2608bfb
[FRAMEBUF] Return the "old" driver back
It has a better license (GPL) and does not have visible drawbacks
compared to framebuf_new.
2023-06-19 13:58:43 +03:00
Hermès Bélusca-Maïto 61012eb544
[XBOXVMP] Fix in VideoPortGetAccessRanges call: missing Slot parameter.
Contrary to what is (badly) written on MSDN, this parameter is
*mandatory* when the ranges looked for are on a PCI adapter.

Detected when testing with MS Windows' videoprt.sys on XBOX emulator;
thanks to Simone Lombardo for assistance!
2023-06-14 12:10:55 +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
Hermès Bélusca-Maïto 6db0d24fb6
Fix typo "managment" -> "management" in our codebase...
... except for 3rd-party code or "official" names.
2023-06-04 21:39: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
Hermès Bélusca-Maïto 44e1d87596
[USER32] RegisterClassExWOWW/ExA: NULL or IS_ATOM class are treated the same. (#5291)
CORE-18978

Fixes NULL pointer access when e.g. class.lpszClassName == NULL and
the class is registered. The RegisterClass(ExA/W/...) should return 0
instead of throwing an invalid access exception.

However, providing an invalid pointer will trigger a crash.
2023-05-21 19:35:19 +02:00
Hermès Bélusca-Maïto f172f98a10
[USER32] Minor formatting and dead-code removal.
Remove dead code CreateSmallIcon from commit e0968c78 (r18764);
see also b243445c (r60592).
2023-05-21 19:28:53 +02:00
Doug Lyons 8a7b5a9009
[SHELL32][USER32] Fix icon regression and one test (#5207) 2023-05-21 11:18:00 +02: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
Hervé Poussineau 49246541de [WIN32SS:ENG] Do not free LDEV if unloading a driver failed
Currently, LDEVOBJ_bUnloadImage always returns FALSE due to missing functionality in ntoskrnl.
LDEVOBJ_vFreeLDEV contains an assert that driver is correctly unloaded before freeing it.
Prevent this assert by calling LDEVOBJ_vFreeLDEV only if LDEVOBJ_bUnloadImage succeed.

This can be easily triggered if DrvEnableDriver function (called in LDEVOBJ_bEnableDriver) fails.
2023-04-16 19:37:05 +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 8f2c2c1def [COMCTL32][USER32] EDIT: Fix caret position for IME
CORE-11700
2023-04-10 08:27:50 +09: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
Katayama Hirofumi MZ 66c8ded454
[COMCTL32][USER32] EDIT: CompForm and CandForm (#5226)
The changes of this PR are on EDIT controls.
- Delete composition_len and composition_start members.
- Add EDIT_ImmSetCompositionWindow helper function.
- At EDIT_SetCaretPos, set the position of the composition window.
- We don't use internal composition string. Rely on the composition window.
- Improve WM_IME_STARTCOMPOSITION, WM_IME_COMPOSITION and WM_IME_ENDCOMPOSITION message handling.
CORE-11700
2023-04-09 15:19:19 +09:00
Katayama Hirofumi MZ 2b356adbc5
[COMCTL32][USER32] EDIT: WM_SETFONT for IME (#5214)
- Call ImmSetCompositionFontW in WM_SETFONT handling of EDIT controls if necessary.
- If the specified font is NULL, then use DEFAULT_GUI_FONT.
CORE-11700
2023-04-04 19:09:21 +09:00
hpoussin 1bdefebc9e
Enable framebuf_new driver (#4775)
Replace framebuf display driver by framebuf_new display driver
Compile framebuf_new as framebuf.dll, and add it to bootcd/livecd
Remove old framebuf from compilation, to not conflict
2023-04-02 23:33:15 +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
Katayama Hirofumi MZ 6d650bfc8f
[COMCTL32][USER32] WM_IME_CHAR: Rely on DefWindowProc... (#5191)
Use DefWindowProc... for WM_IME_CHAR handling. CORE-15289, CORE-11700
2023-03-27 19:42:47 +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 8d26b03775
[COMCTL32][USER32] EDIT: Half-implement WM_IME_SETCONTEXT handling (#5182)
Add WM_IME_SETCONTEXT handling to the window procedure of the EDIT control. CORE-11700, CORE-15289
2023-03-23 12:24:40 +09:00
Katayama Hirofumi MZ b25daf4b56
[COMCTL32][USER32] EDIT: Half-implement WM_IME_STARTCOMPOSITION (#5183)
Improve WM_IME_STARTCOMPOSITION handling in the window procedure of the EDIT control. CORE-15289, CORE-11700
2023-03-23 12:24:00 +09:00
Katayama Hirofumi MZ be518f9f5a
[COMCTL32][USER32] EDIT: Default processing on WM_IME_SELECT/WM_IME_CONTROL (#5173)
Do default processing on WM_IME_SELECT and WM_IME_CONTROL messages in EDIT controls. CORE-11700, CORE-15289
2023-03-22 09:09:38 +09: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