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/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] 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;
}
}
Author: pschweitzer
Date: Thu Jul 27 09:33:11 2017
New Revision: 75419
URL: http://svn.reactos.org/svn/reactos?rev=75419&view=rev
Log:
[SHELL32]
Revert r75348.
Because of r75349, this revision was made useless, and even worse, it was leaking a handle to the directory where the FSD doesn't support notifications.
Also made some debug traces more useful
Modified:
trunk/reactos/dll/win32/shell32/wine/changenotify.c
Modified: trunk/reactos/dll/win32/shell32/wine/changenotify.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/cha…
==============================================================================
--- trunk/reactos/dll/win32/shell32/wine/changenotify.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/wine/changenotify.c [iso-8859-1] Thu Jul 27 09:33:11 2017
@@ -173,7 +173,7 @@
TRACE("Not freeing, still %d queued events\n", queued);
return;
}
- TRACE("Freeing for real!\n");
+ TRACE("Freeing for real! %p (%d) \n", item, item->cidl);
#endif
/* remove item from list */
@@ -693,7 +693,7 @@
static void CALLBACK _RequestTermination(ULONG_PTR arg)
{
LPNOTIFYREGISTER item = (LPNOTIFYREGISTER) arg;
- TRACE("_RequestTermination %p \n", item->hDirectory);
+ TRACE("_RequestTermination %p %p \n", item, item->hDirectory);
if (!item->hDirectory || item->hDirectory == INVALID_HANDLE_VALUE) return;
CancelIo(item->hDirectory);
@@ -724,18 +724,6 @@
#endif
#ifdef __REACTOS__
- /* This is to avoid double-free and potential use after free
- * In case it failed, _BeginRead() already deferenced item
- * But if failure comes the FSD, the APC routine (us) will
- * be called as well, which will cause a double-free on quit.
- * Avoid this by deferencing only once in case of failure and thus,
- * incrementing reference count here
- */
- if (dwErrorCode != ERROR_SUCCESS)
- {
- InterlockedIncrement(&item->pParent->wQueuedCount);
- }
-
/* If the FSD doesn't support directory change notifications, there's no
* no need to retry and requeue notification
*/
@@ -807,7 +795,9 @@
#ifdef __REACTOS__
{
#endif
- ERR("ReadDirectoryChangesW failed. (%p, %p, %p, %p) Code: %u \n",
+ ERR("ReadDirectoryChangesW failed. (%p, %p, %p, %p, %p, %p) Code: %u \n",
+ item,
+ item->pParent,
item->hDirectory,
item->buffer,
&item->overlapped,