Implement mshta.exe. It links directly to the function RunHTMLApplication in mshtml and passes the file name and other optional arguments along. While the function is unimplemented in mshtml, it's a start.
[MSHTML] Add ADD_IMPORTLIB to CMakeLists so mshta can link to mshtml.
[BOOTDATA] Add the association information for mshta.exe to the registry.
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
- Introduce two small helpers to change and restore the console title.
- Console title can change even when internal commands are executed.
- Note that when commands are run from within batch files, title is unchanged.
- When "cmd.exe /c command" is run, the console title is unchanged; however
when "cmd.exe /k command" is run, the console title changes.
- 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