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>
38 /* GLOBALS *****************************************************************/
40 PNTFS_GLOBAL_DATA NtfsGlobalData;
43 /* FUNCTIONS ****************************************************************/
46 DriverEntry(PDRIVER_OBJECT DriverObject,
47 PUNICODE_STRING RegistryPath)
49 * FUNCTION: Called by the system to initalize the driver
51 * DriverObject = object describing this driver
52 * RegistryPath = path to our configuration entries
53 * RETURNS: Success or failure
56 PDEVICE_OBJECT DeviceObject;
58 UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Ntfs");
60 DPRINT("NTFS 0.0.1\n");
62 Status = IoCreateDevice(DriverObject,
63 sizeof(NTFS_GLOBAL_DATA),
65 FILE_DEVICE_DISK_FILE_SYSTEM,
69 if (!NT_SUCCESS(Status))
74 /* Initialize global data */
75 NtfsGlobalData = DeviceObject->DeviceExtension;
76 RtlZeroMemory(NtfsGlobalData,
77 sizeof(NTFS_GLOBAL_DATA));
78 NtfsGlobalData->DriverObject = DriverObject;
79 NtfsGlobalData->DeviceObject = DeviceObject;
81 /* Initialize driver data */
82 DeviceObject->Flags = DO_DIRECT_IO;
83 DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH) NtfsClose;
84 DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH) NtfsCreate;
85 DriverObject->MajorFunction[IRP_MJ_READ] = (PDRIVER_DISPATCH) NtfsRead;
86 DriverObject->MajorFunction[IRP_MJ_WRITE] = (PDRIVER_DISPATCH) NtfsWrite;
87 DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] =
88 (PDRIVER_DISPATCH) NtfsFileSystemControl;
89 DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] =
90 (PDRIVER_DISPATCH) NtfsDirectoryControl;
91 DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
92 (PDRIVER_DISPATCH) NtfsQueryInformation;
93 DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] =
94 (PDRIVER_DISPATCH) NtfsQueryVolumeInformation;
95 DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] =
96 (PDRIVER_DISPATCH) NtfsSetVolumeInformation;
98 DriverObject->DriverUnload = NULL;
100 IoRegisterFileSystem(DeviceObject);
102 return(STATUS_SUCCESS);