Author: tthompson Date: Thu Jul 27 11:35:50 2017 New Revision: 75423
URL: http://svn.reactos.org/svn/reactos?rev=75423&view=rev Log: [NTFS] - After creating a new file, update creation disposition before calling NtfsCreateFile() recursively. This fixes creating a file via right-clicking in a folder.
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyste... ============================================================================== --- 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] Thu Jul 27 11:35:50 2017 @@ -580,8 +580,18 @@ return Status; }
- // Now we should be able to open the file - return NtfsCreateFile(DeviceObject, IrpContext); + // Before we open the file we just created, we need to change the disposition (upper 8 bits of ULONG) + // from create to open, since we already created the file + Stack->Parameters.Create.Options = (ULONG)FILE_OPEN << 24 | RequestedOptions; + + // Now we should be able to open the file using NtfsCreateFile() + Status = NtfsCreateFile(DeviceObject, IrpContext); + if (NT_SUCCESS(Status)) + { + // We need to change Irp->IoStatus.Information to reflect creation + Irp->IoStatus.Information = FILE_CREATED; + } + return Status; } }