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.
- Improved Italian translation for USETUP, WELCOME, REACTOS, EXPLORER.
- Completed translation in SYSSETUP.
- Correct some characters encoding and text alignment in USETUP.
DIRECTORY_ALL_ACCESS is not the correct flag, because it is used with the NtCreateDirectoryObject API
that creates virtual "directories" in the NT object namespace; that's not our purpose here.
svn path=/branches/setup_improvements/; revision=74716
- Use NT string safe functions.
- Add support for other bootloaders;
- Update a couple of comments;
- Remove deprecated __REACTOS__ #ifdefs.
svn path=/branches/setup_improvements/; revision=74713
- Call OpenAndMapFile() with its new ReadWrite parameter;
- Add informative comments in osdetect.c;
- In partlist.c, check whether a disk has a valid MBR by also checking for its 0xAA55 signature.
svn path=/branches/setup_improvements/; revision=74712
- In DoesFileExist(): Call NtOpenFile with FILE_GENERIC_READ instead of the more generic GENERIC_READ access right.
- OpenAndMapFile(): Add support for opening & mapping files with write access (to be used latter).
svn path=/branches/setup_improvements/; revision=74710
- Split IniCacheLoad() and IniCacheSave() into: themselves & IniCacheLoadByHandle() and IniCacheSaveByHandle(),
respectively, so that we can load & save INI files if we already have an opened handle to them.
svn path=/branches/setup_improvements/; revision=74711
- Remove a redundant NtClose() call;
- Return failure if NtQuerySymbolicLinkObject() fails;
- Use RTL_CONSTANT_STRING and RtlInitEmptyUnicodeString() where needed;
- Reduce code indent level;
- Add old-style function annotations;
- Remove the deprecated code copyright notice, since the copyright in usage is already reported in the COPYING file in the top level ReactOS source code directory.
svn path=/branches/setup_improvements/; revision=74698
So far we only have:
- a function FindNTOSBootLoader() that detects the existence of a given boot loader;
- a function EnumerateNTOSBootEntries() (and corresponding helpers) that enumerate the different boot entries in the configuration file(s) for a given boot loader, and for each entry, calls a user-provided callback.
Only supported at the moment: ntldr and freeldr.
Doing that allows me to simplify large portions of the NT-OS detection code so that it becomes more bootloader-agnostic, and this will help me for simplifying some parts of usetup/bootsup.c too, later...
svn path=/branches/setup_improvements/; revision=74661
- Adjust also its callers, adjust OpenAndMapFile() parameters.
- Related to that, simplify IsValidNTOSInstallation() parameters & introduce a IsValidNTOSInstallation_UStr()
that does the same, but takes a UNICODE_STRING instead.
- Simplify CheckForValidPEAndVendor().
Now only exactly 5 calls use the "old" 'DoesFileExist' syntax, using a temporarily auxiliary function "DoesFileExist_2"...
svn path=/branches/setup_improvements/; revision=74641
This allows building concatenated paths with an arbitrary number of separated components.
- Use the newly-introduced CombinePaths() and ConcatPaths() functions.
- Fix also few comments, and place some UNICODE_NULLs here & there.
svn path=/branches/setup_improvements/; revision=74637
svn path=/branches/setup_improvements/; revision=74640
- filesup.c's functions ConcatPaths(), Does[Path|File]Exist(), NtPathToDiskPartComponents(), OpenAndMapFile(), UnMapFile();
- Move the inicache library to setuplib as it'll be used for the 1st stage GUI setup too (indeed, there is no good INI file API
under Win32; the Win32 profile "API" is just good enough to manipulate the win16 ini files, and are here anyways for backward
compatibility purposes only);
- Move the OS detector too.
- Remove the duplicated ConcatPaths() code in arcname.c.
svn path=/branches/setup_improvements/; revision=74634
svn path=/branches/setup_improvements/; revision=74638
- In the partlist.c disk getters: Remove useless "IsListEmpty(&List->DiskListHead)" checks, because this is actually the kind of check the while() loop does just after...
- Fix few DPRINTs.
svn path=/branches/setup_improvements/; revision=74629
- Improve FindExistingNTOSInstall() so that we can find an existing installation either by system root
ARC path or NT path. This is used during the enumeration of available installations from the boot.ini/freeldr.ini
and during other existence & validity checks of NTOS installations.
- Improve AddNTOSInstallation() so that we can save the system root ARC path and NT path of the installation,
as well as its partition entry structure pointer, for caching & later retrieval purposes.
- Remove some deprecated comments & todos, and implement other todos.
- Improve the output of some DPRINTs.
- Fix the return value of FindSubStrI.
svn path=/branches/setup_improvements/; revision=74632
- isspace('\0') returns FALSE anyways so no need to separately test for a NULL character;
- The (str/wcs)toul function cannot return a NULL pointer from its second paramter;
- VersionInfo32_FindChild(): the third argument is indeed a number of characters (not bytes),
so rename the parameter to make this fact clear. The function is however correctly used within this module.
svn path=/branches/setup_improvements/; revision=74629
In all the disks/partitions available, it searches for the presence of freeldr.ini / boot.ini, open & parse them,
and enumerates the available boot entries (as candidates for installations). For each of them, it maps their ARC paths
into the NT namespace (hence the ARC 2 NT path resolver committed in r74621), then attempts to detect in these paths
the existence of NTOS installations.
svn path=/branches/setup_improvements/; revision=74622
The NT path resolver allows mapping between an ARC path as specified in freeldr.ini / boot.ini , to its corresponding NT path, if possible.
Currently, only the mapping direction "ARC to NT" is implemented. It will be used wherever such mappings are needed, for example when identifying
the ReactOS / Windows installations from the available freeldr.ini / boot.ini entries (for upgrading / repair purposes).
The resolver supports the usual ARC paths: multi()disk()[r|f]disk()[partition()] ; eisa()disk()[r|f]disk()[partition()] ; multi()disk()cdrom() ;
scsi()disk()[r|f]disk()[partition()] ; scsi()cdrom()fdisk() ; ramdisk(x) ; net(x) (actually reported as "unsupported" since it would map to some
path on some network), and the newly-introduced Win2k signature()disk()rdisk()[partition()].
The code is in work-in-progress status.
Some validation tests, that were used during the implementation of the resolver, have been added.
svn path=/branches/setup_improvements/; revision=74621
svn path=/branches/setup_improvements/; revision=74631
The aim is to use this detector to be able to detect and select an existing installation of ReactOS for upgrading.
The user then could either select one, or skip this step and perform a regular ReactOS installation.
What remains to be done, is to parse the NTOS loader configuration files (freeldr.ini in ReactOS' case, or boot.ini in Win2k3's case, etc...)
to retrieve the actual installation paths. So far these are currently hardcoded for testing purposes only.
The detector attempts to distinguish between ReactOS and Windows installations by checking at the company name vendor of the ntoskrnl.exe & ntdll.dll files,
so that only ReactOS installations are allowed to be upgraded.
svn path=/branches/setup_improvements/; revision=74527
svn path=/branches/setup_improvements/; revision=74550
From the existing IniCacheLoad() function, introduce a IniCacheLoadFromMemory() function that just does the same (initialize an INI file cache and parse the INI file), but takes the input from a memory buffer. Then, rewrite the IniCacheLoad() function to just open the file given in input, and then fall back to calling IniCacheLoadFromMemory.
The IniCacheLoadFromMemory() function will be used later.
svn path=/branches/setup_improvements/; revision=74620
- Add a NtPathToDiskPartComponents() helper, that takes in input a fully qualified NT path to a file on hard disk,
e.g.: \Device\Harddisk1\Partition2\foo\bar, and returns in output the disk number ('1'), the partition number ('2'),
and the the path component "\foo\bar" that is after the device-harddisk-partition identifier.
- Make the OpenAndMapFile() return the file size of the opened file.
Both of these additions will be used soon.
- Turn a isspace() call into a iswspace() one.
svn path=/branches/setup_improvements/; revision=74619
- Use the previously-introduced 'PreparePartitionForFormatting()' function; set the FormatState of the newly-formatted partition to Formatted.
- Remove the hackish call to CreateFileSystemList() in SelectFileSystemPage().
- Move 'TempPartition' and 'FormatState' back to USETUP.
- Put large "case"-blocks into brackets.
svn path=/branches/setup_improvements/; revision=74575
svn path=/branches/setup_improvements/; revision=74576
- Add a PreparePartitionForFormatting routine that sets the partition ID depending on the chosen filesystem.
- The 'FORMATMACHINESTATE FormatState' machine-state and the 'TempPartition' members of the partition list structure is purely a USETUP convenience, so remove them from the PARTLIST structure and move them back into USETUP.
- Attempt to recognize the filesystem (set the 'FileSystem' member of PARTENTRY) of partitions we are adding into the PARTLIST list.
- Fix the return value of the SelectPartition function, which is by the way completely broken (it doesn't do what it is supposed to do; alternatively its naming is completely wrong...).
svn path=/branches/setup_improvements/; revision=74572
svn path=/branches/setup_improvements/; revision=74573
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
This will allow to reuse it for the 1st-stage GUI setup too, while using another UI representation.
Add also two partition iterator functions: GetNextPartition and GetPrevPartition.
svn path=/branches/setup_improvements/; revision=74554
The aim here is to decouple the UI-specific code from code that can be used by both the text-mode USETUP and a future 1st-stage GUI setup.
Indeed, the GenLists can actually be used in the 1st-stage GUI; and their contents be displayed inside ListBoxes/ListViews... (this is just one example amongst others).
Additionally (in usetup.c):
- Make both FormatPartitionPage and CheckFileSystemPage return PAGE_NUMBERs.
- Improve a couple of comments.
svn path=/branches/setup_improvements/; revision=74553
- Allow retrieving the number of items existing in the list;
- Fix the name of some function parameters.
svn path=/branches/setup_improvements/; revision=74547
- Document more some of the fields in the PARTENTRY, DISKETNRY and PARTLIST structures;
- Remove the redundant members "SystemDisk", "OriginalSystemDisk" and "TempDisk" in PARTLIST as these can be consistently deduced from the corresponding (Original)(System)(Temp)Partition members
(note that we however keep "CurrentDisk" alongside "CurrentPartition", see the comment in the code why we do it so).
- Adjust the rest of the code to take the removal of the redundant members into account. The 2nd parameter of GetNextUnformattedPartition() and GetNextUncheckedPartition() is now really optional.
- Introduce a SetPartitionType() helper to simplify the code that sets the partition type, which also automatically adjusts other internal variables of said partition in accordance.
- "Mounted" logical drives can have assigned letters too, registered in \DosDevices\.
svn path=/branches/setup_improvements/; revision=74532
- Use explicit ansi string safe functions (where they are used ansi, but not explicitely);
- Add (old-school) function parameters annotations;
- Use PARTITION_ENTRY_UNUSED where needed (instead of hardcoding its value);
- Turn some functions static to this module;
- Turn the 2nd parameter of both GetNextUnformattedPartition() and GetNextUncheckedPartition() optional (for next commit);
- Improve some comments;
- Use NT types.
svn path=/branches/setup_improvements/; revision=74531
- Introduce code that detects the filesystem of a (mounted?) partition, using NtQueryVolumeInformationFile() with FileFsAttributeInformation class,
aka. rely on ReactOS itself (kernel, storage stack, filesystem drivers...) to recognize the FS on a partition that should normally be seen by the system.
This currently half-works for whatever reason (to be insvestigated), while it works on Windows.
- Fix few comments & a function parameter name.
- Use NT string pointer types.
svn path=/branches/setup_improvements/; revision=74529
- ConcatPaths that concatenates paths (or a path and a file name);
- OpenAndMapFile (resp. UnMapFile), whose purpose is to open a file and map it in memory (resp. unmap it from memory).
- Add extra optional parameters to DoesPathExist and DoesFileExist: an optional "RootDirectory" handle and, for DoesFileExist only, an optional PathName.
- Close the opened file handles only on success.
svn path=/branches/setup_improvements/; revision=74528
svn path=/branches/setup_improvements/; revision=74538
svn path=/branches/setup_improvements/; revision=74549
- Path must not contain whitespace characters.
- Path must be at least 2 characters long.
- Path must start with a backslash.
- Path must not end with a backslash.
- Path components must not end with a dot.
CORE-9529
- Make sure the DWLP_* values are correct on _WIN64
- Don't use the DWL_* constants, they are not portable. Enforce this by removing them entirely from winuser.h
- Make sure Get/SetWindowLong*Ptr* is used and pointers are not truncated to LONG
Such a manifest is meant to be activated by the caller of the exports of the dll.
This means that the user of syssetup which is setup.exe is the one that should do the proper handling of the manifests.
Since setup.exe is the one that needs to do the right thing, add a CREATEPROCESS_MANIFEST_RESOURCE_ID to it and avoid
dealing with ISOLATIONAWARE_MANIFEST_RESOURCE_ID altogether (which is supposed to be used by activating the activation context
before calling the exports of the dll that has it). We don't really use ISOLATIONAWARE_MANIFEST_RESOURCE_ID correctly in any
place in the tree so let's rely on CREATEPROCESS_MANIFEST_RESOURCE_ID for now.
This fixes one part of CORE-14228 where no image was shown in the theme selector buttons. This happened because comctl32 was
statically linked and calling ImageList_LoadImage ended up creating an image list with comctl32 v5. Then we passed this image
list to a button created with comctl32 v6 and as a result the image list was unusable. This is yet another issue that needs
to be addressed in the future. Namely, it seems that in windows comctl32 v6 can use image lists created by comctl32 v5 whereas
we cannot.
This fix is not a hack but cleverly works around these two bugs that need to be addressed some time in the future.
CORE-14228
This avoids the open failing on certain file systems where GENERIC_WRITE access would be denied
for a readonly file.
This is an addendum to 82f44a2.
CORE-14158
In such situation, try to drop the readonly attribute before overwritting the file.
This fixes setup not being able to overwrite FAT bootcode when reusing a FAT partition
already installed without reformatting.
CORE-14158
it only perform a full check if dirty bit is set (which should never happen *cough*).
This is needed because otherwise, ReactOS installation takes forever when IopParseDevice is gone
due to slow ChkDsk.
* Fix Simplified Chinese Translation of EXPLORER.
* Fix Simplified Chinese Translation of MSCONFIG_NEW.
* Fix Simplified Chinese Translation of MSPAINT.
* Fix Simplified Chinese Translation of SHELL32.
* Fix Simplified Chinese Translation of SYSDM.
* Fix Simplified Chinese Translation of SETUP/REACTOS.