3 * Copyright (C) 2002 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: rw.c,v 1.1 2002/04/15 20:39:49 ekohl Exp $
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: services/fs/cdfs/rw.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Art Yerkes
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
39 /* FUNCTIONS ****************************************************************/
42 CdfsReadFile(PDEVICE_EXTENSION DeviceExt
,
43 PFILE_OBJECT FileObject
,
48 * FUNCTION: Reads data from a file
55 DPRINT("CdfsReadFile(Offset %lu Length %lu)\n", Offset
, Length
);
58 return STATUS_SUCCESS
;
60 Ccb
= (PCCB
)FileObject
->FsContext2
;
63 if (Offset
+ Length
> Fcb
->Entry
.DataLengthL
)
64 Length
= Fcb
->Entry
.DataLengthL
- Offset
;
66 DPRINT( "Reading %d bytes at %d\n", Offset
, Length
);
69 return(STATUS_UNSUCCESSFUL
);
71 Status
= CdfsReadSectors(DeviceExt
->StorageDevice
,
72 Fcb
->Entry
.ExtentLocationL
+ Offset
/ BLOCKSIZE
,
81 CdfsRead(PDEVICE_OBJECT DeviceObject
,
87 PIO_STACK_LOCATION Stack
= IoGetCurrentIrpStackLocation(Irp
);
88 PFILE_OBJECT FileObject
= Stack
->FileObject
;
89 PDEVICE_EXTENSION DeviceExt
= DeviceObject
->DeviceExtension
;
92 DPRINT("CdfsRead(DeviceObject %x, Irp %x)\n",DeviceObject
,Irp
);
94 Buffer
= MmGetSystemAddressForMdl(Irp
->MdlAddress
);
95 Length
= Stack
->Parameters
.Read
.Length
;
96 Offset
= Stack
->Parameters
.Read
.ByteOffset
.u
.LowPart
;
98 Status
= CdfsReadFile(DeviceExt
,FileObject
,Buffer
,Length
,Offset
);
100 Irp
->IoStatus
.Status
= Status
;
101 Irp
->IoStatus
.Information
= Length
;
102 IoCompleteRequest(Irp
,IO_NO_INCREMENT
);
108 CdfsWrite(PDEVICE_OBJECT DeviceObject
,
111 DPRINT("CdfsWrite(DeviceObject %x Irp %x)\n",DeviceObject
,Irp
);
113 Irp
->IoStatus
.Status
= STATUS_UNSUCCESSFUL
;
114 Irp
->IoStatus
.Information
= 0;
115 return(STATUS_UNSUCCESSFUL
);