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.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: services/fs/ntfs/ntfs.c
24 * PURPOSE: NTFS filesystem driver
25 * PROGRAMMER: Eric Kohl
28 /* INCLUDES *****************************************************************/
30 #include <ddk/ntddk.h>
31 #include <rosrtl/string.h>
39 /* GLOBALS *****************************************************************/
41 PNTFS_GLOBAL_DATA NtfsGlobalData
;
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
= ROS_STRING_INITIALIZER(L
"\\Ntfs");
61 DPRINT("NTFS 0.0.1\n");
63 Status
= IoCreateDevice(DriverObject
,
64 sizeof(NTFS_GLOBAL_DATA
),
66 FILE_DEVICE_DISK_FILE_SYSTEM
,
70 if (!NT_SUCCESS(Status
))
75 /* Initialize global data */
76 NtfsGlobalData
= DeviceObject
->DeviceExtension
;
77 RtlZeroMemory(NtfsGlobalData
,
78 sizeof(NTFS_GLOBAL_DATA
));
79 NtfsGlobalData
->DriverObject
= DriverObject
;
80 NtfsGlobalData
->DeviceObject
= DeviceObject
;
82 /* Initialize driver data */
83 DeviceObject
->Flags
= DO_DIRECT_IO
;
84 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = NtfsClose
;
85 DriverObject
->MajorFunction
[IRP_MJ_CREATE
] = NtfsCreate
;
86 DriverObject
->MajorFunction
[IRP_MJ_READ
] = NtfsRead
;
87 DriverObject
->MajorFunction
[IRP_MJ_WRITE
] = NtfsWrite
;
88 DriverObject
->MajorFunction
[IRP_MJ_FILE_SYSTEM_CONTROL
] =
89 NtfsFileSystemControl
;
90 DriverObject
->MajorFunction
[IRP_MJ_DIRECTORY_CONTROL
] =
92 DriverObject
->MajorFunction
[IRP_MJ_QUERY_INFORMATION
] =
94 DriverObject
->MajorFunction
[IRP_MJ_QUERY_VOLUME_INFORMATION
] =
95 NtfsQueryVolumeInformation
;
96 DriverObject
->MajorFunction
[IRP_MJ_SET_VOLUME_INFORMATION
] =
97 NtfsSetVolumeInformation
;
99 DriverObject
->DriverUnload
= NULL
;
101 IoRegisterFileSystem(DeviceObject
);
103 return(STATUS_SUCCESS
);