Dedicated to the hard work of Joachim Henze! xD
This reverts part of commit 043a98dd (see also commit b2aeafca).
Contrary to what I assumed in commit 043a98dd (and was also assumed in
the older commit b2aeafca), we cannot use the singled-linked lists to
queue and dequeue the PnP device-install events, because:
- the events must be treated from the oldest to the newest ones, for
consistency, otherwise this creates problems, as shown by e.g. CORE-16103;
- the system singled-linked lists only offer access to the top of the
list (like a stack) instead of to both the top and the bottom of the
list, as would be required for a queue. Using the SLISTs would mean
that only the newest-received events would be treated first, while the
oldest (which were the first received) events would be treated last,
and this is wrong.
Therefore one must use e.g. the standard doubly-linked list. Also, using
locked operations (insertion & removal) on the list of device-install
events is necessary, because these operations are done concurrently by
two different threads: PnpEventThread() and DeviceInstallThread().
Since the interlocked linked list functions are not available in user-mode,
we need to use instead locking access through e.g. a mutex.
Translations for:
- Applications: clipbrd, dxdiag, rapps,
- cmdutils: attrib, find, help, label, reg, xcopy
- usetup
- dlls: browseui, shell32, syssetup
- Add Spanish translation for Accesibility Utility (utilman).
Update for the "Choose product options" strings in syssetup:
Originally "ProductType" and "ProductSuite" (typesetted without spaces) were the registry value names where these settings would go, but since it's meaningless to show these values it's better instead to use human-readable names with correct translation and spacing.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Updating translation for:
notepad, reactos, usetup, explorer, netshell, msgina, setupapi, shell32.
- Complete and Fix the SPANISH TRANSLATION on Setup
- Correct the random names, fixing the denominations, translate of the English words, and fixing random and incorrect denominations like "Cabinet" or "distribuciones".
- Fixed the notepad shortcuts of "Save" (Ctrl+g) and "Replace".
Correct the random names, fixing the denominations, translate of the English words, and fixing random and incorrect denominations like "Cabinet" or "distribuciones".
This PR enables the developers to include the CJK standard fonts into ReactOS by adding them in Folder modules/optional. This feature is for test purpose only. You may not use the fonts illegally.
The embeddable font files are: mingliu.ttc, simsun.ttc, mssong.ttf, msgothic.ttc, msmincho.ttc, gulim.ttc and batang.ttc.
CORE-9619
CORE-12683
Supersedes PR #612.
* [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs
USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages.
The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates.
This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates
as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields.
The following commit implements:
- MUIGetEntry()
- MUIClearText()
- MUIClearStyledText()
- MUISetText()
- MUISetStyledText()
- Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs.
The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry.
* [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files.
* [USETUP] Implement the IDs for each text MUI entry in locale files.
This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.).
* [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
CORE-15901
This fixes display reset transition when an external module acquired
INBV ownership and then released it, similarly to what was done in
commit 0ad65796 for VIDEOPRT.
For this a backup screenbuffer is used to store the contents of the
screen just before an INBV screen acquire transition, and these contents
are restored when it is detected that INBV ownership has been released.
Also, the active text font associated with the active console code-page
is restored, as well as the cursor state and shape.
In addition, any user of BLUE.SYS is now required to explicitly issue
a new IOCTL_CONSOLE_RESET_SCREEN to either enable or disable the screen.
This allows avoiding nasty unwanted screen mode switches when a handle
to the \Device\BlueScreen device is opened but no screen mode switch was
actually wanted - This "fixes" this annoyance on ReactOS and Windows,
when these are running witha VGA-compatible video driver and one wants
to look at properties of the \Device\BlueScreen device using
Sysinternals' WinObj.
Following this, we don't need to check anymore for explicit INBV
ownership by issuing calls to InbvCheckDisplayOwnership(), but instead
we check whether the screen has beeen manually enabled using the
aforementioned IOCTL. This partly supersedes commit 8b553a4b, and allows
fixing the second bug, namely that if we start ReactOS without the
/NOGUIBOOT option (and thus, INBV is active during boot), USETUP would
not show up anything because BLUE.SYS wouldn't display anything on screen.
See CORE-15901.
[USETUP][CONSRV] Call IOCTL_CONSOLE_RESET_SCREEN to tell BlueScreen device to enable the screen.
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...
Helvetica must be font substitute to Arial font.
- Change some Helvetica substitutes to "Arial" from "Liberation Sans". Not all Helvetica. Some languages are lacking support.
Add "Lucida Console" fonts. CORE-16264
- Add "Lucida Console" font by duplicating "DejaVu Sans Mono" font and renaming it.
- Delete some "Lucida Console" font substitutes.
- Add LICENSE file.
I used FontForge to rename it. Its family name is "Lucida Console". Its display name is "Lucida Console". Its font filename is lucon.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Add "Trebuchet MS" fonts. CORE-16272
- Add "Trebuchet MS", "Trebuchet MS Bold", "Trebuchet MS Bold Italic" and "Trebuchet MS Italic" fonts by duplicating "Open Sans" fonts and renaming them.
- Delete some "Trebuchet MS" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Trebuchet MS". Their display names are "Trebuchet MS", "Trebuchet MS Bold", "Trebuchet MS Bold Italic" and "Trebuchet MS Italic". Their font filenames are trebuc.ttf, trebucbd.ttf, trebucbi.ttf and trebucit.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Add "Times New Roman" fonts. CORE-16272
- Add "Times New Roman" and "Times New Roman Italic" fonts by duplicating "Liberation Serif" fonts and renaming them.
- Delete some "Times New Roman" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Times New Roman". Their display names are "Times New Roman", "Times New Roman Bold", "Times New Roman Bold Italic" and "Times New Roman Italic". Their font filenames are times.ttf, timesbd.ttf, timesbi.ttf and timesi.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Add "Franklin Gothic Medium" fonts. CORE-16272
- Add "Franklin Gothic Medium" and "Franklin Gothic Medium Italic" fonts by duplicating Alexei Vanyashin's "Libre Franklin" fonts and renaming them.
- Delete some "Franklin Gothic Medium" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Franklin Gothic Medium". Their display names are "Franklin Gothic Medium" and "Franklin Gothic Medium Italic". Their font filenames are framd.ttf and framdit.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Alexei Vanyashin's "Libre Franklin" fonts are available at https://github.com/alexeiva/Libre-Franklin .
Add "Palatino Linotype" fonts. CORE-16272
- Add "Palatino Linotype", "Palatino Linotype Bold", "Palatino Linotype Bold Italic" and "Palatino Linotype Italic" fonts by duplicating "DejaVu Serif" fonts and renaming them.
- Delete some "Palatino Linotype" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Palatino Linotype". Their display names are "Palatino Linotype", "Palatino Linotype Bold", "Palatino Linotype Bold Italic" and "Palatino Linotype Italic". Their font filenames are pala.ttf, palab.ttf, palabi.ttf and palai.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Add "Geogia" fonts. CORE-16272
- Add "Geogia", "Geogia Bold", "Geogia Bold Italic" and "Geogia Italic" fonts by duplicating FreeSerif fonts and renaming them.
- Delete some "Geogia" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Geogia". Their display names are "Geogia", "Geogia Bold", "Geogia Bold Italic" and "Geogia Italic". Their font filenames are georgia.ttf, georgiab.ttf, georgiaz.ttf and georgiai.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Add "Courier New" fonts. CORE-16272
- Add "Courier New", "Courier New Bold", "Courier New Bold Italic" and "Courier New Italic" fonts by duplicating FreeMono fonts and renaming them.
- Delete some "Courier New" font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Courier New". Their display names are "Courier New", "Courier New Bold", "Courier New Bold Italic" and "Courier New Italic". Their font filenames are cour.ttf, courbd.ttf, courbi.ttf and couri.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
Add Arial fonts. CORE-16272
- Add "Arial", "Arial Bold", "Arial Bold Italic" and "Arial Italic" fonts by duplicating Liberation Sans fonts and renaming them.
- Disable some Arial font substitutes.
- Add LICENSE file.
I made these font files by using FontForge. Their family name is "Arial". Their display names are "Arial", "Arial Bold", "Arial Bold Italic" and "Arial Italic". Their font filenames are arial.ttf, arialbd.ttf, arialbi.ttf and ariali.ttf. The Underline Positions are hacked by adding an integer value for workaround of FontForge's bug.
By removing font substitution for 'Microsoft Sans Serif'.
Thanks to the patches author Katayama Hirofumi MZ.
This is a partial revert of the guilty rev
master guilty 0.4.13-dev-9-g
811faed421
RC guilty 0.4.12-RC-13-g
8d3def0529
VBox test result:
https://reactos.org/testman/compare.php?ids=68497,68499
The same fix has been applied before to 0.4.12-RC-44-g
ca0e00e8af
- Windows requires 16 bytes of response data.
- Add the PLUGPLAY_CONTROL_USER_RESPONSE_DATA type.
- Usetup and Umpnpmgr must fail if NtPlugPlayControl(PlugPlayControlUserResponse) does not return STATUS_SUCCESS.
Fixes GCC 8 warning:
base/setup/usetup/usetup.c:3407:78: error: '%S' directive writing up to 521 bytes into a region of size 200 [-Werror=format-overflow=]
"Setup is currently unable to check a partition formatted in %S.\n"
^~
base/setup/usetup/usetup.c:3406:9: note: 'sprintf' output between 128 and 649 bytes into a destination of size 260
sprintf(Buffer,
^~~~~~~~~~~~~~~
"Setup is currently unable to check a partition formatted in %S.\n"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"\n"
~~~~
" \x07 Press ENTER to continue Setup.\n"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" \x07 Press F3 to quit Setup.",
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PartEntry->FileSystem);
~~~~~~~~~~~~~~~~~~~~~~
Eliminate some bugs about font enumeration. CORE-15755
- Add "Microsoft Sans Serif" font substitution.
- Fix and improve the treatment of the nominal font names.
- Split IntGetFontFamilyInfo function from NtGdiGetFontFamilyInfo.
- Add DoFontSystemUnittest function for font system unittest to GDI32.
- Call DoFontSystemUnittest function at CreateFontIndirectW first call.
Nowadays more and more people try to install ReactOS from removable
drives (e.g. USB sticks) onto fixed HDDs, or try to install it into
USB sticks too.
Both fixed and removable drives, as well as partitions on these, are
represented in NT using the same device name format:
\Device\HarddiskM\PartitionN ,
with an increasing disk number M. Using this number for building the
corresponding firmware-specific ARC multi(x)disk(y)rdisk(z) path used
by the NT/ROS loader (FreeLdr, ...) is then prone to error since there
may have been removable drives inserted and accounted for in the
calculation of the disk number. These drives must be correctly
subtracted in order to generate the correct ARC path, valid once all
the removable drives have been ejected (which should also be the
situation seen from the BIOS when booting up, except of course if you
boot on a USB stick).
This problem is now solved. Note that it matters only for the disks
that have also been enumerated by the firmware (BIOS; Int 13h). We
don't have to care about the other drives, since the ARC path will be
of a different format and will not use the disk number (instead, the
SCSI coordinates are used).
We also try to enumerate all the disks found in all the possible disk
adapters and controllers enumerated in the Hardware registry tree
(and that are visible by FreeLdr) in order to cover all.
Finally, we detect whether a disk reports as a "super-floppy", i.e.
an unpartitioned disk with a valid VBR. This is indeed how a standard
floppy disk looks like, or how USB sticks are partitioned on Windows.
Such disk is reported has having only one single partition starting at
the beginning of the disk, with partition number == 0, its type being
FAT16 non-bootable.
This allows us to forbid creating any new partitions on such disks.
Note that accessing either \Device\HarddiskN\Partition0 or Partition1
on such a disk returns the same data.
Note also that on the contrary, regular MBR-partitioned disks would
report at least four partitions entries, instead of just one.
The other improvements are:
- Do *NOT* write any MBR on a disk partitioned as "super-floppy".
CORE-13703
- Fix the computed disk identifier, of format: %08x-%08x-%c .
The numbers are respectively the checksum of the first sector, and
the disk signature. The terminating letter is A or X, depending
whether the first sector ends with 0x55AA/0xAA55 or not (see also
commit 5053f1f5).
- Warn if the user attempts to install ReactOS on a disk that is not
visible by the firmware of his computer, because it may not be
bootable.
- Add also some validation ASSERTs and simplify the code here and there.
- The installation partition is called "InstallPartition", while the
global "CurrentPartition" is the disk region currently selected in
the partition UI list, on which prtitioning operations are effectued.
- Extend CheckActiveSystemPartition() to use an optional alternative
disk or partition in case the actual system partition (present in the
first disk) cannot be used, e.g. because we don't support writes on it.
- Find or set the active system partition only once, when we start the
formatting stage. If the system partition is to be created in some
non-partitioned space, we create it.
- A file-system check is always scheduled for both the system and the
installation partitions.
- If the system partition was already formatted (which usually means
that it already existed on the system), don't ask for formatting it.
CORE-13205
- For each partition to be formatted, the file-system menu list is
re-created, in order to display only the FSes that are compatible
with the selected partition, and allow to give the user the choice
to keep the existing file-system only if the selected partition was
already formatted.
- Check whether the user attempts to delete the partition on which
the installation source is present, only if it is not "new" and is
formatted.
- Check first whether the current partition is the system partition,
before displaying the CONFIRM_DELETE_SYSTEM_PARTITION_PAGE.
- Make some partitioning functions not dependent on the selected "CurrentPartition".
- Add some sanity checks.
- Improve some of the "is-partitioned" checks.
Similarly to FMIFS this structure should be private. Instead file-system
names are passed to the helper functions, allowing to use the names
returned by the FS drivers. The names are then internally mapped to the
corresponding FS providers.
In particular this allows to handle the "RAW" file-system and to assign
the 'Unformatted' flag to partitions having this FS.
Finally this helps us refining the checks performed to see whether the
current "active" system partition uses a supported file-system.
- Within the function's body code, check the status values returned by the called functions.
- Change the BuildInstallPaths's function type to NTSTATUS instead of VOID (and check the status of InitDestinationPaths() as well.
By default, we still fallback to FAT if nothing asked, or if there
is an invalid input.
0 is FAT, 1 is BtrFS. This can be grown as soon as we add more IFS.
[REG][REACTOS][EXPLORER][APPWIZ][CONSOLE][INETCPL][INPUT]
[INTL][OPENGLCFG][TIMEDATE][DEVCPUX][COMCTL32][COMDLG32]
[MSGINA][NETCFGX][NETID][SETUPAPI][SHELL32][SYSSETUP]
Update Simplified and Traditional Chinese translations.
- The converter is code7bit I made. code7bit: https://github.com/katahiromz/code7bit
- This converter converts non-clean characters in string literals.
- However I couldn't erase a ton of codepage C4819 warnings.
- CORE-15447
You can edit an European source file as follows:
- Right click the file in the Solution Explorer.
- Select "Open With...".
- Choose "C++ Source Code Editor (with encoding)".
- Choose "Central European (Windows) - Codepage 1260".
- Add checks for GPT disks and either fail or ignore the disk,
depending on the operation being executed.
[USETUP][REACTOS] Display the disk style more accurately.
CORE-7749
- Correctly insert discovered partitions in sorted order of StartSector,
and verify that they do not overlap (-> check for broken partitioning).
May help for CORE-10898.
- Use the correct reported partition numbers that may be modified after
partitioning changes, and that need to be used when opening
\Device\Harddisk'M'\Partition'N' files. This is achieving by
retrieving the returned value of the IOCTL_DISK_SET_DRIVE_LAYOUT call.
Distinguish them from the "on-disk" partition numbers that are the ones
that enumerate the partition in partition-table order (and is the order
known by e.g. the BIOS), and that should be used to construct the
destination ARC path.
May help for CORE-4870, CORE-13205.
- Simplify a lot of duplicated code by using helper functions.
Always perform the partition validity checks when creating new
primary/extended/logical partitions, and also when a new partition
is automatically created when unpartitioned space is selected for
ReactOS installation.
CORE-12246
This will allow compatibility with modern OSes and
modern disk management utilities.
It will also improve performances by properly aligning
partition start.
And it will let enough room at the begin of the disk
for 3rd party bootloaders.
WARNING: this is not compatible with previous partition
model, and old one will likely not be compatible. You'll
have to erase your whole partition table and start from
scratch.
Simplified implementation of the proposed solution by George Bișoc
and revised by Victor Perevertkin from PR #952.
NOTE: For whatever reason ERROR_INSTALL_BOOTCODE and ERROR_WRITE_BOOT
seem to be redundant with each other. To be investigated...
Most of Linux filesystems have the MBR ID assigned as 0x83 and when the user chooses BTRFS upon partitions page wizard, we're thinking of the partition as having Ext2 filesystem which is wrong and misleading.
- Interface the TreeList code and populate it with the list of
discovered disks and partitions. Code is adapted from USETUP.
Also display the names of the disks.
- Display some installation settings summary, before doing the
installation proper.
- Force the user to select a checkbox when (s)he acknowledges that
ReactOS is alpha-quality software and may break on his/her computer
or corrupt his/her data.
- Improve wizard pages transitions and buttons enabling/disabling.
- Press Shift-F10 to start a command-line (as in the 2nd-stage setup
in syssetup.dll).
- Use some explicit UNICODE functions/macros.
Add the TreeList control from Anton Zechner and Sébastien Kirche
from https://github.com/sebkirche/treelist (under GPL-3.0+) as a
*TEMPORARY* solution until a better-suited control for ReactOS is
developed.
- Compilation fixes for the TreeList control.
- SETUPLIB and USETUP: Convert PARTENTRY::DriveLetter to WCHAR.
- SETUPLIB: Retrieve volume label.
- SETUPLIB and USETUP: Move the partition types (IDs) table from
USETUP to SETUPLIB so that they can share it with the 1st-stage
GUI installer too. Also take the opportunity to update the table
with information from http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
and cross-checked with the list from Paragon Hard-Disk Manager.
- USETUP: Simplify PrintPartitionData().
- Add some code comments.
This increases performance for each time the SETUPLIB calls (using NT paths)
Win32 SetupAPI functions which of course only accept Win32 paths.
- Handle also the fact that a NT path to convert may start with
\Device\HarddiskX\PartitionY\..., which can be a symlink to
\Device\HarddiskVolumeN\... on some systems. In that case, the
Win32 path mapping should be done slightly differently.
- Add support for network mapped drives.
- Improve UI usage and wizard transitions (Work In Progress).
- Add interfacing code that display installation status.
- When the user attempts to cancel the installation during file copying,
pause the file copying, and restart it if the user changes it mind and
wants to continue the installation. Otherwise file copying is properly
halted.
- BOOTDATA: Use standard INF signature string, so that they can be
opened successfully using ReactOS' or Windows' setupapi.dll with
the INF_STYLE_WIN4 style.
- SETUPLIB: Use the correct INF_STYLE_* INF styles in SpInfOpenInfFile() calls.
- REACTOS : Switch thread locale to user-specified LocaleId when calling
SetupOpenInfFileW(), so that the correct localized strings are used.
- In PrepareCopyInfFile(), explicitly use AddSectionToCopyQueueCab()
to retrieve the files from the CAB INF.
Otherwise if one continued to use and rely on AddSectionToCopyQueue()
to do this job instead, bad things could happen like, re-enumerating
twice or more (and adding them to the file queue) the same files.
This is because in the new code AddSectionToCopyQueue() can be called
many times to deal with different SIF file sections. The old code then
called AddSectionToCopyQueueCab() in turn, but on the same list...
Now the steps performed are clear, and everything works as intended.
- Simplify the code that computes the full source and destination paths
for the files to be copied and directories to be created, using helper
functions.
- Compute the source file and target location from the TXTSETUP.SIF
entries in a NT-compatible manner.
- Use adequate access flag when opening symbolic links.
- Simplify the prototype of UpdateRegistry() since now both Setup INF
handle and settings lists are inside the USETUP_DATA structure.
This means, call in the correct order the user callback with the correct
parameters (in particular the correct paths for file copy operations),
and check also for the callback returned value to know whether or not to
continue the file operations.
This allows using some of the SetupApi.dll functions when SETUPLIB is
used in the (Win32) GUI 1st-stage installer "REACTOS", while using the
custom implemented NT-aware functions in "USETUP".
- Add support for delete and move/rename operations, which are needed
for implementing ReactOS upgrading support.
- Use cabinet contexts.
- Use standard LIST_ENTRY structures for implementing the lists.
- Move the path-building hack code in SetupCommitFileQueueW() that had
been introduced in r66604 (97bb83f) out of the file-queues code.
- Make the function prototypes compatible with win32's setupapi functions.
- Fix the format of the data passed to the custom notification handler.
- Adjust the file-copy callback to correctly use its arguments (setupapi-compatible).
- Move a great deal of global variables into the USETUP_DATA structure
(the SetupInf, the SetupFileQueue, the generic lists...).
- Place the common setup initialization code into an InitializeSetup()
routine, and the cleanup code into FinishSetup().
- Implement the setup-code part support for the TXTSETUP.SIF setup
source path override variables "SetupSourceDevice" and "SetupSourcePath"
(see CORE-9023); support for them in SETUPLDR will be added later.
- In the 1st-stage GUI setup, display the list of existing discovered
NTOS installations, with its name, installation path and vendor name,
and an associated icon.
svn path=/branches/setup_improvements/; revision=75544
[SETUP:REACTOS] More interfacing of the 1st-stage GUI installer with the setuplib.
- Add a ConvertNtPathToWin32Path() helper function that allows converting
NT paths like: \Device\CdRom0\i386\txtsetup.sif file into a Win32 path
that the Win32 versions of the SetupApi functions (e.g. SetupOpenInfFileW)
can accept.
Note that RtlNtPathNameToDosPathName() cannot be used here because this
function only works for NT paths within the \DosDevices\ (or \??\) NTObj
directory, and not in other directories.
- Use this helper function in the implementation of SetupOpenInfFileExW.
Now the txtsetup.sif function can be loaded by setuplib *when being used*
by the 1st-stage GUI installer!
- Remove deprecated code.
svn path=/branches/setup_improvements/; revision=75668
svn path=/branches/setup_improvements/; revision=75721
svn path=/branches/setup_improvements/; revision=75750
This includes also to remove the created symlinks.
Symlinks deletion is special, as one has to open first the symlink
itself (and not its target), then remove the "SymbolicLinkTarget" value
before really deleting the key. Of course everything must be done under
proper access rights.
Additional changes:
- Change prototype BOOLEAN CmpLinkKeyToHive(...) to NTSTATUS CreateSymLinkKey(...).
- Silence few DPRINTs.
- Document some FIXMEs that I need to inspect later on ReactOS.
- HKEY --> HANDLE.
- It can therefore be also used by the 1st-stage GUI setup.
- Rename some function parameters to clarify what they should be.
Based on:
svn path=/branches/setup_improvements/; revision=75750
Additions:
- Use explicit __cdecl calling convention for variadic functions.
- Fix also the whitespace in consup.h.
svn path=/branches/setup_improvements/; revision=75749
[USETUP] Improve usage of ERROR_TXTSETUP_SECTION and ERROR_CABINET_SECTION error codes, correctly display associated error message, and remove a deprecated string.
- Apart from allowing a UI cache variable that may be used when
displaying GENERIC_LIST_ENTRY-ies, do not store any display strings
associated to these list entries. They should be instead computed only
when initializing a list UI (or a combo-box or list control if the
code is used in Win32 environment).
For this matter a callback is provided to InitGenericListUi() that
does the job of computing the displayed string corresponding to a
given GENERIC_LIST_ENTRY.
- Simplify the calls to InitGenericListUi(), and refactor the
RestoreGenericListUiState() function.
- Use for-loops for iterating over GENERIC_LIST items.
- Adapt the storage data format for lists of settings items.
- The txtsetup.sif INF format specified in LoadSetupInf() should not be
INF_STYLE_WIN4 (to be investigated...).
- Use OBJ_CASE_INSENSITIVE when initializing object attributes
(no actual reason why to keep case sensitivity there).
- Check the success of a RtlStringCchPrintfW call in EnumerateReactOSEntries().
- Explicitly check for returned STATUS_NOT_SUPPORTED from ChkdskPartition()
or FormatPartition(), and display an appropriate error message.
- Remove some left-over comments but also explain why I kept some
commented code (mainly for future reference).
Comment about the status of two '#if 0'.
[SETUPLIB] Fix some uninitialized variables (caught by clang-cl).
Also, initialize NtName->Length in return paths in ResolveArcNameManually().
Only convert to ANSI when needed (e.g. in the display code for usetup).
The 1st-stage GUI setup will however use the UNICODE strings directly.
svn path=/branches/setup_improvements/; revision=75753
[SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build.
svn path=/branches/setup_improvements/; revision=75711
[SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources",
and what concerns general language parameters (in the setuplib).
It may be interesting to retrieve the language parameters
from INF file (e.g. intl.inf) (suggested by Giannis).
svn path=/branches/setup_improvements/; revision=75715
[SETUPLIB] Add the necessary headers to mui.c to be able to compile.
[USETUP] Comment out the languages that don't have any resources.
svn path=/branches/setup_improvements/; revision=75716
[SETUPLIB][USETUP] Adjust MUI and settings code.
- Re-enable settings code concerning language, keyboards & layout
in the setuplib, and remove the old code in usetup.
- Remove useless code in setuplib's mui.c.
- Rename usetup's MUI "LanguageList" into "ResourceList" so as to
avoid colliding with the "LanguageList" of setuplib.
- Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that
I forgot previously, that caused the "LanguageList" of setuplib to be empty!
The code compiles and works during my tests.
svn path=/branches/setup_improvements/; revision=75717
[SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific
"SelectedLanguageId" variable is not used in the library.
svn path=/branches/setup_improvements/; revision=75719
[SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library.
Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again.
svn path=/branches/setup_improvements/; revision=75720
svn path=/branches/setup_improvements/; revision=75724
[USETUP] Code adaptations.
- Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element.
- Modify MUIGetOEMCodePage() call after r75719.
- Use PCWSTR where needed.
svn path=/branches/setup_improvements/; revision=75722
[USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721.
svn path=/branches/setup_improvements/; revision=75723
[INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
This code is moved ther since it'll be needed for 1st-stage GUI
installer as well.
The code dealing with keyboard layouts is however not moved yet,
since it uses MUI* functions from usetup.
I'll try to think how to include that in setuplib...
svn path=/branches/setup_improvements/; revision=75701
Move the bootsup.c code into the setuplib, as the code is generic
enough to be used by both USETUP and the 1st-stage GUI installer.
svn path=/branches/setup_improvements/; revision=75674
This helper is inspired by the reactos/reactos.c!LoadGenEntry() function.
Use this helper in the different Create*List() functions.
svn path=/branches/setup_improvements/; revision=75700
- Compute the installation source paths based on the full path of the
installer program that uses the setup library.
- Add INF_STYLE_OLDNT define in infsupp.h.
- Add some (silenced) diagnostic DPRINTs.
svn path=/branches/setup_improvements/; revision=75667
- Use correct inf style flags in SetupOpenInfFileEx() calls when opening
txtsetup.sif and unattend.inf. Technically txtsetup.sif would be
INF_STYLE_WIN4, but since we use "$ReactOS$" as its version signature,
it would not work when opening it with setupapi.dll functions.
Hence this flag is combined with INF_STYLE_OLDNT too.
- Don't fail if opening the \SystemRoot symbolic link doesn't work
(usually due to incorrect access rights); in that case, just use the
installer image file path as the installation source path.
svn path=/branches/setup_improvements/; revision=75676
And turn the previous two functions into macros.
svn path=/branches/setup_improvements/; revision=75635
svn path=/branches/setup_improvements/; revision=75652
Used in exiting code and in later code in this file.
svn path=/branches/setup_improvements/; revision=75632
svn path=/branches/setup_improvements/; revision=75652
- Move several global setup variables into a structure "USETUP_DATA",
similar to the syssetup structure "SETUPDATA" (or the WIP 1st-stage
installer structure of the same name), so that these variables can be
set easily by different helper setup functions;
- Move CheckUnattendedSetup() and GetSourcePaths() to setuplib and make
CheckUnattendedSetup() use the USETUP_DATA structure;
- Add a LoadSetupInf() function that loads the txtsetup.sif file
(factoring out the corresponding code in USETUP);
- Add a InstallSetupInfFile() function (that I'll probably rename later on)
whose purpose is to create a valid "$winnt$.inf" setup installation file
in the ReactOS\system32 directory, which should help the 2nd-stage installer
to correctly retrieve the source installation media we used during 1st-stage,
and contain the unattended setup lines copied from unattend.inf. This is
done in a Windows-compatible way.
svn path=/branches/setup_improvements/; revision=75518
[USETUP] Close the txtsetup.sif file at the end of the operations.
svn path=/branches/setup_improvements/; revision=75539
They currently do nothing, since the getter functions don't actually
capture (copy) the strings but merely return pointers to read-only strings.
But the calls are placed here for consistency, because if one day the
getters' implementation is changed so that strings are captured, it would
then be needed to free the allocated buffers.
In addition, fix a buggy call to INF_GetData() -- should be instead
INF_GetDataField() -- in AddSectionToCopyQueue().
svn path=/branches/setup_improvements/; revision=75516
Remove the commented-out IsValidPath() in that file, and remove
as well the temporary prototypes in regutil.c .
svn path=/branches/setup_improvements/; revision=75249
Split the registry helper code into registry utility functions
(create/mount/unmount/verify hives) and registry creation code
(the rest: initializing the system hives) and move it in the
setup library.
svn path=/branches/setup_improvements/; revision=75247
[USETUP][SETUPLIB] Improve how the Setup* INF APIs are interfaced in the code.
Define prototypes compatible (including their calling convention)
with the ones defined by setupapi (.h/.dll) so that it can be possible
to either use an internal implementation of these functions (via the
INFLIB library) as currently being done, or using imported setupapi
functions, as would be done by the future 1st-stage GUI installer.
[SETUPLIB] Cleanup the registry.c file and use the infsupp.h header.
svn path=/branches/setup_improvements/; revision=75345
svn path=/branches/setup_improvements/; revision=75346
[USETUP][SETUPLIB] Move some INF-related code from usetup to the setuplib.
- Move the generic INF_GetDataField() and INF_GetData() helpers to
setuplib, and rework them a bit so that they explicitly call setupapi
functions (or implementations thereof when being used in usetup);
- Rework the headers in accordance;
- Fix compilation in lib/registry.c .
- Fix compilation when these headers are used withing usetup (who
doesn't use setupapi.dll) and "reactos" (the 1st-stage GUI installer
that uses setupapi.dll).
svn path=/branches/setup_improvements/; revision=75515
svn path=/branches/setup_improvements/; revision=75537
svn path=/branches/setup_improvements/; revision=75538
- As GetSourcePaths() is used once in USETUP to initialize global
UNICODE_STRING path strings once, move it out of drivesup.c and
put it in usetup.c. Then remove drivesup.c : 1 file less!
- Move some INF file prototype declarations out of usetup.h and
inside inffile.h where they should better be, as inffile.h and .c
is the glue code for the INF library, defining similar functions
as the ones in setupapi.dll.
- I rename our local SetupOpenInfFileW() into SetupOpenInfFileExW()
because the latter one takes an extra user-provided LCID parameter,
and this is this one that we use in USETUP.
- Make 'UNICODE_STRING SourcePath;' visible only inside usetup.c
(not used elsewhere).
- Implement installation path validity check in case we are either
in repair/update, or unattended setup mode. If the path is detected
as invalid, then we fall back into manual path specification
(for now...; note that we could instead fail the installation too).
svn path=/branches/setup_improvements/; revision=75246
- Modify a bit the page flow so that the upgrade page is inserted before
the Device-settings page, and after the Install-Intro page.
- Insert some extra 'RepairUpdateFlag' checks in SelectPartitionPage() and
InstallDirectoryPage() to take specific actions in case the flag is TRUE.
svn path=/branches/setup_improvements/; revision=74576
svn path=/branches/setup_improvements/; revision=75525
Implement work-in-progress code that, when upgrading an existing
ReactOS installation, verifies whether the (existing) system registry
hives are valid (by loading & unloading them, this allows using the
built-in repair functionality if needed), or not.
If a given hive cannot be repaired successfully, it is backed up
(with a '.brk' extension, "brk" as "broken"), then is marked up for
recreation.
When all hives have been checked, if there are any hive that needs
to be recreated, we recreate its hive file, mount it, but we do *NOT*
mount the other valid existing hives for update. We create instead
dummy registry hives so that we can actually use, as the update code,
the same one as the one used when fully creating the registry hives
for a clean installation (of course, this choice can be improved later on).
The update code (i.e. the same as the registry clean-install one) then
adds the registry keys & values, either putting them in the dummy
registry hives (the ones that we don't want to recreate) or in the
registry hive that is recreated.
At the end, the (re)created registry hives are flushed back to disk,
and a copy of them (under a '.sav' extension) are created, so that they
can be used for restoration purposes if 2nd-stage (and up) goes berserk.
Extra fixes:
- Use the correct structure member field when initializing the
'InstallDir' variable, when performing an upgrade.
- CreateNestedKey() should be better analysed to see whether it correctly
creates the full registry path compatible with volatile/non-volatile keys
(under inspection).
svn path=/branches/setup_improvements/; revision=75010
Will be used soon to make backups of system files, like the registry hive files just freshly created.
- Make the SetupCopyFile() function closer to its win32 counterpart.
- Adjust the code that calls SetupCopyFile().
svn path=/branches/setup_improvements/; revision=75008
svn path=/branches/setup_improvements/; revision=75009
The rationale is as follows.
We now have the 1st-stage ReactOS setup running with its own registry SYSTEM hive,
similarly to regular ROS running instances (livecd, regular installation...).
The ReactOS-specific SetInstallPathValue() hack, introduced in a76689e9 (r3794)
and 5f973ce0 (r3795), is removed. This hack told the kernel that, during the setup,
it had to "switch" the used registry hives and instead use the ones of the ROS
installation being prepared.
This was really hackish because this means, mixing between registry settings used only
for the setup running instance, that could use different registry settings
than the ones that should be set for the ROS installation being actually performed.
Also, note that in the case of a 1st-stage GUI setup, consisting in running the
LiveCD + the GUI setup program, this situation would be untenable. Note also that
for people willing to use the Setup*** functions exported by setupapi.dll to parse
the registry INF files to initialize the registry of the ROS installation being
prepared, this would be impossible either.
Hence the need to have offline registry modification functionality.
svn path=/branches/setup_improvements/; revision=74766
- Also, reserve a new field to display whether the disk is MBR or GPT-initialized.
- Adjust the code that used the "STRING_HDDINFOUNKx" string labels.
The extra slot added to some of the strings is to indicate whether the disk is MBR or GPT.
As attentive readers will notice, the code that "determines" whether the disk is either MBR or GPT
is of course just temporary: it's just a placeholder code that should currently just show "MBR".
Having the NoMbr flag mostly signifies that the disk is uninitialized. A GPT disk also has a MBR
but it's for "backcompatibility" / "protective" reasons (so that MBR-only tools would see the disk
as just a big 1-partitioned only disk with which they could barely do anything). A real involved test
for the nature of the disk should involve calling the correct IOCTLs in the disk detection code in partlist.c .
This is for the future (and when ReactOS will better support GPT disks).
svn path=/branches/setup_improvements/; revision=74614
svn path=/branches/setup_improvements/; revision=74615
- The "intro" page is renamed into the "Welcome" page, because its corresponding resource indeed is the welcome screen;
- Because the "setup start" page can only be displayed once, move it out of the while-loop, and use its result as the initial value of the 'Page' variable.
- Remove unneeded _PAGE_NUMBER_DEFINED guards;
- Add a DPRINT in the RepairUpdateFlag case of RegistryPage() (because we don't implement yet a correct upgrading or repairing of the registry).
- In InstallIntroPage(), display the page itself only if needed (i.e. after all the validation checks & repair/update or unattended checks are done). Similar modifications are done also in DeviceSettingsPage(), SelectPartitionPage()
- Turn both CheckUnattendedSetup() and UpdateKBLayout() into static functions.
- Fix the code of ScsiControllerPage() so that it can be compiled if needed, and add a dummy OemDriverPage().
svn path=/branches/setup_improvements/; revision=74575
Fixes in particular a regression brought by 57402ee (thanks George Bisoc
for having noticed this), where the BTRFS bootsector code could not be
installed anymore.
CORE-15192
- Fix the usage of the BootEntry's "Version" member.
- Don't surround with too many quotation marks the "friendly" boot entry name in AddBootStoreEntry().
svn path=/branches/setup_improvements/; revision=74964
In particular the helper functions CreateCommonFreeLdrSections() and (Un)protectBootIni() are now removed from there (they are used in bldrsup.c only).
This should pave the way for future integration with other sorts of NT boot loaders (BootMgr and (u)EFI boot loader).
svn path=/branches/setup_improvements/; revision=74954
This concerns so far, only freeldr.ini and to an extent, boot.ini, but planning in the future to add support for registry-oriented BCD
as well as possibly direct (u)EFI entries, using the corresponding NT functions.
This code is so far only used in osdetect.c, but will be soon used by usetup's bootsup.c (note that some helper functions: CreateCommonFreeLdrSections()
and (Un)protectBootIni() are already taken from it and used in bldrsup.c).
- In EnumerateNTOSBootEntries(), continue enumerating the boot entries until the user callback returns an status code that is not successful.
- Remove some old code from osdetect.c; use directly BootEntry->FriendlyName when building the display names of the available installations, since now
BootEntry->FriendlyName is a PCWSTR (and not a UNICODE_STRING anymore).
svn path=/branches/setup_improvements/; revision=74943
[SETUPLIB] Make the NTOS_BOOT_ENTRY structure more generic, so that it can wrap around either actual NTOS boot entry options, or FreeLdr-like boot-sector options.
In a sense, the NTOS_BOOT_ENTRY structure now looks much more like the NT structure "BOOT_ENTRY".
- Adapt the code in bldrsup.c to these modifications, and re-enable FreeLdr-like boot-sector-file support code that was commented out.
More code cleanup will follow later.
svn path=/branches/setup_improvements/; revision=74952
- Convert almost all swprintf() into StringCchPrintfW() and wcscpy() into StringCchCopyW();
- Explicitly add a trailing path separator to the "\Device\HarddiskX\PartitionY(\)" paths
when they refer to FS directories (and not to partition objects);
- Remove useless (and half-buggy) "Remove trailing backslash" code.
With that, it is possible to install ReactOS in e.g. C:\ReactOS (as usual), C:\ReactOS\dir1\dir2 (as many dirs as you wish), and also in C:\ (yes yes!).
But in that latter case, a strange bug related to the registry arises...
Additionally:
- Adjust some comments;
- Add some debugging DPRINTs;
- The SetInstallPathValue() is part of the big hack I've mentioned in f51faa4a (r74709).
svn path=/branches/setup_improvements/; revision=74717
Also, trim any potential trailing path separator from the NT disk partition path before opening the partition object itself for read/write access.
svn path=/branches/setup_improvements/; revision=74715
- Don't hardcode the installer file name in ExpandInstallerPath() but
provide it from a parameter. Return TRUE/FALSE if the installer file
is/is not found.
- Expand any environment string present in the items command line.
- Enable/disable the menu buttons depending on whether or not an
associated command is present.
- Enable mirroring from resources.
- Add the MUI ID resource.
- Implement the shutdown timeout progress bar function and the TimeOut string handler.
- Add the resource string to other resource languages.
- Simplify the usage of the PUPDATE_PROGRESS callback.
- Add the possibility of specifying an initial non-zero StepCount when
creating the progress-bar (using the -Ex version), so that it can be
initially drawn with the expected initial count.
Of course ProgressSetStepCount() can continue to be used.
Updated the font substitutions to use the new Hebrew glyphs in the updated Tahoma font.
Also added substitution for the Ubuntu font to make the Lautus and Modern themes legible with Hebrew UI elements.
Follow up to PR #789 and #790 ; CORE-14880, CORE-14943
Improve the progress bar functions:
- Add a member in the struct, which will be used as a bar colour parameter for the new CreateProgressBarEx().
- CreateProgressBar() which will now invoke the Ex variant without the additional parameter.