Commit graph

19 commits

Author SHA1 Message Date
Adam Słaboń fec827eeef
[FREELDR][NTOS:MM] Add security cookie generation to FreeLoader (#6270)
* [NTOS:MM] Misc improvements for cookie generation code

- Improve support for 64 bit images
- Improve LdrpFetchAddressOfSecurityCookie code

* [FREELDR] Add security cookie generation to FreeLoader

CORE-17808
2024-03-27 23:33:06 +02:00
Hermès Bélusca-Maïto 7112815e23
[FREELDR] PeLdrLoadImage: FileName -> FilePath and make it const. 2023-05-07 22:14:30 +02:00
Hermès Bélusca-Maïto 2221df213f
[FREELDR] Add cleanup in PE-image-handling-related failure code paths. 2022-02-18 20:24:49 +01:00
Hermès Bélusca-Maïto f6a13d452c
[FREELDR:NTLDR] Implement support for the SOS option.
CORE-9023, CORE-18033

- Reset the UI to a minimal one in SOS mode.

- In SOS mode, a trace of loaded files is displayed on the screen,
  instead of the usual progress bar.

- Add a callback to the PE loader to notify when imported DLLs are
  loaded for a main image. This allows getting an accurate SOS trace.
2022-02-06 23:53:41 +01:00
Hermès Bélusca-Maïto cfbec70e04
[FREELDR] Use strsafe functions in the PE loader. 2022-02-06 22:20:58 +01:00
Serge Gautherie c5e5e3117c
[FREELDR] Diverse improvements and fixes for CORE-12802. (#3466)
- Move a few lines around.
- Switch to RtlZeroMemory() from memset().
- Make while() more explicit.

For CORE-12802:
- Add/Fix FrLdrHeapAlloc() failure handling and related.
  Especially, add/fix FrLdrHeapFree() calls.

- Add/Improve ERR() to some FrLdrHeapAlloc() failure cases.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2021-11-19 01:49:55 +01:00
Hermès Bélusca-Maïto 9b1edceae1
[REACTOS] Fix some instances of DPRINTs with trailing whitespace before newlines. 2021-09-13 03:52:19 +02:00
Hervé Poussineau 5904361a54 [FREELDR] In PE loader, use cache to not load twice the start of the file
This is especially important in PXE boot, where a seek backwards requires reloading the file from start.
2021-01-28 20:45:44 +01:00
Mark Harmstone 43a8d871bf
[FREELDR] Set LDRP_IMAGE_INTEGRITY_FORCED if necessary. (Part of PR #1905)
+ Add extra information.
Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2019-10-14 00:49:00 +02:00
Mark Harmstone 22fbfb0df9
[FREELDR] Insert DLLs into load order before what references them. (#1951) 2019-10-05 23:20:52 +02:00
Mark Harmstone fc9c3fe6f7
[FREELDR] Set LDRP_DRIVER_DEPENDENT_DLL where necessary. (#1951) 2019-10-05 23:20:52 +02:00
Hermès Bélusca-Maïto 658d5a3ff5
[FREELDR] Rename the PE loader functions 'PeLdr*' instead of 'WinLdr*'. 2019-09-19 02:53:57 +02:00
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 dca43193c8
[FREELDR] Demote the ArcOpen() trace in WinLdrLoadImage() to a warning only. 2019-08-18 15:26:25 +02:00
Timo Kreuzer cbb7ad6f5b [FREELDR] Improve debug output 2019-08-15 18:04:57 +02:00
Hermès Bélusca-Maïto fba4ad4ceb
[FREELDR] Move files where they are only used.
- Merge fade.c/palette.c/video.c into video.c and move it into UI.
- Move inffile.c into NTLDR.
2019-08-11 22:01:36 +02:00
Victor Perevertkin 304e281099 [FREELDR] Verbose error output for FS errors 2019-08-08 02:33:10 +03:00
Victor Perevertkin 12542f271d
[FREELDR] Fix Release build 2019-06-26 00:56:21 +03:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Renamed from reactos/boot/freeldr/freeldr/lib/peloader.c (Browse further)