3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: services/fs/npfs/volume.c
6 * PURPOSE: Named pipe filesystem
7 * PROGRAMMER: Eric Kohl <ekohl@rz-online.de>
10 /* INCLUDES *****************************************************************/
12 #include <ddk/ntddk.h>
20 /* FUNCTIONS ****************************************************************/
23 NpfsQueryFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
26 DPRINT("NpfsQueryFsDeviceInformation()\n");
27 DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
29 if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION))
30 return(STATUS_BUFFER_OVERFLOW);
32 FsDeviceInfo->DeviceType = FILE_DEVICE_NAMED_PIPE;
33 FsDeviceInfo->Characteristics = 0;
35 *BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION);
37 DPRINT("NpfsQueryFsDeviceInformation() finished.\n");
39 return(STATUS_SUCCESS);
44 NpfsQueryFsAttributeInformation(PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo,
47 DPRINT("NpfsQueryFsAttributeInformation() called.\n");
48 DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo);
50 if (*BufferLength < sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8)
51 return(STATUS_BUFFER_OVERFLOW);
53 FsAttributeInfo->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES;
54 FsAttributeInfo->MaximumComponentNameLength = 255;
55 FsAttributeInfo->FileSystemNameLength = 8;
56 wcscpy(FsAttributeInfo->FileSystemName,
59 DPRINT("NpfsQueryFsAttributeInformation() finished.\n");
60 *BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8);
62 return(STATUS_SUCCESS);
67 NpfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
70 PIO_STACK_LOCATION Stack;
71 FS_INFORMATION_CLASS FsInformationClass;
72 NTSTATUS Status = STATUS_SUCCESS;
77 assert(DeviceObject != NULL);
80 DPRINT("NpfsQueryVolumeInformation(DeviceObject %x, Irp %x)\n",
84 Stack = IoGetCurrentIrpStackLocation (Irp);
85 FsInformationClass = Stack->Parameters.QueryVolume.FsInformationClass;
86 BufferLength = Stack->Parameters.QueryVolume.Length;
87 SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
89 DPRINT("FsInformationClass %d\n", FsInformationClass);
90 DPRINT("SystemBuffer %x\n", SystemBuffer);
92 switch (FsInformationClass)
94 case FileFsDeviceInformation:
95 Status = NpfsQueryFsDeviceInformation(SystemBuffer,
99 case FileFsAttributeInformation:
100 Status = NpfsQueryFsAttributeInformation(SystemBuffer,
105 Status = STATUS_NOT_SUPPORTED;
108 Irp->IoStatus.Status = Status;
109 if (NT_SUCCESS(Status))
110 Irp->IoStatus.Information =
111 Stack->Parameters.QueryVolume.Length - BufferLength;
113 Irp->IoStatus.Information = 0;
114 IoCompleteRequest(Irp,