mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
NTFS driver improvments :
- Implemented NtfsFsdDispatch to dispatch some IO requests (use it with implemented functions that need it) - Implemented NtfsIsIrpTopLevel (From Rajeev Nagar), NtfsAllocateIrpContext - Added more checks - Renamed functions that are called by IO to NtfsFsd* (similar to Windows NTFS driver) - Use NTAPI instead of STDCALL to have MSVC compatibility, thanks to Hervé - Reorganized functions order with increasing index - Updated files headers svn path=/trunk/; revision=32253
This commit is contained in:
parent
b78400c9f4
commit
47b892354b
16 changed files with 291 additions and 102 deletions
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: drivers/fs/ntfs/attrib.c
|
* FILE: drivers/filesystem/ntfs/attrib.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
* Updated by Valentin Verkhovsky 2003/09/12
|
* Updated by Valentin Verkhovsky 2003/09/12
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/blockdev.c
|
* FILE: drivers/filesystem/ntfs/blockdev.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/close.c
|
* FILE: drivers/filesystem/ntfs/close.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
* UPDATE HISTORY:
|
* UPDATE HISTORY:
|
||||||
|
@ -79,8 +77,8 @@ NtfsCloseFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsClose(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdClose(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
PDEVICE_EXTENSION DeviceExtension;
|
PDEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/create.c
|
* FILE: drivers/filesystem/ntfs/create.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
@ -205,8 +203,8 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsCreate(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
PDEVICE_EXTENSION DeviceExt;
|
PDEVICE_EXTENSION DeviceExt;
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: drivers/fs/ntfs/dirctl.c
|
* FILE: drivers/filesystem/ntfs/dirctl.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
@ -670,8 +668,8 @@ NtfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsDirectoryControl(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
PIO_STACK_LOCATION Stack;
|
PIO_STACK_LOCATION Stack;
|
||||||
|
|
90
reactos/drivers/filesystems/ntfs/dispatch.c
Normal file
90
reactos/drivers/filesystems/ntfs/dispatch.c
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
/*
|
||||||
|
* ReactOS kernel
|
||||||
|
* Copyright (C) 2008 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
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS kernel
|
||||||
|
* FILE: drivers/filesystem/ntfs/dispatch.c
|
||||||
|
* PURPOSE: NTFS filesystem driver
|
||||||
|
* PROGRAMMER: Pierre Schweitzer
|
||||||
|
* UPDATE HISTORY:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
|
#include "ntfs.h"
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS *****************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FUNCTION: This function manages IRP for various major functions
|
||||||
|
* ARGUMENTS:
|
||||||
|
* DriverObject = object describing this driver
|
||||||
|
* Irp = IRP to be passed to internal functions
|
||||||
|
* RETURNS: Status of I/O Request
|
||||||
|
*/
|
||||||
|
NTSTATUS NTAPI
|
||||||
|
NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
||||||
|
PIRP Irp)
|
||||||
|
{
|
||||||
|
PNTFS_IRP_CONTEXT IrpContext = NULL;
|
||||||
|
NTSTATUS Status = STATUS_UNSUCCESSFUL;
|
||||||
|
|
||||||
|
TRACE_(NTFS, "NtfsFsdDispatch()\n");
|
||||||
|
|
||||||
|
FsRtlEnterFileSystem();
|
||||||
|
ASSERT(DeviceObject);
|
||||||
|
ASSERT(Irp);
|
||||||
|
|
||||||
|
NtfsIsIrpTopLevel(Irp);
|
||||||
|
|
||||||
|
IrpContext = NtfsAllocateIrpContext(DeviceObject, Irp);
|
||||||
|
if (IrpContext)
|
||||||
|
{
|
||||||
|
switch (IrpContext->MajorFunction)
|
||||||
|
{
|
||||||
|
case IRP_MJ_QUERY_VOLUME_INFORMATION:
|
||||||
|
{
|
||||||
|
Status = NtfsQueryVolumeInformation(IrpContext);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case IRP_MJ_SET_VOLUME_INFORMATION:
|
||||||
|
{
|
||||||
|
Status = NtfsSetVolumeInformation(IrpContext);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
Irp->IoStatus.Status = Status;
|
||||||
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
|
||||||
|
if (IrpContext)
|
||||||
|
ExFreePoolWithTag(IrpContext, TAG('N', 'I', 'R', 'P'));
|
||||||
|
|
||||||
|
IoSetTopLevelIrp(NULL);
|
||||||
|
FsRtlExitFileSystem();
|
||||||
|
return Status;
|
||||||
|
}
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/fcb.c
|
* FILE: drivers/filesystem/ntfs/fcb.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/dirctl.c
|
* FILE: drivers/filesystem/ntfs/dirctl.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
@ -180,8 +178,8 @@ NtfsGetInternalInformation(PFCB Fcb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsQueryInformation(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Retrieve the specified file information
|
* FUNCTION: Retrieve the specified file information
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -448,8 +446,8 @@ NtfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
PIO_STACK_LOCATION Stack;
|
PIO_STACK_LOCATION Stack;
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/mft.c
|
* FILE: drivers/filesystem/ntfs/mft.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
* Updated by Valentin Verkhovsky 2003/09/12
|
* Updated by Valentin Verkhovsky 2003/09/12
|
||||||
|
|
93
reactos/drivers/filesystems/ntfs/misc.c
Normal file
93
reactos/drivers/filesystems/ntfs/misc.c
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
/*
|
||||||
|
* ReactOS kernel
|
||||||
|
* Copyright (C) 2008 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
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS kernel
|
||||||
|
* FILE: drivers/filesystem/ntfs/misc.c
|
||||||
|
* PURPOSE: NTFS filesystem driver
|
||||||
|
* PROGRAMMER: Pierre Schweitzer
|
||||||
|
* UPDATE HISTORY:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
|
#include "ntfs.h"
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS *****************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FUNCTION: Used with IRP to set them to TopLevelIrp field
|
||||||
|
* ARGUMENTS:
|
||||||
|
* Irp = The IRP to set
|
||||||
|
* RETURNS: TRUE if top level was null, else FALSE
|
||||||
|
*/
|
||||||
|
BOOLEAN
|
||||||
|
NtfsIsIrpTopLevel(PIRP Irp)
|
||||||
|
{
|
||||||
|
BOOLEAN ReturnCode = FALSE;
|
||||||
|
|
||||||
|
TRACE_(NTFS, "NtfsIsIrpTopLevel()\n");
|
||||||
|
|
||||||
|
if (IoGetTopLevelIrp() == NULL)
|
||||||
|
{
|
||||||
|
IoSetTopLevelIrp(Irp);
|
||||||
|
ReturnCode = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ReturnCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FUNCTION: Allocate and fill an NTFS_IRP_CONTEXT struct in order to use it for IRP
|
||||||
|
* ARGUMENTS:
|
||||||
|
* DeviceObject = Used to fill in struct
|
||||||
|
* Irp = The IRP that need IRP_CONTEXT struct
|
||||||
|
* RETURNS: NULL or PNTFS_IRP_CONTEXT
|
||||||
|
*/
|
||||||
|
PNTFS_IRP_CONTEXT
|
||||||
|
NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
|
||||||
|
PIRP Irp)
|
||||||
|
{
|
||||||
|
PNTFS_IRP_CONTEXT IrpContext;
|
||||||
|
PIO_STACK_LOCATION IoStackLocation;
|
||||||
|
|
||||||
|
TRACE_(NTFS, "NtfsAllocateIrpContext()\n");
|
||||||
|
|
||||||
|
IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
|
IrpContext = (PNTFS_IRP_CONTEXT)ExAllocatePoolWithTag(NonPagedPool, sizeof(NTFS_IRP_CONTEXT), TAG('N', 'I', 'R', 'P'));
|
||||||
|
if (IrpContext == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
RtlZeroMemory(IrpContext, sizeof(NTFS_IRP_CONTEXT));
|
||||||
|
IrpContext->Identifier.Type = NTFS_TYPE_IRP_CONTEST;
|
||||||
|
IrpContext->Identifier.Size = sizeof(NTFS_IRP_CONTEXT);
|
||||||
|
IrpContext->Irp = Irp;
|
||||||
|
IrpContext->MajorFunction = IoStackLocation->MajorFunction;
|
||||||
|
IrpContext->MinorFunction = IoStackLocation->MinorFunction;
|
||||||
|
IrpContext->DeviceObject = DeviceObject;
|
||||||
|
IrpContext->IsTopLevel = (IoGetTopLevelIrp() == Irp);
|
||||||
|
|
||||||
|
return IrpContext;
|
||||||
|
}
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/ntfs.c
|
* FILE: drivers/filesystem/ntfs/ntfs.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
* Pierre Schweitzer
|
* Pierre Schweitzer
|
||||||
|
@ -120,15 +118,15 @@ NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
|
||||||
* RETURNS: Nothing
|
* RETURNS: Nothing
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = NtfsClose;
|
DriverObject->MajorFunction[IRP_MJ_CREATE] = NtfsFsdCreate;
|
||||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = NtfsCreate;
|
DriverObject->MajorFunction[IRP_MJ_CLOSE] = NtfsFsdClose;
|
||||||
DriverObject->MajorFunction[IRP_MJ_READ] = NtfsRead;
|
DriverObject->MajorFunction[IRP_MJ_READ] = NtfsFsdRead;
|
||||||
DriverObject->MajorFunction[IRP_MJ_WRITE] = NtfsWrite;
|
DriverObject->MajorFunction[IRP_MJ_WRITE] = NtfsFsdWrite;
|
||||||
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = NtfsFileSystemControl;
|
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NtfsFsdQueryInformation;
|
||||||
DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = NtfsDirectoryControl;
|
DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NtfsFsdDispatch;
|
||||||
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NtfsQueryInformation;
|
DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = NtfsFsdDispatch;
|
||||||
DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NtfsQueryVolumeInformation;
|
DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = NtfsFsdDirectoryControl;
|
||||||
DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = NtfsSetVolumeInformation;
|
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = NtfsFsdFileSystemControl;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,7 @@ typedef struct _CCB
|
||||||
|
|
||||||
#define TAG_CCB TAG('I', 'C', 'C', 'B')
|
#define TAG_CCB TAG('I', 'C', 'C', 'B')
|
||||||
|
|
||||||
|
#define NTFS_TYPE_IRP_CONTEST TAG('F','S',0,6)
|
||||||
#define NTFS_TYPE_GLOBAL_DATA TAG('F','S',0,7)
|
#define NTFS_TYPE_GLOBAL_DATA TAG('F','S',0,7)
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -317,6 +318,19 @@ typedef struct
|
||||||
ULONG Unknown2;
|
ULONG Unknown2;
|
||||||
} VOLINFO_ATTRIBUTE, *PVOLINFO_ATTRIBUTE;
|
} VOLINFO_ATTRIBUTE, *PVOLINFO_ATTRIBUTE;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
NTFSIDENTIFIER Identifier;
|
||||||
|
ULONG Flags;
|
||||||
|
UCHAR MajorFunction;
|
||||||
|
UCHAR MinorFunction;
|
||||||
|
WORK_QUEUE_ITEM WorkQueueItem;
|
||||||
|
PIRP Irp;
|
||||||
|
BOOLEAN IsTopLevel;
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
NTSTATUS SavedExceptionCode;
|
||||||
|
} NTFS_IRP_CONTEXT, *PNTFS_IRP_CONTEXT;
|
||||||
|
|
||||||
|
|
||||||
extern PNTFS_GLOBAL_DATA NtfsGlobalData;
|
extern PNTFS_GLOBAL_DATA NtfsGlobalData;
|
||||||
|
|
||||||
|
@ -363,24 +377,30 @@ NtfsDeviceIoControl(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
/* close.c */
|
/* close.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsClose;
|
DRIVER_DISPATCH NtfsFsdClose;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsClose(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdClose(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
/* create.c */
|
/* create.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsCreate;
|
DRIVER_DISPATCH NtfsFsdCreate;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsCreate(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
/* dirctl.c */
|
/* dirctl.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsDirectoryControl;
|
DRIVER_DISPATCH NtfsFsdDirectoryControl;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsDirectoryControl(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject,
|
||||||
|
PIRP Irp);
|
||||||
|
|
||||||
|
/* dispatch.c */
|
||||||
|
DRIVER_DISPATCH NtfsFsdDispatch;
|
||||||
|
NTSTATUS NTAPI
|
||||||
|
NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
/* fcb.c */
|
/* fcb.c */
|
||||||
|
@ -437,17 +457,17 @@ NtfsGetFCBForFile(PDEVICE_EXTENSION Vcb,
|
||||||
|
|
||||||
/* finfo.c */
|
/* finfo.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsQueryInformation;
|
DRIVER_DISPATCH NtfsFsdQueryInformation;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsQueryInformation(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
/* fsctl.c */
|
/* fsctl.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsFileSystemControl;
|
DRIVER_DISPATCH NtfsFsdFileSystemControl;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
|
@ -510,9 +530,15 @@ EnumerAttribute(PFILE_RECORD_HEADER file,
|
||||||
PDEVICE_EXTENSION Vcb,
|
PDEVICE_EXTENSION Vcb,
|
||||||
PDEVICE_OBJECT DeviceObject);
|
PDEVICE_OBJECT DeviceObject);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* misc.c */
|
/* misc.c */
|
||||||
|
BOOLEAN
|
||||||
|
NtfsIsIrpTopLevel(PIRP Irp);
|
||||||
|
|
||||||
|
PNTFS_IRP_CONTEXT
|
||||||
|
NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
|
||||||
|
PIRP Irp);
|
||||||
|
|
||||||
|
#if 0
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
wstrcmpjoki(PWSTR s1, PWSTR s2);
|
wstrcmpjoki(PWSTR s1, PWSTR s2);
|
||||||
|
|
||||||
|
@ -532,28 +558,24 @@ CdfsFileFlagsToAttributes(PFCB Fcb,
|
||||||
|
|
||||||
/* rw.c */
|
/* rw.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsRead;
|
DRIVER_DISPATCH NtfsFsdRead;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsRead(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsWrite;
|
DRIVER_DISPATCH NtfsFsdWrite;
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsWrite(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdWrite(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
/* volinfo.c */
|
/* volinfo.c */
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsQueryVolumeInformation;
|
NTSTATUS
|
||||||
NTSTATUS STDCALL
|
NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
|
||||||
NtfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
|
||||||
PIRP Irp);
|
|
||||||
|
|
||||||
DRIVER_DISPATCH NtfsSetVolumeInformation;
|
NTSTATUS
|
||||||
NTSTATUS STDCALL
|
NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
|
||||||
NtfsSetVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
|
||||||
PIRP Irp);
|
|
||||||
|
|
||||||
/* ntfs.c */
|
/* ntfs.c */
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,12 @@
|
||||||
<file>close.c</file>
|
<file>close.c</file>
|
||||||
<file>create.c</file>
|
<file>create.c</file>
|
||||||
<file>dirctl.c</file>
|
<file>dirctl.c</file>
|
||||||
|
<file>dispatch.c</file>
|
||||||
<file>fcb.c</file>
|
<file>fcb.c</file>
|
||||||
<file>finfo.c</file>
|
<file>finfo.c</file>
|
||||||
<file>fsctl.c</file>
|
<file>fsctl.c</file>
|
||||||
<file>mft.c</file>
|
<file>mft.c</file>
|
||||||
|
<file>misc.c</file>
|
||||||
<file>ntfs.c</file>
|
<file>ntfs.c</file>
|
||||||
<file>rw.c</file>
|
<file>rw.c</file>
|
||||||
<file>volinfo.c</file>
|
<file>volinfo.c</file>
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/cdfs/rw.c
|
* FILE: drivers/filesystem/ntfs/rw.c
|
||||||
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
* UPDATE HISTORY:
|
* UPDATE HISTORY:
|
||||||
|
@ -131,8 +129,8 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsRead(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
PDEVICE_EXTENSION DeviceExt;
|
PDEVICE_EXTENSION DeviceExt;
|
||||||
|
@ -183,8 +181,8 @@ NtfsRead(PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS NTAPI
|
||||||
NtfsWrite(PDEVICE_OBJECT DeviceObject,
|
NtfsFsdWrite(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
DPRINT("NtfwWrite(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
|
DPRINT("NtfwWrite(DeviceObject %x Irp %x)\n",DeviceObject,Irp);
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* 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$
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/ntfs/volume.c
|
* FILE: drivers/filesystem/ntfs/volume.c
|
||||||
* PURPOSE: NTFS filesystem driver
|
* PURPOSE: NTFS filesystem driver
|
||||||
* PROGRAMMER: Eric Kohl
|
* PROGRAMMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
@ -165,10 +163,11 @@ NtfsGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS
|
||||||
NtfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext)
|
||||||
PIRP Irp)
|
|
||||||
{
|
{
|
||||||
|
PIRP Irp;
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
FS_INFORMATION_CLASS FsInformationClass;
|
FS_INFORMATION_CLASS FsInformationClass;
|
||||||
PIO_STACK_LOCATION Stack;
|
PIO_STACK_LOCATION Stack;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
@ -177,6 +176,10 @@ NtfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
DPRINT("NtfsQueryVolumeInformation() called\n");
|
DPRINT("NtfsQueryVolumeInformation() called\n");
|
||||||
|
|
||||||
|
ASSERT(IrpContext);
|
||||||
|
|
||||||
|
Irp = IrpContext->Irp;
|
||||||
|
DeviceObject = IrpContext->DeviceObject;
|
||||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
FsInformationClass = Stack->Parameters.QueryVolume.FsInformationClass;
|
FsInformationClass = Stack->Parameters.QueryVolume.FsInformationClass;
|
||||||
BufferLength = Stack->Parameters.QueryVolume.Length;
|
BufferLength = Stack->Parameters.QueryVolume.Length;
|
||||||
|
@ -215,29 +218,30 @@ NtfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
Status = STATUS_NOT_SUPPORTED;
|
Status = STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Irp->IoStatus.Status = Status;
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
Irp->IoStatus.Information =
|
Irp->IoStatus.Information =
|
||||||
Stack->Parameters.QueryVolume.Length - BufferLength;
|
Stack->Parameters.QueryVolume.Length - BufferLength;
|
||||||
else
|
else
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
||||||
|
|
||||||
return(Status);
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS
|
||||||
NtfsSetVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext)
|
||||||
PIRP Irp)
|
|
||||||
{
|
{
|
||||||
|
PIRP Irp;
|
||||||
|
|
||||||
DPRINT("NtfsSetVolumeInformation() called\n");
|
DPRINT("NtfsSetVolumeInformation() called\n");
|
||||||
|
|
||||||
|
ASSERT(IrpContext);
|
||||||
|
|
||||||
|
Irp = IrpContext->Irp;
|
||||||
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
||||||
|
|
||||||
return(STATUS_NOT_SUPPORTED);
|
return STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue