Commit graph

86375 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
b15dcb5cf6
[NTOS:KD64] The DbgKdPageInApi, introduced in NT4, has been obsoleted in NT5.
It has been replaced by ExpDebuggerPageIn support in ExpDebuggerWorker().
2024-12-14 23:33:53 +01:00
Hermès Bélusca-Maïto
08ed0988ff
[NTOS:KE] KeRemoveQueueDpc(): Use KeRestoreInterrupts() 2024-12-14 23:33:49 +01:00
Hermès Bélusca-Maïto
da59d797d1
[NTOS:EX] Minor enhancements to ExpDebuggerWorker()
- Add some DbgPrints.
- Use SAL2 annotations.
2024-12-14 23:31:51 +01:00
Hermès Bélusca-Maïto
ec4c169e3e
[NTOS:EX] Revamp ExpLoadBootSymbols() a bit.
- Use a for-loop.
- Make some comments more accurate.
- Reduce indentation level in the loop.
2024-12-14 23:31:49 +01:00
Hermès Bélusca-Maïto
f395f87bb3
[NTOS:MM] MiScanMemoryDescriptors(): Use the MiIsMemoryTypeInvisible() and MiIsMemoryTypeFree() helpers. 2024-12-14 23:31:48 +01:00
Hermès Bélusca-Maïto
c53eb190c7
[NTOS:KD64] Revamp the debugger banner helpers a little.
- Directly call KdpGetMemorySizeInMBs() within KdpPrintBanner(),
  instead of having the caller doing it.
- Use the miarm.h MiIsMemoryTypeInvisible() helper.
- Add Doxygen comments.
2024-12-14 23:31:47 +01:00
Hermès Bélusca-Maïto
cb0c9a4570
[NTOS:KD64] KdInitSystem(): Minor code enhancements.
- Move local variables to the code blocks where they are used.
- if-s one-line bodies on their own lines.
- Massage the boot-images symbols loading, using a for-loop.
2024-12-14 23:31:46 +01:00
Hermès Bélusca-Maïto
ba342e1d14
[FREELDR] peloader.c: Minor code enhancements.
PeLdrCheckForLoadedDll():
- Use a for-loop to iterate over the linked list.
- Adjust few comments.
- Use SAL2 annotations.

PeLdrpCompareDllName():
- Make its input paramters const.
- Use SAL2 annotations.
2024-12-14 23:31:41 +01:00
Eric Kohl
4d376dfd64 [SETUPAPI] CM_Set_Class_Registry_PropertyW: Do not convert SD if ulLength is 0 2024-12-14 20:09:27 +01:00
Hermès Bélusca-Maïto
4795177ced
[DRIVERS] Fix misusages of the RTL_REGISTRY_OPTIONAL flag.
See https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlqueryregistryvalues

The RTL_REGISTRY_OPTIONAL applies to the first parameter of the
RtlQueryRegistryValues() function, not to the Flags member of the
table entries. However, a RTL_QUERY_REGISTRY_REQUIRED flag exists
to mark values whose existence is NOT optional.

Problematic usage was introduced in the following modules:
drivers/input/i8042prt: Commit e7e959fb0 (r30000)
drivers/input/kbdclass: Commit 5a77f871d (r18911)
drivers/input/mouclass: Commit aeeab7d1f (r18906)
drivers/input/sermouse: Commit 3f348259c (r19100)
rosapps/drivers/green : Commit c8a90f769 (r21165)
2024-12-14 19:12:11 +01:00
Eric Kohl
b96e648019 [SETUPAPI] CM_Set_Class_Registry_PropertyW: Implement SD conversion
Convert text SD to binary SD for the CM_CRP_SECURITY_SDS property.
2024-12-14 13:52:55 +01:00
Tomáš Veselý
0540c212ea
[USER32_APITEST] Improve RedrawWindow API test. Follow up of #7160 (#7297)
* extension-RedrawWindow-apitest-by-flags-update

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2024-12-11 13:58:15 -06:00
Ratin Gao
d936dba7ff [REACTOS] Fix 'seperate' typos 2024-12-11 08:56:06 +02:00
Daniel Victor
34e76ade03 [FREELDR] Make it more compatible with w2k3 ini file 2024-12-11 07:18:34 +02:00
Václav Zouzalík
e897a5654d [ACPPAGE] Update German (de-DE) translation 2024-12-10 22:37:02 +01:00
Eric Kohl
b667d82f0b [SETUPAPI] Implement CM_Set_Class_Registry_PropertyA() 2024-12-09 21:53:35 +01:00
Hermès Bélusca-Maïto
01a10da73d
[VIDEOPRT] VideoPortInitialize(): Display the invalid and expected struct sizes on error 2024-12-09 13:42:44 +01:00
Thamatip Chitpong
4d9f67c79b [REACTOS] Rename ReactOS_LogOn.wav to ReactOS_Startup.wav
CORE-13951
2024-12-09 09:52:57 +07:00
Thamatip Chitpong
2557948179 [WINLOGON] Implement startup sound support (HACK)
CORE-13951
2024-12-09 09:52:57 +07:00
Thamatip Chitpong
37375fcc4d [WINLOGON] Implement shutdown sound support
CORE-13951
2024-12-09 09:52:57 +07:00
Thamatip Chitpong
77bfc12e0f [WINLOGON] Move logoff flags handling code to HandleLogoff 2024-12-09 09:52:57 +07:00
Eric Kohl
18c3f39c18 [SETUPAPI] Implement CM_Set_Class_Registry_PropertyW()
The conversion of text SDs to binary SDs is not implemented yet.
2024-12-08 23:03:30 +01:00
Thamatip Chitpong
92231340ec
[WINMM] PlaySound: Fix user-specific environment variables handling (#7536)
Correctly retrieve user-specific environment variables when impersonating.
Addendum to commit f18111b641.
CORE-13951
2024-12-07 09:15:11 +07:00
Andrei Miloiu
e6c18b4497
[VGAFONTEDIT] Update Romanian (ro-RO) translation (#7354) 2024-12-06 21:15:51 +01:00
Andrei Miloiu
29ef7062a7
[CONSOLE] Update Romanian (ro-RO) translation (#7404) 2024-12-06 21:12:45 +01:00
Andrei Miloiu
d8daf05e4a
[IEFRAME] Update Romanian (ro-RO) translation (#7356) 2024-12-06 21:05:33 +01:00
Andrei Miloiu
5251d08663
[MSCTFIME] Add Romanian (ro-RO) translation (#7365) 2024-12-06 21:02:30 +01:00
Andrei Miloiu
5a030eaa33
[WINED3DCFG] Update Romanian (ro-RO) translation (#7406) 2024-12-06 20:58:25 +01:00
Andrei Miloiu
c212c184f3
[EVENTVWR] Update Romanian (ro-RO) translation (#7352) 2024-12-06 20:54:26 +01:00
Andrei Miloiu
6ec5f8841b
[FDEBUG] Update Romanian (ro-RO) translation (#7340) 2024-12-06 20:48:33 +01:00
Whindmar Saksit
63bb46a2fd
[CABVIEW] Add CabView shell extension (#7494)
CORE-14616
2024-12-05 15:14:55 +01:00
Timo Kreuzer
3bd9ddca94 [CRT] corecrt.h: add secure function overload macros
Taken from MIT release of UCRT (https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3). These are used by newer mingw headers, which we include when compiling C++ code. Fixes build with GCC 13 based RosBE.
2024-12-04 08:13:49 +02:00
Hermès Bélusca-Maïto
6cf426345b
[NTOS:KD64] Use KdpDprintf() instead of DbgPrint() for the debugger banner DPRINTs (#7540)
Override DbgPrint(), used by the debugger banner DPRINTs,
because KdInitSystem() can be called under the debugger lock
by KdEnableDebugger(WithLock)().

In this case, when DbgPrint() (re-)enters the debugger via an
interrupt and acquires the debugger lock, a deadlock occurs.
2024-12-03 22:14:02 +01:00
Hermès Bélusca-Maïto
1a02d3306b
[NTOS:KD64] Fix usage of the debugging banner code, based on when KdInitSystem() is called (#7540)
- The debugging banner helpers *CANNOT* be in the INIT section, because
  it is possible for KdInitSystem() to enable the debugger **MUCH LATER**
  after boot time. (Reverts part of commit f239ca0f0 (r72922).)

  This can happen in two situations:

  * When the debugger is in CRASHDEBUG mode, i.e. initialized at boot
    time but not immediately enabled, and a BSOD happens later that
    enables the debugger with a `KdInitSystem(0, NULL)` call.

  * When the debugger was possibly manually disabled with a
    KdDisableDebugger() call, then later re-enabled with a
    KdEnableDebugger() call.

- In the same cases as described above, the KeLoaderBlock is freed after
  boot time. Thus, KdpGetMemorySizeInMBs() cannot use it and enumerate
  the MemoryDescriptors to evaluate the number of physical memory pages
  available on the system. Instead, we can use what the memory manager
  has already computed, since the latter is already initialized by now.

These two fixes avoid (invisible) crashes when (re-)enabling
the debugger at non-boot run time.
2024-12-03 22:13:57 +01:00
Hermès Bélusca-Maïto
76d35dde1d
[NTOS:KD64] KdInitSystem(): Poll for break-in on symbol load *ONLY* at boot-time (#7539)
I.e. when LoaderBlock != NULL and we have loaded the initial hal and
ntoskrnl symbols. KdBreakAfterSymbolLoad is then checked for when the
other boot symbols have been loaded by ex/init.c!ExpLoadBootSymbols(),
invoked by ExpInitializeExecutive().
2024-12-03 19:29:12 +01:00
Hermès Bélusca-Maïto
2995806a44
[NTOS:KD64] kdx64.c: Implement KdpAllowDisable() the same as in x86 (#7538)
AMD64 has the same DR7 register as x86 with the same bits meanings,
thus the same implementation can be used.

References:

- https://en.wikipedia.org/wiki/X86_debug_register#DR7_-_Debug_control

- AMD64 Architecture Programmer’s Manual, Volume 2: System Programming
  https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/24593.pdf
  Section "13.1.1.4 Debug-Control Register (DR7)"
  pgs. 393-396 (pgs. 455-458 of the PDF)

- Intel® 64 and IA-32 Architectures Software Developer’s Manual,
  Volume 3 (3A, 3B, 3C, & 3D): System Programming Guide
  https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
  Section "19.2.4 Debug Control Register (DR7)" (pgs. 644-646)
  Section "19.2.6 Debug Registers and Intel® 64 Processors" (pg. 647)
2024-12-03 19:02:28 +01:00
Hermès Bélusca-Maïto
61feb649d1
[NTOS:KD64] kdx86.c: Fix Dr7 check to verify whether debugger disabling is allowed (#7538)
Don't check the whole Dr7 value, but only the first 8 bits that
correspond to the local/global enable breakpoints.

We cannot check the whole value because some of the Dr7 bits are
reserved always set to 1 (bit 10), or describe other debug state.

References:

- https://en.wikipedia.org/wiki/X86_debug_register#DR7_-_Debug_control

- Intel® 64 and IA-32 Architectures Software Developer’s Manual,
  Volume 3 (3A, 3B, 3C, & 3D): System Programming Guide
  https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
  Section "19.2.4 Debug Control Register (DR7)" (pgs. 644-646)
2024-12-03 19:02:21 +01:00
Hermès Bélusca-Maïto
dfb43905bb
[FREELDR] peloader.c: Fix PE import binding (#7537)
Use the PE import table's OriginalFirstThunk array when scanning and
resolving imports during DLL binding.

It points to an array of pointer-sized IMAGE_THUNK_DATA structures
which describe the functions being imported. On the other hand, the
FirstThunk points to an array of pointers, whose initial values are
a copy of those pointed to by OriginalFirstThunk, but are replaced
by the actual function pointers determined at runtime, when a DLL
is loaded (see PeLdrpBindImportName() function).
If we were to use the FirstThunk array to find again later the imports
by name or ordinal, we would fail because these are replaced by the
addresses of the corresponding functions.

This fixes loading kdcom.dll from Windows XP x64 with FreeLDR when
testing on ReactOS x64.

```diff
 (freeldr\freeldr\lib\peloader.c:498) trace: PeLdrpScanImportAddressTable() ---- Calling PeLdrpBindImportName() in a loop
 (freeldr\freeldr\lib\peloader.c:501) trace: *** ThunkName->u1.AddressOfData = 00000000000070F0
 (freeldr\freeldr\lib\peloader.c:502) trace: *** ThunkData->u1.AddressOfData = 0000000000573780
 (freeldr\freeldr\lib\peloader.c:209) trace:   !!! ExportDirectory->NumberOfNames 1504
-(freeldr\freeldr\lib\peloader.c:210) trace:   !!! ImportHint 0 - ExportName 'CcCanIWrite' - ImportDataName ''
+(freeldr\freeldr\lib\peloader.c:210) trace:   !!! ImportHint 282 - ExportName 'HalPrivateDispatchTable' - ImportDataName 'HalPrivateDispatchTable'
 ....
-(freeldr\freeldr\lib\peloader.c:268) err: Did not find export ''!
-(freeldr\freeldr\lib\peloader.c:709) err: PeLdrpScanImportAddressTable() failed: ImportName = 'ntoskrnl.exe', DirectoryPath = 'multi(0)disk(0)rdisk(0)partition(2)\ReactOS\system32\'
```
('-': lines before the fix; '+': lines after the fix)

Code has been adapted based from the following functions:
ntdll/ldr/ldrpe.c!LdrpSnapThunk() and LdrpSnapIAT()
ntoskrnl/mm/ARM3/sysldr.c!MiSnapThunk() and MiResolveImageReferences()

References:
https://devblogs.microsoft.com/oldnewthing/20231129-00/?p=109077
https://devblogs.microsoft.com/oldnewthing/20231130-00/?p=109084
https://stackoverflow.com/questions/42413937/why-pe-need-original-first-thunkoft
2024-12-03 13:13:38 +01:00
Hermès Bélusca-Maïto
576fafbaf8
[FREELDR] peloader.c: Add SAL2 annotations for two import-resolving helpers (#7537)
Add annotations for PeLdrpBindImportName()
and PeLdrpScanImportAddressTable().
2024-12-03 13:13:26 +01:00
Hermès Bélusca-Maïto
ddd59f19ae
[FREELDR] peloader.c: Fix some traces 2024-12-03 12:32:08 +01:00
Eric Kohl
9382aa286c [DISKPART] Fix typos in string resources for the SELECT command 2024-12-03 00:40:21 +01:00
Hermès Bélusca-Maïto
d7c1d220b5
[SETUPLIB][REACTOS][USETUP] Turn setuplib into a DLL shared between TUI and GUI 1st-stage setups (#7523)
CORE-13525

Notes:
- Most of the exported functions have been turned from default cdecl to explicit stdcall / "NTAPI".
- The two InitializeSetup() phases have been collapsed to make the initialization simpler.

Average reductions (percentages; see PR #7523 for actual numbers):

x86 Debug builds:
reactos.exe: 35.1%
smss.exe   : 39.8%
Total (including setuplib.dll): 17.9%

x86 Release builds:
reactos.exe: 22.3%
smss.exe   : 25.0%
Total (including setuplib.dll): 10.6%

x64 Debug builds:
reactos.exe: 40.6%
smss.exe   : 41.6%
Total (including setuplib.dll): 20.0%

x64 Release builds:
reactos.exe: 22.8%
smss.exe   : 22.3%
Total (including setuplib.dll): 10.1%
2024-12-02 23:05:38 +01:00
Serge Gautherie
e51e5de1f8
[EXPLORER] Remove redundant bIsSystemShell assignments (#7542)
Addendum to commit df197bc42 (PR #7502)
CORE-19887
2024-12-02 20:42:46 +01:00
Vitaly Orekhov
76014b92a4
[REACTOS] Replace all references of CLSID_ConnectionFolder to CLSID_NetworkConnections (#7503)
Use name from public Windows SDK for 'Network Connections' CLSID, available since Windows SDK 6.0A (Visual Studio 2008 or higher).
Replace all such instances in netshell, shell32, apitests/com.

- Partially reverts/refactors commit bea0b47
- Follow-up to PR #7266
2024-12-02 20:27:19 +01:00
Thamatip Chitpong
e62c917ddf
[WINMM] Add DLL version info (#7543) 2024-12-02 17:44:03 +07:00
Eric Kohl
647d351278 [DISKPART] Use the MBR_MAGIC to check for a valid MBR 2024-12-01 21:32:53 +01:00
Eric Kohl
8972448127 [DISKPART] Fix a comment 2024-12-01 20:56:21 +01:00
Eric Kohl
1b5e679282 [DISKPART] Implement 'select disk system' and 'select disk next' 2024-12-01 19:33:16 +01:00
Whindmar Saksit
11d5cb8095
[BROWSEUI] FindFolder must release the view and the browser (#7529)
CORE-19780
2024-11-30 22:05:50 +01:00
Brady McDermott
df197bc424
[EXPLORER] Check registry key for default shell (#7502)
Improves detection of Explorer being the default shell.

- Check the "Software\Microsoft\Windows NT\CurrentVersion\Winlogon" key to see if Explorer is the default shell.
- Use this check to determine whether to start the desktop and taskbar or only open a file browser window.

JIRA issue CORE-19887
2024-11-30 10:17:54 -07:00