/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
- * FILE: drivers/filesastems/npfs/dirctl.c
+ * FILE: drivers/filesystems/npfs/dirctl.c
* PURPOSE: Named pipe filesystem
* PROGRAMMER: Eric Kohl
*/
/* Determine Buffer for result */
if (Irp->MdlAddress)
{
- Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
+ Buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress,
+ NormalPagePriority);
}
else
{
PipeIndex = 0;
Vcb = Ccb->Fcb->Vcb;
+ KeLockMutex(&Vcb->PipeListLock);
CurrentEntry = Vcb->PipeListHead.Flink;
while (CurrentEntry != &Vcb->PipeListHead &&
Status == STATUS_SUCCESS)
/* Leave, if there is no space left in the buffer */
if (Status == STATUS_BUFFER_OVERFLOW)
+ {
+ KeUnlockMutex(&Vcb->PipeListLock);
return Status;
+ }
/* Leave, if we should return only one entry */
if (Stack->Flags & SL_RETURN_SINGLE_ENTRY)
+ {
+ KeUnlockMutex(&Vcb->PipeListLock);
return STATUS_SUCCESS;
+ }
/* Store the current offset for the next round */
LastOffset = CurrentOffset;
CurrentEntry = CurrentEntry->Flink;
}
+ KeUnlockMutex(&Vcb->PipeListLock);
/* Return STATUS_NO_MORE_FILES if no matching pipe name was found */
if (CurrentOffset == 0)
NTSTATUS Status;
ULONG Size = 0;
+ UNREFERENCED_PARAMETER(DeviceObject);
+
DPRINT("NpfsDirectoryControl() called\n");
IoStack = IoGetCurrentIrpStackLocation(Irp);