Commit graph

85325 commits

Author SHA1 Message Date
Timo Kreuzer
6ac260dcec [NTOS:KE/x64] Handle NMI vs swapgs race condition 2024-04-23 15:50:06 +02:00
Timo Kreuzer
72fd54a7f4 [NTOS:KE/x64] Implement Kd processor switching 2024-04-23 15:50:06 +02:00
Timo Kreuzer
9229709312 [NTOS:KE/x64] Implement processor freeze code 2024-04-23 15:50:06 +02:00
Timo Kreuzer
af2ce4d08f [NTOS:KE/x64] Implement KiSaveProcessorState / KiRestoreProcessorState 2024-04-23 15:50:06 +02:00
Timo Kreuzer
1d289fec77 [NTOS:KE] Improve freeze code in KeBugCheckWithTf
- Don't wait 1 second for each processor
- Use AFFINITY_MASK
- Use Prcb->Number, which is more future proof than KeGetCurrentProcessorNumber
- Improve for loop
2024-04-23 15:50:06 +02:00
Timo Kreuzer
d96f01b5dc [NTOS:KE/x64] Add KiNmiInterruptHandler
So far it only calls KiHandleNmi. It will also handle processor freeze later.

TODO: Pass TF_WITH_EF to directly generate a KEXCEPTION_FRAME
2024-04-23 15:50:06 +02:00
Katayama Hirofumi MZ
1dc8d80ca1
[SHELL32] SHChangeNotify: Add drive, remove drive (#6782)
Implementing missing features...
JIRA issue: CORE-13950
- Add WM_DEVICECHANGE message handler in the shell window to detect
  DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE.
- Use GetLogicalDrives function to detect drives.
- Use SHChangeNotify to send SHCNE_DRIVEADD and
  SHCNE_DRIVEREMOVED notifications.
- Modify CDefView::OnChangeNotify.
2024-04-23 08:28:38 +09:00
Timo Kreuzer
a8ece7e81a [EVTLIB] Fix size of event log record
The size is 32bit, don't read a SIZE_T. Fixes crashes of advapi32_winetest eventlog on x64.
2024-04-22 16:42:02 +02:00
Timo Kreuzer
565828127f [WIN32U_VISTA] Add win32u.dll for Vista 2024-04-22 10:15:40 +02:00
Serge Gautherie
fd331f1494 [NTUSER] UserSetCursorPos(): Use an early return
Addendum to 76290a6 (0.4.15-dev-7889).
2024-04-20 13:57:35 -06:00
Serge Gautherie
8b9bf3369c
[DOC] 3rd Party Files.txt: Update 3 unknown versions (#6771) 2024-04-20 21:29:26 +02:00
Katayama Hirofumi MZ
0240a87618
[SHELL32] SHChangeNotify: SHCNF_DWORD and SHCNF_PRINTERA/W (#6777)
Implementing missing features...
JIRA issue: CORE-13950
- Add Shell_ParsePrinterName helper function.
- Implement SHCNF_DWORD, SHCNF_PRINTERA,
  and SHCNF_PRINTERW types of SHChangeNotify
  function.
2024-04-20 23:11:31 +09:00
Serge Gautherie
68a8619b7b [SHELL32] Remove 2 redundant initializations
Addendum to 6146fd0 (r54688) and 99b2e3d (r54979).
2024-04-20 01:50:14 +04:00
Whindmar Saksit
62c30d1f93
[SHELL32] SHCreateDefaultContextMenu: Pass HWND to callback (#6764)
The caller's callback function is supposed to receive the window handle
passed to SHCreateDefaultContextMenu / CDefFolderMenu_Create2.
2024-04-20 00:34:45 +03:00
Whindmar Saksit
dacdd80390
[ZIPFLDR] Fix ShellExecute opening a .zip (#6714)
ShellExecute on a .zip file fails because the command in the registry
uses rundll32 that passes in an ANSI string, which is the default for
exported functions without a W suffix.

- This should also fix RAPPS not being able to open downloaded .zip files
- I made it use the full path to Explorer for good measure

Fixes regression introduced by 0.4.15-dev-6343-g bf2cec186c (#5411)

CORE-19506
2024-04-20 00:12:56 +03:00
Hermès Bélusca-Maïto
5f3554a40c
[FREELDR] Merge boot-drive and partition functionalities together (#6760)
And deprecate corresponding boot types "Drive" and "Partition".
These are replaced by the more general "BootSector" boot type.

Finish the unification of the code, started in commit ff85aa0c3,
that loads and boots disk MBR, partition VBR or boot sector in file.

A "WarnDeprecated()" helper is added to warn the user about the
deprecated features, and to inform them to adjust their FREELDR.INI
file in accordance.

In addition, bump FreeLoader version to 3.2 (at last!): a lot of
features have been added or deprecated since its last release.
2024-04-19 21:45:41 +02:00
Oleg Dubinskiy
5949c20d97
[MMIXER] Fix additional data size initialization for different audio formats (#6753)
Calculate size of the additinal data based on the format tag specified by the caller.
For PCM wave format, it should be zero, and for all others,
it should be taken from cbSize member of WAVEFORMATEX structure.
- Initialize data size for each format appropriately.
- Append it to the total pin connect allocation size, to allocate enough memory for it.
- Use it as additional data size for requested wave format.
- Append it to the total size of data format.
- Add SAL2 annotations for MMixerInitializeDataFormat function.
Fixes two crashes in winmm:capture and winmm:wave winetests, which have been introduced by 12b3272d9e.
So this is an addendum to that commit.
CORE-19514
2024-04-18 23:19:35 +02:00
Justin Miller
ad9c634efa
[SDK] Don't just infinitely spam the DbgPrint in the bootloader (#6763) 2024-04-18 12:08:00 -07:00
Mark Harmstone
dd6c1c8843 [FREELDR] Allow Freeloader to boot Vista revamp of PR #1905 (#6479)
[FREELDR] Add "WindowsVista" boot type
[FREELDR] Set GDT correctly for Vista
[FREELDR] Map first page of memory, this is an observed behavior, and
also increases stability boot Checked windows 2003 SP2 ntoskrnl with
freeloader.
[SDK] Don't assert on big keys in bootloader

Co-authored-by: Justin Miller <justin.miller@reactos.org>
2024-04-18 09:28:54 -07:00
Stanislav Motylkov
6d853be981 [ZIPFLDR] Make function prototype consistent
It is the only function in that file that used this format, all the others are one line.

Spotted by Whindmar Saksit.
2024-04-18 18:22:17 +03:00
Stanislav Motylkov
359c9c7b42 [SHELL32] Update Russian (ru-RU) translation
Addendum to 9238a1762f.
2024-04-18 18:18:16 +03:00
Carlo Bramini
605fa32d45
[CALC] Fix input bug when display is in error. (#5988)
CORE-19191

Reproduce the same behaviour of the calculator for Windows XP when an error condition is met.
When the result is NaN and it cannot be printed, the error condition is cleared by pressing the CLEAR button.
2024-04-18 11:39:46 +02:00
Justin Miller
2a2556c5d0
[WIN32SS] Introduce the NATIVE_REACTX define and disable some Dx calls (#6025)
The code itself isn't wrong but we're entirely missing the logic needed
to make it work. This leads to spontaneous crashes with video drivers and
various unity games.
2024-04-17 21:47:49 -07:00
Justin Miller
9452b29c7f
[VFDLIB] GitHub actions workaround - Disable PDB generation for vfd.dll (#6762)
After a back and fourth investigation I've just decided to disable pdb generation for this ROSAPP for now.
We tried taking the code apart a bit and only building parts but alas it didnt yield any sucess.

disabling the AV also didn't help.
2024-04-17 20:24:33 -07:00
Joachim Henze
21a9f78b2d [COMCTL32] Pt.rc: Place accelerator FIXMEs 2024-04-18 01:53:20 +02:00
Katayama Hirofumi MZ
d383b20b01
[REGEDIT] Correctly limit splitter's X coordinates (#6758)
JIRA issue: CORE-19516
- Add ClampSplitBarX helper function to delete
  duplicated code.
- Use a signed value in WM_LBUTTONUP handling.
- Use ClampSplitBarX in ResizeWnd function,
  WM_LBUTTONDOWN, WM_MOUSEMOVE, and
  WM_LBUTTONUP handling.
2024-04-18 06:09:58 +09:00
Hermès Bélusca-Maïto
7b4f42470f
[FREELDR] Reformat the boot editor strings in the code. 2024-04-17 22:25:14 +02:00
Hermès Bélusca-Maïto
e5517176b8
[FREELDR] linuxboot: It doesn't need the BIOS boot drive number and partition.
Also document a little bit the RootDevice field in the boot sector;
add SAL2 annotations.
2024-04-17 22:25:13 +02:00
Hermès Bélusca-Maïto
c25a0e1919
[FREELDR:UI] Minor miscellaneous fixes.
- UiMessageBox(): Enlarge the default buffer used to printf msgbox strings.

- TuiUpdateDateTime(): When displaying the time, don't pad too much
  with spaces on the left.

- TuiDrawShadow():
  * Pre-calculate whether we need to show the right/bottom shadows,
    and whether the right-shadow has a double width.
  * Cap the right and bottom upper-bound coordinates before looping,
    in order to avoid buffer overflows if the given coordinates go
    beyond the screen.

- TuiDrawMsgBoxCommon(): Improve how the message box centering
  calculations are done:
  * When the "full-UI" is used (and center-menu is used), try to
    center the message box in the space between the header and
    the status bar.
  * Ensure the top-left box corner is inside the screen, in case
    the calculated message box borders go off-screen.

- TuiCalcMenuBoxSize():
  * Uniformize the way the menu box coordinates are calculated.
  * Reduce the space between menu box margins and the longest item.
  * Ensure the top-left menu corner is inside the screen, in case
    the calculated menu box borders go off-screen.
2024-04-17 22:19:43 +02:00
Hermès Bélusca-Maïto
c044201472
[FREELDR] Skip NULL-pointer entries in Argv when enumerating arguments.
A NULL pointer (not necessarily the terminating one) is a valid entry
in the Argv argument vector, according to the ARC specification
(Section 4.4 "Loaded-Program Conventions").
Thus, such pointer needs to be ignored when searching over the
argument vector.
2024-04-17 21:57:12 +02:00
Hermès Bélusca-Maïto
93245d385d
[FREELDR] arcsupp.c: Relicense my code to MIT and use SAL2 annotations. 2024-04-17 21:57:11 +02:00
Hermès Bélusca-Maïto
5b2dcdd03d
[FREELDR] BuildArgvForOsLoader: Add a terminating NULL pointer to the Argv vector.
Addendum to commits d05be0da3 and bd451f240.

This is required for POSIX compliance, which the ARC specification obeys.

See Section 2.1.2.2.1 (ANSI X3.159-1989) or 5.1.2.2.1 (ISO/IEC 9899:x)
"Program startup":
```
If they are declared, the parameters to the main function shall obey
the following constraints:
— The value of argc shall be nonnegative.
— argv[argc] shall be a null pointer.
[...]
```

See also https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
2024-04-17 21:57:09 +02:00
Joachim Henze
6cb18bc6a4
[COMDLG32] *.rc: Tweak spaces in IDS_INVALID_FILENAME (#6736)
This saves a few bytes in the binary, e.g.
comdlg32.dll master 0.4.15-dev-7887-g64a59a1 RosBEWin2.2.2 GCC8.4.0 dbg x86 shrinks
from 1.011.712 bytes to 1.009.664 bytes.

Furthermore it syncs the translations at this line, because pt-PT.rc already applied such a tweak.

Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
2024-04-17 16:53:09 +02:00
Timo Kreuzer
95bf896b10 [CRT] crtdefs.h: Wrap localeinfo_struct in ifdef
This prevents a redefinition error, when GCC 13 host headers are included when compiling c++ code.
2024-04-16 20:10:38 +02:00
Katayama Hirofumi MZ
1b85a5fa06
[BROWSEUI] SHExplorerParseCmdLine: Fix parsing of /root (#6752)
Remove excessive (!pInfo->pidlPath) check in SHExplorerParseCmdLine
function.
JIRA issue: CORE-16939
2024-04-15 09:41:01 +09:00
Carl J. Bialorucki
ea34ecc9ec
Check if dwBandID is NULL before getting band object (#6738)
fixes CORE-18807 'Our explorer.exe ATL-asserts when executed on XPSP3'
which most likely got unhidden when we enabled the ATL-assertions in
0.4.15-dev-5023-g 55343f04b0
2024-04-15 01:08:01 +02:00
Katayama Hirofumi MZ
b1de3bfb2b
[SHELL32] Fix ParseDisplayName Part 4 (#6747)
Follow-up to #6746. Reduce SHParseDisplayName
failures.
JIRA issue: CORE-19495
- Re-implement CDrivesFolder::ParseDisplayName
  method.
2024-04-15 03:25:20 +09:00
Katayama Hirofumi MZ
63e5885b37
[SHELL32] Fix ParseDisplayName Part 3 (#6746)
Follow-up to #6740. Reduce SHParseDisplayName
failures.
JIRA issue: CORE-19495
- Add CRegFolder::_IsInNameSpace helper method.
- Half-implement CRegFolder::ParseDisplayName
  method.
- Parse class string by using GUIDFromStringW
  function.
- Return CO_E_CLASSSTRING for invalid CLSID
  string.
2024-04-15 03:24:09 +09:00
Timo Kreuzer
8feb078692 [NTOS:KE/x64] Use movaps instead of movdqa
It does the same thing, but is one byte shorter.
2024-04-14 16:09:20 +02:00
Timo Kreuzer
8d459f2820 [NTOS:KE/x64] Clean up EnterTrap/ExitTrap
- Always save and restore all non-volatile registers, including xmm
- Remove the obsolete flags
2024-04-14 16:09:20 +02:00
Timo Kreuzer
05456808e8 [NTOS:KE/x64] Fix handling of non-volatiles in trap vs exception frame
The registers that are saved/restored in the trap / exception frame need to be consistent between all entry/exit points as well as the functions that convert between trap/exception frame and context. The trap frame contains only the non-volatile registers and rbp, the rest is saved in the exception frame.
The previous code didn't save rbp in the syscall handler, which led to it being clobbered when exiting though KiServiceExit2 rather than returning back to the syscall exit path. Also KeContextToTrapFrame would use rbx, rsi and rdi from the trap frame, which wouldn't be saved there by the syscall handler.
2024-04-14 16:09:20 +02:00
Timo Kreuzer
83e741c643 [RTL/x64] Implement RtlRaiseException in asm
This fixes invalid contexts being passed to RtlDispatchException. Also update the ExceptionAddress field in the EXCEPTION_FRAME, to match the Rip value in the CONTEXT, which is required for proper unwinding.
2024-04-14 14:12:35 +02:00
Joachim Henze
ba170757d6
[REGEDIT] Anonymize CONTROL "List1" (#6735)
This saves a few bytes in the binary, e.g.
regedit.exe master 0.4.15-dev-7887-g64a59a1 RosBEWin2.2.2 GCC8.4.0 dbg x86 shrinks
from 1.049.600 bytes to 1.049.080 bytes.

Furthermore it syncs the translations at this line, because es-ES.rc even translated that identifier to "Lista1" already.
2024-04-14 11:10:01 +02:00
Carl J. Bialorucki
78dc504e72
[SHELL32] Initialize MenuItemInfoW struct in AddStaticContextMenusToMenu (#6737)
This prevents an issue where clicking on most of the icons on the desktop
that isn't the file explorer causes explorer to throw an exception,
and also prevents another issue where most applications won't launch from the start menu;
at least on MSVC builds running on VirtualBox 5.2.44.

^- I am pretty sure, that this was not always the case. The guilty rev is yet unknown though.
2024-04-14 00:12:35 +02:00
Serge Gautherie
b8abfa76ca
[DOC] 3rd Party Files.txt: Complete 'win-iconv' (#6691)
Upstream (code) reads:
`win_iconv is placed in the public domain.`
2024-04-13 21:23:15 +02:00
Timo Kreuzer
fc6e23d6b8 [NDK/x64] Remove #pragma pack(push,4) around KPRCB/KPCR 2024-04-13 17:59:04 +02:00
Timo Kreuzer
bb444b93d9 [RTL/x64] Handle STATUS_UNWIND_CONSOLIDATE in RtlRestoreContext
It's not entirely correct yet and will probably fail on recursive c++ exceptions, but it fixes basic c++ exception handling.
2024-04-13 14:34:23 +02:00
Katayama Hirofumi MZ
ff282894a8
[SHELL32] Refactor and simplify CDesktopFolder (#6741)
Follow-up to #6721. This PR can reduce 1KB of
binary size.
JIRA issue: CORE-19495
- Delete CStubFolderBase and derived classes.
- Add
  CDesktopFolder::_ParseDisplayNameByParent
  method.
- Don't use excessive IShellFolder objects in
  parsing display names.
- Simplify and reduce code.
2024-04-13 21:08:39 +09:00
Katayama Hirofumi MZ
7fdec96009
[SHELL32] Fix ParseDisplayName Part 2 (#6740)
Follow-up to #6721. Reduce
SHParseDisplayName failures.
JIRA issue: CORE-19495
- Re-implement CFSFolder::ParseDisplayName
  method to validate the names.
- Add CFSFolder::_ParseSimple,
  CFSFolder::_GetFindDataFromName, and
  CFSFolder::_CreateIDListFromName helper
  methods.
- Add PathIsDotOrDotDotW, PathIsValidElement,
  PathIsDosDevice, and SHILAppend helper
  functions.
- Delete GetNextElementW and add
  Shell_NextElement function.
2024-04-13 21:07:12 +09:00
Ratin Gao
f61e14f554 [NTDLL][ADVAPI32][ADVAPI32_APITEST][CRYPTLIB] Add hash API exports for NT6+ and apitests with small fixes
- For NT6.0+, NTDLL exports those hash APIs that ADVAPI32 thunks forward to
- Fix undocumented context structure layout and content
- Add apitests to verify both of hash result and structure content
2024-04-13 12:41:36 +02:00