Commit graph

83170 commits

Author SHA1 Message Date
Katayama Hirofumi MZ c766ee9ebb
[NETSHELL] Shrink radio buttons vertically (#5157)
- Fix the visual glitch of the network settings dialog of 2nd setup.
- Shrink the IDC_NETWORK_TYPICAL and IDC_NETWORK_CUSTOM radio buttons of IDD_NETWORKSETTINGSPAGE resource dialog vertically not to be overlapped.
CORE-18874
2023-03-14 07:03:54 +09:00
Joachim Henze 2aea4ab945 [NTUSER] Scrollbar.c pure whitespace fixes
The scrollbar code is now finally in a good shape.
Therefore I will port the current state back today,
and for that I want to have the formatting in good shape.

No functional changes!
2023-03-12 10:34:50 +01:00
Katayama Hirofumi MZ b9ef348ab0
[NTUSER][USER32] KLF_SETFORPROCESS for ActivateKeyboardLayout (#5126)
Supporting KLF_SETFORPROCESS flag in ActivateKeyboardLayout function.

Implement KLF_SETFORPROCESS for co_UserActivateKeyboardLayout.
Use KLF_SETFORPROCESS flag in WM_INPUTLANGCHANGEREQUEST handling.
Add co_IntSetKeyboardLayoutForProcess helper function.
2023-03-12 13:39:41 +09:00
Hermès Bélusca-Maïto ab92e40317
[NTOS:KD] Remove unneeded 'extern' declaration. Addendum to commit 4ce819ca. 2023-03-12 02:17:15 +01:00
Hermès Bélusca-Maïto 372eb0c0b8
[NTOS:KDBG] Remove dead code. Addendum to baa47fa5e and fe777bb52. 2023-03-12 02:16:58 +01:00
Katayama Hirofumi MZ d0ab35e9da
[NOTEPAD] Refactor around _tWinMain (#5135)
- Add hInstance parameter to NOTEPAD_InitData.
- Move some code in _tWinMain into NOTEPAD_InitData.
- Move some code in _tWinMain into WM_CREATE handling.
- Move some code in WM_CLOSE handling into WM_DESTROY handling.
- Fix the exit code of _tWinMain.
CORE-18837
2023-03-12 08:26:33 +09:00
Katayama Hirofumi MZ 3b0791547f [NOTEPAD] Move the printing code to the newly added printing.c
CORE-18837
2023-03-12 07:51:53 +09:00
Katayama Hirofumi MZ 072503c1fc
[NOTEPAD] Add 'Now-printing' dialog (#5127)
Allow the user to cancel the print job.
- Add DIALOG_PRINTING dialog.
- Make the print job another thread.
- Let the thread communicate with the dialog box by PRINTING_MESSAGE.
- Add some resource strings.
CORE-18837
2023-03-11 22:23:14 +09:00
Katayama Hirofumi MZ b49b47fc84 [MSPAINT] Delete unused HWND hToolBtn[16] global variable
CORE-18867
2023-03-11 14:19:12 +09:00
Katayama Hirofumi MZ 9ff9295a22
[MSPAINT] Remember status bar visibility (#5145)
- Add ShowStatusBar registry setting.
- Save ShowStatusBar status and restore the status on startup.
CORE-18867
2023-03-11 11:41:52 +09:00
Hermès Bélusca-Maïto 4ce819ca5a
[NTOS:KD][KDBG] Rework the BootPhase >= 2 initialization of the KD/KDBG kernel debugger. (#4892)
CORE-17470

+ KdpDebugLogInit: Add resources cleanup in failure code paths.

Fix, in an NT-compatible manner, how (and when) the KD/KDBG BootPhase >=2
initialization steps are performed.
These are necessary for any functionality KDBG needs, that would depend
on the NT I/O Manager and the storage and filesystem stacks to be running.
This includes, creating the debug log file, and for KDBG, loading its
KDBinit initialization file.

As a result, file debug logging is fixed.

The old ReactOS-specific (NT-incompatible) callback we did in the middle
of IoInitSystem() is removed, in favor of a runtime mechanism that should
work on Windows as well.

The idea for this new mechanism is loosely inspired by the TDL4 rootkit,
see http://blog.w4kfu.com/public/tdl4_article/draft_tdl4article.html
but contrary to it, a specific hook is used instead, as well as the
technique of driver reinitialization:
https://web.archive.org/web/20211021050515/https://driverentry.com.br/en/blog/?p=261

Its rationale is as follows:

We want to be able to perform I/O-related initialization (starting a
logger thread for file log debugging, loading KDBinit file for KDBG,
etc.). A good place for this would be as early as possible, once the
I/O Manager has started the storage and the boot filesystem drivers.

Here is an overview of the initialization steps of the NT Kernel and
Executive:
----
KiSystemStartup(KeLoaderBlock)
    if (Cpu == 0) KdInitSystem(0, KeLoaderBlock);
    KiSwitchToBootStack() -> KiSystemStartupBootStack()
    -> KiInitializeKernel() -> ExpInitializeExecutive(Cpu, KeLoaderBlock)

(NOTE: Any unexpected debugger break will call KdInitSystem(0, NULL); )
KdInitSystem(0, LoaderBlock) -> KdDebuggerInitialize0(LoaderBlock);

ExpInitializeExecutive(Cpu == 0):    ExpInitializationPhase = 0;
    HalInitSystem(0, KeLoaderBlock); <-- Sets HalInitPnpDriver callback.
    ...
    PsInitSystem(LoaderBlock)
        PsCreateSystemThread(Phase1Initialization)

Phase1Initialization(Discard):       ExpInitializationPhase = 1;
    HalInitSystem(1, KeLoaderBlock);
    ...
    Early initialization of Ob, Ex, Ke.
    KdInitSystem(1, KeLoaderBlock);
    ...
    KdDebuggerInitialize1(LoaderBlock);
    ...
    IoInitSystem(LoaderBlock);
    ...
----
As we can see, KdDebuggerInitialize1() is the last KD initialization
routine the kernel calls, and is called *before* the I/O Manager starts.
Thus, direct Nt/ZwCreateFile ... calls done there would fail. Also,
we want to do the I/O initialization as soon as possible. There does
not seem to be any exported way to be notified about the I/O manager
initialization steps... that is, unless we somehow become a driver and
insert ourselves in the flow!

Since we are not a regular driver, we need to invoke IoCreateDriver()
to create one. However, remember that we are currently running *before*
IoInitSystem(), the I/O subsystem is not initialized yet. Due to this,
calling IoCreateDriver(), much like any other IO functions, would lead
to a crash, because it calls
ObCreateObject(..., IoDriverObjectType, ...), and IoDriverObjectType
is non-initialized yet (it's NULL).

The chosen solution is to hook a "known" exported callback: namely, the
HalInitPnpDriver() callback (it initializes the "HAL Root Bus Driver").
It is set very early on by the HAL via the HalInitSystem(0, ...) call,
and is called early on by IoInitSystem() before any driver is loaded,
but after the I/O Manager has been minimally set up so that new drivers
can be created.
When the hook: KdpInitDriver() is called, we create our driver with
IoCreateDriver(), specifying its entrypoint KdpDriverEntry(), then
restore and call the original HalInitPnpDriver() callback.

Another possible unexplored alternative, could be to insert ourselves
in the KeLoaderBlock->LoadOrderListHead boot modules list, or in the
KeLoaderBlock->BootDriverListHead boot-driver list. (Note that while
we may be able to do this, because boot-drivers are resident in memory,
much like we are, we cannot insert ourselves in the system-driver list
however, since those drivers are expected to come from PE image files.)

Once the KdpDriverEntry() driver entrypoint is called, we register
KdpDriverReinit() for re-initialization with the I/O Manager, in order
to provide more initialization points. KdpDriverReinit() calls the KD
providers at BootPhase >= 2, and schedules further reinitializations
(at most 3 more) if any of the providers request so.
2023-03-11 01:22:19 +01:00
Hervé Poussineau bf734e5373
[NTOS:KD] Move handling of Dmesg buffer from screen provider to KDBG provider. (#5143)
CORE-10749

The dmesg command is now available even if screen output is disabled.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2023-03-10 23:59:08 +01:00
Katayama Hirofumi MZ 86e2f9e635
[MSPAINT] There were two "main" windows (#5147)
Our mspaint had two windows of window class "MainWindow".
class CToolBox should inherit CWindowImpl<CToolBox> instead of CWindowImpl<CMainWindow>.
CORE-18867
2023-03-11 07:42:04 +09:00
Joachim Henze 784946db8c [SYSSETUP] Tweak resources CORE-18870
de-DE: Harmonize the length of IDC_COMPUTERNAME with IDC_ADMINPASSWORD1 and IDC_ADMINPASSWORD2
which looks better and is already done like that in en-US.

de-DE: Also harmonize some 2nd stage captions. Some were named "Setup" and some were
named "Installation". I harmonized to "Setup" everywhere as that is what is also used in
1st stage, is shorter and no german person will have any issue understanding
that. It is also more likely to be kept in sync in the future if new dlgs would
be added, as it is the same word as used in en-US.

de-DE: Align the IDC_PROJECTS with the GPL button (which is slightly more wide in de-DE).

All languages:
Use same width for IDC_PRODUCT_OPTIONS as for IDC_PRODUCT_DESCRIPTION.
2023-03-10 21:36:46 +01:00
Hermès Bélusca-Maïto dfb6996b45
[NTOS:KDBG] Split KdbInitialize into KdbSymInit and KDBG initialization proper.
- KdbSymInit() in kdb_symbols.c only initializes symbols implementation
  support.
- The rest of KdbInitialize gets moved into kdb_cli.c and initializes
  the KDBG debugger itself.
- Move KdbDebugPrint to kdb_cli.c as well.
2023-03-10 20:56:21 +01:00
Joachim Henze 793e9f20ef [DXDIAG] Fix text truncation on button for french fr-FR.rc CORE-18853
By shortening the text to what MS Windows uses there.
See the 2k3sp2 pic in the ticket.
2023-03-10 18:03:02 +01:00
Katayama Hirofumi MZ 02c647802f
[MSPAINT] Fix use of uninitialized variable on startup (#5140)
There was an exception in starting up of mspaint of Visual Studio 2019 build. CORE-18594, CORE-18867
2023-03-10 07:31:31 +09:00
Joachim Henze 29d0deef13
[DXDIAG] Fix text truncation german de-DE.rc CORE-18853 (#5137) 2023-03-09 23:27:49 +01:00
Katayama Hirofumi MZ 87e905ecd8
[NOTEPAD] Use Globals.hMainWnd in ShowLastError (#5132)
Improving UI/UX by making Globals.hMainWnd the owner of the message box. CORE-18837
2023-03-10 07:25:06 +09:00
Hermès Bélusca-Maïto a49732e5b6
[NTOS:KD] KdpDebugLogInit: Fix ZwCreateFile flags for appending to debug logging file.
However, ReactOS currently doesn't handle FILE_APPEND_DATA correctly,
so temporarily add a hack for fixing its support.

CORE-18789
2023-03-09 18:59:16 +01:00
Hermès Bélusca-Maïto a8b09eddc4
[NTOS:KD] Add some annotations. 2023-03-09 18:32:36 +01:00
Hermès Bélusca-Maïto cee893be99
[NTOS:KD] Simplify min-values calculations in KdpPrintToLogFile and KdpScreenPrint. 2023-03-09 18:26:53 +01:00
Hermès Bélusca-Maïto 4585372c6d
[NTOS:IO/KD/KDBG] Formatting fixes only. 2023-03-09 18:26:02 +01:00
Ratin Gao df7ab5d8f7
[KERNEL32] Remove a pointless SEH in VirtualAllocEx (#5117)
Win2K3 just wraps in SEH only this syscall, which appears pointless
and was removed since NT6.0. We remove it too as an experiment.
Revert the change that added SEH here from commit 6d97180 (r52899).
2023-03-09 17:08:08 +01:00
Katayama Hirofumi MZ 139809b747
[NOTEPAD] Use DestroyIcon instead of DeleteObject to destroy icon (#5130)
CORE-18837
2023-03-09 08:24:19 +09:00
Katayama Hirofumi MZ bc89074cd5
[NOTEPAD] Remove some needless type casts (#5134)
CORE-18837
2023-03-09 08:23:08 +09:00
Hermès Bélusca-Maïto abece16776
[WORDPAD][WRITE] Remove redundant pragma code_page(65001)...
... since this is done in the main RC file, from which the per-language
resource files are included.
2023-03-09 00:13:59 +01:00
Doug Lyons 2f43d9c183
[MSAFD] Work around regression of CORE-18848 from 0.4.12-dev-693-g2b1f6c8 (#5102)
Fix winetest for ws2_32:sock that crashes on 'test_AcceptEX' by modifying return values of WSPIoctl for 'case SIO_GET_EXTENSION_FUNCTION_POINTER'
2023-03-08 21:47:45 +01:00
Mark Jansen 5bc045c041
[SDK:SCRNSAVE] Implement mouse move threshold.
This makes it easier to start the screensavers by double-clicking.
2023-03-08 20:19:19 +01:00
Katayama Hirofumi MZ f91b92c3f9
[NOTEPAD] Delete main.h (#5133)
Reduce files to improve readability. Move the codes in main.h into notepad.h. Make the size of Globals.szFilter 512.
CORE-18837
2023-03-09 03:41:11 +09:00
Katayama Hirofumi MZ 9ac20a7fe2
[NOTEPAD] Reduce lines in and around comments (#5131)
Reduce lines. CORE-18837
2023-03-09 03:11:57 +09:00
Thomas Faber 8e0c920fd2
[WINESYNC] user32/edit: Allow buffer access after EM_GETHANDLE.
wine commit id f62d8dc58fb3fb5f11a8ab55620ab9b2fbdaf967 by Nikolay Sivov <nsivov@codeweavers.com>
2023-03-07 21:48:06 -05:00
Thomas Faber 1ee9ea4518
[REGEDIT] Avoid buffer overflow in SelectNode. CORE-18602 2023-03-07 19:43:57 -05:00
Thomas Faber 910822b8f5
[REGEDIT] Add back import prompt message lost during Wine sync. CORE-18770 2023-03-07 19:41:51 -05:00
George Bișoc 8b75dce45a
[NTOS:SE][FORMATTING] Fix the file header
This fixes the copyright file header at the top of the file, reflecting
the Coding Style rules. No code changes!
2023-03-07 18:39:46 +01:00
George Bișoc b284e82f47
[NTOS:SE] Do not allocate memory pool just for the access rights
Access check is an expensive operation, that is, whenever an access to an
object is performed an access check has to be done to ensure the access
can be allowed to the calling thread who attempts to access such object.

Currently SepAnalyzeAcesFromDacl allocates a block of pool memory for
access check rights, nagging the Memory Manager like a desperate naughty
creep. So instead initialize the access rights as a simple variable in
SepAccessCheck and pass it out as an address to SepAnalyzeAcesFromDacl so
that the function will fill it up with access rights. This helps with
performance, avoiding wasting a few bits of memory just to hold these
access rights.

In addition to that, add a few asserts and fix the copyright header on
both se.h and accesschk.c, to reflect the Coding Style rules.
2023-03-07 17:50:39 +01:00
Katayama Hirofumi MZ 064ac123d1
[NOTEPAD] Improve printing (header/footer/tabs/performance) (#5111)
- Fix GetPrintingRect function.
- Add DrawHeaderOrFooter, DoPrintBody, DoPrintPage, DoCreatePrintFonts, and DoPrintDocument helper functions.
- Implement page header/footer and tabs printing in DIALOG_FilePrint function.
- Improve printing performance.
- Modify the header/footer resource strings.
- Delete the needless resource strings.
CORE-18837
2023-03-07 14:42:27 +09:00
George Bișoc a804ba3200
[NTOS:SE] Print debug output only if NDEBUG is not defined
This mutes a lot of debug spam that fills up the debugger when an access
check fails because a requestor doesn't have enough privileges to access
an object.
2023-03-06 20:03:44 +01:00
Doug Lyons b0a03a7caa
[WS2_32] Fix Two DPRINT typo errors (#5113) 2023-03-06 12:22:28 +01:00
Katayama Hirofumi MZ fdedc549d0 [MSVCRT] Follow-up of Follow-up of #5032 (f172503)
Fix for system/_wsystem.
Use _set_errno(ENOMEM) for malloc failure.
Rename status variable as exit_code.
2023-03-05 23:28:00 +09:00
Katayama Hirofumi MZ 5a7dbd6064 [MSVCRT] Follow-up of #5032 (f172503)
Use _cwait() instead of WaitForSingleObject and GetExitCodeProcess.
Use malloc/free instead of LocalAlloc/LocalFree.
2023-03-05 23:20:12 +09:00
Katayama Hirofumi MZ f172503d57
[MSVCRT][CRT_APITEST] Implement _wsystem (#5032)
Implement _wsystem(), by referring system().
Improve system().
Use WaitForSingleObject in system() and _wsystem().
Check existence of COMSPEC.
Thanks ChatGPT.
2023-03-05 21:01:14 +09:00
Atharva Kulkarni 72974d2bac
[MSPAINT] Treat as a file even if the bitmap file is empty
CORE-18508
2023-03-05 20:53:38 +09:00
Katayama Hirofumi MZ 77e6348f5f
[NTUSER][USER32] Refactor NtUserLoadKeyboardLayoutEx (#5107)
- Split some code of NtUserLoadKeyboardLayoutEx to newly-added co_IntLoadKeyboardLayoutEx helper function.
- Modify NtUserLoadKeyboardLayoutEx prototype.
- Move co_UserImmLoadLayout code.
- Implement KLF_REORDER.
- Rename UserLoadKbdLayout as co_UserLoadKbdLayout.
- Improve LoadKeyboardLayoutEx.
CORE-11700
2023-03-05 11:41:32 +09:00
Joachim Henze 0fb580a855
[SDK] Improve gen_baseaddress.py and its output files (#4964)
* [SDK:TOOLS] Improve gen_baseaddress.py

Adds some kbd layout modules into the excludes-section:
that we do lack for todays master: e.g._ kbdeo, kbdsf, kbdrost

and also some that we lacked in the past
(for improving backwards compatibility of the script to older rls-branches):
kbdgm, kbdes, kbdgrist, kbdja, kbdko, kbdsk, kbdsk1

* [SDK:CMAKE] Highlight in the output files where the script does misbehave
2023-03-04 11:45:06 +01:00
Carlo Bramini 6d57c6c91c [CMDUTILS] Add Italian (it-IT) translation for WHERE command 2023-03-01 22:05:04 +01:00
Katayama Hirofumi MZ f8c7bd6898
[NOTEPAD] Don't reset Find/Replace if lpstrFindWhat is set (#5104)
We don't want to reset the status of the checkboxes even if the Find/Replace dialog was closed. If lpstrFindWhat is set, do not reset the Find/Replace settings at DIALOG_SearchDialog. CORE-18837
2023-03-01 20:17:27 +09:00
Katayama Hirofumi MZ 8c7233e015
[NOTEPAD] Fix NOTEPAD_FindTextAt (#5103)
The whole-word search of Notepad had a bug around punctuation. For example, the text "Windows" didn't match in the text "MS-DOS,Windows,ReactOS". Use _istalnum instead of _istspace. Fix the position to check. _istalnum matches an alphabet letter or numeric digit. CORE-18837
2023-03-01 19:57:10 +09:00
Katayama Hirofumi MZ 55e3feba53
[NOTEPAD] Shift+F3 for backward search (#5101)
- Add Shift+F3 accelerator as command CMD_SEARCH_PREV.
- Extend DIALOG_SearchNext function with bDown argument for the action of CMD_SEARCH_PREV.
- Modify the message loop for effective F3 key on Find/Replace dialog.
CORE-17064
2023-03-01 07:16:28 +09:00
Joachim Henze a9b1e059f4
[RAPPS] Style-addendum, no functional change (#5091)
* Just rename the 4 new files. Absolutely no other change.
* CMakeLists.txt, adapt the filenames
* Adapt all includes to make it compile
* CApplicationDB->CAppDB
* CApplicationInfo->CAppInfo
* Follow Mark Jansens good example and antipad the headers
2023-02-28 01:00:29 +01:00