/*
* 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
*/
PULONG Size)
{
PIO_STACK_LOCATION Stack;
- LONG BufferLength = 0;
+ ULONG BufferLength = 0;
PUNICODE_STRING SearchPattern = NULL;
FILE_INFORMATION_CLASS FileInformationClass;
ULONG FileIndex = 0;
/* Determine Buffer for result */
if (Irp->MdlAddress)
{
- Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
+ Buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress,
+ NormalPagePriority);
}
else
{
if (SearchPattern != NULL)
{
Ccb->u.Directory.SearchPattern.Buffer =
- ExAllocatePool(NonPagedPool, SearchPattern->Length + sizeof(WCHAR));
+ ExAllocatePoolWithTag(NonPagedPool,
+ SearchPattern->Length + sizeof(WCHAR),
+ TAG_NPFS_NAMEBLOCK);
if (Ccb->u.Directory.SearchPattern.Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
else
{
Ccb->u.Directory.SearchPattern.Buffer =
- ExAllocatePool(NonPagedPool, 2 * sizeof(WCHAR));
+ ExAllocatePoolWithTag(NonPagedPool,
+ 2 * sizeof(WCHAR),
+ TAG_NPFS_NAMEBLOCK);
if (Ccb->u.Directory.SearchPattern.Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
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)
PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
PNPFS_CCB Ccb;
- PNPFS_FCB Fcb;
+ //PNPFS_FCB Fcb;
NTSTATUS Status;
ULONG Size = 0;
+ UNREFERENCED_PARAMETER(DeviceObject);
+
DPRINT("NpfsDirectoryControl() called\n");
IoStack = IoGetCurrentIrpStackLocation(Irp);
return Status;
}
- Fcb = Ccb->Fcb;
+ //Fcb = Ccb->Fcb;
switch (IoStack->MinorFunction)
{