Commit graph

75620 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto bd451f240f
[FREELDR] Code fixes and enhancements.
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.
2019-08-31 01:42:46 +02:00
Hermès Bélusca-Maïto 602fc29ad4
[FREELDR] Formatting only. 2019-08-31 01:42:40 +02:00
Hermès Bélusca-Maïto 98a44b4f9b
[FREELDR] Update the FREELDR.INI documentation / template. 2019-08-31 01:42:23 +02:00
Hermès Bélusca-Maïto 41ad62ea69
[FREELDR] Move around & static-ify some disk/partition functions. 2019-08-31 00:25:06 +02:00
Stanislav Motylkov 32fb2e7b5f [VIDEOPRT] Fix uninitialized Reserved bit field in PciSlotNumber
CORE-16317
2019-08-31 00:19:03 +02:00
Stanislav Motylkov 8c36145087 [XBOXVMP] Add Xbox video miniport driver
Also make XboxVmp driver compatible with Video Port driver, specify
vendor id and device id explicitly in VideoPortGetAccessRanges() call

CORE-16317
2019-08-31 00:19:03 +02:00
James Tabor a02b3da183 Update Header
Add missing structure.
2019-08-29 15:47:56 -05:00
Colin Finck c8681feee9
Fix the ntstrsafe.h tests to make sense, actually succeed using ntstrsafe.h from Win10 (10.0.15063), and fix ReactOS' ntstrsafe.h to also pass these tests. (#1859) 2019-08-28 22:42:52 +02:00
Colin Finck 46ed46c73f
Fix and unify function prototypes for ntstrsafe functions taking variadic arguments. 2019-08-28 22:35:01 +02:00
Colin Finck 331e331209
[FORMATTING] Restore some kind of style to ntstrsafe.h, considering all comments in PR #522 and #523. 2019-08-28 22:32:49 +02:00
Hernán Di Pietro 99818568ed
[DDK] RtlUnicodeStringPrintf(Ex) implementations and ntstrsafe.h tests (#522, #523)
[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
2019-08-28 22:28:13 +02:00
Shy Zedaka 162e43d927 [TRANSLATION][UTILMAN] Translations for UTILMAN and some other stuff (#1880) 2019-08-27 13:04:34 +02:00
maharmstone e6a9aafe58 [CMLIB] Clean volatile registry entries in the same manner as Windows (#1883)
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.
2019-08-27 02:39:27 +02:00
Jose Carlos Jesus d5dca45e51 [WIN32SS][USER][EXPLORER] Add/Update portuguese translation (#1882) 2019-08-26 21:01:41 +02:00
Carlo Bramini 055c5a9bb7 [CALC] Enable support for HTMLHELP (#1877)
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'.
2019-08-26 16:14:01 +02:00
Katayama Hirofumi MZ ca967db5ca
[MEDIA][FONTS] Add Verdana fonts (#1881)
- 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
2019-08-26 22:19:06 +09:00
Katayama Hirofumi MZ e85e396438 [ROSAPPS][SHLEXTDBG] Delete DbgPrint hack for gcc (fix build) 2019-08-26 21:36:59 +09:00
Katayama Hirofumi MZ 0f06035c9b [MEDIA][FONTS] Make MS Sans Serif ells sans serif CORE-16166 2019-08-26 10:07:56 +09:00
Katayama Hirofumi MZ 24e5d36d5d [MEDIA][FONTS] Adjust internal leading of Baltic MS Sans Serif 2019-08-26 03:36:48 +09:00
Eric Kohl 324afc252c [NETAPI32] Implement DsEnumerateDomainTrustsW 2019-08-25 18:23:38 +02:00
Ioannis Adamopoulos 7eb28dd0a9 Fix build 2019-08-25 14:56:12 +03:00
Eric Kohl abeb3324fb [NETAPI32] Implement DsAddressToSiteNamesA and DsAddressToSiteNamesExA 2019-08-25 11:39:53 +02:00
Ioannis Adamopoulos e419195d37 [HEADERS] Move some helpers from undocshell.h to shellutils.h as they didn't cover anything undocumented. Merge traycmd.h in undocshell.h as both contain just undocumented shell definitions. 2019-08-25 12:20:52 +03:00
Eric Kohl 121f0a5c50 [NETAPI32] Fix a typo in DsDeregisterDnsHostRecordsA
Thank you very much UserNT and Thomas for the hint!
2019-08-25 11:15:00 +02:00
Katayama Hirofumi MZ bfea773ee5 [SETUPLIB][USETUP] Fix build about switch 2019-08-25 12:07:31 +09:00
Katayama Hirofumi MZ 7426a31770 [MEDIA][FONTS] Add Thai MS Sans Serif (ssee874.fon) CORE-16166 2019-08-25 11:37:26 +09:00
Hermès Bélusca-Maïto 59acff79e5
[SETUPLIB][USETUP] Slightly modify how and when the HW system partition is detected and used.
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.
2019-08-25 02:38:53 +02:00
Hermès Bélusca-Maïto 626c654a10
[SETUPLIB][USETUP] Code simplifications & fixes.
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...
2019-08-25 02:38:52 +02:00
Eric Kohl c9537b392b [NETAPI32] Implement DsDeregisterDnsHostRecordsA 2019-08-24 22:57:36 +02:00
Eric Kohl 47b749aa31 [NETAPI32] Implement DsGetDcNameWithAccountA 2019-08-24 21:40:11 +02:00
Eric Kohl 792d0f6b78 [NETAPI32] Implement DsGetDcSiteCoverageA 2019-08-24 19:44:37 +02:00
Eric Kohl 61ac4f1ee9 [NETAPI32] Add the NetpAllocStrFromWStr helper function 2019-08-24 14:00:33 +02:00
Eric Kohl 3d5c682cd8 [NETAPI32] Implement DsGetSiteNameA
Also add the NetpAllocAnsiStrFromWStr helper function.
2019-08-24 13:15:41 +02:00
Eric Kohl 0b129da05c [NTOSKRNL] Fix indentation. No code changes! 2019-08-24 10:02:55 +02:00
Mark Jansen 6d2381631f
[TESTS] Add a test for spec2def 2019-08-23 18:10:28 +02:00
Timo Kreuzer 767d424b0a [CMAKE] Turn C4715: "'function': not all control paths return a value" into an error on MSVC builds 2019-08-23 14:47:39 +02:00
Mark Jansen 1539fb1414
[NTOSKRNL] Demote some noisy dprints 2019-08-23 13:03:36 +02:00
Mark Jansen 4872912eb2
[SETUPAPI] Demote some noisy dprints 2019-08-23 13:03:36 +02:00
Mark Jansen 029b8f2cf9
[NTDLL] Use the embedded manifest from the process to check compatibility. 2019-08-21 18:57:52 +02:00
Shy Zedaka cbf47846e7 [TRANSLATION] Changes to Newdev and hdwwiz 2019-08-21 18:49:59 +02:00
Shy Zedaka cc8180fe63 [TRANSLATION] Change the recycle bin from 'Trash' to 'Recycle bin' 2019-08-21 18:49:59 +02:00
Serge Gautherie 963bae1a11 [README.WINE] Update paths and add winetests/iphlpapi (#1866) 2019-08-21 09:01:47 +02:00
Mark Jansen 9853eab1ea
[CRT_APITEST] Exclude a test with the same rule as in the cmakelist 2019-08-20 22:31:56 +02:00
Mark Jansen ca4b001544
[NTDLL_VISTA] Fix the build for arm 2019-08-20 22:31:56 +02:00
Mark Jansen 6872cef0da
[FRAMEDYN[ARM] Fix some exports 2019-08-20 22:31:55 +02:00
Mark Jansen 419d7e96ad
[NTDLL][ARM] Export pow 2019-08-20 22:31:55 +02:00
Mark Jansen 69cd1ebbbd
[TIMEOUT] Use Int32x32To64 instead of __emul 2019-08-20 22:31:55 +02:00
Mark Jansen b445fef904
[SDK] Update Int32x32To64 macro for arm 2019-08-20 22:28:11 +02:00
Mark Jansen 35aeaa2397
[RUNTMCHK] Provide fallback memset for arm builds 2019-08-20 22:28:11 +02:00
Mark Jansen 93b2d5597e
[FREELDR][ARM] Suppress error about unused var 2019-08-20 22:28:11 +02:00