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: services/fs/vfat/iface.c
23 * PURPOSE: VFAT Filesystem
24 * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
27 /* INCLUDES *****************************************************************/
29 #include <ddk/ntddk.h>
36 /* GLOBALS *****************************************************************/
38 PVFAT_GLOBAL_DATA VfatGlobalData;
40 /* FUNCTIONS ****************************************************************/
43 DriverEntry(PDRIVER_OBJECT DriverObject,
44 PUNICODE_STRING RegistryPath)
46 * FUNCTION: Called by the system to initalize the driver
48 * DriverObject = object describing this driver
49 * RegistryPath = path to our configuration entries
50 * RETURNS: Success or failure
53 PDEVICE_OBJECT DeviceObject;
54 UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Fat");
57 Status = IoCreateDevice(DriverObject,
58 sizeof(VFAT_GLOBAL_DATA),
60 FILE_DEVICE_DISK_FILE_SYSTEM,
64 if (!NT_SUCCESS(Status))
68 VfatGlobalData = DeviceObject->DeviceExtension;
69 RtlZeroMemory (VfatGlobalData, sizeof(VFAT_GLOBAL_DATA));
70 VfatGlobalData->DriverObject = DriverObject;
71 VfatGlobalData->DeviceObject = DeviceObject;
73 DeviceObject->Flags = DO_DIRECT_IO;
74 DriverObject->MajorFunction[IRP_MJ_CLOSE] = VfatBuildRequest;
75 DriverObject->MajorFunction[IRP_MJ_CREATE] = VfatBuildRequest;
76 DriverObject->MajorFunction[IRP_MJ_READ] = VfatBuildRequest;
77 DriverObject->MajorFunction[IRP_MJ_WRITE] = VfatBuildRequest;
78 DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = VfatBuildRequest;
79 DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = VfatBuildRequest;
80 DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = VfatBuildRequest;
81 DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = VfatBuildRequest;
82 DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] =
84 DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] =
86 DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = VfatShutdown;
87 DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL] = VfatBuildRequest;
88 DriverObject->MajorFunction[IRP_MJ_CLEANUP] = VfatBuildRequest;
89 DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = VfatBuildRequest;
91 DriverObject->DriverUnload = NULL;
93 ExInitializeNPagedLookasideList(&VfatGlobalData->FcbLookasideList,
94 NULL, NULL, 0, sizeof(VFATFCB), TAG_FCB, 0);
95 ExInitializeNPagedLookasideList(&VfatGlobalData->CcbLookasideList,
96 NULL, NULL, 0, sizeof(VFATCCB), TAG_CCB, 0);
97 ExInitializeNPagedLookasideList(&VfatGlobalData->IrpContextLookasideList,
98 NULL, NULL, 0, sizeof(VFAT_IRP_CONTEXT), TAG_IRP, 0);
100 ExInitializeResourceLite(&VfatGlobalData->VolumeListLock);
101 InitializeListHead(&VfatGlobalData->VolumeListHead);
102 IoRegisterFileSystem(DeviceObject);
103 return(STATUS_SUCCESS);