Commit graph

81183 commits

Author SHA1 Message Date
Mark Jansen bc5603d9d0
[SHELL32] Show properties dialog in a new thread 2022-02-07 20:56:46 +01:00
Mark Jansen 93fac5533d
[SHELL32] ShellExecute: Retry after searching for the file in the SEE_MASK_INVOKEIDLIST case
CORE-18035
2022-02-07 20:56:46 +01:00
Mark Jansen f6f5490ab4
[SHELL32] ShellExecute: Implement SEE_MASK_INVOKEIDLIST
CORE-18035
Also simplify some error handling by using smart pointers
2022-02-07 20:56:21 +01:00
Katayama Hirofumi MZ 1bc9dda5e6
[NTUSER] Rewrite NtUserDestroyInputContext (#4342)
CORE-11700
2022-02-07 10:45:02 +09:00
Hermès Bélusca-Maïto 914f14a8b9
[FREELDR:NTLDR] Adjust some debug traces. RegOpenKey(): demote an ERR to WARN.
CORE-18040
2022-02-07 00:26:30 +01:00
Hermès Bélusca-Maïto f6a13d452c
[FREELDR:NTLDR] Implement support for the SOS option.
CORE-9023, CORE-18033

- Reset the UI to a minimal one in SOS mode.

- In SOS mode, a trace of loaded files is displayed on the screen,
  instead of the usual progress bar.

- Add a callback to the PE loader to notify when imported DLLs are
  loaded for a main image. This allows getting an accurate SOS trace.
2022-02-06 23:53:41 +01:00
Hermès Bélusca-Maïto cfbec70e04
[FREELDR] Use strsafe functions in the PE loader. 2022-02-06 22:20:58 +01:00
Hermès Bélusca-Maïto 313e6b6cbb
[FREELDR:UI] Clean-up when uninitializing the UI.
- If the started OS loader failed and we are back to the OS selection
  menu, re-initialize the UI as the loader may have messed up the display
  in the meantime.

- Tear down allocated off-screen back-buffer when uninitializing the TUI.
- Clear up the screen when initializing the direct-UI.
2022-02-06 22:20:57 +01:00
Hermès Bélusca-Maïto e2daca3f60
[FREELDR:UI] Improve drawing of progress bars, reducing flickering.
- Remove excessive UiDrawBackdrop() calls that caused too many
  unnecessary redraws.

- ProgressBar: Clear only the portions that need to be cleared up.
  This allows to not use DrawBackdrop anymore and the flickering.
2022-02-06 17:52:46 +01:00
Hermès Bélusca-Maïto 9101247366
[FREELDR:UI] Couple of fixes for the ProgressBar functions.
- Fix box size calculations.
- MiniTUI: Distinguish Vista+ vs. NTLDR style progress bar.
2022-02-06 17:52:44 +01:00
Hermès Bélusca-Maïto d749b45e2a
[FREELDR:UI] Cleanup for the ProgressBar functions.
- Remove duplicated code from directui.c and use the one from
  TUI instead, with the latter properly #ifdef'ed for _M_ARM.

- Fix their title color.
- Add SAL annotations.
2022-02-06 17:52:43 +01:00
Hermès Bélusca-Maïto a9994eab45
[FREELDR:UI] Couple of fixes for some TUI Draw*Text functions.
- TuiDrawCenteredText: Partly fix centering calculations (susceptible
  to give negative coordinates).

- TuiDrawText2: Don't display anything if X or Y are out of the screen.
2022-02-06 17:52:42 +01:00
Hermès Bélusca-Maïto f6a2438c1f
[FREELDR:UI] Cleanup for the DrawText* functions.
- Remove duplicated code from directui.c and use the one from
  TUI instead, with the latter properly #ifdef'ed for _M_ARM.

- Provide the minimal implementations for NoUiDrawText*().
- TuiDrawText() is just a particular case of TuiDrawText2().

- Isolate the TuiPrintf() and TuiDraw*Text*() functions as separate
  "Generic TUI utils".

- Fix "TAG_TAG" typo in TAG_TAG_TUI_PALETTE.
- Add SAL annotations.
2022-02-06 17:52:40 +01:00
Hermès Bélusca-Maïto 06fc2e72a6
[FREELDR:UI] Disable GUI code from compilation as it is currently stubbed.
Rename "ShowGui" -> "ShowUi" as this variable was actually unrelated
to *graphical* aspects of the UI.
2022-02-06 17:52:39 +01:00
Hermès Bélusca-Maïto 844c9dce6c
[FREELDR:UI] Code formatting only. 2022-02-06 17:52:38 +01:00
Eric Kohl 942e79963a [SCHEDSVC] This is a shared process service too 2022-02-06 16:56:43 +01:00
Eric Kohl b76d49bcaa [SYSSETUP] Disable debug messages on the process page 2022-02-06 16:30:53 +01:00
Katayama Hirofumi MZ f2c3167db3
[NTUSER] Implement NtUserAssociateInputContext (#4334)
- Add IntReAllocatePoolWithTag function in window.c.
- Define WINDOWLIST structure in "window.h".
- Add IntBuildHwndList and IntFreeHwndList helper functions in window.c.
- Add IntAssociateInputContext and IntAssociateInputContextEx helper functions in ime.c.
- Implement NtUserAssociateInputContext function.
CORE-11700
2022-02-05 20:23:57 +09:00
Joachim Henze bf16435303 [WIN32SS] Remove an ambiguous assert entirely CORE-16738
It popped up very reliably when performing git-clone of the ros sources
while having the taskmgr open in the processes-tab.
Or when building 'ninja bootcd -j1' while having the taskmgr open in the processes-tab.

It is always possible to ignore it and then continue using ros for days without
noticing any side effects.
James Tabor judged the assert to have a "questionable logic".
Giannis who once added it, was also 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.

It was commented out already on 2020-04-21 via
0.4.14-dev-1519-g 87f6c82d85
2022-02-05 01:06:15 +01:00
Hermès Bélusca-Maïto f79c02bd8a
[CONSRV] Introduce a CON_SET_OUTPUT_CP() macro to simplify setting the console's output CP + associated changes. Simplify ConDrvSetConsoleCP() as well. 2022-02-04 21:35:15 +01:00
Mark Jansen f80de47c85 [SHELL32_APITEST] ShellExecuteEx: Add test for 'properties' verb
CORE-18035
2022-02-03 21:50:34 +01:00
Mark Jansen d40d642f03 [PSDK] Add some parameter names 2022-02-03 21:50:34 +01:00
Serge Gautherie 1944d7b71b [KERNEL32] HeapCreateTagsW(): Sync' types and add annotations
See RtlCreateTagHeap().
2022-02-03 20:21:40 +01:00
Serge Gautherie 25bff3a1e0 [NDK][NTDLL][RTL] RtlCreateTagHeap(): Fix types and annotations
According to
https://processhacker.sourceforge.io/doc/ntrtl_8h.html
2022-02-03 20:21:40 +01:00
Katayama Hirofumi MZ 0519ae0ac5
[NTUSER] Half-implement NtUserSetImeOwnerWindow (#4332)
- Add some code to NtUserSetImeOwnerWindow function.
- Add IntGetTopLevelWindow helper function.
CORE-11700
2022-02-03 13:39:15 +09:00
George Bișoc 8bd980e483
[NTOS:CC] Unintialize private cache maps before purging the cache section
Before purging the data cache of a certain section of a file from system cache, we have to unintialize the private cache maps of that section if a filesystem or any other component prompts the kernel to do so.
2022-02-02 17:45:59 +01:00
Katayama Hirofumi MZ 8c6dcdcf81
[USER32] Implement ImeWnd_OnImeSetContext (#4329)
- Modify NtUserSetImeOwnerWindow prototype.
- Add User32GetTopLevelWindow function.
- Add ImeWnd_OnImeSetContext function.
- Implement WM_IME_SETCONTEXT message handling of the IME window.
CORE-11700
2022-02-02 11:58:31 +09:00
Katayama Hirofumi MZ 470aa27610
[NTUSER] Move IMM-related code to ime.c (#4322)
Move the IMM-related code from ntstubs.c into ime.c.
CORE-11700
2022-02-02 11:56:40 +09:00
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
Joachim Henze cacb2db2f3 [TAPIUI] Fix es-ES.rc MSVC warning RC4206 : title string too long; truncated at 256 CORE-18034
An addendum to 0.4.15-dev-257-g 546862babc which was (#2667)

Thanks for the shortened translation, provided by Vic Marcal and julenuri.
2022-01-30 17:20:57 +01:00
Katayama Hirofumi MZ 0839711566
[MSPAINT] Improve Undo/Redo and finishing tool (#4324)
- Fix Undo/Redo mechanism.
- Finish drawing when the tool is to be chanaged and when the file is to be saved.
- Add ToolBase::OnFinishDraw to virtualize finishing drawing.
- Extend bClearRedo parameter to ImageModel::Undo.
- Add ImageModel::DrawSelectionBackground and ImageModel::DeleteSelection methods.
- Fix some WM_PAINT message handling.
CORE-17969
2022-01-30 12:05:23 +09:00
Hermès Bélusca-Maïto c5b029d0fc
[BOOTDATA] "open" actions for 'msstylesfile' and 'themefile' should be REG_EXPAND_SZ since they contain unexpanded environment variables. 2022-01-30 03:51:34 +01:00
Hermès Bélusca-Maïto 4929d8ddb8
[BOOTDATA] Add missing quotes around %1 for the 'cplfile' Control_RunDLL command line.
Suppose you copy a CPL file (e.g. console.dll renamed into console.cpl)
into a path containing spaces, for example into the Desktop:

  C:\Documents and Settings\Administrator\Desktop\console.cpl

If the shell registry value for the "open" action of 'cplfile' does not
contain quotes around %1, then the Control_RunDLL function will attempt
to load "C:\Documents" as a file, which of course does not exist.

(NOTE: Missing in ReactOS: Doing a PathFindOnPath() or a PathFileExists()
call to verify that the file actually exists, instead of blindly trying
to run it and failing later in kernel32!LoadExecuteExW ...)

Adding quotes around the %1 fixes this and the correct file is being
loaded.

This behaviour has been confirmed to exist e.g. on Windows Server 2003
too (and is thus *NOT* a bug in ReactOS/Wine's Control_RunDLL
implementation).

----------------------

How to confirm this behaviour, in Win2k3 x86:

1. Start Win2k3 in debug mode under WinDbg. Ensure you have the debug
   symbols available.

2. Once loaded, break into the debugger, attach context to explorer.exe,
   and enter the magical :) single WinDbg command (all in one line, with
   **NO inserted newlines!!**):

bp shell32!CPL_RunMeBaby ".echo \"CPL CmdLine:\"; ?? (wchar_t*)*(void**)(@esp+12);
  bp SHLWAPI!PathIsFileSpecW \".echo \\\"CPL Path:\\\"; ?? (wchar_t*)*(void**)(@esp+4);
  bc \\\"SHLWAPI!PathIsFileSpecW\\\"; g;\"; g"

(Explanation:
a breakpoint is placed in the internal shell32!CPL_RunMeBaby function.
When the bp is hit, it runs the large WinDbg command inside the quotes.
This command echoes an informative line, then dumps the 3rd parameter
of the function on the stack that contains the CPL command-line.
It then adds a new breakpoint in SHLWAPI!PathIsFileSpecW, which is the
function that is being called *just after* the internal parsing of the
CPL command-line, and will verify whether the extracted CPL path does
exist. That new breakpoint in turn will run a WinDbg command that will:
(i) Display the CPL file path (1st-param of that new function), then
(ii) Clear that breakpoint.  Finally, automatic continuation ensues.)

3. On vanilla Win2k3, whose 'cplfile' "open" action does contain the
   quotes around %1:
     rundll32.exe shell32.dll,Control_RunDLL "%1",%*

   you will observe the following:

CPL CmdLine:
wchar_t * 0x00094e30
 ""C:\Documents and Settings\Administrator\Desktop\console.cpl","
CPL Path:
wchar_t * 0x0007f898
 "C:\Documents and Settings\Administrator\Desktop\console.cpl"

Notice the extra pair of quotes around the CPL filename in the CmdLine.

4. When modifying the 'cplfile' "open" action by *removing* the quotes
   around %1, you will instead see the following, thereby confirming
   the behaviour, which is now identical to what used to happen in ROS:

CPL CmdLine:
wchar_t * 0x00094e30
 "C:\Documents and Settings\Administrator\Desktop\console.cpl,"
CPL Path:
wchar_t * 0x0007f898
 "C:\Documents"

Due to the (now) absence of quotes around %1, the command-line gets
wrongly parsed and the extracted file path is incorrect.
2022-01-30 03:51:33 +01: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 4fe4a57889
[PSDK] commctrl.h: Add missing 'U' unsigned indicators. 2022-01-30 01:02:12 +01:00
Hermès Bélusca-Maïto 38f6fd9df7
[CONSOLE.CPL] Fix problems detected by code analysis.
colors.c(129): warning C6287: Redundant code: the left and right sub-expressions are identical.

colors.c(159): warning C6001: Using uninitialized memory 'colorIndex'.
colors.c(180): warning C6385: Reading invalid data from 'ConInfo->ColorTable': the readable size is '64' bytes, but '259696' bytes may be read.
(I thank ThFabba for the suggestion fix.)

console.c(313): warning C6387: 'ConInfo->hWnd' could be '0': this does not adhere to the specification for the function 'SendMessageW'.

font.c(60): warning C6387: 'Preview->hFont' could be '0': this does not adhere to the specification for the function 'GetFontCellSize'.
font.c(230): warning C6001: Using uninitialized memory 'szFontSize'.
font.c(230): warning C6054: String 'szFontSize' might not be zero-terminated.
font.c(671): warning C6387: 'hFont' could be '0': this does not adhere to the specification for the function 'GetFontCellSize'.

layout.c(502): warning C6387: 'FontPreview.hFont' could be '0': this does not adhere to the specification for the function 'SelectObject'.
2022-01-30 01:02:10 +01: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 2a5536c540
[CONSOLE.CPL] Rewrite the BuildCodePageList() registry enumeration loop and use far less stack space.
Any valid code page value name in System\CurrentControlSet\Control\Nls\CodePage
is a string representation of its corresponding decimal value, that
cannot be larger than MAXUSHORT == 65535, i.e. longer than 5+1
characters.

Noticed with the analyser warning
dll\cpl\console\options.c(74): warning C6262: Function uses '32808' bytes
of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap.

Make the enumeration loop actually stop when ERROR_NO_MORE_ITEMS is
returned. If we got another error, e.g. because the value name was
too long (and thus, an invalid code page), just ignore and continue
looping.
2022-01-30 01:02:08 +01:00
Hermès Bélusca-Maïto 13b3425369
[CONSOLE.CPL] Use fallback brushes for text preview in case CreateSolidBrush() fails (e.g. low memory scenario). 2022-01-30 01:02:07 +01:00
Hermès Bélusca-Maïto 0e5496d082
[CONSOLE.CPL] Add missing/fix some SendMessageW result casts. 2022-01-30 01:02:06 +01:00
Hermès Bélusca-Maïto 446eb60937
[CONSOLE.CPL] Update faces/fonts list on Fonts page activation, when the current code page has changed. 2022-01-30 01:02:05 +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
Victor Perevertkin e1cda2fb9e
[WDMAUD.DRV] Enable the module for amd64 architecture 2022-01-29 12:28:55 +03: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