Added experimental support for FAT and NTFS FSDs.

Silenced debug messges.

svn path=/trunk/; revision=2954
This commit is contained in:
Eric Kohl 2002-05-15 18:05:00 +00:00
parent 1875c5ebb2
commit 2d27974602
12 changed files with 284 additions and 92 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: cdfs.c,v 1.4 2002/05/15 09:39:54 ekohl Exp $ /* $Id: cdfs.c,v 1.5 2002/05/15 18:01:30 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -58,7 +58,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
NTSTATUS Status; NTSTATUS Status;
UNICODE_STRING DeviceName; UNICODE_STRING DeviceName;
DbgPrint("CDFS 0.0.2\n"); DPRINT("CDFS 0.0.2\n");
RtlInitUnicodeString(&DeviceName, RtlInitUnicodeString(&DeviceName,
L"\\Cdfs"); L"\\Cdfs");

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: fsctl.c,v 1.5 2002/05/14 23:16:23 ekohl Exp $ /* $Id: fsctl.c,v 1.6 2002/05/15 18:01:30 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -118,8 +118,6 @@ CdfsGetSVDData(PUCHAR Buffer,
JolietLevel = 3; JolietLevel = 3;
} }
/* Don't support Joliet yet! */
//#if 0
Vcb->CdInfo.JolietLevel = JolietLevel; Vcb->CdInfo.JolietLevel = JolietLevel;
if (JolietLevel != 0) if (JolietLevel != 0)
@ -130,7 +128,6 @@ CdfsGetSVDData(PUCHAR Buffer,
DPRINT("RootStart: %lu\n", Svd->RootDirRecord.ExtentLocationL); DPRINT("RootStart: %lu\n", Svd->RootDirRecord.ExtentLocationL);
DPRINT("RootSize: %lu\n", Svd->RootDirRecord.DataLengthL); DPRINT("RootSize: %lu\n", Svd->RootDirRecord.DataLengthL);
} }
//#endif
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: blockdev.c,v 1.1 2002/05/15 09:40:47 ekohl Exp $ /* $Id: blockdev.c,v 1.2 2002/05/15 18:02:59 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -48,11 +48,17 @@ FsRecReadSectors(IN PDEVICE_OBJECT DeviceObject,
IO_STATUS_BLOCK IoStatus; IO_STATUS_BLOCK IoStatus;
LARGE_INTEGER Offset; LARGE_INTEGER Offset;
ULONG BlockSize; ULONG BlockSize;
KEVENT Event; PKEVENT Event;
PIRP Irp; PIRP Irp;
NTSTATUS Status; NTSTATUS Status;
KeInitializeEvent(&Event, Event = ExAllocatePool(NonPagedPool, sizeof(KEVENT));
if (Event == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
}
KeInitializeEvent(Event,
NotificationEvent, NotificationEvent,
FALSE); FALSE);
@ -71,38 +77,90 @@ FsRecReadSectors(IN PDEVICE_OBJECT DeviceObject,
Buffer, Buffer,
BlockSize, BlockSize,
&Offset, &Offset,
&Event, Event,
&IoStatus); &IoStatus);
if (Irp == NULL) if (Irp == NULL)
{ {
DPRINT("IoBuildSynchronousFsdRequest failed\n"); DPRINT("IoBuildSynchronousFsdRequest failed\n");
ExFreePool(Event);
return(STATUS_INSUFFICIENT_RESOURCES); return(STATUS_INSUFFICIENT_RESOURCES);
} }
DPRINT("Calling IO Driver... with irp %x\n", Irp); DPRINT("Calling IO Driver... with irp %x\n", Irp);
Status = IoCallDriver(DeviceObject, Irp); Status = IoCallDriver(DeviceObject, Irp);
DPRINT("Waiting for IO Operation for %x\n", Irp);
if (Status == STATUS_PENDING) if (Status == STATUS_PENDING)
{ {
DPRINT("Operation pending\n"); DPRINT("Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); KeWaitForSingleObject(Event, Suspended, KernelMode, FALSE, NULL);
DPRINT("Getting IO Status... for %x\n", Irp);
Status = IoStatus.Status; Status = IoStatus.Status;
} }
if (!NT_SUCCESS(Status)) ExFreePool(Event);
{
DPRINT("FsrecReadSectors() failed (Status %x)\n", Status);
DPRINT("(DeviceObject %x, DiskSector %x, Buffer %x, Offset 0x%I64x)\n",
DeviceObject, DiskSector, Buffer,
Offset.QuadPart);
return(Status);
}
DPRINT("Block request succeeded for %x\n", Irp);
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
} }
NTSTATUS
FsRecDeviceIoControl(IN PDEVICE_OBJECT DeviceObject,
IN ULONG ControlCode,
IN PVOID InputBuffer,
IN ULONG InputBufferSize,
IN OUT PVOID OutputBuffer,
IN OUT PULONG OutputBufferSize)
{
ULONG BufferSize = 0;
PKEVENT Event;
PIRP Irp;
IO_STATUS_BLOCK IoStatus;
NTSTATUS Status;
if (OutputBufferSize != NULL)
{
BufferSize = *OutputBufferSize;
}
Event = ExAllocatePool(NonPagedPool, sizeof(KEVENT));
if (Event == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
}
KeInitializeEvent(Event, NotificationEvent, FALSE);
DPRINT("Building device I/O control request ...\n");
Irp = IoBuildDeviceIoControlRequest(ControlCode,
DeviceObject,
InputBuffer,
InputBufferSize,
OutputBuffer,
BufferSize,
FALSE,
Event,
&IoStatus);
if (Irp == NULL)
{
DPRINT("IoBuildDeviceIoControlRequest() failed\n");
ExFreePool(Event);
return(STATUS_INSUFFICIENT_RESOURCES);
}
DPRINT("Calling IO Driver... with irp %x\n", Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
if (OutputBufferSize)
{
*OutputBufferSize = BufferSize;
}
ExFreePool(Event);
return(Status);
}
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: cdfs.c,v 1.1 2002/05/15 09:40:47 ekohl Exp $ /* $Id: cdfs.c,v 1.2 2002/05/15 18:02:59 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -40,11 +40,27 @@
static NTSTATUS static NTSTATUS
FsRecIsCdfsVolume(IN PDEVICE_OBJECT DeviceObject) FsRecIsCdfsVolume(IN PDEVICE_OBJECT DeviceObject)
{ {
DISK_GEOMETRY DiskGeometry;
PUCHAR Buffer; PUCHAR Buffer;
NTSTATUS Status; NTSTATUS Status;
ULONG Size;
Size = sizeof(DISK_GEOMETRY);
Status = FsRecDeviceIoControl(DeviceObject,
IOCTL_CDROM_GET_DRIVE_GEOMETRY,
NULL,
0,
&DiskGeometry,
&Size);
DPRINT("FsRecDeviceIoControl() Status %lx\n", Status);
if (!NT_SUCCESS(Status))
{
return(Status);
}
DPRINT("BytesPerSector: %lu\n", DiskGeometry.BytesPerSector);
Buffer = ExAllocatePool(NonPagedPool, Buffer = ExAllocatePool(NonPagedPool,
2048); DiskGeometry.BytesPerSector);
if (Buffer == NULL) if (Buffer == NULL)
{ {
return(STATUS_INSUFFICIENT_RESOURCES); return(STATUS_INSUFFICIENT_RESOURCES);
@ -53,7 +69,7 @@ FsRecIsCdfsVolume(IN PDEVICE_OBJECT DeviceObject)
Status = FsRecReadSectors(DeviceObject, Status = FsRecReadSectors(DeviceObject,
16, /* CDFS_PVD_SECTOR */ 16, /* CDFS_PVD_SECTOR */
1, 1,
2048, DiskGeometry.BytesPerSector,
Buffer); Buffer);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -90,7 +106,6 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
{ {
case IRP_MN_MOUNT_VOLUME: case IRP_MN_MOUNT_VOLUME:
DPRINT("Cdfs: IRP_MN_MOUNT_VOLUME\n"); DPRINT("Cdfs: IRP_MN_MOUNT_VOLUME\n");
Status = FsRecIsCdfsVolume(Stack->Parameters.MountVolume.DeviceObject); Status = FsRecIsCdfsVolume(Stack->Parameters.MountVolume.DeviceObject);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
@ -102,7 +117,8 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
case IRP_MN_LOAD_FILE_SYSTEM: case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("Cdfs: IRP_MN_LOAD_FILE_SYSTEM\n"); DPRINT("Cdfs: IRP_MN_LOAD_FILE_SYSTEM\n");
#if 0 #if 0
RtlInitUnicodeString(&RegistryPath, FSD_REGISTRY_PATH); RtlInitUnicodeString(&RegistryPath,
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\Cdfs");
#endif #endif
RtlInitUnicodeString(&RegistryPath, RtlInitUnicodeString(&RegistryPath,
L"\\SystemRoot\\system32\\drivers\\cdfs.sys"); L"\\SystemRoot\\system32\\drivers\\cdfs.sys");

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: fat.c,v 1.1 2002/05/15 09:40:47 ekohl Exp $ /* $Id: fat.c,v 1.2 2002/05/15 18:02:59 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -29,7 +29,7 @@
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
//#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
#include "fs_rec.h" #include "fs_rec.h"
@ -37,6 +37,61 @@
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
static NTSTATUS
FsRecIsFatVolume(IN PDEVICE_OBJECT DeviceObject)
{
DISK_GEOMETRY DiskGeometry;
PUCHAR Buffer;
ULONG Size;
NTSTATUS Status;
Size = sizeof(DISK_GEOMETRY);
Status = FsRecDeviceIoControl(DeviceObject,
IOCTL_DISK_GET_DRIVE_GEOMETRY,
NULL,
0,
&DiskGeometry,
&Size);
DPRINT("FsRecDeviceIoControl() Status %lx\n", Status);
if (!NT_SUCCESS(Status))
{
return(Status);
}
DPRINT("BytesPerSector: %lu\n", DiskGeometry.BytesPerSector);
Buffer = ExAllocatePool(NonPagedPool,
DiskGeometry.BytesPerSector);
if (Buffer == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
}
Status = FsRecReadSectors(DeviceObject,
0, /* Partition boot sector */
1,
DiskGeometry.BytesPerSector,
Buffer);
if (!NT_SUCCESS(Status))
{
return(Status);
}
if ((strncmp(&Buffer[0x36], "FAT12", 5) == 0) ||
(strncmp(&Buffer[0x36], "FAT16", 5) == 0) ||
(strncmp(&Buffer[0x52], "FAT32", 5) == 0))
{
Status = STATUS_SUCCESS;
}
else
{
Status = STATUS_UNRECOGNIZED_VOLUME;
}
ExFreePool(Buffer);
return(Status);
}
NTSTATUS NTSTATUS
FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject, FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
@ -51,24 +106,20 @@ FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
switch (Stack->MinorFunction) switch (Stack->MinorFunction)
{ {
case IRP_MN_MOUNT_VOLUME: case IRP_MN_MOUNT_VOLUME:
DPRINT("Fat: IRP_MN_MOUNT_VOLUME\n"); DPRINT("FAT: IRP_MN_MOUNT_VOLUME\n");
Status = STATUS_INVALID_DEVICE_REQUEST;
#if 0
Status = FsRecIsFatVolume(Stack->Parameters.MountVolume.DeviceObject); Status = FsRecIsFatVolume(Stack->Parameters.MountVolume.DeviceObject);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
DPRINT("Identified FAT volume\n"); DPRINT("Identified FAT volume\n");
Status = STATUS_FS_DRIVER_REQUIRED; Status = STATUS_FS_DRIVER_REQUIRED;
} }
#endif
break; break;
case IRP_MN_LOAD_FILE_SYSTEM: case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("Fat: IRP_MN_LOAD_FILE_SYSTEM\n"); DPRINT("FAT: IRP_MN_LOAD_FILE_SYSTEM\n");
Status = STATUS_INVALID_DEVICE_REQUEST;
#if 0 #if 0
#if 0 RtlInitUnicodeString(&RegistryPath,
RtlInitUnicodeString(&RegistryPath, FSD_REGISTRY_PATH); L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\Vfatfs");
#endif #endif
RtlInitUnicodeString(&RegistryPath, RtlInitUnicodeString(&RegistryPath,
L"\\SystemRoot\\system32\\drivers\\vfatfs.sys"); L"\\SystemRoot\\system32\\drivers\\vfatfs.sys");
@ -81,11 +132,10 @@ FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
{ {
IoUnregisterFileSystem(DeviceObject); IoUnregisterFileSystem(DeviceObject);
} }
#endif
break; break;
default: default:
DPRINT("Fat: Unknown minor function %lx\n", Stack->MinorFunction); DPRINT("FAT: Unknown minor function %lx\n", Stack->MinorFunction);
Status = STATUS_INVALID_DEVICE_REQUEST; Status = STATUS_INVALID_DEVICE_REQUEST;
break; break;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: fs_rec.c,v 1.1 2002/05/15 09:40:47 ekohl Exp $ /* $Id: fs_rec.c,v 1.2 2002/05/15 18:02:59 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -217,7 +217,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
} }
} }
#if 0
Status = FsRecRegisterFs(DriverObject, Status = FsRecRegisterFs(DriverObject,
L"\\Fat", L"\\Fat",
L"\\FileSystem\\FatRecognizer", L"\\FileSystem\\FatRecognizer",
@ -227,7 +226,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
{ {
DeviceCount++; DeviceCount++;
} }
#endif
Status = FsRecRegisterFs(DriverObject, Status = FsRecRegisterFs(DriverObject,
L"\\Ntfs", L"\\Ntfs",

View file

@ -1,39 +1,39 @@
/* /*
This is a File System Recognizer for RomFs. * ReactOS kernel
Copyright (C) 2001 Bo Brantén. * Copyright (C) 2002 ReactOS Team
This program is free software; you can redistribute it and/or modify *
it under the terms of the GNU General Public License as published by * This program is free software; you can redistribute it and/or modify
the Free Software Foundation; either version 2 of the License, or * it under the terms of the GNU General Public License as published by
(at your option) any later version. * the Free Software Foundation; either version 2 of the License, or
This program is distributed in the hope that it will be useful, * (at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of *
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * This program is distributed in the hope that it will be useful,
GNU General Public License for more details. * but WITHOUT ANY WARRANTY; without even the implied warranty of
You should have received a copy of the GNU General Public License * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program; if not, write to the Free Software * GNU General Public License for more details.
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
*/ * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// */
// Registry path for the FSD and this driver /* $Id: fs_rec.h,v 1.2 2002/05/15 18:02:59 ekohl Exp $
// *
* COPYRIGHT: See COPYING in the top level directory
#define FSD_REGISTRY_PATH \ * PROJECT: ReactOS kernel
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\RomFs" * FILE: services/fs/fs_rec/fs_rec.h
* PURPOSE: Filesystem recognizer driver
#define FSR_REGISTRY_PATH \ * PROGRAMMER: Eric Kohl
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\RomFsRec" */
/* Filesystem types (add new filesystems here)*/ /* Filesystem types (add new filesystems here)*/
#define FS_TYPE_UNUSED 0 #define FS_TYPE_UNUSED 0
#define FS_TYPE_VFAT 1 #define FS_TYPE_VFAT 1
#define FS_TYPE_NTFS 2 #define FS_TYPE_NTFS 2
#define FS_TYPE_CDFS 3 #define FS_TYPE_CDFS 3
typedef struct _DEVICE_EXTENSION typedef struct _DEVICE_EXTENSION
{ {
ULONG FsType; ULONG FsType;
@ -49,6 +49,14 @@ FsRecReadSectors(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize, IN ULONG SectorSize,
IN OUT PUCHAR Buffer); IN OUT PUCHAR Buffer);
NTSTATUS
FsRecDeviceIoControl(IN PDEVICE_OBJECT DeviceObject,
IN ULONG ControlCode,
IN PVOID InputBuffer,
IN ULONG InputBufferSize,
IN OUT PVOID OutputBuffer,
IN OUT PULONG OutputBufferSize);
/* cdfs.c */ /* cdfs.c */
@ -57,17 +65,17 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
/* fat.c */
NTSTATUS
FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/* ntfs.c */ /* ntfs.c */
NTSTATUS NTSTATUS
FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject, FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
/* vfat.c */
NTSTATUS
FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: ntfs.c,v 1.1 2002/05/15 09:40:47 ekohl Exp $ /* $Id: ntfs.c,v 1.2 2002/05/15 18:02:59 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -29,7 +29,7 @@
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
//#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
#include "fs_rec.h" #include "fs_rec.h"
@ -37,6 +37,59 @@
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
static NTSTATUS
FsRecIsNtfsVolume(IN PDEVICE_OBJECT DeviceObject)
{
DISK_GEOMETRY DiskGeometry;
PUCHAR Buffer;
ULONG Size;
NTSTATUS Status;
Size = sizeof(DISK_GEOMETRY);
Status = FsRecDeviceIoControl(DeviceObject,
IOCTL_DISK_GET_DRIVE_GEOMETRY,
NULL,
0,
&DiskGeometry,
&Size);
DPRINT("FsRecDeviceIoControl() Status %lx\n", Status);
if (!NT_SUCCESS(Status))
{
return(Status);
}
DPRINT("BytesPerSector: %lu\n", DiskGeometry.BytesPerSector);
Buffer = ExAllocatePool(NonPagedPool,
DiskGeometry.BytesPerSector);
if (Buffer == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
}
Status = FsRecReadSectors(DeviceObject,
0, /* Partition boot sector */
1,
DiskGeometry.BytesPerSector,
Buffer);
if (!NT_SUCCESS(Status))
{
return(Status);
}
if (strncmp(&Buffer[3], "NTFS ", 8) == 0)
{
Status = STATUS_SUCCESS;
}
else
{
Status = STATUS_UNRECOGNIZED_VOLUME;
}
ExFreePool(Buffer);
return(Status);
}
NTSTATUS NTSTATUS
FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject, FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
@ -52,23 +105,20 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
{ {
case IRP_MN_MOUNT_VOLUME: case IRP_MN_MOUNT_VOLUME:
DPRINT("NTFS: IRP_MN_MOUNT_VOLUME\n"); DPRINT("NTFS: IRP_MN_MOUNT_VOLUME\n");
Status = STATUS_INVALID_DEVICE_REQUEST;
#if 0
Status = FsRecIsNtfsVolume(Stack->Parameters.MountVolume.DeviceObject); Status = FsRecIsNtfsVolume(Stack->Parameters.MountVolume.DeviceObject);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
DPRINT("Identified NTFS volume\n"); DPRINT("Identified NTFS volume\n");
Status = STATUS_FS_DRIVER_REQUIRED; Status = STATUS_FS_DRIVER_REQUIRED;
} }
#endif
break; break;
case IRP_MN_LOAD_FILE_SYSTEM: case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("NTFS: IRP_MN_LOAD_FILE_SYSTEM\n"); DPRINT("NTFS: IRP_MN_LOAD_FILE_SYSTEM\n");
Status = STATUS_INVALID_DEVICE_REQUEST;
#if 0 #if 0
#if 0 RtlInitUnicodeString(&RegistryPath,
RtlInitUnicodeString(&RegistryPath, FSD_REGISTRY_PATH); L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\Ntfs");
#endif #endif
RtlInitUnicodeString(&RegistryPath, RtlInitUnicodeString(&RegistryPath,
L"\\SystemRoot\\system32\\drivers\\ntfs.sys"); L"\\SystemRoot\\system32\\drivers\\ntfs.sys");
@ -81,7 +131,6 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
{ {
IoUnregisterFileSystem(DeviceObject); IoUnregisterFileSystem(DeviceObject);
} }
#endif
break; break;
default: default:

View file

@ -1,4 +1,4 @@
/* $Id: cleanup.c,v 1.3 2001/11/02 22:44:34 hbirr Exp $ /* $Id: cleanup.c,v 1.4 2002/05/15 18:05:00 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -42,6 +42,12 @@ NTSTATUS VfatCleanup (PVFAT_IRP_CONTEXT IrpContext)
DPRINT("VfatCleanup(DeviceObject %x, Irp %x)\n", DeviceObject, Irp); DPRINT("VfatCleanup(DeviceObject %x, Irp %x)\n", DeviceObject, Irp);
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
{
Status = STATUS_SUCCESS;
goto ByeBye;
}
if (!ExAcquireResourceExclusiveLite (&IrpContext->DeviceExt->DirResource, IrpContext->Flags & IRPCONTEXT_CANWAIT)) if (!ExAcquireResourceExclusiveLite (&IrpContext->DeviceExt->DirResource, IrpContext->Flags & IRPCONTEXT_CANWAIT))
{ {
return VfatQueueRequest (IrpContext); return VfatQueueRequest (IrpContext);
@ -51,6 +57,7 @@ NTSTATUS VfatCleanup (PVFAT_IRP_CONTEXT IrpContext)
ExReleaseResourceLite (&IrpContext->DeviceExt->DirResource); ExReleaseResourceLite (&IrpContext->DeviceExt->DirResource);
ByeBye:
IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Status = Status;
IrpContext->Irp->IoStatus.Information = 0; IrpContext->Irp->IoStatus.Information = 0;

View file

@ -1,4 +1,4 @@
/* $Id: close.c,v 1.10 2002/05/05 20:18:33 hbirr Exp $ /* $Id: close.c,v 1.11 2002/05/15 18:05:00 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -80,6 +80,13 @@ NTSTATUS VfatClose (PVFAT_IRP_CONTEXT IrpContext)
DPRINT ("VfatClose(DeviceObject %x, Irp %x)\n", DeviceObject, Irp); DPRINT ("VfatClose(DeviceObject %x, Irp %x)\n", DeviceObject, Irp);
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
{
DPRINT("Closing file system\n");
Status = STATUS_SUCCESS;
goto ByeBye;
}
if (!ExAcquireResourceExclusiveLite (&IrpContext->DeviceExt->DirResource, IrpContext->Flags & IRPCONTEXT_CANWAIT)) if (!ExAcquireResourceExclusiveLite (&IrpContext->DeviceExt->DirResource, IrpContext->Flags & IRPCONTEXT_CANWAIT))
{ {
return VfatQueueRequest (IrpContext); return VfatQueueRequest (IrpContext);
@ -88,6 +95,7 @@ NTSTATUS VfatClose (PVFAT_IRP_CONTEXT IrpContext)
Status = VfatCloseFile (IrpContext->DeviceExt, IrpContext->FileObject); Status = VfatCloseFile (IrpContext->DeviceExt, IrpContext->FileObject);
ExReleaseResourceLite (&IrpContext->DeviceExt->DirResource); ExReleaseResourceLite (&IrpContext->DeviceExt->DirResource);
ByeBye:
IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Status = Status;
IrpContext->Irp->IoStatus.Information = 0; IrpContext->Irp->IoStatus.Information = 0;
IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT); IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT);

View file

@ -1,4 +1,4 @@
/* $Id: create.c,v 1.40 2002/05/05 20:18:33 hbirr Exp $ /* $Id: create.c,v 1.41 2002/05/15 18:05:00 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -816,7 +816,8 @@ NTSTATUS VfatCreate (PVFAT_IRP_CONTEXT IrpContext)
assert (IrpContext); assert (IrpContext);
if (IrpContext->DeviceObject->Size == sizeof (DEVICE_OBJECT)) // if (IrpContext->DeviceObject->Size == sizeof (DEVICE_OBJECT))
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
{ {
/* DeviceObject represents FileSystem instead of logical volume */ /* DeviceObject represents FileSystem instead of logical volume */
DPRINT ("FsdCreate called with file system\n"); DPRINT ("FsdCreate called with file system\n");

View file

@ -1,4 +1,4 @@
/* $Id: iface.c,v 1.62 2002/03/18 22:37:12 hbirr Exp $ /* $Id: iface.c,v 1.63 2002/05/15 18:05:00 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -58,7 +58,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
DPRINT("VFAT 0.0.6\n"); DPRINT("VFAT 0.0.6\n");
RtlInitUnicodeString(&DeviceName, RtlInitUnicodeString(&DeviceName,
L"\\Device\\Vfat"); L"\\Fat");
Status = IoCreateDevice(DriverObject, Status = IoCreateDevice(DriverObject,
sizeof(VFAT_GLOBAL_DATA), sizeof(VFAT_GLOBAL_DATA),
&DeviceName, &DeviceName,