reactos.git
13 months ago[WS2_32_APITEST] Add a test for recv overread. CORE-18328
Thomas Faber [Sun, 19 Mar 2023 13:26:24 +0000 (09:26 -0400)]
[WS2_32_APITEST] Add a test for recv overread. CORE-18328

13 months ago[MSPAINT] Make sizeboxes window-less (#5166)
Katayama Hirofumi MZ [Sun, 19 Mar 2023 01:42:10 +0000 (10:42 +0900)]
[MSPAINT] Make sizeboxes window-less (#5166)

Reduce window controls and integrate to the canvas window.
- The sizeboxes are absorbed by canvasWindow.
- class CSizeboxWindow is deleted.
- Add enum CANVAS_HITTEST.
- Add getSizeBoxRect, getSizeBoxHitTest, and drawSizeBoxes helper functions in sizebox.cpp.
CORE-18867

13 months ago[FREELDR] Move platform-specific build targets into dedicated .cmake files. (#5141) 5141/head
Hermès Bélusca-Maïto [Thu, 9 Mar 2023 16:30:34 +0000 (17:30 +0100)]
[FREELDR] Move platform-specific build targets into dedicated .cmake files. (#5141)

- Keep the common definitions and file lists in CMakeLists.txt
- Move PC-AT & compatibles (PC-98, XBOX) definitions in pcat.cmake
- Future UEFI-specific definitions will be in an uefi.cmake

13 months ago[FREELDR] Move common x64 runtime-specific ASM helpers to a misc file.
Hermès Bélusca-Maïto [Thu, 9 Mar 2023 16:26:38 +0000 (17:26 +0100)]
[FREELDR] Move common x64 runtime-specific ASM helpers to a misc file.

Co-authored-by: Justin Miller <justinmiller100@gmail.com>
13 months ago[DDK:NDIS] Fix definition of broadcast address macro (#5155)
Dmitry Borisov [Sat, 18 Mar 2023 15:57:52 +0000 (21:57 +0600)]
[DDK:NDIS] Fix definition of broadcast address macro (#5155)

ff:ff:ff:ff:ff:ff is the broadcast MAC address.

CORE-8724

13 months ago[MSPAINT] Save ToolBox visibility (#5167)
Katayama Hirofumi MZ [Sat, 18 Mar 2023 08:19:56 +0000 (17:19 +0900)]
[MSPAINT] Save ToolBox visibility (#5167)

According to my registry analysis, the target value is HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Paint\General-Bar3:Visible.
- Add ShowToolBox registry setting.
CORE-18867

13 months ago[MSPAINT] Save paletteWindow visibility (#5167)
Katayama Hirofumi MZ [Sat, 18 Mar 2023 08:12:28 +0000 (17:12 +0900)]
[MSPAINT] Save paletteWindow visibility (#5167)

According to my registry analysis, HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\General-Bar4:Visible is the target value.
- Improve ReadDWORD helper function.
- Add ShowPalette registry setting.
- Simplify RegistrySettings::Load and RegistrySettings::Store.
CORE-18867

13 months ago[NTOS:KD] Improve the display of the output providers' signons.
Hermès Bélusca-Maïto [Tue, 14 Mar 2023 17:50:30 +0000 (18:50 +0100)]
[NTOS:KD] Improve the display of the output providers' signons.

13 months ago[NTOS:MM] Simplify definitions of MM_SYSLDR_NO_IMPORTS and MM_SYSLDR_BOOT_LOADED.
Hermès Bélusca-Maïto [Wed, 15 Mar 2023 19:31:28 +0000 (20:31 +0100)]
[NTOS:MM] Simplify definitions of MM_SYSLDR_NO_IMPORTS and MM_SYSLDR_BOOT_LOADED.

13 months ago[SDK] driverspecs.h: Add missing dummy _IRQL_limited_to_() definition (when _PREFAST_...
Hermès Bélusca-Maïto [Sat, 18 Mar 2023 02:06:54 +0000 (03:06 +0100)]
[SDK] driverspecs.h: Add missing dummy _IRQL_limited_to_() definition (when _PREFAST_ is not defined).

Addendum to commit 8a688204.

13 months ago[MSPAINT] Encapsulation: hNontranspIcon and hTranspIcon
Katayama Hirofumi MZ [Fri, 17 Mar 2023 23:24:19 +0000 (08:24 +0900)]
[MSPAINT] Encapsulation: hNontranspIcon and hTranspIcon

CORE-18867

13 months ago[MSPAINT] Encapsulation: hCurFill, hCurColor etc.
Katayama Hirofumi MZ [Fri, 17 Mar 2023 23:09:26 +0000 (08:09 +0900)]
[MSPAINT] Encapsulation: hCurFill, hCurColor etc.

CORE-18867

13 months ago[MSPAINT] Add Static Edge to toolbars
Katayama Hirofumi MZ [Fri, 17 Mar 2023 10:18:07 +0000 (19:18 +0900)]
[MSPAINT] Add Static Edge to toolbars

- Add WS_EX_STATICEDGE to paletteWindow.
- Remove CCS_NODIVIDER from toolbar.
CORE-18867

13 months ago[MSPAINT] Delete useless "STATIC" control
Katayama Hirofumi MZ [Fri, 17 Mar 2023 10:01:42 +0000 (19:01 +0900)]
[MSPAINT] Delete useless "STATIC" control

CORE-18867

13 months ago[MSPAINT] Move UpdateCanvas's code to newly-defined CCanvasWindow::Update
Katayama Hirofumi MZ [Thu, 16 Mar 2023 22:51:12 +0000 (07:51 +0900)]
[MSPAINT] Move UpdateCanvas's code to newly-defined CCanvasWindow::Update

CORE-18867

13 months ago[MSPAINT] Rename scrollbox as canvas
Katayama Hirofumi MZ [Thu, 16 Mar 2023 22:45:14 +0000 (07:45 +0900)]
[MSPAINT] Rename scrollbox as canvas

- s/CScrollboxWindow/CCanvasWindow/
- s/scrollboxWindow/canvasWindow/
- s/UpdateScrollbox/UpdateCanvas/
CORE-18867

13 months ago[MSPAINT] Remove extra scrlClientWindow (#5162)
Katayama Hirofumi MZ [Thu, 16 Mar 2023 22:28:42 +0000 (07:28 +0900)]
[MSPAINT] Remove extra scrlClientWindow (#5162)

CORE-18867

13 months ago[MSPAINT] Refactor about Recent Files (#5163)
Katayama Hirofumi MZ [Thu, 16 Mar 2023 22:28:01 +0000 (07:28 +0900)]
[MSPAINT] Refactor about Recent Files (#5163)

Define MAX_RECENT_FILES macro as 4.
Remove strFile1, ..., strFile4 settings and add strFiles[MAX_RECENT_FILES] for Most Recently Used (MRU) files.
CORE-18867

13 months ago[MSPAINT] Restore the main window saved show state (#5158)
Katayama Hirofumi MZ [Thu, 16 Mar 2023 22:26:44 +0000 (07:26 +0900)]
[MSPAINT] Restore the main window saved show state (#5158)

Our mspaint didn't remember the maximized status of the main window. CORE-18867

13 months ago[MSPAINT] Unlink HHCTRL.OCX and use dynamic load (#5165)
Katayama Hirofumi MZ [Thu, 16 Mar 2023 22:25:51 +0000 (07:25 +0900)]
[MSPAINT] Unlink HHCTRL.OCX and use dynamic load (#5165)

Unlink HHCTRL.OCX by modifying CMakeLists.txt. Add DoHtmlHelpW helper function. CORE-18879, CORE-18867

13 months ago[NTDLL_APITEST] Write some tests for NtQueryOpenSubKeys 5164/head
George Bișoc [Wed, 15 Mar 2023 18:52:29 +0000 (19:52 +0100)]
[NTDLL_APITEST] Write some tests for NtQueryOpenSubKeys

13 months ago[MSPAINT] Delete needless CMainWindow::OnSetCursor
Katayama Hirofumi MZ [Thu, 16 Mar 2023 09:13:28 +0000 (18:13 +0900)]
[MSPAINT] Delete needless CMainWindow::OnSetCursor

CORE-18867

13 months ago[MSPAINT] Delete useless CFullscreenWindow::OnSetCursor
Katayama Hirofumi MZ [Thu, 16 Mar 2023 08:56:05 +0000 (17:56 +0900)]
[MSPAINT] Delete useless CFullscreenWindow::OnSetCursor

CORE-18867

13 months ago[MSPAINT] Delete needless CMiniatureWindow::OnSetCursor
Katayama Hirofumi MZ [Thu, 16 Mar 2023 08:49:05 +0000 (17:49 +0900)]
[MSPAINT] Delete needless CMiniatureWindow::OnSetCursor

CORE-18867

13 months ago[MSPAINT] Delete needless CToolBox::OnSetCursor
Katayama Hirofumi MZ [Thu, 16 Mar 2023 08:26:27 +0000 (17:26 +0900)]
[MSPAINT] Delete needless CToolBox::OnSetCursor

CORE-18867

13 months ago[NOTEPAD] Use full path for non-existent file (#5152)
Katayama Hirofumi MZ [Thu, 16 Mar 2023 01:18:54 +0000 (10:18 +0900)]
[NOTEPAD] Use full path for non-existent file (#5152)

In HandleCommandLine function, use GetFullPathName API to get the full path of a non-existent file. CORE-18259, CORE-18837

13 months ago[REGEDIT] import Wine commit f5fe9a6 by Hugh McMaster.
Robert Naumann [Tue, 14 Mar 2023 19:09:19 +0000 (20:09 +0100)]
[REGEDIT] import Wine commit f5fe9a6 by Hugh McMaster.
https://github.com/wine-mirror/wine/commit/f5fe9a6cf9121004ecdf5c0b285fcd88ec8a0d94
This removes the ROS-diff caused by CORE-18603's fix

13 months ago[MSPAINT] Delete unused global variables (lfTextFont, ...
Katayama Hirofumi MZ [Wed, 15 Mar 2023 06:09:26 +0000 (15:09 +0900)]
[MSPAINT] Delete unused global variables (lfTextFont, ...

hfontTextFont, hwndEditCtl, textToolText, and textToolTextMaxLen).
CORE-18867

13 months agoFix buffer read past end problem. (#5146)
Doug Lyons [Wed, 15 Mar 2023 01:57:54 +0000 (20:57 -0500)]
Fix buffer read past end problem. (#5146)

Fixes crashes in regedit-find affecting CORE-15896 and CORE-18230. After possible RegQueryValueExW append 3 zero bytes to guarantee that we will end with a UNICODE NULL.

13 months ago[MSPAINT] Avoid flickering when resizing (#5144)
Katayama Hirofumi MZ [Tue, 14 Mar 2023 22:29:25 +0000 (07:29 +0900)]
[MSPAINT] Avoid flickering when resizing (#5144)

- Add CPaletteWindow::OnEraseBkgnd to avoid flickering.
- Add getColorBoxRect and drawColorBox helper functions to draw a color box.
- Add CPaletteWindow::DoHitTest helper function to do a hit test.
- Improve CPaletteWindow::OnPaint by using a memory bitmap.
- Improve readability of CMainWindow::alignChildrenToMainWindow.
CORE-18867

13 months ago[NOTEPAD] Delete license.c (no use) (#5159)
Katayama Hirofumi MZ [Tue, 14 Mar 2023 22:28:15 +0000 (07:28 +0900)]
[NOTEPAD] Delete license.c (no use) (#5159)

File license.c is not used. Reduce source code. CORE-18837

13 months ago[NOTEPAD] Use new-style file header (#5160)
Katayama Hirofumi MZ [Tue, 14 Mar 2023 22:27:29 +0000 (07:27 +0900)]
[NOTEPAD] Use new-style file header (#5160)

CORE-18837

13 months ago[SHELL32] Give opportunity to rename file/folder on its creation (#5139)
Jose Carlos Jesus [Tue, 14 Mar 2023 21:27:14 +0000 (18:27 -0300)]
[SHELL32] Give opportunity to rename file/folder on its creation (#5139)

* [SHELL32] Fix issue when creating a new file or folder. No chance to rename the displayed name.

The CNewMenu::SelectNewItem method starts with a request to notify the View object about a new item by calling SHChangeNotify.
After creating and obtaining the new PIDL by calling ILFindLastID, the CDefView::SelectItem method is called.
This method fails right from the start when calling LV_FindItemByPidl which returns -1, thus preventing the user from being given the opportunity to change the name displayed by default.

This failure is due to the fact that this object has not yet been added to the CDefView::m_ListView list. This is caused by the asynchronous nature of SHChangeNotify.

Thanks to Giannis Adamopoulos for the big help.

13 months ago[MSPAINT] CImageAreaWindow should inherit CWindowImpl<CImgAreaWindow>
Katayama Hirofumi MZ [Tue, 14 Mar 2023 05:17:12 +0000 (14:17 +0900)]
[MSPAINT] CImageAreaWindow should inherit CWindowImpl<CImgAreaWindow>

... instead of CWindowImpl<CMainWindow>.
CORE-18867

13 months ago[MSPAINT] Window class of main window should be 'MSPaintApp'
Katayama Hirofumi MZ [Tue, 14 Mar 2023 05:09:17 +0000 (14:09 +0900)]
[MSPAINT] Window class of main window should be 'MSPaintApp'

CORE-18867

13 months ago[REGEDIT] CMakeLists.txt: Enable _DEBUG on debugging
Katayama Hirofumi MZ [Tue, 14 Mar 2023 03:22:23 +0000 (12:22 +0900)]
[REGEDIT] CMakeLists.txt: Enable _DEBUG on debugging

CORE-18876

13 months ago[NOTEPAD] CMakeLists.txt: Enable _DEBUG on debugging
Katayama Hirofumi MZ [Tue, 14 Mar 2023 03:17:40 +0000 (12:17 +0900)]
[NOTEPAD] CMakeLists.txt: Enable _DEBUG on debugging

CORE-18837

13 months ago[REGEDIT] Use HeapFree for g_pChildWnd, instead of free()
Katayama Hirofumi MZ [Tue, 14 Mar 2023 03:08:50 +0000 (12:08 +0900)]
[REGEDIT] Use HeapFree for g_pChildWnd, instead of free()

13 months ago[NOTEPAD] Add 'katahiromz' to STRING_NOTEPAD_AUTHORS
Katayama Hirofumi MZ [Tue, 14 Mar 2023 02:24:12 +0000 (11:24 +0900)]
[NOTEPAD] Add 'katahiromz' to STRING_NOTEPAD_AUTHORS

CORE-18837

13 months ago[NOTEPAD] Save searchString and replaceString settings
Katayama Hirofumi MZ [Tue, 14 Mar 2023 02:03:20 +0000 (11:03 +0900)]
[NOTEPAD] Save searchString and replaceString settings

CORE-18837

13 months ago[NTOS:KDBG] Fix the support for /(NO)LOADSYMBOLS as we didn't respect them properly.
Hermès Bélusca-Maïto [Mon, 13 Mar 2023 23:51:03 +0000 (00:51 +0100)]
[NTOS:KDBG] Fix the support for /(NO)LOADSYMBOLS as we didn't respect them properly.

LoadSymbols was reset to its default value whenever KdbSymInit() was
called, thus we would e.g. load symbols even if /NOLOADSYMBOLS or
/LOADSYMBOLS=NO were specified at the command line.

13 months ago[SDK] sdkddkver.h: Add NTDDI_* defines for newest Windows 10 and 11 versions.
Hermès Bélusca-Maïto [Sun, 12 Mar 2023 20:22:52 +0000 (21:22 +0100)]
[SDK] sdkddkver.h: Add NTDDI_* defines for newest Windows 10 and 11 versions.

And add version descriptions, especially for Windows 10 as it becomes messy.

Information from:
- https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlisntddiversionavailable
- Shared/sdk/extdef.h from https://github.com/Mattiwatti/WinObjEx64
- Descriptions from https://github.com/MiroKaku/Veil
- Cross-checked with headers from https://github.com/microsoft/wil

13 months ago[REGEDIT] Use _CrtSetDbgFlag to check memory leak
Katayama Hirofumi MZ [Mon, 13 Mar 2023 22:22:34 +0000 (07:22 +0900)]
[REGEDIT] Use _CrtSetDbgFlag to check memory leak

We can borrow the power of CRT debug. These changes are effective for debug version only:
- Insert #include <crtdbg.h> at main.c.
- Call _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) at the prologue of wWinMain.

This is a follow-up of #5151 (9abd9b6) and 0998665.

13 months ago[MSPAINT] Use _CrtSetDbgFlag to check memory leak
Katayama Hirofumi MZ [Mon, 13 Mar 2023 22:17:14 +0000 (07:17 +0900)]
[MSPAINT] Use _CrtSetDbgFlag to check memory leak

We can borrow the power of CRT debug. These changes are effective for debug version only:
- Insert #include <crtdbg.h> at main.cpp.
- Call _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) at the prologue of _tWinMain.

This is a follow-up of #5151 (9abd9b6).
CORE-18867

13 months ago[NOTEPAD] Use _CrtSetDbgFlag to check memory leak (#5151)
Katayama Hirofumi MZ [Mon, 13 Mar 2023 22:08:56 +0000 (07:08 +0900)]
[NOTEPAD] Use _CrtSetDbgFlag to check memory leak (#5151)

We can borrow the power of CRT debug. These changes are effective for debug version only:
- Insert #include <crtdbg.h> at main.c.
- Call _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) at the prologue of _tWinMain.
CORE-18837

13 months ago[NETSHELL] Shrink radio buttons vertically (#5157)
Katayama Hirofumi MZ [Mon, 13 Mar 2023 22:03:54 +0000 (07:03 +0900)]
[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

13 months ago[NTUSER] Scrollbar.c pure whitespace fixes
Joachim Henze [Sun, 12 Mar 2023 09:33:21 +0000 (10:33 +0100)]
[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!

13 months ago[NTUSER][USER32] KLF_SETFORPROCESS for ActivateKeyboardLayout (#5126)
Katayama Hirofumi MZ [Sun, 12 Mar 2023 04:39:41 +0000 (13:39 +0900)]
[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.

13 months ago[NTOS:KD] Remove unneeded 'extern' declaration. Addendum to commit 4ce819ca.
Hermès Bélusca-Maïto [Sat, 11 Mar 2023 16:08:39 +0000 (17:08 +0100)]
[NTOS:KD] Remove unneeded 'extern' declaration. Addendum to commit 4ce819ca.

13 months ago[NTOS:KDBG] Remove dead code. Addendum to baa47fa5e and fe777bb52.
Hermès Bélusca-Maïto [Sun, 27 Nov 2022 23:43:22 +0000 (00:43 +0100)]
[NTOS:KDBG] Remove dead code. Addendum to baa47fa5e and fe777bb52.

13 months ago[NOTEPAD] Refactor around _tWinMain (#5135)
Katayama Hirofumi MZ [Sat, 11 Mar 2023 23:26:33 +0000 (08:26 +0900)]
[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

13 months ago[NOTEPAD] Move the printing code to the newly added printing.c
Katayama Hirofumi MZ [Sat, 11 Mar 2023 22:51:53 +0000 (07:51 +0900)]
[NOTEPAD] Move the printing code to the newly added printing.c

CORE-18837

13 months ago[NOTEPAD] Add 'Now-printing' dialog (#5127)
Katayama Hirofumi MZ [Sat, 11 Mar 2023 13:23:14 +0000 (22:23 +0900)]
[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

13 months ago[MSPAINT] Delete unused HWND hToolBtn[16] global variable
Katayama Hirofumi MZ [Sat, 11 Mar 2023 05:19:12 +0000 (14:19 +0900)]
[MSPAINT] Delete unused HWND hToolBtn[16] global variable

CORE-18867

13 months ago[MSPAINT] Remember status bar visibility (#5145)
Katayama Hirofumi MZ [Sat, 11 Mar 2023 02:41:52 +0000 (11:41 +0900)]
[MSPAINT] Remember status bar visibility (#5145)

- Add ShowStatusBar registry setting.
- Save ShowStatusBar status and restore the status on startup.
CORE-18867

13 months ago[NTOS:KD][KDBG] Rework the BootPhase >= 2 initialization of the KD/KDBG kernel debugg... 4892/head
Hermès Bélusca-Maïto [Mon, 9 Jan 2023 18:35:18 +0000 (19:35 +0100)]
[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.

13 months ago[NTOS:KD] Move handling of Dmesg buffer from screen provider to KDBG provider. (... 5143/head
Hervé Poussineau [Sun, 10 Jul 2022 13:01:01 +0000 (15:01 +0200)]
[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>
13 months ago[MSPAINT] There were two "main" windows (#5147)
Katayama Hirofumi MZ [Fri, 10 Mar 2023 22:42:04 +0000 (07:42 +0900)]
[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

13 months ago[SYSSETUP] Tweak resources CORE-18870
Joachim Henze [Fri, 10 Mar 2023 20:36:17 +0000 (21:36 +0100)]
[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.

13 months ago[NTOS:KDBG] Split KdbInitialize into KdbSymInit and KDBG initialization proper.
Hermès Bélusca-Maïto [Fri, 10 Mar 2023 17:12:32 +0000 (18:12 +0100)]
[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.

13 months ago[DXDIAG] Fix text truncation on button for french fr-FR.rc CORE-18853
Joachim Henze [Fri, 10 Mar 2023 17:03:02 +0000 (18:03 +0100)]
[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.

13 months ago[MSPAINT] Fix use of uninitialized variable on startup (#5140)
Katayama Hirofumi MZ [Thu, 9 Mar 2023 22:31:31 +0000 (07:31 +0900)]
[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

13 months ago[DXDIAG] Fix text truncation german de-DE.rc CORE-18853 (#5137)
Joachim Henze [Thu, 9 Mar 2023 22:27:49 +0000 (23:27 +0100)]
[DXDIAG] Fix text truncation german de-DE.rc CORE-18853 (#5137)

13 months ago[NOTEPAD] Use Globals.hMainWnd in ShowLastError (#5132)
Katayama Hirofumi MZ [Thu, 9 Mar 2023 22:25:06 +0000 (07:25 +0900)]
[NOTEPAD] Use Globals.hMainWnd in ShowLastError (#5132)

Improving UI/UX by making Globals.hMainWnd the owner of the message box. CORE-18837

13 months ago[NTOS:KD] KdpDebugLogInit: Fix ZwCreateFile flags for appending to debug logging...
Hermès Bélusca-Maïto [Mon, 9 Jan 2023 19:42:11 +0000 (20:42 +0100)]
[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

13 months ago[NTOS:KD] Add some annotations.
Hermès Bélusca-Maïto [Mon, 9 Jan 2023 11:31:03 +0000 (12:31 +0100)]
[NTOS:KD] Add some annotations.

13 months ago[NTOS:KD] Simplify min-values calculations in KdpPrintToLogFile and KdpScreenPrint.
Hermès Bélusca-Maïto [Mon, 9 Jan 2023 15:08:07 +0000 (16:08 +0100)]
[NTOS:KD] Simplify min-values calculations in KdpPrintToLogFile and KdpScreenPrint.

13 months ago[NTOS:IO/KD/KDBG] Formatting fixes only.
Hermès Bélusca-Maïto [Mon, 9 Jan 2023 11:11:19 +0000 (12:11 +0100)]
[NTOS:IO/KD/KDBG] Formatting fixes only.

13 months ago[KERNEL32] Remove a pointless SEH in VirtualAllocEx (#5117)
Ratin Gao [Thu, 9 Mar 2023 16:08:08 +0000 (00:08 +0800)]
[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).

13 months ago[NOTEPAD] Use DestroyIcon instead of DeleteObject to destroy icon (#5130)
Katayama Hirofumi MZ [Wed, 8 Mar 2023 23:24:19 +0000 (08:24 +0900)]
[NOTEPAD] Use DestroyIcon instead of DeleteObject to destroy icon (#5130)

CORE-18837

13 months ago[NOTEPAD] Remove some needless type casts (#5134)
Katayama Hirofumi MZ [Wed, 8 Mar 2023 23:23:08 +0000 (08:23 +0900)]
[NOTEPAD] Remove some needless type casts (#5134)

CORE-18837

13 months ago[WORDPAD][WRITE] Remove redundant pragma code_page(65001)...
Hermès Bélusca-Maïto [Wed, 8 Mar 2023 23:13:48 +0000 (00:13 +0100)]
[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.

13 months ago[MSAFD] Work around regression of CORE-18848 from 0.4.12-dev-693-g2b1f6c8 (#5102)
Doug Lyons [Wed, 8 Mar 2023 20:47:45 +0000 (14:47 -0600)]
[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'

13 months ago[SDK:SCRNSAVE] Implement mouse move threshold. 5110/head
Mark Jansen [Wed, 1 Mar 2023 20:35:17 +0000 (21:35 +0100)]
[SDK:SCRNSAVE] Implement mouse move threshold.

This makes it easier to start the screensavers by double-clicking.

13 months ago[NOTEPAD] Delete main.h (#5133)
Katayama Hirofumi MZ [Wed, 8 Mar 2023 18:41:11 +0000 (03:41 +0900)]
[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

13 months ago[NOTEPAD] Reduce lines in and around comments (#5131)
Katayama Hirofumi MZ [Wed, 8 Mar 2023 18:11:57 +0000 (03:11 +0900)]
[NOTEPAD] Reduce lines in and around comments (#5131)

Reduce lines. CORE-18837

13 months ago[WINESYNC] user32/edit: Allow buffer access after EM_GETHANDLE. 5121/head
Thomas Faber [Sun, 5 Mar 2023 19:42:22 +0000 (14:42 -0500)]
[WINESYNC] user32/edit: Allow buffer access after EM_GETHANDLE.

wine commit id f62d8dc58fb3fb5f11a8ab55620ab9b2fbdaf967 by Nikolay Sivov <nsivov@codeweavers.com>

13 months ago[REGEDIT] Avoid buffer overflow in SelectNode. CORE-18602 5119/head
Thomas Faber [Fri, 20 Jan 2023 01:34:46 +0000 (20:34 -0500)]
[REGEDIT] Avoid buffer overflow in SelectNode. CORE-18602

13 months ago[REGEDIT] Add back import prompt message lost during Wine sync. CORE-18770 5118/head
Thomas Faber [Sat, 4 Mar 2023 21:51:57 +0000 (16:51 -0500)]
[REGEDIT] Add back import prompt message lost during Wine sync. CORE-18770

13 months ago[NTOS:SE][FORMATTING] Fix the file header 5128/head
George Bișoc [Tue, 7 Mar 2023 17:39:46 +0000 (18:39 +0100)]
[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!

13 months ago[NTOS:SE] Do not allocate memory pool just for the access rights 5123/head
George Bișoc [Tue, 7 Mar 2023 10:42:22 +0000 (11:42 +0100)]
[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.

13 months ago[NOTEPAD] Improve printing (header/footer/tabs/performance) (#5111)
Katayama Hirofumi MZ [Tue, 7 Mar 2023 05:42:27 +0000 (14:42 +0900)]
[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

13 months ago[NTOS:SE] Print debug output only if NDEBUG is not defined
George Bișoc [Mon, 6 Mar 2023 19:03:44 +0000 (20:03 +0100)]
[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.

13 months ago[WS2_32] Fix Two DPRINT typo errors (#5113)
Doug Lyons [Mon, 6 Mar 2023 11:22:28 +0000 (05:22 -0600)]
[WS2_32] Fix Two DPRINT typo errors (#5113)

13 months ago[MSVCRT] Follow-up of Follow-up of #5032 (f172503)
Katayama Hirofumi MZ [Sun, 5 Mar 2023 14:28:00 +0000 (23:28 +0900)]
[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.

13 months ago[MSVCRT] Follow-up of #5032 (f172503)
Katayama Hirofumi MZ [Sun, 5 Mar 2023 14:20:12 +0000 (23:20 +0900)]
[MSVCRT] Follow-up of #5032 (f172503)

Use _cwait() instead of WaitForSingleObject and GetExitCodeProcess.
Use malloc/free instead of LocalAlloc/LocalFree.

13 months ago[MSVCRT][CRT_APITEST] Implement _wsystem (#5032)
Katayama Hirofumi MZ [Sun, 5 Mar 2023 12:01:14 +0000 (21:01 +0900)]
[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.

13 months ago[MSPAINT] Treat as a file even if the bitmap file is empty
Atharva Kulkarni [Sun, 5 Mar 2023 11:53:38 +0000 (17:23 +0530)]
[MSPAINT] Treat as a file even if the bitmap file is empty

CORE-18508

13 months ago[NTUSER][USER32] Refactor NtUserLoadKeyboardLayoutEx (#5107)
Katayama Hirofumi MZ [Sun, 5 Mar 2023 02:41:32 +0000 (11:41 +0900)]
[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

13 months ago[SDK] Improve gen_baseaddress.py and its output files (#4964)
Joachim Henze [Sat, 4 Mar 2023 10:45:06 +0000 (11:45 +0100)]
[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

13 months ago[CMDUTILS] Add Italian (it-IT) translation for WHERE command
Carlo Bramini [Thu, 23 Feb 2023 09:57:28 +0000 (10:57 +0100)]
[CMDUTILS] Add Italian (it-IT) translation for WHERE command

13 months ago[NOTEPAD] Don't reset Find/Replace if lpstrFindWhat is set (#5104)
Katayama Hirofumi MZ [Wed, 1 Mar 2023 11:17:27 +0000 (20:17 +0900)]
[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

13 months ago[NOTEPAD] Fix NOTEPAD_FindTextAt (#5103)
Katayama Hirofumi MZ [Wed, 1 Mar 2023 10:57:10 +0000 (19:57 +0900)]
[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

13 months ago[NOTEPAD] Shift+F3 for backward search (#5101)
Katayama Hirofumi MZ [Tue, 28 Feb 2023 22:16:28 +0000 (07:16 +0900)]
[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

13 months ago[RAPPS] Style-addendum, no functional change (#5091)
Joachim Henze [Tue, 28 Feb 2023 00:00:29 +0000 (01:00 +0100)]
[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

13 months agoFix ICO_ExtractIconExW causing explorer to crash when trying
Doug Lyons [Sun, 26 Feb 2023 19:03:53 +0000 (13:03 -0600)]
Fix ICO_ExtractIconExW causing explorer to crash when trying
 to display icon for bad EXE PE header.

See CORE-15879

Co-authored-by: Thomas Faber <thomas.faber@reactos.org>
13 months ago[IMM32] Fix ImmGetCompositionStringA/W (#5105)
Katayama Hirofumi MZ [Mon, 27 Feb 2023 03:33:45 +0000 (12:33 +0900)]
[IMM32] Fix ImmGetCompositionStringA/W (#5105)

Fix some typos in Imm32GetCompStrA/W. CORE-11700

13 months ago[IMM32] Silence 'Out of boundary' log-spam
Katayama Hirofumi MZ [Sun, 26 Feb 2023 02:57:44 +0000 (11:57 +0900)]
[IMM32] Silence 'Out of boundary' log-spam

CORE-18852

13 months ago[SYSSETUP] Removed qemu credit entirely (#4971)
Rexx J. Larsson [Sat, 25 Feb 2023 22:44:06 +0000 (23:44 +0100)]
[SYSSETUP] Removed qemu credit entirely (#4971)

13 months ago[USER32] Fix edit UAF by importing wine commit b40ddf42370e8344a862fbbc40384678db3871a9 4818/head
Mark Jansen [Tue, 31 Jan 2023 17:12:52 +0000 (18:12 +0100)]
[USER32] Fix edit UAF by importing wine commit b40ddf42370e8344a862fbbc40384678db3871a9