Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenvolume.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS kernel 00004 * FILE: drivers/fs/npfs/volume.c 00005 * PURPOSE: Named pipe filesystem 00006 * PROGRAMMER: Eric Kohl 00007 */ 00008 00009 /* INCLUDES *****************************************************************/ 00010 00011 #include "npfs.h" 00012 00013 #define NDEBUG 00014 #include <debug.h> 00015 00016 /* FUNCTIONS ****************************************************************/ 00017 00018 static NTSTATUS 00019 NpfsQueryFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo, 00020 PULONG BufferLength) 00021 { 00022 DPRINT("NpfsQueryFsDeviceInformation()\n"); 00023 DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo); 00024 00025 if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION)) 00026 { 00027 *BufferLength = sizeof(FILE_FS_DEVICE_INFORMATION); 00028 return STATUS_BUFFER_OVERFLOW; 00029 } 00030 00031 FsDeviceInfo->DeviceType = FILE_DEVICE_NAMED_PIPE; 00032 FsDeviceInfo->Characteristics = 0; 00033 00034 *BufferLength = sizeof(FILE_FS_DEVICE_INFORMATION); 00035 00036 DPRINT("NpfsQueryFsDeviceInformation() finished.\n"); 00037 00038 return STATUS_SUCCESS; 00039 } 00040 00041 00042 static NTSTATUS 00043 NpfsQueryFsAttributeInformation(PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo, 00044 PULONG BufferLength) 00045 { 00046 DPRINT("NpfsQueryFsAttributeInformation() called.\n"); 00047 DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo); 00048 00049 if (*BufferLength < sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8) 00050 { 00051 *BufferLength = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8); 00052 return STATUS_BUFFER_OVERFLOW; 00053 } 00054 00055 FsAttributeInfo->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES; 00056 FsAttributeInfo->MaximumComponentNameLength = 255; 00057 FsAttributeInfo->FileSystemNameLength = 8; 00058 wcscpy(FsAttributeInfo->FileSystemName, 00059 L"NPFS"); 00060 00061 DPRINT("NpfsQueryFsAttributeInformation() finished.\n"); 00062 *BufferLength = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8); 00063 00064 return STATUS_SUCCESS; 00065 } 00066 00067 00068 NTSTATUS NTAPI 00069 NpfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject, 00070 PIRP Irp) 00071 { 00072 PIO_STACK_LOCATION Stack; 00073 FS_INFORMATION_CLASS FsInformationClass; 00074 NTSTATUS Status = STATUS_SUCCESS; 00075 PVOID SystemBuffer; 00076 ULONG BufferLength; 00077 00078 /* PRECONDITION */ 00079 ASSERT(DeviceObject != NULL); 00080 ASSERT(Irp != NULL); 00081 00082 DPRINT("NpfsQueryVolumeInformation(DeviceObject %p, Irp %p)\n", 00083 DeviceObject, 00084 Irp); 00085 00086 Stack = IoGetCurrentIrpStackLocation(Irp); 00087 FsInformationClass = Stack->Parameters.QueryVolume.FsInformationClass; 00088 BufferLength = Stack->Parameters.QueryVolume.Length; 00089 SystemBuffer = Irp->AssociatedIrp.SystemBuffer; 00090 00091 DPRINT("FsInformationClass %d\n", FsInformationClass); 00092 DPRINT("SystemBuffer %p\n", SystemBuffer); 00093 00094 switch (FsInformationClass) 00095 { 00096 case FileFsDeviceInformation: 00097 Status = NpfsQueryFsDeviceInformation(SystemBuffer, 00098 &BufferLength); 00099 break; 00100 00101 case FileFsAttributeInformation: 00102 Status = NpfsQueryFsAttributeInformation(SystemBuffer, 00103 &BufferLength); 00104 break; 00105 00106 default: 00107 Status = STATUS_NOT_SUPPORTED; 00108 } 00109 00110 Irp->IoStatus.Status = Status; 00111 Irp->IoStatus.Information = BufferLength; 00112 00113 IoCompleteRequest(Irp, 00114 IO_NO_INCREMENT); 00115 00116 return Status; 00117 } 00118 00119 /* EOF */ Generated on Mon May 28 2012 04:19:04 for ReactOS by
1.7.6.1
|