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: common.c,v 1.2 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/vfat/volume.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Art Yerkes
28 /* INCLUDES *****************************************************************/
30 #include <ddk/ntddk.h>
38 /* FUNCTIONS ****************************************************************/
41 CdfsReadSectors(IN PDEVICE_OBJECT DeviceObject
,
46 IO_STATUS_BLOCK IoStatus
;
53 KeInitializeEvent(&Event
,
57 Offset
.u
.LowPart
= DiskSector
<< 11;
58 Offset
.u
.HighPart
= DiskSector
>> 21;
60 BlockSize
= BLOCKSIZE
* SectorCount
;
62 DPRINT("CdfsReadSectors(DeviceObject %x, DiskSector %d, Buffer %x)\n",
63 DeviceObject
, DiskSector
, Buffer
);
64 DPRINT("Offset %I64x BlockSize %ld\n",
68 DPRINT("Building synchronous FSD Request...\n");
69 Irp
= IoBuildSynchronousFsdRequest(IRP_MJ_READ
,
78 DPRINT("IoBuildSynchronousFsdRequest failed\n");
79 return(STATUS_INSUFFICIENT_RESOURCES
);
82 DPRINT("Calling IO Driver... with irp %x\n", Irp
);
83 Status
= IoCallDriver(DeviceObject
, Irp
);
85 DPRINT("Waiting for IO Operation for %x\n", Irp
);
86 if (Status
== STATUS_PENDING
)
88 DPRINT("Operation pending\n");
89 KeWaitForSingleObject(&Event
, Suspended
, KernelMode
, FALSE
, NULL
);
90 DPRINT("Getting IO Status... for %x\n", Irp
);
91 Status
= IoStatus
.Status
;
94 if (!NT_SUCCESS(Status
))
96 DPRINT("CdfsReadSectors() failed (Status %x)\n", Status
);
97 DPRINT("(DeviceObject %x, DiskSector %x, Buffer %x, Offset 0x%I64x)\n",
98 DeviceObject
, DiskSector
, Buffer
,
103 DPRINT("Block request succeeded for %x\n", Irp
);
105 return(STATUS_SUCCESS
);