Commit graph

86419 commits

Author SHA1 Message Date
Whindmar Saksit
7d75bfb449
[SHELL32] ILLoadFromStream must allow loading unknown pidl formats (#7570) 2024-12-25 20:32:08 +01:00
Eric Kohl
3dd6e3103f [INCLUDE][WKSSVC][MSV1_0] Rename msv1_0p.h to ntmsv1_0.h and move it to the ddk directory 2024-12-25 12:52:55 +01:00
Doug Lyons
1c55924045
[USER32_APTEST][USER32] CopyImage improve regression test and function. (#7524)
CORE-19806 and CORE-17902.

* Follow-up of PR #6886 and commit d3ec7cd to remove hack.
2024-12-24 17:51:31 -06:00
Timo Kreuzer
1ea3af8959 [SDK] Fix naming of a CPUID structure 2024-12-24 17:27:32 +02:00
Hermès Bélusca-Maïto
3b800165b0
[SETUP:REACTOS][SYSSETUP] Fix Shift-F10 cmd.exe invocation.
Pressing Shift-F10 to open cmd.exe when the setup program runs from
a different current directory than System32, now works correctly.

Use the 2nd CreateProcessW() `lpCommandLine` parameter, instead of the
1st parameter `lpApplicationName`, so as to use default path search.
The command-line buffer given to the 2nd-parameter can be temporarily
modified by CreateProcessW(), thus use an on-stack buffer.

https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw#parameters
2024-12-24 12:22:42 +01:00
Hermès Bélusca-Maïto
d7f1a784a8
[SHLWAPI] Use an explicit "int*" type for the 3rd parameter of StrToIntExA/W
As this is already present in our PSDK shlwapi.h header, MS PSDK one, and MSDN.
2024-12-23 22:44:54 +01:00
Hermès Bélusca-Maïto
c19ebd0b0a
[SHLWAPI] Explicitly cast to "int*" the 3rd parameter of StrToIntExW calls (fix build)
Fixes build error:

../src/dll/win32/shlwapi/ordinal.c:5417:63: error: passing argument 3 of 'StrToIntExW' from incompatible pointer type [-Werror=incompatible-pointer-types]
         if (!StrToIntExW(V_BSTR(&vargTemp), STIF_SUPPORT_HEX, &V_I4(&variTemp)))
In file included from ../src/dll/win32/shlwapi/ordinal.c:45:
../src/sdk/include/psdk/shlwapi.h:1682:52: note: expected 'int *' but argument is of type 'LONG *' {aka 'long int *'}
 BOOL WINAPI StrToIntExW(_In_ LPCWSTR, DWORD, _Out_ int*);
                                                    ^~~~
2024-12-23 22:44:23 +01:00
Denis Robert
6f60301d25
[NEWDEV] Fix bad use of PropSheet_SetCurSelByID (#7574)
PropSheet_SetCurSelByID() was badly called in response of PSN_WIZBACK or
PSN_WIZNEXT notifications. See the reference on these notification codes:

https://learn.microsoft.com/en-us/windows/win32/controls/psn-wizback

> Returns 0 to allow the wizard to go to the previous page. Returns -1 to
> prevent the wizard from changing pages. To display a particular page,
> return its dialog resource identifier.
> (...)
> To set the return value, the dialog box procedure for the page must call
> the SetWindowLong function with the DWL_MSGRESULT value and return TRUE.

This bug sometimes causes the wrong page to appear (e.g. "Previous" in
IDD_NODRIVER should come back in IDD_CHSOURCE, but goes to IDD_WELCOME).
2024-12-23 16:24:21 +03:00
Whindmar Saksit
0743faf2e3
[NETSHELL] Handle DefView accelerators (#7572)
CORE-18750
2024-12-22 21:27:20 +01:00
Hermès Bélusca-Maïto
cc3672cb73
[RESOURCES] Remove redundant #pragma code_page(), includes, etc.
They are redundant when these are already present in the given module's
root resource file, from which the language-specific resource files are
being included.
2024-12-22 18:39:26 +01:00
Hermès Bélusca-Maïto
40f360445b
Merry Christmas time! 2024-12-22 18:38:34 +01:00
Hermès Bélusca-Maïto
9c544a5552
[BASE][DLL][ROSAPPS][SCREENSAVERS] Remove deprecated legacy Win16 resource attributes (#7567)
- Remove DISCARDABLE attribute.
- Remove MOVEABLE attribute.

See: https://learn.microsoft.com/en-us/windows/win32/menurc/common-resource-attributes

3rd-party module rosapps/lib/vfdlib is left unchanged.
2024-12-22 16:50:14 +01:00
Eric Kohl
ae7e375a4d [LSALIB][SECURE32][LSASRV] Improve the check for trusted/untrusted callers
- A caller of LsaRegisterLogonProcess is a trusted caller if the calling process has got the Tcb privilege, otherwise it is an untrusted caller.
- A caller of LsaConnectUntrusted is always an untrusted caller.
- A caller of LsapOpenLsaPort is always a trusted caller.
2024-12-22 11:15:37 +01:00
Timo Kreuzer
2d4c0b87b1 [WIN32K:NTUSER] Check for NULL desktop window in co_IntProcessMouseMessage 2024-12-22 10:19:01 +02:00
Eric Kohl
216196a10d [WKSSVC] Simplify NetrWkstaSetInfo 2024-12-21 16:19:14 +01:00
Eric Kohl
f06c4dcc6b [WKSSVC] InitWorkstationInfo: Set data size before retrieving registry values 2024-12-21 15:28:43 +01:00
Eric Kohl
85e90601e0 [SETUPAPI] Implement SetupDiGetCustomDevicePropertyA 2024-12-21 10:35:53 +01:00
Stanislav Motylkov
392473c7b5 [GITHUB] Stick to ubuntu-22.04 for build-linux
Fixes clang build, since ubuntu-latest (24.04.1 LTS / Noble Numbat) has no
LLVM 13 package available:

```
Ign:6 https://apt.llvm.org/noble llvm-toolchain-noble-13 InRelease
Err:9 https://apt.llvm.org/noble llvm-toolchain-noble-13 Release
  404  Not Found [IP: 151.101.46.49 443]
Reading package lists...
E: The repository 'http://apt.llvm.org/noble llvm-toolchain-noble-13 Release' does not have a Release file.
Error: Process completed with exit code 100.
```
2024-12-20 19:48:55 +03:00
Whindmar Saksit
28399a216b
[SHELL32] Use FS compatible PIDL format for Recycle Bin items (#7532)
* [SHELL32] Use FS compatible PIDL format for Recycle Bin items

This allows SHChangeNotify to handle these items and DefView will correctly update the recycle folder.

CORE-18005 CORE-19239 CORE-13950 CORE-18435 CORE-18436 CORE-18437
2024-12-19 14:38:27 +01:00
Hermès Bélusca-Maïto
a18424267b
[NTOS:CM] Add some more configuration options.
Add support for configuring the CM lazy-flush and delay-close variables:

  `CmpLazyFlushIntervalInSeconds`, `CmpLazyFlushHiveCount`,
  and `CmpDelayedCloseSize`,

using REG_DWORD values named respectively:

  `RegistryLazyFlushInterval`, `RegistryLazyFlushHiveCount`,
  and `DelayCloseSize`,

in the registry key
`HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager` .

Extra observations:
- While delay-close support exists in Windows 2003, configuring
  the delay-close size is possible only in Windows Vista and later.
- The possibility of configuring the lazy-flush hive count has been
  removed in Windows 8+.

See the comparison tables at:
https://redplait.blogspot.com/2011/07/cmcontrolvector.html
https://redplait.blogspot.com/2012/06/cmcontrolvector-for-w8.html
https://redplait.blogspot.com/2016/03/cmcontrolvector-from-windows-10-build.html

In addition:
Remove `CmpDelayedCloseIndex` from cm.h as it is not used anymore in our code.
2024-12-19 11:52:13 +01:00
Eric Kohl
d44ed03b6c [SETUPAPI][PSDK] Implement SetupDiGetCustomDevicePropertyW 2024-12-18 23:18:36 +01:00
Thamatip Chitpong
1e06829961 [NTOS:PS] Add query support for QUOTA_LIMITS_EX 2024-12-18 09:53:21 +07:00
Thamatip Chitpong
bf0dbdbd19 [NTOS:PS] NtQueryInformationProcess: Move process information-specific variables to their own scope 2024-12-18 09:53:21 +07:00
Thamatip Chitpong
b1f27287ae [NTDLL_APITEST] NtQueryInformationProcess: Add tests for ProcessQuotaLimits/Ex 2024-12-18 09:53:21 +07:00
Thamatip Chitpong
dabe14ae67 [NTDLL_APITEST] NtQueryInformationProcess: Add tests for ProcessBasicInformation 2024-12-18 09:53:21 +07:00
Václav Zouzalík
e18763e13f
[USERINIT] Update German (de-DE) translation (#7541)
* [USERINIT] Update German (de-DE) translation

* [USERINIT] Update German (de-DE) translation

* [USERINIT] Fix copyright header
2024-12-17 20:28:14 +01:00
George Bișoc
28b277aa42
[STOBJECT] Display the estimated battery time when hovering the battery icon
We do have IDS_PWR_HOURS_REMAINING and IDS_PWR_MINUTES_REMAINING string resources but they're never used programmatically.
Display the estimated battery time ONLY if the returned time is not unknown.

CORE-18969
CORE-19452
2024-12-17 14:34:30 +01:00
George Bișoc
b0680d65fe
[BATTC] Signal the wait battery tag event when notifying Battery Class
BatteryClassStatusNotify is used by battery miniport drivers to notify the Battery Class of a status change. This can either be a battery status change or battery tag assignation, depending on what the device extension (namely the composite battery) waits for.

We do have implementation for EVENT_BATTERY_STATUS but not for EVENT_BATTERY_TAG. What happens is when BatteryClassIoctl fails to query the battery tag because it has not yet been assigned, the thread is stuck on waiting for the event object to be signaled, forever.
This tipically happens when a timeout of -1 (meaning the calling thread must wait indefinitely) is supplied. The composite battery driver (COMPBATT) is responsible to signal the Battery Class when a CM (Control Method) ACPI battery receives a tag, which then this function will signal the event.

CORE-18969
CORE-19452
2024-12-17 14:23:33 +01:00
Eric Kohl
c10c5224ff [SETUPAPI] Implement SetupDiGetClassRegistryPropertyA and SetupDiSetClassRegistryPropertyA 2024-12-16 23:19:56 +01:00
George Bișoc
f3dd15ad64
[CMBATT] Grab the design voltage after the BIF data gets copied
There was a risk of accessing invalid data as the design voltage was grabbed before the read BIF data was copied into the device extension.
2024-12-16 22:09:02 +01:00
George Bișoc
ea8315ba56
[CMBATT] Convert power statistics from mAh to mWh
ReactOS (like any other OSes) expects power data to be represented in milliwatts per hour, not in milliamps per hour.
Currently CMBATT defaults the stats to unknown values, if that's the case, and there are a bunch of machines that do report their data from _BIF ACPI method in ampere.

CORE-18969
CORE-19452
2024-12-16 17:33:51 +01:00
George Bișoc
2416c31a30
[BATTC] Fix the wait timeout conversion
KeWaitForSingleObject takes 100ns unit for timeout. Both IOCTL_BATTERY_QUERY_TAG and IOCTL_BATTERY_QUERY_STATUS take a wait for the timeout in milliseconds.
Supposedly a miniport driver wants to supply a wait of 5000 ms (which is equivalent to 5 s), the miniport driver WON'T BE WAITING 5 seconds but 0.5!!!

CORE-18969
CORE-19452
2024-12-16 17:24:56 +01:00
Timo Kreuzer
5ebd478325 [NTOS][HAL:APIC] Call HalBegin/EndSystemInterrupt from clock handler 2024-12-16 16:21:44 +02:00
Timo Kreuzer
1f647e4479 [HAL] Remove KiEoiHelper hack 2024-12-16 16:21:44 +02:00
Timo Kreuzer
67231bd69a [NTOS:KE/X64] Fix KiInterruptDispatch
- Enable interrupts
- Acquire the spinlock on SMP builds
2024-12-16 16:21:44 +02:00
Timo Kreuzer
29721ac552 [NTOS:KE/x64] Fix unwinding in KiUserApcDispatcher
This adds a MACHINE_FRAME to the user mode APC dispatcher stack frame.
2024-12-16 16:19:32 +02:00
Timo Kreuzer
91948dea80 [NTOS:KE/x64] Fix handling of PCR::UserRsp
This is a temporary helper for the system call entry point to store the user mode stack, before switching to the kernel mode stack. Initially it was copied to the trap frame inside KiSystemCallHandler. This has been moved to the system call entry point, but some remnants remained. The problem is that KiSystemCallHandler can be called twice in a system call (when the call is the first GUI call and the stack needs to be extended). In that scenario, when the thread was preempted, a new value could be saved in the PCR before running KiSystemCallHandler again, and then overwriting the proper value with a bogus one from a different thread. This rarely seemed to happen on UP, but happens a lot with SMP.
2024-12-16 16:18:45 +02:00
Doug Lyons
5df3a0bb4a
[EVENTVWR] Fix typo in Romanian (ro-RO) translation (#7561)
Addendum to 0.4.16-dev-323-g c212c184f3 (#7352).
In the usage help message one line started with '\pentru', but it should have been '\tpentru'.

Fixes GCC compiler error:
base/applications/mscutils/eventvwr/lang/ro-RO.rc:177: unrecognized escape sequence

Co-authored-by: George Bișoc <george.bisoc@reactos.org>
2024-12-16 13:42:47 +03:00
Hermès Bélusca-Maïto
3c1e022d0e
[NTOS:KE] Synchronize KiPcToFileHeader/KiRosPcToUserFileHeader 1st parameter name 2024-12-15 22:21:10 +01:00
Hermès Bélusca-Maïto
cc40a5870a
[NTOS:CM] Implement Win7+ VolatileBoot support.
Its support is controlled with a REG_DWORD value named
`VolatileBoot` inside the registry key
`HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager` .

Its implementation is very trivial: when enabled, CmpShareSystemHives
is set to TRUE and doesn't change state during runtime.
In a sense this is similar to what happens in WinPE-boot, except that
ALL hives without exception (system hives and others) will be loaded
in shared mode.
2024-12-15 22:15:13 +01:00
Hermès Bélusca-Maïto
f42c81e4ed
[NTOS:CM] Allow CmSelfHeal to be configured via registry.
This is controlled with a REG_DWORD value named
`SelfHealingEnabled` inside the registry key
`HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager` .

The `CmSelfHeal` variable is used to retrieve the data,
hence it needs to be a ULONG.
2024-12-15 22:12:51 +01:00
Hermès Bélusca-Maïto
a43bfe2916
[NTOS:CM/IO/KE] Implement minimal support for CrashControl:AutoReboot
The REG_DWORD value `AutoReboot` stored in the registry key
`HKLM\SYSTEM\CurrentControlSet\Control\CrashControl`
(used as a boolean value), controls whether to automatically reboot
the operating system at the end of the crash dump, after a bugcheck.

ReactOS doesn't currently implement crash dumps, so only the auto-reboot
is done. (The reason of the apparent redundant `Reboot` variable in
KeBugCheckWithTf() is because that variable would be updated on return
by the not-yet-existing crash-dump helper routines called from there.)
2024-12-15 22:12:22 +01:00
Eric Kohl
44564cb682 [SETUPAPI] Implement SetupDiGetClassRegistryPropertyW and SetupDiSetClassRegistryPropertyW 2024-12-15 15:54:35 +01:00
Hermès Bélusca-Maïto
3abb21080d
[NTOS:KE/EX] Add minimal EMS (headless) support for bugcheck.
In particular, the HeadlessGlobals->InBugCheck flag MUST be set prior
to displaying the blue-screen, because the HDL global lock function
would trigger a (nested) BSoD otherwise.

Regarding the unimplemented HeadlessCmdSendBlueScreenData:
it sends to the management console an XML description of the bugcheck.
An example can be seen in this issue report:
https://github.com/cloud-hypervisor/cloud-hypervisor/issues/3168

For more information, please consult:
https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/windowsserver2003emssacxml.doc
2024-12-14 23:38:43 +01:00
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