Author: hbelusca
Date: Sat Aug 26 14:33:48 2017
New Revision: 75676
URL: http://svn.reactos.org/svn/reactos?rev=75676&view=rev
Log:
[SETUPLIB]: Initialization fixes:
- 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 I combine the flag 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.
Modified:
branches/setup_improvements/base/setup/lib/setuplib.c
Modified: branches/setup_improvements/base/setup/lib/setuplib.c
URL: http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/setuplib.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/setuplib.c [iso-8859-1] Sat Aug 26 14:33:48 2017
@@ -49,7 +49,7 @@
/* Load 'unattend.inf' from installation media */
UnattendInf = SetupOpenInfFileExW(UnattendInfPath,
NULL,
- INF_STYLE_WIN4,
+ INF_STYLE_OLDNT,
pSetupData->LanguageId,
&ErrorLine);
@@ -262,7 +262,8 @@
#if 0
/* TODO: Append the standard unattend.inf file */
- CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2, pSetupData->SourcePath.Buffer, L"unattend.inf");
+ CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2,
+ pSetupData->SourcePath.Buffer, L"unattend.inf");
if (DoesFileExist(NULL, UnattendInfPath) == FALSE)
{
DPRINT("Does not exist: %S\n", UnattendInfPath);
@@ -437,7 +438,16 @@
SYMBOLIC_LINK_QUERY,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
- return Status;
+ {
+ /*
+ * We failed at opening the \SystemRoot link (usually due to wrong
+ * access rights). Do not consider this as a fatal error, but use
+ * instead the image file path as the installation source path.
+ */
+ DPRINT1("NtOpenSymbolicLinkObject(%wZ) failed with Status 0x%08lx\n",
+ &SystemRootPath, Status);
+ goto InitPaths;
+ }
RtlInitEmptyUnicodeString(&SystemRootPath,
SystemRootBuffer,
@@ -449,7 +459,7 @@
NtClose(Handle);
if (!NT_SUCCESS(Status))
- return Status;
+ return Status; // Unexpected error
/* Check whether the resolved \SystemRoot is a prefix of the image file path */
if (RtlPrefixUnicodeString(&SystemRootPath, InstallSourcePath, TRUE))
@@ -459,6 +469,7 @@
}
+InitPaths:
/*
* Retrieve the different source path components
*/
@@ -499,7 +510,7 @@
*SetupInf = SetupOpenInfFileExW(FileNameBuffer,
NULL,
- INF_STYLE_WIN4,
+ INF_STYLE_WIN4 | INF_STYLE_OLDNT,
pSetupData->LanguageId,
&ErrorLine);
Author: hbelusca
Date: Sat Aug 26 12:52:28 2017
New Revision: 75675
URL: http://svn.reactos.org/svn/reactos?rev=75675&view=rev
Log:
[BOOTDATA]: Move an inf comment where it belongs.
Modified:
trunk/reactos/boot/bootdata/bootcd/unattend.inf
trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf
Modified: trunk/reactos/boot/bootdata/bootcd/unattend.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcd/unatt…
==============================================================================
--- trunk/reactos/boot/bootdata/bootcd/unattend.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/bootcd/unattend.inf [iso-8859-1] Sat Aug 26 12:52:28 2017
@@ -1,8 +1,7 @@
-; Set UnattendSetupEnabled to yes in order to get unattended setup working
-
[Unattend]
Signature = "$ReactOS$"
+; Set UnattendSetupEnabled to yes in order to get unattended setup working
; yes - unattend setup enabled
; no - unattend setup disabled
UnattendSetupEnabled = no
Modified: trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcdregtes…
==============================================================================
--- trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf [iso-8859-1] Sat Aug 26 12:52:28 2017
@@ -1,8 +1,7 @@
-; Set UnattendSetupEnabled to yes in order to get unattended setup working
-
[Unattend]
Signature = "$ReactOS$"
+; Set UnattendSetupEnabled to yes in order to get unattended setup working
; yes - unattend setup enabled
; no - unattend setup disabled
UnattendSetupEnabled = yes
Author: tthompson
Date: Fri Aug 25 17:16:04 2017
New Revision: 75671
URL: http://svn.reactos.org/svn/reactos?rev=75671&view=rev
Log:
[NTFS] - When creating files:
-Don't add a preceding backslash when creating files on root.
-Use NTFS_FILE_NAME_POSIX name type if CaseSensitive option is specified.
-Don't try to create a file when a folder is requested (folder creation is still TODO).
Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c [iso-8859-1] Fri Aug 25 17:16:04 2017
@@ -172,10 +172,10 @@
// we need to extract the filename from the path
DPRINT1("Pathname: %wZ\n", &FileObject->FileName);
- FilenameNoPath.Buffer = FileObject->FileName.Buffer;
- FilenameNoPath.MaximumLength = FilenameNoPath.Length = FileObject->FileName.Length;
-
FsRtlDissectName(FileObject->FileName, &Current, &Remaining);
+
+ FilenameNoPath.Buffer = Current.Buffer;
+ FilenameNoPath.MaximumLength = FilenameNoPath.Length = Current.Length;
while (Current.Length != 0)
{
@@ -232,7 +232,7 @@
// For now, we're emulating the way Windows behaves when 8.3 name generation is disabled
// TODO: add DOS Filename as needed
- if (RtlIsNameLegalDOS8Dot3(&FilenameNoPath, NULL, NULL))
+ if (!CaseSensitive && RtlIsNameLegalDOS8Dot3(&FilenameNoPath, NULL, NULL))
FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS;
else
FileNameAttribute->NameType = NTFS_FILE_NAME_POSIX;
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c [iso-8859-1] Fri Aug 25 17:16:04 2017
@@ -567,6 +567,13 @@
DPRINT1("NTFS write-support is EXPERIMENTAL and is disabled by default!\n");
NtfsCloseFile(DeviceExt, FileObject);
return STATUS_ACCESS_DENIED;
+ }
+
+ // We can't create directories yet
+ if (RequestedOptions & FILE_DIRECTORY_FILE)
+ {
+ DPRINT1("FIXME: Folder creation is still TODO!\n");
+ return STATUS_NOT_IMPLEMENTED;
}
// Create the file record on disk
Author: hbelusca
Date: Fri Aug 25 14:38:12 2017
New Revision: 75669
URL: http://svn.reactos.org/svn/reactos?rev=75669&view=rev
Log:
[USETUP]: Add few checks to forbid the user to attempt installing ReactOS in the installation source directory, or a subdirectory thereof, or to delete the partition containing the installation source.
This is needed because the ReactOS installer can also be present from within a HDD partition!
Modified:
branches/setup_improvements/base/setup/usetup/usetup.c
Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL: http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/usetup.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c [iso-8859-1] Fri Aug 25 14:38:12 2017
@@ -1614,9 +1614,31 @@
}
else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D') /* D */
{
+ WCHAR PathBuffer[MAX_PATH];
+ UNICODE_STRING CurrentPartition;
+
if (PartitionList->CurrentPartition->IsPartitioned == FALSE)
{
MUIDisplayError(ERROR_DELETE_SPACE, Ir, POPUP_WAIT_ANY_KEY);
+ return SELECT_PARTITION_PAGE;
+ }
+
+ StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ L"\\Device\\Harddisk%lu\\Partition%lu\\",
+ PartitionList->CurrentDisk->DiskNumber,
+ PartitionList->CurrentPartition->PartitionNumber);
+ RtlInitUnicodeString(&CurrentPartition, PathBuffer);
+
+ /*
+ * Check whether the user attempts to delete the partition on which
+ * the installation source is present. If so, fail with an error.
+ */
+ // &USetupData.SourceRootPath
+ if (RtlPrefixUnicodeString(&CurrentPartition, &USetupData.SourcePath, TRUE))
+ {
+ PopupError("You cannot delete the partition containing the installation source!",
+ MUIGetString(STRING_CONTINUE),
+ Ir, POPUP_WAIT_ENTER);
return SELECT_PARTITION_PAGE;
}
@@ -2591,6 +2613,8 @@
PartTypeString,
ARRAYSIZE(PartTypeString));
+ MUIDisplayPage(SELECT_FILE_SYSTEM_PAGE);
+
if (PartEntry->AutoCreate == TRUE)
{
CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NEWPARTITION));
@@ -2674,8 +2698,6 @@
&DiskEntry->DriverName,
DiskEntry->NoMbr ? "GPT" : "MBR");
}
-
- MUIDisplayPage(SELECT_FILE_SYSTEM_PAGE);
if (FileSystemList == NULL)
{
@@ -3068,6 +3090,20 @@
/* Initialize DestinationDriveLetter */
DestinationDriveLetter = (WCHAR)PartEntry->DriveLetter;
+
+ /*
+ * Check whether the user attempts to install ReactOS within the
+ * installation source directory, or in a subdirectory thereof.
+ * If so, fail with an error.
+ */
+ if (RtlPrefixUnicodeString(&USetupData.SourcePath, &USetupData.DestinationPath, TRUE))
+ {
+ INPUT_RECORD Ir;
+ PopupError("You cannot install ReactOS within the installation source directory!",
+ MUIGetString(STRING_CONTINUE),
+ &Ir, POPUP_WAIT_ENTER);
+ return INSTALL_DIRECTORY_PAGE;
+ }
return PREPARE_COPY_PAGE;
}