3 * Copyright (C) 2002, 2003 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.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: drivers/fs/cdfs/cdfs.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Art Yerkes
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
32 #include <rosrtl/string.h>
40 /* GLOBALS *****************************************************************/
42 PCDFS_GLOBAL_DATA CdfsGlobalData
;
45 /* FUNCTIONS ****************************************************************/
48 DriverEntry(PDRIVER_OBJECT DriverObject
,
49 PUNICODE_STRING RegistryPath
)
51 * FUNCTION: Called by the system to initalize the driver
53 * DriverObject = object describing this driver
54 * RegistryPath = path to our configuration entries
55 * RETURNS: Success or failure
58 PDEVICE_OBJECT DeviceObject
;
60 UNICODE_STRING DeviceName
= ROS_STRING_INITIALIZER(L
"\\Cdfs");
62 DPRINT("CDFS 0.0.3\n");
64 Status
= IoCreateDevice(DriverObject
,
65 sizeof(CDFS_GLOBAL_DATA
),
67 FILE_DEVICE_CD_ROM_FILE_SYSTEM
,
71 if (!NT_SUCCESS(Status
))
76 /* Initialize global data */
77 CdfsGlobalData
= DeviceObject
->DeviceExtension
;
78 RtlZeroMemory(CdfsGlobalData
,
79 sizeof(CDFS_GLOBAL_DATA
));
80 CdfsGlobalData
->DriverObject
= DriverObject
;
81 CdfsGlobalData
->DeviceObject
= DeviceObject
;
83 /* Initialize driver data */
84 DeviceObject
->Flags
= DO_DIRECT_IO
;
85 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = CdfsClose
;
86 DriverObject
->MajorFunction
[IRP_MJ_CLEANUP
] = CdfsCleanup
;
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_SET_INFORMATION
] =
98 DriverObject
->MajorFunction
[IRP_MJ_QUERY_VOLUME_INFORMATION
] =
99 CdfsQueryVolumeInformation
;
100 DriverObject
->MajorFunction
[IRP_MJ_SET_VOLUME_INFORMATION
] =
101 CdfsSetVolumeInformation
;
103 DriverObject
->DriverUnload
= NULL
;
105 IoRegisterFileSystem(DeviceObject
);
107 return(STATUS_SUCCESS
);