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: cdfs.c,v 1.5 2002/05/15 18:01:30 ekohl Exp $
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: services/fs/cdfs/cdfs.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Art Yerkes
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
39 /* GLOBALS *****************************************************************/
41 PCDFS_GLOBAL_DATA CdfsGlobalData
;
44 /* FUNCTIONS ****************************************************************/
47 DriverEntry(PDRIVER_OBJECT DriverObject
,
48 PUNICODE_STRING RegistryPath
)
50 * FUNCTION: Called by the system to initalize the driver
52 * DriverObject = object describing this driver
53 * RegistryPath = path to our configuration entries
54 * RETURNS: Success or failure
57 PDEVICE_OBJECT DeviceObject
;
59 UNICODE_STRING DeviceName
;
61 DPRINT("CDFS 0.0.2\n");
63 RtlInitUnicodeString(&DeviceName
,
65 Status
= IoCreateDevice(DriverObject
,
66 sizeof(CDFS_GLOBAL_DATA
),
68 FILE_DEVICE_CD_ROM_FILE_SYSTEM
,
72 if (!NT_SUCCESS(Status
))
77 /* Initialize global data */
78 CdfsGlobalData
= DeviceObject
->DeviceExtension
;
79 RtlZeroMemory(CdfsGlobalData
,
80 sizeof(CDFS_GLOBAL_DATA
));
81 CdfsGlobalData
->DriverObject
= DriverObject
;
82 CdfsGlobalData
->DeviceObject
= DeviceObject
;
84 /* Initialize driver data */
85 DeviceObject
->Flags
= DO_DIRECT_IO
;
86 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = CdfsClose
;
87 DriverObject
->MajorFunction
[IRP_MJ_CREATE
] = CdfsCreate
;
88 DriverObject
->MajorFunction
[IRP_MJ_READ
] = CdfsRead
;
89 DriverObject
->MajorFunction
[IRP_MJ_WRITE
] = CdfsWrite
;
90 DriverObject
->MajorFunction
[IRP_MJ_FILE_SYSTEM_CONTROL
] =
91 CdfsFileSystemControl
;
92 DriverObject
->MajorFunction
[IRP_MJ_DIRECTORY_CONTROL
] =
94 DriverObject
->MajorFunction
[IRP_MJ_QUERY_INFORMATION
] =
96 DriverObject
->MajorFunction
[IRP_MJ_QUERY_VOLUME_INFORMATION
] =
97 CdfsQueryVolumeInformation
;
98 DriverObject
->MajorFunction
[IRP_MJ_SET_VOLUME_INFORMATION
] =
99 CdfsSetVolumeInformation
;
101 DriverObject
->DriverUnload
= NULL
;
103 IoRegisterFileSystem(DeviceObject
);
105 return(STATUS_SUCCESS
);