Commit graph

83355 commits

Author SHA1 Message Date
Katayama Hirofumi MZ e9f3790aa4 [MSPAINT] Encapsulation: hNontranspIcon and hTranspIcon
CORE-18867
2023-03-18 08:24:19 +09:00
Katayama Hirofumi MZ cc3b53fef9 [MSPAINT] Encapsulation: hCurFill, hCurColor etc.
CORE-18867
2023-03-18 08:09:26 +09:00
Katayama Hirofumi MZ d40de8f47c [MSPAINT] Add Static Edge to toolbars
- Add WS_EX_STATICEDGE to paletteWindow.
- Remove CCS_NODIVIDER from toolbar.
CORE-18867
2023-03-17 19:18:07 +09:00
Katayama Hirofumi MZ 868c7c4d53 [MSPAINT] Delete useless "STATIC" control
CORE-18867
2023-03-17 19:01:42 +09:00
Katayama Hirofumi MZ eacf003c81 [MSPAINT] Move UpdateCanvas's code to newly-defined CCanvasWindow::Update
CORE-18867
2023-03-17 07:51:12 +09:00
Katayama Hirofumi MZ 7361592ede [MSPAINT] Rename scrollbox as canvas
- s/CScrollboxWindow/CCanvasWindow/
- s/scrollboxWindow/canvasWindow/
- s/UpdateScrollbox/UpdateCanvas/
CORE-18867
2023-03-17 07:45:14 +09:00
Katayama Hirofumi MZ a88dcbd6c3
[MSPAINT] Remove extra scrlClientWindow (#5162)
CORE-18867
2023-03-17 07:28:42 +09:00
Katayama Hirofumi MZ 41c30182d4
[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
2023-03-17 07:28:01 +09:00
Katayama Hirofumi MZ a81f229065
[MSPAINT] Restore the main window saved show state (#5158)
Our mspaint didn't remember the maximized status of the main window. CORE-18867
2023-03-17 07:26:44 +09:00
Katayama Hirofumi MZ 88733bca77
[MSPAINT] Unlink HHCTRL.OCX and use dynamic load (#5165)
Unlink HHCTRL.OCX by modifying CMakeLists.txt. Add DoHtmlHelpW helper function. CORE-18879, CORE-18867
2023-03-17 07:25:51 +09:00
George Bișoc eb7550f767
[NTDLL_APITEST] Write some tests for NtQueryOpenSubKeys 2023-03-16 20:04:31 +01:00
Katayama Hirofumi MZ 0cf45d508c [MSPAINT] Delete needless CMainWindow::OnSetCursor
CORE-18867
2023-03-16 18:13:28 +09:00
Katayama Hirofumi MZ b5ae55f3ff [MSPAINT] Delete useless CFullscreenWindow::OnSetCursor
CORE-18867
2023-03-16 17:56:05 +09:00
Katayama Hirofumi MZ b369ec3fa1 [MSPAINT] Delete needless CMiniatureWindow::OnSetCursor
CORE-18867
2023-03-16 17:49:05 +09:00
Katayama Hirofumi MZ 34881b9a88 [MSPAINT] Delete needless CToolBox::OnSetCursor
CORE-18867
2023-03-16 17:26:27 +09:00
Katayama Hirofumi MZ 136f23578f
[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
2023-03-16 10:18:54 +09:00
Robert Naumann 75ac9f8477 [REGEDIT] import Wine commit f5fe9a6 by Hugh McMaster.
f5fe9a6cf9
This removes the ROS-diff caused by CORE-18603's fix
2023-03-15 16:54:47 +01:00
Katayama Hirofumi MZ 3625f55fbb [MSPAINT] Delete unused global variables (lfTextFont, ...
hfontTextFont, hwndEditCtl, textToolText, and textToolTextMaxLen).
CORE-18867
2023-03-15 15:09:26 +09:00
Doug Lyons cce3eb9393
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.
2023-03-15 10:57:54 +09:00
Katayama Hirofumi MZ 44b2a46d03
[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
2023-03-15 07:29:25 +09:00
Katayama Hirofumi MZ f5840df9e9
[NOTEPAD] Delete license.c (no use) (#5159)
File license.c is not used. Reduce source code. CORE-18837
2023-03-15 07:28:15 +09:00
Katayama Hirofumi MZ fb1d9d722d
[NOTEPAD] Use new-style file header (#5160)
CORE-18837
2023-03-15 07:27:29 +09:00
Jose Carlos Jesus b8c4d589b1
[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.
2023-03-14 22:27:14 +01:00
Katayama Hirofumi MZ 9b6b1b3513 [MSPAINT] CImageAreaWindow should inherit CWindowImpl<CImgAreaWindow>
... instead of CWindowImpl<CMainWindow>.
CORE-18867
2023-03-14 14:17:40 +09:00
Katayama Hirofumi MZ d91b262590 [MSPAINT] Window class of main window should be 'MSPaintApp'
CORE-18867
2023-03-14 14:09:17 +09:00
Katayama Hirofumi MZ 0eeffc2143 [REGEDIT] CMakeLists.txt: Enable _DEBUG on debugging
CORE-18876
2023-03-14 12:22:23 +09:00
Katayama Hirofumi MZ 598dd51d70 [NOTEPAD] CMakeLists.txt: Enable _DEBUG on debugging
CORE-18837
2023-03-14 12:17:40 +09:00
Katayama Hirofumi MZ 19027f3c81 [REGEDIT] Use HeapFree for g_pChildWnd, instead of free() 2023-03-14 12:08:50 +09:00
Katayama Hirofumi MZ 0a1d467a11 [NOTEPAD] Add 'katahiromz' to STRING_NOTEPAD_AUTHORS
CORE-18837
2023-03-14 11:24:12 +09:00
Katayama Hirofumi MZ c888a13c0b [NOTEPAD] Save searchString and replaceString settings
CORE-18837
2023-03-14 11:03:20 +09:00
Hermès Bélusca-Maïto de892d5bc7
[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.
2023-03-14 01:17:42 +01:00
Hermès Bélusca-Maïto e241c87eea
[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
2023-03-14 00:14:12 +01:00
Katayama Hirofumi MZ 5cf947edc7 [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.
2023-03-14 07:22:34 +09:00
Katayama Hirofumi MZ 0998665463 [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
2023-03-14 07:17:14 +09:00
Katayama Hirofumi MZ 9abd9b667a
[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
2023-03-14 07:08:56 +09:00
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