3 * Copyright (C) 1998, 1999, 2000, 2001 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 * PROJECT: ReactOS kernel
22 * FILE: drivers/fs/vfat/iface.c
23 * PURPOSE: VFAT Filesystem
24 * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
28 /* INCLUDES *****************************************************************/
30 #include <ddk/ntddk.h>
31 #include <rosrtl/string.h>
38 /* GLOBALS *****************************************************************/
40 PVFAT_GLOBAL_DATA VfatGlobalData
;
42 /* FUNCTIONS ****************************************************************/
45 DriverEntry(PDRIVER_OBJECT DriverObject
,
46 PUNICODE_STRING RegistryPath
)
48 * FUNCTION: Called by the system to initalize the driver
50 * DriverObject = object describing this driver
51 * RegistryPath = path to our configuration entries
52 * RETURNS: Success or failure
55 PDEVICE_OBJECT DeviceObject
;
56 UNICODE_STRING DeviceName
= ROS_STRING_INITIALIZER(L
"\\Fat");
59 Status
= IoCreateDevice(DriverObject
,
60 sizeof(VFAT_GLOBAL_DATA
),
62 FILE_DEVICE_DISK_FILE_SYSTEM
,
66 if (!NT_SUCCESS(Status
))
70 VfatGlobalData
= DeviceObject
->DeviceExtension
;
71 RtlZeroMemory (VfatGlobalData
, sizeof(VFAT_GLOBAL_DATA
));
72 VfatGlobalData
->DriverObject
= DriverObject
;
73 VfatGlobalData
->DeviceObject
= DeviceObject
;
75 DeviceObject
->Flags
= DO_DIRECT_IO
;
76 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = VfatBuildRequest
;
77 DriverObject
->MajorFunction
[IRP_MJ_CREATE
] = VfatBuildRequest
;
78 DriverObject
->MajorFunction
[IRP_MJ_READ
] = VfatBuildRequest
;
79 DriverObject
->MajorFunction
[IRP_MJ_WRITE
] = VfatBuildRequest
;
80 DriverObject
->MajorFunction
[IRP_MJ_FILE_SYSTEM_CONTROL
] = VfatBuildRequest
;
81 DriverObject
->MajorFunction
[IRP_MJ_QUERY_INFORMATION
] = VfatBuildRequest
;
82 DriverObject
->MajorFunction
[IRP_MJ_SET_INFORMATION
] = VfatBuildRequest
;
83 DriverObject
->MajorFunction
[IRP_MJ_DIRECTORY_CONTROL
] = VfatBuildRequest
;
84 DriverObject
->MajorFunction
[IRP_MJ_QUERY_VOLUME_INFORMATION
] =
86 DriverObject
->MajorFunction
[IRP_MJ_SET_VOLUME_INFORMATION
] =
88 DriverObject
->MajorFunction
[IRP_MJ_SHUTDOWN
] = VfatShutdown
;
89 DriverObject
->MajorFunction
[IRP_MJ_LOCK_CONTROL
] = VfatBuildRequest
;
90 DriverObject
->MajorFunction
[IRP_MJ_CLEANUP
] = VfatBuildRequest
;
91 DriverObject
->MajorFunction
[IRP_MJ_FLUSH_BUFFERS
] = VfatBuildRequest
;
93 DriverObject
->DriverUnload
= NULL
;
95 ExInitializeNPagedLookasideList(&VfatGlobalData
->FcbLookasideList
,
96 NULL
, NULL
, 0, sizeof(VFATFCB
), TAG_FCB
, 0);
97 ExInitializeNPagedLookasideList(&VfatGlobalData
->CcbLookasideList
,
98 NULL
, NULL
, 0, sizeof(VFATCCB
), TAG_CCB
, 0);
99 ExInitializeNPagedLookasideList(&VfatGlobalData
->IrpContextLookasideList
,
100 NULL
, NULL
, 0, sizeof(VFAT_IRP_CONTEXT
), TAG_IRP
, 0);
102 ExInitializeResourceLite(&VfatGlobalData
->VolumeListLock
);
103 InitializeListHead(&VfatGlobalData
->VolumeListHead
);
104 IoRegisterFileSystem(DeviceObject
);
105 return(STATUS_SUCCESS
);