Commit Graph

86248 Commits

Author SHA1 Message Date
Timo Kreuzer
4e3c0529cf [RTL/x64] Fix RtlCaptureContext/RtlpRestoreContextInternal in kernel mode
According to tests, legacy fp state is not saved in kernel mode.
Also add an int 2c to the path that changes cs, as it should not be used and probably never will be.
2024-10-21 10:17:11 +03:00
Hermès Bélusca-Maïto
467efcb423
[USETUP] Adjust translations of the BootLoaderRemovableDiskPageEntries page.
The page is shown only when the user wants to install the bootloader
on a removable disk; not when there was a problem while installing it.
2024-10-20 16:51:29 +02:00
Hermès Bélusca-Maïto
424278db3f
[SETUP:REACTOS] Add bootloader installation support (#7310)
CORE-13525
2024-10-20 16:51:26 +02:00
Hermès Bélusca-Maïto
b3cd576737
[SETUPLIB][USETUP] Introduce a bootloader installation helper (#7310)
CORE-13525

This is done so that the caller doesn't need to know details
about particular architecture specifics, like VBR, MBR etc.

Extra checks and specific handling is also performed for supporting
bootloader installation on removable media:
- verify whether the media is a floppy or some other removable media,
- depending on which, a suitable file system is chosen,
- and if the media is not a floppy, do the supplemental partition
  verifications to determine whether the media is a "super-floppy"
  (in the partitioning sense).
2024-10-20 16:51:25 +02:00
Hermès Bélusca-Maïto
636e2e9172
[SETUPLIB] Introduce a helper for copying bootloader files (#7310)
This function could be generalized later to copy other files necessary
for the bootloader; removing also the currently hardcoded placement in
the installation source directory, and instead, using a configurable
path (specified in txtsetup.sif); etc.

Adapted from a commit by Timo Kreuzer (see PR #7420)

Co-Authored-By: Timo Kreuzer <timo.kreuzer@reactos.org>
2024-10-20 16:51:24 +02:00
Hermès Bélusca-Maïto
d6d3d0eacd
[SETUPLIB] Add helpers to determine whether a disk is partitioned as a "super-floppy" (#7310) 2024-10-20 16:51:23 +02:00
Hermès Bélusca-Maïto
ad5d9aa28a
[SETUPLIB] Add UNICODE_STRING versions of the pOpenDevice helpers (#7310)
+ Use a FILE_SHARE_ALL define. Based on a suggestion from Whindmar Saksit.
2024-10-20 16:51:16 +02:00
Timo Kreuzer
1d3bce1a59 [NTOS:KE] Make KeFlushQueuedDpcs SMP ready
KeFlushQueuedDpcs is used by some drivers, when unloading or removing a device, to be sure no DPC is still running their code. On a UP system this can be done "inline", on an SMP system, it requires to send an IPI to each processor that has DPCs queued and also synchronize it with the calling thread, which is what KeSetSystemAffinityThread does implicitly: When a queued DPC was detected on a remote processor (implying that processor is currently running at DISPATCH_LEVEL or above), KeSetSystemAffinityThread will schedule the current thread on that processor and send a DPC interrupt. The remote processor will handle that DPC interrupt once it is back below DISPATCH_LEVEL. It will only run the current thread, after all queued DPCs (including threaded DPCs) have finished running.
2024-10-20 16:28:11 +03:00
Timo Kreuzer
bf95874c2d [REACTOS] Improve handling of non-standard names
- Link oldnames instead of defining names
- Define _CRT_DECLARE_NONSTDC_NAMES to 1 where needed
- Remove header hacks
2024-10-20 14:12:25 +03:00
Timo Kreuzer
b707be90a1 [REACTOS] Use standard conforming names
- Use _alloca instead of non-standard alloca
- Use _TCHAR instead of non-standard TCHAR
- Use _off_t instead of deprecated off_t
- Use _O_BINARY instead of O_BINARY
2024-10-20 14:12:25 +03:00
Timo Kreuzer
1de09c477c [3RDPARTY] Link to oldnames for stricmp/wcsicmp 2024-10-20 14:12:25 +03:00
Timo Kreuzer
a3bab12b50 [OLDNAMES] Add _CRT_NONSTDC_NO_DEPRECATE interface definitions 2024-10-20 14:12:25 +03:00
Timo Kreuzer
e4930be4ff [REACTOS] Use the ISO C and C++ conformant names: _wcsicmp, _stricmp
Stop using non-conforming wcsicmp, stricmp, strcasecmp
2024-10-20 14:12:25 +03:00
Timo Kreuzer
fb9571ee3c [WIN32K] Use UserRefObjectCo in co_UserFreeWindow 2024-10-20 09:35:14 +03:00
Timo Kreuzer
08b9354ff3 [WIN32K/USER] Fix callout object referencing in co_IntUpdateWindows
Move UserRefObjectCo, so that it covers co_IntSendMessage as well.
This caused a use-after-free during testing.
2024-10-20 09:35:14 +03:00
Timo Kreuzer
9eca7c52f6 [WIN32K] ASSERT that all callout references have been cleaned up on thread exit 2024-10-20 09:35:14 +03:00
Justin Miller
690783179e [SDK][WIN32SS] Make Them Build 2024-10-19 13:45:59 -07:00
Justin Miller
50647e58e4 [SDK] Disable the unknown-pragma for GCC 2024-10-19 13:45:59 -07:00
Justin Miller
e09679f2d1 [SDK] Import WDDM Headers from MIT varient in libdxg 2024-10-19 13:45:59 -07:00
William Kent
d4719197b2
[MKISOFS] Fix Clang check for macOS platforms (#7037)
* [MKISOFS] Fix Clang check for macOS platforms

On macOS, CMAKE_C_COMPILER_ID is "AppleClang". While certainly Clang,
this does not match the exact string "Clang" that is being checked for,
and as a result the warning flags guarded thereby are not passed to the
compiler. With this change CMake will recognize both Clang and AppleClang.

* Update sdk/tools/mkisofs/CMakeLists.txt
2024-10-19 12:15:31 -07:00
Hermès Bélusca-Maïto
90831e7451
[SERVICES] Use pointers to const string (PCWSTR) instead of non-const for argv (#7440)
const PCWSTR* == const (const WCHAR*)* == (const WCHAR*) const *
2024-10-19 18:29:03 +02:00
Daniel Victor
3fd6e34ab8
[FREELDR/x64] Fix the Multiboot pointer size (#7469)
Addendum to b524c18a3e. CORE-18374
2024-10-19 18:50:41 +03:00
Daniel Victor
b524c18a3e [FREELDR/x64] Add Multiboot header 2024-10-19 17:54:39 +03:00
Timo Kreuzer
398486f5f6 [ATL] CComCriticalSection destructor should not be virtual
Fixes GCC 13 build of shdocvw
2024-10-19 16:16:51 +03:00
Timo Kreuzer
fd265bd7ac [CMAKE] Enable proper definition of __cplusplus macro on MSVC
MSVC defaults to always reporting 199711L to satisfy broken C++ code. You have to add a command line argument to make it work correctly. See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170
2024-10-19 15:11:44 +03:00
Whindmar Saksit
5797340164
[SHELL32] Fix broken delete file type verb (#7462)
CORE-19809
2024-10-18 14:42:08 +02:00
Timo Kreuzer
30952992e1 [ADVAPI32] Add some missing Vista+ exports 2024-10-17 18:39:37 +03:00
Timo Kreuzer
b27429b126 [ADVAPI32][ETWTRACE] Add etwtrace library and link advapi32 to it on NT6+ 2024-10-17 18:39:37 +03:00
Timo Kreuzer
98e7e64391 [SOFTPUB] Replace some stubs with forwarders 2024-10-17 18:39:37 +03:00
Timo Kreuzer
a2a8ce4947 [WINSPOOL.DRV] Improve some stubs 2024-10-17 18:39:37 +03:00
Timo Kreuzer
a5ed119813 [MSVCRT] Properly export sprintf_s and _vcwprintf 2024-10-17 18:39:37 +03:00
Timo Kreuzer
bed8b2a0a6 [FREELDR][NDK][X64] Remove KIP0PCRADDRESS definition and mapping
It is not used by either ReactOS or Windows.
2024-10-17 18:31:32 +03:00
Timo Kreuzer
4e5e72fa12 [CMAKE] Silence ML's "Assembling ..." message 2024-10-17 12:01:17 +03:00
Serge Gautherie
4c84e191fd
[NTOS:KE/i386] KeStartAllProcessors(): ProcessorCount is a ULONG (#7455)
Let's be explicit.

Addendum to 516ccad (0.4.15-dev-7016).
2024-10-16 22:38:01 +02:00
Hermès Bélusca-Maïto
5d361b602d
[FREELDR] fs.c: Fix handling of file handles, (de)referencing, and direct-device access (#7414)
- The original code was just incrementing the reference counts (RefCounts)
  of the device objects or the device/file handles, without decrementing
  them when closing the handles. This is now fixed.

  Notice the following:

  * When opening a file on a device (disk), the device's (and its
    handle's) RefCount is incremented, and the file handle's RefCount
    is incremented as well.

  * When closing a file, the file handle's RefCount is decremented
    (and the file closed if the RefCount reaches zero), and the file's
    parent device handle is also closed, recursively.
    This has the effect of decrementing the parent device handle's
    RefCount, and the device's own RefCount is decremented as well.

  IMPORTANT NOTE: The usefulness of handle-level RefCount is still
  under question, and might be (consistently) removed in the future.

- Fix opening a device (disk) in direct access, when this device is
  already opened. Indeed, we previously allowed direct access only if
  the device was opened as such for the very first time (its RefCount
  = 0 originally); no filesystem mounting was attempted as well.
  Then for any later open-operations on this device (while keeping an
  already-opened handle to it), filesystem access was assumed.

  Thus, this problem would show up in two ways:

  * Either the device is first opened for direct access, this succeeded
    and no filesystem was mounted. Then, for any other open-operations,
    the filesystem was NOT mounted, and opening files on it would fail.
    Direct accesses would succeed but would create an unnecessary second
    file handle.

  * Or, the device is first opened for file-access: a filesystem was
    mounted and file opening would succeed. Any other file opening
    operation would succeed as well (if the file exists). But, a direct
    access open-operation would fail, because now any open-operations on
    the device would be assumed to be a file opening.

  This is now correctly fixed. If direct-open is requested, just do it.
  If this is a file opening, we open the device, then try to mount a
  filesystem on it (if not already done), then we try to open the file.

  If file opening fails, derereference the device.

- Pass the file path to the filesystem-specific Open() functions without
  truncating the leading path separator, if any. This has to be handled
  by the filesystem routines themselves.
2024-10-16 22:20:52 +02:00
Timo Kreuzer
7dcfda815c [SPEC2DEF] Use explicit ordinals on MSVC, too
This prevents MSVC from reordering the exports in a way that doesn't match our spec file. Also improve the algorithm to apply ordinals, by starting with the first specified ordinal, possibly reserving ordinals for anything declared without an ordinal before.
2024-10-16 20:00:26 +03:00
Whindmar Saksit
f271bebb71
[SHELL32] Exclude executable extensions from File Types dialog (#7452)
PathIsExeW is used and will exclude exe, com, pif, cmd, bat, scf and scr. The previous #6122 PR added support for the FTA_Exclude flag and that will exclude .lnk files.

CORE-19805
2024-10-16 14:09:33 +02:00
Serge Gautherie
54433319af
[USETUP] CabinetExtractFile(): Do not overwrite Status value (#7456)
Addendum to 5d4d912 (r15403).
2024-10-16 12:20:41 +02:00
Hermès Bélusca-Maïto
52192f19d6
[NTOS:KDBG] For SYSREG2: HACK emission of a 'bt' command when entering the debugger
CORE-19807
2024-10-14 23:37:22 +02:00
Hervé Poussineau
42914af218 [WIN32SS:ENG] Only accept VGASave service (ie vga.sys driver) as the real VGA device
CORE-19796
2024-10-14 23:26:11 +02:00
Hervé Poussineau
b4e781d72d [WIN32SS:ENG] Make gpPrimaryGraphicsDevice variable static 2024-10-14 23:26:11 +02:00
Hervé Poussineau
6e71e94242 [WIN32SS:ENG] Make gpVgaGraphicsDevice variable static 2024-10-14 23:26:10 +02:00
Hervé Poussineau
0d8e26588a [WIN32SS:USER] Remove assignation of gpPrimaryGraphicsDevice (already done in EngpUpdateGraphicsDeviceList) 2024-10-14 23:26:10 +02:00
Justin Miller
770adbc8a3
[WINETESTS] Fix warnings when compiling comctl32_winetest (#7316)
fix warnings when compiling comctl32_winetest
the comctl32 winetest just does a few things so properly mark the ros diff.
2024-10-14 14:14:56 -07:00
Hermès Bélusca-Maïto
b15963abb8
[NTOS:KDBG] Reintroduce the capability of KdbpCliInit() to interpret the KDBinit file (#4917)
Addendum to commit baa47fa5e.

Similarly to what was originally done, have KdbpCliInterpretInitFile()
parse the KDBinit file by breaking back into the debugger.
But contrary to before, replace the deprecated call to KdbEnter() by
a standard DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C) . This allows
KdbEnterDebuggerException() to do the KdbpCliInterpretInitFile() call.

Additional fixes and improvements:

- Run KdbpCliInterpretInitFile() in full KDBG environment (interrupts
  disabled, modified IRQL, own stack), like the usual interactive loop.

- The KDBinit data buffer must be in non-paged pool.

- Demote the "Could not open KDBinit" error to a DPRINT, so that it
  doesn't pollute the debug log when the KDBG init function is called
  early (before the storage stack is initialized), or if the file
  doesn't exist -- since this is an optional feature.
2024-10-14 22:51:54 +02:00
Hermès Bélusca-Maïto
b86c4bd522
[NTOS:KDBG] Small improvements for KdbpCliMainLoop() and KdbpDoCommand() (#4917)
- Move the printing pager state reset code (setting the number of
  printed rows and columns to zero, and the output aborted flag)
  to KdbpDoCommand(). This allows to keep the original behaviour,
  while also inheriting it whenever KdbpDoCommand() is invoked
  elsewhere (for example, from KdbpCliInterpretInitFile()).

- Use KdbPuts/Printf() instead of KdbpPrint() for the entry banners,
  so that they aren't subject to the current printing pager state.
  Do the same for the "command unknown" error in KdbpDoCommand().

- Add a "Type 'help' for a list of commands" banner, for the users.

- Replace the do-while-loop with a simple while-loop.
2024-10-14 22:51:52 +02:00
Hermès Bélusca-Maïto
842e40d7cd
[NTOS:KDBG] Minor code style for the following commits 2024-10-14 22:51:51 +02:00
Joachim Henze
478a9030a5 [SHELL32] ro-RO.rc: Strip unintended empty line that we don't have in en-US
Addendum to last commit 43d07fe695
which accidentally introduced it.
2024-10-14 20:40:36 +02:00
Whindmar Saksit
43d07fe695
[SHELL32] File Types dialog: Add functionality, optimize loading time (#6122)
- Support loading protocols like XP
- Support most of the relevant EditFlags
- Support reading/writing the AlwaysShowExt and BrowserFlags properties
- Loads the list much faster with optimized code and delaying the large icon and description string
- Reduce the number of magic buffer sizes by replacing them with defines that are in the ballpark of being correct
- Implemented column sorting
- Removed custom icon extraction code
- Removed IDS_FILE_EXT_TYPE string because it must be the same as IDS_ANY_FILE
- Don't touch verb keys that are not edited to retain the original REG type
- Don't clobber unchanged %1 icon location when editing a type

CORE-19756
2024-10-14 18:03:28 +02:00
Joachim Henze
798ea90784
[FREELDR] Less outdated version-hardcodes (#7384)
Those haven't been groomed anymore for more than 10 years. We had many thousands of
different freeldr builds with different behavior and bugs each, but nobody ever
did have the slightest motivation to update those hardcoded
FREELOADER_MAJOR_VERSION, FREELOADER_MINOR_VERSION, FREELOADER_PATCH_VERSION
from ver.h. And that is logical, because touching other modules will change the behavior
of freeldr as well, so it is absolutely impossible to groom anything like that correctly.
Instead we should simply do what we started to do in PR7383, which will at least give
some information (the actual sources it was built from) instead of some misleading voodoo-version.

This might slightly shrink the size of freeldr as well, but I was too lazy to measure by how much.
2024-10-13 19:23:38 +02:00