This fixes the bug when VidInitialize asks for different translated addresses
and VgaIsPresent always returns FALSE either because the machine does not have
VGA controller at all (e.g. 86Duino Zero), or it does have video hardware
that is not compatible with VGA standard (e.g. Original Xbox).
The problem investigated by Stanislav Motylkov. Suggested fix by Thomas Faber.
CORE-14625 CORE-16216 CORE-16222
Co-authored-by: Thomas Faber <thomas.faber@reactos.org>
CORE-16356
Therefore the ERRORLEVEL value will be correctly set in accordance on
return from the utility in cmd.exe, and conditional tests based on this
returned value will succeed as they should.
- Reserve the pipe NtControlPipe0 for the security process.
- Count regular service control pipes from 1.
- Use I_ScIsSecurityProcess to identify the security process.
- Services.exe uses the SECURITY_SERVICES_STARTED event to notify the security process that NtControlPipe0 is ready for use.
CORE-9023
FIXES:
======
- Fix parsing of the multiboot options string.
NOTE: They are not yet treated in a case-insensitive manner!
- Fix a bug in ArcOpen() so that it correctly skips the first path
separator (after the adapter-controller-peripheral ARC descriptors).
The path separator can be either a backslash or a slash (both are
allowed according to the specs); they were also already handled
correctly in other parts of the code.
- Fix DissectArcPath() so as to:
* **OPTIONALLY** (and not mandatorily!) return the path part that follows
the ARC adapter-controller-peripheral elements in the ARC path;
* make it correctly handle the (yes, optional!!) partition() part in the
ARC path, for the multi(x)disk(y)rdisk(z) cases.
ENHANCEMENTS:
=============
- Directly retrieve the default OS entry as we enumerate them and
build their list (i.e. merge the GetDefaultOperatingSystem() helper
within InitOperatingSystemList()).
- Directly use the opened 'FreeLoader' INI section via its ID in the
different functions that need it.
- Make the custom-boot and linux loaders honour the boot options they are
supposed to support (see FREELDR.INI documentation / template).
This includes the 'BootDrive' and 'BootPartition' (alternatively the ARC
'BootPath').
This also allows them to take into account the user-specified choices in the
FreeLdr custom-boot editors.
- Modify the FreeLdr custom-boot editors so as to correctly honour
the priorities of the boot options as specified in the FREELDR.INI
documentation / template.
- Use stack trick (union of structs) to reduce stack usage in the
FreeLdr custom-boot editors, because there are strings buffers that are
used in an alternate manner.
- Extract out from the editors the LoadOperatingSystem() calls, and
move it back into OptionMenuCustomBoot(), so that when this latter
function is called there is no risk of having a stack almost full.
- When building the ARC-compatible argument vector for the loaders, add
the mandatory "SystemPartition" path. This allows the loaders to NOT
call the machine-specific MachDiskGetBootPath() later on (this data is
indeed passed to them by the boot manager part of FreeLdr).
- Improve the FsOpenFile() helper so as to make it:
* return an adequate ARC_STATUS instead of a mere uninformative BOOLEAN;
* take open options, as well as a default path (optional) that would be
prepended to the file name in case the latter is a relative one.
- Make RamDiskLoadVirtualFile() return an actual descriptive ARC_STATUS
value, and make it take an optional default path (same usage as the one
in FsOpenFile() ).
+ Remove useless NTAPI .
- UiInitialize() and TuiTextToColor(), TuiTextToFillStyle(): load or
convert named settings into corresponding values using setting table and
a tight for-loop, instead of duplicating 10x the same parameter reading
logic.
- UiInitialize(): Open the "Display" INI section just once. Remove usage
of DisplayModeText[] buffer.
- UiShowMessageBoxesInSection() and UiShowMessageBoxesInArgv(): reduce
code indentation level.
ENHANCEMENTS for NT OS loader:
==============================
- Don't use MachDiskGetBootPath() but use instead the "SystemPartition"
value passed via the ARC argument vector by the boot manager
(+ validation checks). Use it as the "default path" when calling
FsOpenFile() or loading the ramdisk.
- Honour the FreeLdr-specific "Hal=" and "Kernel=" options by converting
them into NT standard "/HAL=" and "/KERNEL=" options in the boot
command line.
Note that if the latter ones are already present on the standard "Options="
option line, they would take precedence over those passed via the separate
"Hal=" and "Kernel=" FreeLdr-specific options.
Also add some documentation links to Geoff Chappell's website about
how the default HAL and KERNEL names are chosen depending on the
detected underlying platform on which the NT OS loader is running.
[KMTESTS:RTL] (CORE-14565)
+ Added buffer overrun tests.
+ New style header.
+ ISO C90 compatibility
[DDK] (CORE-9819): RtlUnicodeStringPrintf(Ex) and RtlUnicodeStringValidate(Ex) fixes plus formatting.
[DDK]: Cosmetic changes (NTSTATUS variable naming and tabs)
[DDK] First implementation of Unicode functions for NtStrSafe (CORE-9819)
+ This implementation does not modify the interface of previous functions.
+ Since we need length returned for the destination UNICODE_STRING.Length field:
- an intermediate "Len" postfixed function was added with optional
argument to return the _vsnwprintf character count.
- Wide Printf(Ex) functions already existent work now call new Rtlp
private worker functions.
+ For several UnicodeStringPrintf(Ex) tests, see work going on CORE-14565
NOTES:
+ MSDN says they won't insert NULL characters on formatted strings. But
seems this is incorrect at MSDN (interpret this as DONT ASSUME NULL-termination).
We return zero-terminated strings, and MS functions seems to do the same.
(XP DDK 7.1)
[DDK] First implementation of Unicode functions for NtStrSafe (CORE-9819)
+ This implementation does not modify the interface of previous functions.
+ Since we need length returned for the destination UNICODE_STRING.Length field:
- an intermediate "Len" postfixed function was added with optional
argument to return the _vsnwprintf character count.
- Wide Printf(Ex) functions already existent work now call new Rtlp
private worker functions.
+ For several UnicodeStringPrintf(Ex) tests, see work going on CORE-14565
NOTES:
+ MSDN says they won't insert NULL characters on formatted strings. But
seems this is incorrect at MSDN (interpret this as DONT ASSUME NULL-termination).
We return zero-terminated strings, and MS functions seems to do the same.
(XP DDK 7.1)
[DDK] Fixed bad NtStrSafe.h va_start call (CORE-9819)
Update on RtlUnicodeStringPrintfEx plus cosmetic changes.
[DDK] First implementation of Unicode functions for NtStrSafe (CORE-9819)
+ This implementation does not modify the interface of previous functions.
+ Since we need length returned for the destination UNICODE_STRING.Length field:
- an intermediate "Len" postfixed function was added with optional
argument to return the _vsnwprintf character count.
- Wide Printf(Ex) functions already existent work now call new Rtlp
private worker functions.
+ For several UnicodeStringPrintf(Ex) tests, see work going on CORE-14565
NOTES:
+ MSDN says they won't insert NULL characters on formatted strings. But
seems this is incorrect at MSDN (interpret this as DONT ASSUME NULL-termination).
We return zero-terminated strings, and MS functions seems to do the same.
(XP DDK 7.1)
[KMTESTS:RTL] Tests for new RtlUnicodePrintf(Ex) functions (CORE-14565)
+ 45 Tests working.
+ Lacks remaining non-Unicode functions in NtStrSafe.h for now.
+ Used for first tests on CORE-9819
[KMTESTS/RTL] Fixed test not taking care of null (CORE-14565)
[DDK] Fixed bad NtStrSafe.h va_start call (CORE-9819)
[KMTESTS:RTL] First Test.
Update on RtlUnicodeStringPrintfEx plus cosmetic changes.
[KMTESTS] Added NtStrSafe to test lists (CORE-14565)
First commit: Skeleton for test implementation + Addition to COMMON SOURCES in kmtests Cmake lists.
WIP.
+Implementation of RtlStringVPrintfWorkerLenW, RtlStringVPrintfExWorkerLenW to avoid changing existing public functions. This is required as existent functions did not return vsnprintf result, so we didn't have any return info to update UNICODE_STRING.Length.
+Additional implementation of RtlUnicodeStringValidate for checking purposes.
+Former RtlStringVPrintfWorker(ex) refactored to RtlInternalStringVPrintf(Ex)WorkerW.
+No ANSI functions affected as we didn't need them for Unicode printf's.
WIP: RtlUnicodeStringPrintf
This fixes the crashes in HvpGetCellMapped on Windows Server 2003 when booting from Freeloader, as mentioned in maharmstone/btrfs#16.
When the bootloader loads the system hive, it cleans the data pertaining to any volatile keys. The Windows bootloader does this by setting SubKeyCounts[Volatile] to 0. After boot, the kernel marks any cell where this is 0 but SubKeyLists[Volatile] isn't HCELL_NIL as dirty, meaning that the sanitized version will then get flushed to the disk.
Because Freeloader sets SubKeyLists[Volatile] to HCELL_NIL straightaway, Windows thinks the cell is clean, and can unload it without flushing. If it then reads it from the disk, it will crash in HvpGetCellMapped due to the stale volatile pointers.
If you break on nt!CmpInitializeSystemHive on Windows and "gu" to the let the function run, you'll see that DirtyVector of the HHIVE has only the first 8 bits set. If you run it using the official bootloader, it'll have a lot more than that.
Nowadays ReactOS includes support for htmlhelp.h and a working implementation of HHCTRL.OCX. Although current imported HHCTRL.OCX suffers of this issue:
https://bugs.winehq.org/show_bug.cgi?id=47379
See also CORE-15019
+ Revert 'intptr_t' to 'size_t'.
- Add "Verdana", "Verdana Bold", "Verdana Bold Italic" and "Verdana Italic" fonts by duplicating "Bitstream Vera Sans" fonts and renaming them.
- Delete some "Verdana" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Verdana". Their display names are "Verdana", "Verdana Bold", "Verdana Bold Italic" and "Verdana Italic". Their font filenames are verdana.ttf, verdanab.ttf, verdanaz.ttf and verdanai.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug. CORE-16264
CORE-16274
SETUPLIB:
=========
- Find the system partition initially when we create the list of
partitions.
- Split the old CheckActiveSystemPartition() helper in two helpers:
FindSupportedSystemPartition() and SetActivePartition(). This allows
simplifying slightly the former one, and allows the user, in an
interactive situation, to decide whether the "supported system
partition" found can actually be used or not.
- Remove the "OriginalSystemPartition" hack in the PARTLIST structure.
- Add a note regarding the SystemPartition member in PARTLIST.
USETUP:
=======
- Use the introduced helpers from above. If the "system" partition we
are going to use, in case we install ReactOS on a fixed disk, is *NOT*
the same as the original one (e.g. because it is detected to be not
supported by ReactOS...), display an informative screen to the user
and let him confirm whether or not he wants to change the partition.
If we install on a fixed disk, try to find a supported system partition
on the system. Otherwise if we install on a removable disk, use the
install partition as the system partition instead.
This allows providing a fix for CORE-16274.
SETUPLIB:
=========
- Remove useless HiddenSectors member in PARTENTRY structure.
- InsertDiskRegion() helper returns a BOOLEAN success.
- CreateInsertBlankRegion() helper sets LogicalPartition.
- Simplify the InitializePartitionEntry() helper so that its PartEntry
parameter is clearly the one that is being initialized (i.e. converted
from a blank region to) an actual partition, and use the helper
CreateInsertBlankRegion(). The calculations for the StartSector and
SectorCount are exactly equivalent with the old version of this
function. Also make it return a BOOLEAN success instead.
+ Add some extra validation checks.
+ Adjust CreatePrimaryPartition(), CreateExtendedPartition() and
CreateLogicalPartition() in this regard.
- Better handling of "RAW"-mounted partitions: treat them as
"Unformatted" only if they are RAW *AND* their PartitionType is one of
those associated with FAT file-system. Otherwise we cannot decide
whether they are indeed unformatted or have an unknown file-system on
them, therefore treat them as the latter.
In this regard, the IsSupportedActivePartition() helper should not
look for FileSystem == RAW but instead only look whether the partition
is Unformatted.
This should help with situations similar to the one described in CORE-16274
where a partition with a genuine file-system but not recognized by
ReactOS (because we currently do not have the EXT2/3/4 filesystem
driver loaded during 1st-stage setup due to commit 5a650f6b) and
therefore mounted as RAW, was thought to be unformatted.
USETUP:
=======
- Use the "global" SystemPartition pointer: this is the "system"
partition we will actually use. It can be different from the actual
one of the computer, for example when we install ReactOS on a
removable disk. This allows also to simplify the code.
- Remove the single-used DestinationDriveLetter variable.
- Remove BuildInstallPaths() helper and use InitDestinationPaths()
directly instead.
- Always mention the disk where the partition being formatted is.
- Cleanup old code comments, add assertions here & there...