Author: pschweitzer
Date: Sun Jun 26 10:23:35 2016
New Revision: 71674
URL: http://svn.reactos.org/svn/reactos?rev=71674&view=rev
Log:
[FASTFAT]
Don't allow renaming a directory if there are opened files in it.
The way we do it for now isn't fully optimal and could be really improved, but that's a first step in the right direction.
This should help getting rid of FAT volumes corruption.
This also fixes a few winetests it seems.
CORE-11426 #comment Patch that fixes bug 3 committed in r71674
Modified:
trunk/reactos/drivers/filesystems/fastfat/finfo.c
Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Sun Jun 26 10:23:35 2016
@@ -704,6 +704,27 @@
vfatSplitPathName(&NewName, &NewPath, &NewFile);
DPRINT("New dir: %wZ, New file: %wZ\n", &NewPath, &NewFile);
+ /* FIXME: Do it in a more efficient way, like linking FCBs to their parent FCB so that we browse less FCBs
+ * Note: The FIXME is the way MS FastFAT seems to do it
+ */
+ if (vfatFCBIsDirectory(FCB))
+ {
+ PLIST_ENTRY Entry;
+ PVFATFCB VolFCB;
+
+ for (Entry = DeviceExt->FcbListHead.Flink; Entry != &DeviceExt->FcbListHead; Entry = Entry->Flink)
+ {
+ VolFCB = CONTAINING_RECORD(Entry, VFATFCB, FcbListEntry);
+ if (VolFCB->parentFcb == FCB && VolFCB->OpenHandleCount != 0)
+ {
+ DPRINT1("At least one children file opened! %wZ (%u, %u)\n", &VolFCB->PathNameU, VolFCB->RefCount, VolFCB->OpenHandleCount);
+ Status = STATUS_ACCESS_DENIED;
+ ASSERT(OldReferences == FCB->parentFcb->RefCount);
+ goto Cleanup;
+ }
+ }
+ }
+
/* Are we working in place? */
if (FsRtlAreNamesEqual(&SourcePath, &NewPath, TRUE, NULL))
{
Author: tfaber
Date: Sat Jun 25 23:27:45 2016
New Revision: 71673
URL: http://svn.reactos.org/svn/reactos?rev=71673&view=rev
Log:
[NTOS:LPC]
- Avoid dereferencing a null pointer in LpcpDeletePort. By Samuel Serapión.
CORE-6850 #resolve
Modified:
trunk/reactos/ntoskrnl/lpc/close.c
Modified: trunk/reactos/ntoskrnl/lpc/close.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/close.c?rev=7…
==============================================================================
--- trunk/reactos/ntoskrnl/lpc/close.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/lpc/close.c [iso-8859-1] Sat Jun 25 23:27:45 2016
@@ -432,20 +432,20 @@
/* Dereference the object unless it's the same port */
if (ConnectionPort != Port) ObDereferenceObject(ConnectionPort);
+
+ /* Check if this is a connection port with a server process */
+ if (((Port->Flags & LPCP_PORT_TYPE_MASK) == LPCP_CONNECTION_PORT) &&
+ (ConnectionPort->ServerProcess))
+ {
+ /* Dereference the server process */
+ ObDereferenceObject(ConnectionPort->ServerProcess);
+ ConnectionPort->ServerProcess = NULL;
+ }
}
else
{
/* Release the lock */
KeReleaseGuardedMutex(&LpcpLock);
- }
-
- /* Check if this is a connection port with a server process */
- if (((Port->Flags & LPCP_PORT_TYPE_MASK) == LPCP_CONNECTION_PORT) &&
- (ConnectionPort->ServerProcess))
- {
- /* Dereference the server process */
- ObDereferenceObject(ConnectionPort->ServerProcess);
- ConnectionPort->ServerProcess = NULL;
}
/* Free client security */