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;
}