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
))
27 *BufferLength
= sizeof(FILE_FS_DEVICE_INFORMATION
);
28 return STATUS_BUFFER_OVERFLOW
;
31 FsDeviceInfo
->DeviceType
= FILE_DEVICE_NAMED_PIPE
;
32 FsDeviceInfo
->Characteristics
= 0;
34 *BufferLength
= sizeof(FILE_FS_DEVICE_INFORMATION
);
36 DPRINT("NpfsQueryFsDeviceInformation() finished.\n");
38 return STATUS_SUCCESS
;
43 NpfsQueryFsAttributeInformation(PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo
,
46 DPRINT("NpfsQueryFsAttributeInformation() called.\n");
47 DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo
);
49 if (*BufferLength
< sizeof(FILE_FS_ATTRIBUTE_INFORMATION
) + 8)
51 *BufferLength
= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION
) + 8);
52 return STATUS_BUFFER_OVERFLOW
;
55 FsAttributeInfo
->FileSystemAttributes
= FILE_CASE_PRESERVED_NAMES
;
56 FsAttributeInfo
->MaximumComponentNameLength
= 255;
57 FsAttributeInfo
->FileSystemNameLength
= 8;
58 wcscpy(FsAttributeInfo
->FileSystemName
,
61 DPRINT("NpfsQueryFsAttributeInformation() finished.\n");
62 *BufferLength
= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION
) + 8);
64 return STATUS_SUCCESS
;
69 NpfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject
,
72 PIO_STACK_LOCATION Stack
;
73 FS_INFORMATION_CLASS FsInformationClass
;
74 NTSTATUS Status
= STATUS_SUCCESS
;
79 ASSERT(DeviceObject
!= NULL
);
82 DPRINT("NpfsQueryVolumeInformation(DeviceObject %p, Irp %p)\n",
86 Stack
= IoGetCurrentIrpStackLocation(Irp
);
87 FsInformationClass
= Stack
->Parameters
.QueryVolume
.FsInformationClass
;
88 BufferLength
= Stack
->Parameters
.QueryVolume
.Length
;
89 SystemBuffer
= Irp
->AssociatedIrp
.SystemBuffer
;
91 DPRINT("FsInformationClass %d\n", FsInformationClass
);
92 DPRINT("SystemBuffer %p\n", SystemBuffer
);
94 switch (FsInformationClass
)
96 case FileFsDeviceInformation
:
97 Status
= NpfsQueryFsDeviceInformation(SystemBuffer
,
101 case FileFsAttributeInformation
:
102 Status
= NpfsQueryFsAttributeInformation(SystemBuffer
,
107 Status
= STATUS_NOT_SUPPORTED
;
110 Irp
->IoStatus
.Status
= Status
;
111 Irp
->IoStatus
.Information
= BufferLength
;
113 IoCompleteRequest(Irp
,