2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: drivers/fs/npfs/volume.c
5 * PURPOSE: Named pipe filesystem
6 * PROGRAMMER: Eric Kohl
9 /* INCLUDES *****************************************************************/
16 /* FUNCTIONS ****************************************************************/
19 NpfsQueryFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo
,
22 DPRINT("NpfsQueryFsDeviceInformation()\n");
23 DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo
);
25 if (*BufferLength
< sizeof(FILE_FS_DEVICE_INFORMATION
))
26 return STATUS_BUFFER_OVERFLOW
;
28 FsDeviceInfo
->DeviceType
= FILE_DEVICE_NAMED_PIPE
;
29 FsDeviceInfo
->Characteristics
= 0;
31 *BufferLength
-= sizeof(FILE_FS_DEVICE_INFORMATION
);
33 DPRINT("NpfsQueryFsDeviceInformation() finished.\n");
35 return STATUS_SUCCESS
;
40 NpfsQueryFsAttributeInformation(PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo
,
43 DPRINT("NpfsQueryFsAttributeInformation() called.\n");
44 DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo
);
46 if (*BufferLength
< sizeof(FILE_FS_ATTRIBUTE_INFORMATION
) + 8)
47 return STATUS_BUFFER_OVERFLOW
;
49 FsAttributeInfo
->FileSystemAttributes
= FILE_CASE_PRESERVED_NAMES
;
50 FsAttributeInfo
->MaximumComponentNameLength
= 255;
51 FsAttributeInfo
->FileSystemNameLength
= 8;
52 wcscpy(FsAttributeInfo
->FileSystemName
,
55 DPRINT("NpfsQueryFsAttributeInformation() finished.\n");
56 *BufferLength
-= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION
) + 8);
58 return STATUS_SUCCESS
;
63 NpfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject
,
66 PIO_STACK_LOCATION Stack
;
67 FS_INFORMATION_CLASS FsInformationClass
;
68 NTSTATUS Status
= STATUS_SUCCESS
;
73 ASSERT(DeviceObject
!= NULL
);
76 DPRINT("NpfsQueryVolumeInformation(DeviceObject %p, Irp %p)\n",
80 Stack
= IoGetCurrentIrpStackLocation(Irp
);
81 FsInformationClass
= Stack
->Parameters
.QueryVolume
.FsInformationClass
;
82 BufferLength
= Stack
->Parameters
.QueryVolume
.Length
;
83 SystemBuffer
= Irp
->AssociatedIrp
.SystemBuffer
;
85 DPRINT("FsInformationClass %d\n", FsInformationClass
);
86 DPRINT("SystemBuffer %p\n", SystemBuffer
);
88 switch (FsInformationClass
)
90 case FileFsDeviceInformation
:
91 Status
= NpfsQueryFsDeviceInformation(SystemBuffer
,
95 case FileFsAttributeInformation
:
96 Status
= NpfsQueryFsAttributeInformation(SystemBuffer
,
101 Status
= STATUS_NOT_SUPPORTED
;
104 Irp
->IoStatus
.Status
= Status
;
105 if (NT_SUCCESS(Status
))
106 Irp
->IoStatus
.Information
= Stack
->Parameters
.QueryVolume
.Length
- BufferLength
;
108 Irp
->IoStatus
.Information
= 0;
109 IoCompleteRequest(Irp
,