mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Implemented verify override for device access routines and started experimental media change support.
svn path=/trunk/; revision=6590
This commit is contained in:
parent
0327d87e6e
commit
2433129700
5 changed files with 192 additions and 189 deletions
|
@ -221,21 +221,17 @@ typedef struct
|
||||||
extern PCDFS_GLOBAL_DATA CdfsGlobalData;
|
extern PCDFS_GLOBAL_DATA CdfsGlobalData;
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN ULONG DiskSector,
|
|
||||||
IN ULONG SectorCount,
|
|
||||||
IN OUT PUCHAR Buffer);
|
|
||||||
|
|
||||||
int CdfsStrcmpi( wchar_t *str1, wchar_t *str2 );
|
int CdfsStrcmpi( wchar_t *str1, wchar_t *str2 );
|
||||||
void CdfsWstrcpy( wchar_t *str1, wchar_t *str2, int max );
|
void CdfsWstrcpy( wchar_t *str1, wchar_t *str2, int max );
|
||||||
|
|
||||||
|
|
||||||
/* cleanup.c */
|
/* cleanup.c */
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CdfsCleanup(PDEVICE_OBJECT DeviceObject,
|
CdfsCleanup(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
/* close.c */
|
/* close.c */
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
|
@ -246,19 +242,15 @@ NTSTATUS
|
||||||
CdfsCloseFile(PDEVICE_EXTENSION DeviceExt,
|
CdfsCloseFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
PFILE_OBJECT FileObject);
|
PFILE_OBJECT FileObject);
|
||||||
|
|
||||||
|
|
||||||
/* common.c */
|
/* common.c */
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN ULONG DiskSector,
|
IN ULONG DiskSector,
|
||||||
IN ULONG SectorCount,
|
IN ULONG SectorCount,
|
||||||
IN OUT PUCHAR Buffer);
|
IN OUT PUCHAR Buffer,
|
||||||
|
IN BOOLEAN Override);
|
||||||
NTSTATUS
|
|
||||||
CdfsReadRawSectors(IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN ULONG DiskSector,
|
|
||||||
IN ULONG SectorCount,
|
|
||||||
IN OUT PUCHAR Buffer);
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
@ -266,7 +258,9 @@ CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PVOID InputBuffer,
|
IN PVOID InputBuffer,
|
||||||
IN ULONG InputBufferSize,
|
IN ULONG InputBufferSize,
|
||||||
IN OUT PVOID OutputBuffer,
|
IN OUT PVOID OutputBuffer,
|
||||||
IN OUT PULONG pOutputBufferSize);
|
IN OUT PULONG pOutputBufferSize,
|
||||||
|
IN BOOLEAN Override);
|
||||||
|
|
||||||
|
|
||||||
/* create.c */
|
/* create.c */
|
||||||
|
|
||||||
|
@ -349,12 +343,18 @@ NTSTATUS STDCALL
|
||||||
CdfsSetInformation(PDEVICE_OBJECT DeviceObject,
|
CdfsSetInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
/* fsctl.c */
|
/* fsctl.c */
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
|
PCDINFO CdInfo);
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CdfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
CdfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp);
|
PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
/* misc.c */
|
/* misc.c */
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
@ -373,6 +373,7 @@ VOID
|
||||||
CdfsFileFlagsToAttributes(PFCB Fcb,
|
CdfsFileFlagsToAttributes(PFCB Fcb,
|
||||||
PULONG FileAttributes);
|
PULONG FileAttributes);
|
||||||
|
|
||||||
|
|
||||||
/* rw.c */
|
/* rw.c */
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* ReactOS kernel
|
||||||
* Copyright (C) 2002 ReactOS Team
|
* Copyright (C) 2002, 2003 ReactOS Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,13 +16,14 @@
|
||||||
* 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: common.c,v 1.5 2002/09/15 22:25:05 hbirr Exp $
|
/* $Id: common.c,v 1.6 2003/11/09 11:20:28 ekohl Exp $
|
||||||
*
|
*
|
||||||
* 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/vfat/volume.c
|
* FILE: drivers/fs/cdfs/common.c
|
||||||
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
|
* Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -41,8 +42,10 @@ NTSTATUS
|
||||||
CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN ULONG DiskSector,
|
IN ULONG DiskSector,
|
||||||
IN ULONG SectorCount,
|
IN ULONG SectorCount,
|
||||||
IN OUT PUCHAR Buffer)
|
IN OUT PUCHAR Buffer,
|
||||||
|
IN BOOLEAN Override)
|
||||||
{
|
{
|
||||||
|
PIO_STACK_LOCATION Stack;
|
||||||
IO_STATUS_BLOCK IoStatus;
|
IO_STATUS_BLOCK IoStatus;
|
||||||
LARGE_INTEGER Offset;
|
LARGE_INTEGER Offset;
|
||||||
ULONG BlockSize;
|
ULONG BlockSize;
|
||||||
|
@ -79,6 +82,12 @@ CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
return(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Override)
|
||||||
|
{
|
||||||
|
Stack = IoGetNextIrpStackLocation(Irp);
|
||||||
|
Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME;
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -119,90 +128,20 @@ CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
CdfsReadRawSectors(IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN ULONG DiskSector,
|
|
||||||
IN ULONG SectorCount,
|
|
||||||
IN OUT PUCHAR Buffer)
|
|
||||||
{
|
|
||||||
PIO_STACK_LOCATION Stack;
|
|
||||||
IO_STATUS_BLOCK IoStatus;
|
|
||||||
LARGE_INTEGER Offset;
|
|
||||||
ULONG BlockSize;
|
|
||||||
KEVENT Event;
|
|
||||||
PIRP Irp;
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
KeInitializeEvent(&Event,
|
|
||||||
NotificationEvent,
|
|
||||||
FALSE);
|
|
||||||
|
|
||||||
Offset.u.LowPart = DiskSector << 11;
|
|
||||||
Offset.u.HighPart = DiskSector >> 21;
|
|
||||||
|
|
||||||
BlockSize = BLOCKSIZE * SectorCount;
|
|
||||||
|
|
||||||
DPRINT("CdfsReadSectors(DeviceObject %x, DiskSector %d, Buffer %x)\n",
|
|
||||||
DeviceObject, DiskSector, Buffer);
|
|
||||||
DPRINT("Offset %I64x BlockSize %ld\n",
|
|
||||||
Offset.QuadPart,
|
|
||||||
BlockSize);
|
|
||||||
|
|
||||||
DPRINT("Building synchronous FSD Request...\n");
|
|
||||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
|
|
||||||
DeviceObject,
|
|
||||||
Buffer,
|
|
||||||
BlockSize,
|
|
||||||
&Offset,
|
|
||||||
&Event,
|
|
||||||
&IoStatus);
|
|
||||||
if (Irp == NULL)
|
|
||||||
{
|
|
||||||
DPRINT("IoBuildSynchronousFsdRequest failed\n");
|
|
||||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stack = IoGetCurrentIrpStackLocation(Irp);
|
|
||||||
// Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME;
|
|
||||||
|
|
||||||
DPRINT("Calling IO Driver... with irp %x\n", Irp);
|
|
||||||
Status = IoCallDriver(DeviceObject, Irp);
|
|
||||||
|
|
||||||
DPRINT("Waiting for IO Operation for %x\n", Irp);
|
|
||||||
if (Status == STATUS_PENDING)
|
|
||||||
{
|
|
||||||
DPRINT("Operation pending\n");
|
|
||||||
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
|
|
||||||
DPRINT("Getting IO Status... for %x\n", Irp);
|
|
||||||
Status = IoStatus.Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT("CdfsReadSectors() 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN ULONG CtlCode,
|
IN ULONG CtlCode,
|
||||||
IN PVOID InputBuffer,
|
IN PVOID InputBuffer,
|
||||||
IN ULONG InputBufferSize,
|
IN ULONG InputBufferSize,
|
||||||
IN OUT PVOID OutputBuffer,
|
IN OUT PVOID OutputBuffer,
|
||||||
IN OUT PULONG pOutputBufferSize)
|
IN OUT PULONG pOutputBufferSize,
|
||||||
|
IN BOOLEAN Override)
|
||||||
{
|
{
|
||||||
|
PIO_STACK_LOCATION Stack;
|
||||||
|
IO_STATUS_BLOCK IoStatus;
|
||||||
ULONG OutputBufferSize = 0;
|
ULONG OutputBufferSize = 0;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
IO_STATUS_BLOCK IoStatus;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, "
|
DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, "
|
||||||
|
@ -234,6 +173,12 @@ CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Override)
|
||||||
|
{
|
||||||
|
Stack = IoGetNextIrpStackLocation(Irp);
|
||||||
|
Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME;
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -246,11 +191,14 @@ CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
Status = IoStatus.Status;
|
Status = IoStatus.Status;
|
||||||
}
|
}
|
||||||
if (OutputBufferSize)
|
|
||||||
|
if (pOutputBufferSize)
|
||||||
{
|
{
|
||||||
*pOutputBufferSize = OutputBufferSize;
|
*pOutputBufferSize = OutputBufferSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Returning Status %x\n", Status);
|
DPRINT("Returning Status %x\n", Status);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* ReactOS kernel
|
||||||
* Copyright (C) 2002 ReactOS Team
|
* Copyright (C) 2002, 2003 ReactOS Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,14 +16,14 @@
|
||||||
* 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: create.c,v 1.8 2003/02/13 22:24:15 hbirr Exp $
|
/* $Id: create.c,v 1.9 2003/11/09 11:20:28 ekohl Exp $
|
||||||
*
|
*
|
||||||
* 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/cdfs.c
|
* FILE: services/fs/cdfs/cdfs.c
|
||||||
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
* UPDATE HISTORY:
|
* Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
#include "cdfs.h"
|
#include "cdfs.h"
|
||||||
|
|
||||||
|
//#define MEDIA_CHANGE_SUPPORT
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
@ -89,6 +91,10 @@ CdfsOpenFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
PFCB Fcb;
|
PFCB Fcb;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PWSTR AbsFileName = NULL;
|
PWSTR AbsFileName = NULL;
|
||||||
|
#ifdef MEDIA_CHANGE_SUPPORT
|
||||||
|
ULONG MediaChangeCount = 0;
|
||||||
|
ULONG BufferSize;
|
||||||
|
#endif
|
||||||
|
|
||||||
DPRINT("CdfsOpenFile(%08lx, %08lx, %S)\n", DeviceExt, FileObject, FileName);
|
DPRINT("CdfsOpenFile(%08lx, %08lx, %S)\n", DeviceExt, FileObject, FileName);
|
||||||
|
|
||||||
|
@ -107,6 +113,50 @@ CdfsOpenFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
return(STATUS_UNSUCCESSFUL);
|
return(STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MEDIA_CHANGE_SUPPORT
|
||||||
|
BufferSize = sizeof(ULONG);
|
||||||
|
Status = CdfsDeviceIoControl (DeviceExt->StorageDevice,
|
||||||
|
IOCTL_CDROM_CHECK_VERIFY,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
(PVOID)&MediaChangeCount,
|
||||||
|
&BufferSize,
|
||||||
|
TRUE);
|
||||||
|
DPRINT ("Status %lx\n", Status);
|
||||||
|
if (Status == STATUS_VERIFY_REQUIRED)
|
||||||
|
{
|
||||||
|
CDINFO CdInfo;
|
||||||
|
DPRINT1 ("Media change detected!\n");
|
||||||
|
|
||||||
|
Status = CdfsGetVolumeData (DeviceExt->StorageDevice,
|
||||||
|
&CdInfo);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1 ("CdfsGetVolumeData() failed (Status %lx)\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: Comparing the serial numbers is not enough */
|
||||||
|
if (DeviceExt->CdInfo.SerialNumber == CdInfo.SerialNumber)
|
||||||
|
{
|
||||||
|
DPRINT1 ("Same CD\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT1 ("Different CD\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1 ("Status %lx\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT ("MediaChangeCount %lu\n", MediaChangeCount);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//FIXME: Get cannonical path name (remove .'s, ..'s and extra separators)
|
//FIXME: Get cannonical path name (remove .'s, ..'s and extra separators)
|
||||||
|
|
||||||
DPRINT("PathName to open: %S\n", FileName);
|
DPRINT("PathName to open: %S\n", FileName);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* ReactOS kernel
|
||||||
* Copyright (C) 2002 ReactOS Team
|
* Copyright (C) 2002, 2003 ReactOS Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,14 +16,14 @@
|
||||||
* 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.14 2003/06/07 11:34:35 chorns Exp $
|
/* $Id: fsctl.c,v 1.15 2003/11/09 11:20:28 ekohl Exp $
|
||||||
*
|
*
|
||||||
* 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/fsctl.c
|
* FILE: drivers/fs/cdfs/fsctl.c
|
||||||
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
* UPDATE HISTORY:
|
* Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#include "cdfs.h"
|
#include "cdfs.h"
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
|
@ -44,6 +45,7 @@ int msf_to_lba (BYTE m, BYTE s, BYTE f)
|
||||||
return (((m * 60) + s) * 75 + f) - 150;
|
return (((m * 60) + s) * 75 + f) - 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
CdfsGetPVDData(PUCHAR Buffer,
|
CdfsGetPVDData(PUCHAR Buffer,
|
||||||
PCDINFO CdInfo)
|
PCDINFO CdInfo)
|
||||||
|
@ -177,7 +179,7 @@ CdfsGetSVDData(PUCHAR Buffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static NTSTATUS
|
NTSTATUS
|
||||||
CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
PCDINFO CdInfo)
|
PCDINFO CdInfo)
|
||||||
{
|
{
|
||||||
|
@ -201,9 +203,8 @@ CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
Buffer = ExAllocatePool(NonPagedPool,
|
Buffer = ExAllocatePool(NonPagedPool,
|
||||||
CDFS_BASIC_SECTOR);
|
CDFS_BASIC_SECTOR);
|
||||||
|
|
||||||
if (Buffer == NULL)
|
if (Buffer == NULL)
|
||||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
Size = sizeof(Toc);
|
Size = sizeof(Toc);
|
||||||
Status = CdfsDeviceIoControl(DeviceObject,
|
Status = CdfsDeviceIoControl(DeviceObject,
|
||||||
|
@ -211,7 +212,8 @@ CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
&Toc,
|
&Toc,
|
||||||
&Size);
|
&Size,
|
||||||
|
TRUE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePool(Buffer);
|
ExFreePool(Buffer);
|
||||||
|
@ -237,14 +239,15 @@ CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
for (Sector = CDFS_PRIMARY_DESCRIPTOR_LOCATION; Sector < 100 && Buffer[0] != 255; Sector++)
|
for (Sector = CDFS_PRIMARY_DESCRIPTOR_LOCATION; Sector < 100 && Buffer[0] != 255; Sector++)
|
||||||
{
|
{
|
||||||
/* Read the Primary Volume Descriptor (PVD) */
|
/* Read the Primary Volume Descriptor (PVD) */
|
||||||
Status = CdfsReadRawSectors(DeviceObject,
|
Status = CdfsReadSectors (DeviceObject,
|
||||||
Sector + Offset,
|
Sector + Offset,
|
||||||
1,
|
1,
|
||||||
Buffer);
|
Buffer,
|
||||||
|
TRUE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePool(Buffer);
|
ExFreePool(Buffer);
|
||||||
return(Status);
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Sector == CDFS_PRIMARY_DESCRIPTOR_LOCATION)
|
if (Sector == CDFS_PRIMARY_DESCRIPTOR_LOCATION)
|
||||||
|
@ -287,7 +290,6 @@ CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
DPRINT1("Unknown volume descriptor type %u found!\n", VdHeader->VdType);
|
DPRINT1("Unknown volume descriptor type %u found!\n", VdHeader->VdType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExFreePool(Buffer);
|
ExFreePool(Buffer);
|
||||||
|
@ -295,6 +297,7 @@ CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
|
CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* ReactOS kernel
|
||||||
* Copyright (C) 2002 ReactOS Team
|
* Copyright (C) 2002, 2003 ReactOS Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,14 +16,14 @@
|
||||||
* 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: rw.c,v 1.10 2003/02/13 22:24:15 hbirr Exp $
|
/* $Id: rw.c,v 1.11 2003/11/09 11:20:28 ekohl Exp $
|
||||||
*
|
*
|
||||||
* 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/fs/cdfs/rw.c
|
||||||
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
* UPDATE HISTORY:
|
* Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -112,7 +112,8 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
Status = CdfsReadSectors(DeviceExt->StorageDevice,
|
Status = CdfsReadSectors(DeviceExt->StorageDevice,
|
||||||
Fcb->Entry.ExtentLocationL + (ReadOffset / BLOCKSIZE),
|
Fcb->Entry.ExtentLocationL + (ReadOffset / BLOCKSIZE),
|
||||||
Length / BLOCKSIZE,
|
Length / BLOCKSIZE,
|
||||||
Buffer);
|
Buffer,
|
||||||
|
FALSE);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
*LengthRead = Length;
|
*LengthRead = Length;
|
||||||
|
|
Loading…
Reference in a new issue