1 /* $Id: iface.c,v 1.62 2002/03/18 22:37:12 hbirr Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: services/fs/vfat/iface.c
6 * PURPOSE: VFAT Filesystem
7 * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
10 * 24-10-1998 Fixed bugs in long filename support
11 * Fixed a bug that prevented unsuccessful file open requests
13 * Now works with long filenames that span over a sector
15 * 28-10-1998 Reads entire FAT into memory
16 * VFatReadSector modified to read in more than one sector at a
18 * 7-11-1998 Fixed bug that assumed that directory data could be
20 * 8-12-1998 Added FAT32 support
21 * Added initial writability functions
22 * WARNING: DO NOT ATTEMPT TO TEST WRITABILITY FUNCTIONS!!!
23 * 12-12-1998 Added basic support for FILE_STANDARD_INFORMATION request
27 /* INCLUDES *****************************************************************/
29 #include <ddk/ntddk.h>
36 /* GLOBALS *****************************************************************/
39 PVFAT_GLOBAL_DATA VfatGlobalData
;
41 /* FUNCTIONS ****************************************************************/
44 DriverEntry(PDRIVER_OBJECT DriverObject
,
45 PUNICODE_STRING RegistryPath
)
47 * FUNCTION: Called by the system to initalize the driver
49 * DriverObject = object describing this driver
50 * RegistryPath = path to our configuration entries
51 * RETURNS: Success or failure
54 PDEVICE_OBJECT DeviceObject
;
55 UNICODE_STRING DeviceName
;
58 DPRINT("VFAT 0.0.6\n");
60 RtlInitUnicodeString(&DeviceName
,
62 Status
= IoCreateDevice(DriverObject
,
63 sizeof(VFAT_GLOBAL_DATA
),
65 FILE_DEVICE_DISK_FILE_SYSTEM
,
69 if (!NT_SUCCESS(Status
))
73 VfatGlobalData
= DeviceObject
->DeviceExtension
;
74 RtlZeroMemory (VfatGlobalData
, sizeof(VFAT_GLOBAL_DATA
));
75 VfatGlobalData
->DriverObject
= DriverObject
;
76 VfatGlobalData
->DeviceObject
= DeviceObject
;
78 DeviceObject
->Flags
= DO_DIRECT_IO
;
79 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = VfatBuildRequest
;
80 DriverObject
->MajorFunction
[IRP_MJ_CREATE
] = VfatBuildRequest
;
81 DriverObject
->MajorFunction
[IRP_MJ_READ
] = VfatBuildRequest
;
82 DriverObject
->MajorFunction
[IRP_MJ_WRITE
] = VfatBuildRequest
;
83 DriverObject
->MajorFunction
[IRP_MJ_FILE_SYSTEM_CONTROL
] = VfatBuildRequest
;
84 DriverObject
->MajorFunction
[IRP_MJ_QUERY_INFORMATION
] = VfatBuildRequest
;
85 DriverObject
->MajorFunction
[IRP_MJ_SET_INFORMATION
] = VfatBuildRequest
;
86 DriverObject
->MajorFunction
[IRP_MJ_DIRECTORY_CONTROL
] = VfatBuildRequest
;
87 DriverObject
->MajorFunction
[IRP_MJ_QUERY_VOLUME_INFORMATION
] = VfatBuildRequest
;
88 DriverObject
->MajorFunction
[IRP_MJ_SET_VOLUME_INFORMATION
] = VfatBuildRequest
;
89 DriverObject
->MajorFunction
[IRP_MJ_SHUTDOWN
] = VfatShutdown
;
90 DriverObject
->MajorFunction
[IRP_MJ_CLEANUP
] = VfatBuildRequest
;
92 DriverObject
->DriverUnload
= NULL
;
94 IoRegisterFileSystem(DeviceObject
);
95 return STATUS_SUCCESS
;