Based on a patch by Herve Poussineau poussine@freesurf.fr: - Clean up #includes. - Get rid of ROSRTL dependancy. Modified: trunk/reactos/drivers/fs/vfat/blockdev.c Modified: trunk/reactos/drivers/fs/vfat/cleanup.c Modified: trunk/reactos/drivers/fs/vfat/close.c Modified: trunk/reactos/drivers/fs/vfat/create.c Modified: trunk/reactos/drivers/fs/vfat/dir.c Modified: trunk/reactos/drivers/fs/vfat/direntry.c Modified: trunk/reactos/drivers/fs/vfat/dirwr.c Modified: trunk/reactos/drivers/fs/vfat/ea.c Modified: trunk/reactos/drivers/fs/vfat/fat.c Modified: trunk/reactos/drivers/fs/vfat/fcb.c Modified: trunk/reactos/drivers/fs/vfat/finfo.c Modified: trunk/reactos/drivers/fs/vfat/flush.c Modified: trunk/reactos/drivers/fs/vfat/fsctl.c Modified: trunk/reactos/drivers/fs/vfat/iface.c Modified: trunk/reactos/drivers/fs/vfat/misc.c Modified: trunk/reactos/drivers/fs/vfat/shutdown.c Modified: trunk/reactos/drivers/fs/vfat/string.c Modified: trunk/reactos/drivers/fs/vfat/vfat.h Modified: trunk/reactos/drivers/fs/vfat/volume.c _____
Modified: trunk/reactos/drivers/fs/vfat/blockdev.c --- trunk/reactos/drivers/fs/vfat/blockdev.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/blockdev.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -10,11 +10,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ***************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/cleanup.c --- trunk/reactos/drivers/fs/vfat/cleanup.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/cleanup.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -10,11 +10,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/close.c --- trunk/reactos/drivers/fs/vfat/close.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/close.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -10,11 +10,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/create.c --- trunk/reactos/drivers/fs/vfat/create.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/create.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -27,13 +27,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> -#include <limits.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS *****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/dir.c --- trunk/reactos/drivers/fs/vfat/dir.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/dir.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -10,21 +10,16 @@
*/
-#include <ddk/ntddk.h> -#include <wchar.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
// function like DosDateTimeToFileTime BOOLEAN -FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, USHORT wDosDate, WORD wDosTime, PLARGE_INTEGER SystemTime) +FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, USHORT DosDate, USHORT DosTime, PLARGE_INTEGER SystemTime) { - PDOSTIME pdtime = (PDOSTIME) & wDosTime; - PDOSDATE pddate = (PDOSDATE) & wDosDate; + PDOSTIME pdtime = (PDOSTIME) &DosTime; + PDOSDATE pddate = (PDOSDATE) &DosDate; TIME_FIELDS TimeFields; LARGE_INTEGER LocalTime;
_____
Modified: trunk/reactos/drivers/fs/vfat/direntry.c --- trunk/reactos/drivers/fs/vfat/direntry.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/direntry.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -13,13 +13,7 @@
/* ------------------------------------------------------- INCLUDES */
-#include <ddk/ntddk.h> -#include <wchar.h> -#include <limits.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
ULONG _____
Modified: trunk/reactos/drivers/fs/vfat/dirwr.c --- trunk/reactos/drivers/fs/vfat/dirwr.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/dirwr.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -9,14 +9,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <ctype.h> -#include <wchar.h> -#include <string.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
NTSTATUS _____
Modified: trunk/reactos/drivers/fs/vfat/ea.c --- trunk/reactos/drivers/fs/vfat/ea.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/ea.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -27,13 +27,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> -#include <limits.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS *****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/fat.c --- trunk/reactos/drivers/fs/vfat/fat.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/fat.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -12,13 +12,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> -#include <ntos/minmax.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* GLOBALS ******************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/fcb.c --- trunk/reactos/drivers/fs/vfat/fcb.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/fcb.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -13,14 +13,9 @@
/* ------------------------------------------------------- INCLUDES */
-#include <ddk/ntddk.h> -#include <wchar.h> -#include <limits.h> -#include <rosrtl/string.h> +#include <wctype.h> /* towlower prototype */
#define NDEBUG -#include <debug.h> - #include "vfat.h"
/* -------------------------------------------------------- DEFINES */ @@ -372,10 +367,8 @@ PVFATFCB FCB; ULONG FirstCluster, CurrentCluster, Size = 0; NTSTATUS Status = STATUS_SUCCESS; - UNICODE_STRING NameU; + UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\");
- RtlRosInitUnicodeStringFromLiteral(&NameU, L"\"); - FCB = vfatNewFCB(pVCB, &NameU); if (FCB->Flags & FCB_IS_FATX_ENTRY) { @@ -425,10 +418,8 @@ vfatOpenRootFCB(PDEVICE_EXTENSION pVCB) { PVFATFCB FCB; - UNICODE_STRING NameU; + UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\");
- RtlRosInitUnicodeStringFromLiteral(&NameU, L"\"); - FCB = vfatGrabFCBFromTable (pVCB, &NameU); if (FCB == NULL) { @@ -654,7 +645,7 @@ PVFATFCB FCB = NULL; PVFATFCB parentFCB; UNICODE_STRING NameU; - UNICODE_STRING RootNameU; + UNICODE_STRING RootNameU = RTL_CONSTANT_STRING(L"\"); PWCHAR curr, prev, last; ULONG Length;
@@ -668,8 +659,6 @@
if (parentFCB == NULL) { - RtlRosInitUnicodeStringFromLiteral(&RootNameU, L"\"); - // Trivial case, open of the root directory on volume if (RtlEqualUnicodeString(pFileNameU, &RootNameU, FALSE)) { _____
Modified: trunk/reactos/drivers/fs/vfat/finfo.c --- trunk/reactos/drivers/fs/vfat/finfo.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/finfo.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -12,12 +12,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/flush.c --- trunk/reactos/drivers/fs/vfat/flush.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/flush.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -9,12 +9,9 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> +#define NDEBUG #include "vfat.h"
-#define NDEBUG -#include <debug.h> - /* FUNCTIONS ****************************************************************/
NTSTATUS VfatFlushFile(PDEVICE_EXTENSION DeviceExt, PVFATFCB Fcb) _____
Modified: trunk/reactos/drivers/fs/vfat/fsctl.c --- trunk/reactos/drivers/fs/vfat/fsctl.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/fsctl.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -26,13 +26,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <rosrtl/string.h> -#include <wchar.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ @@ -385,7 +379,8 @@ PVFATFCB VolumeFcb = NULL; PVFATCCB Ccb = NULL; PDEVICE_OBJECT DeviceToMount; - UNICODE_STRING NameU; + UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\$$Fat$$"); + UNICODE_STRING VolumeNameU = RTL_CONSTANT_STRING(L"\$$Volume$$");
DPRINT("VfatMount(IrpContext %x)\n", IrpContext);
@@ -495,7 +490,6 @@ DPRINT("FsDeviceObject %lx\n", DeviceObject);
DeviceExt->FATFileObject = IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice); - RtlRosInitUnicodeStringFromLiteral(&NameU, L"\$$Fat$$"); Fcb = vfatNewFCB(DeviceExt, &NameU); if (Fcb == NULL) { @@ -541,9 +535,8 @@ ExInitializeResourceLite(&DeviceExt->FatResource);
InitializeListHead(&DeviceExt->FcbListHead); - RtlRosInitUnicodeStringFromLiteral(&NameU, L"\$$Volume$$");
- VolumeFcb = vfatNewFCB(DeviceExt, &NameU); + VolumeFcb = vfatNewFCB(DeviceExt, &VolumeNameU); if (VolumeFcb == NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; _____
Modified: trunk/reactos/drivers/fs/vfat/iface.c --- trunk/reactos/drivers/fs/vfat/iface.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/iface.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -27,12 +27,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <rosrtl/string.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* GLOBALS *****************************************************************/ @@ -53,7 +48,7 @@ */ { PDEVICE_OBJECT DeviceObject; - UNICODE_STRING DeviceName = ROS_STRING_INITIALIZER(L"\Fat"); + UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\Fat"); NTSTATUS Status;
Status = IoCreateDevice(DriverObject, _____
Modified: trunk/reactos/drivers/fs/vfat/misc.c --- trunk/reactos/drivers/fs/vfat/misc.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/misc.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -10,12 +10,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/shutdown.c --- trunk/reactos/drivers/fs/vfat/shutdown.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/shutdown.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -9,11 +9,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/string.c --- trunk/reactos/drivers/fs/vfat/string.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/string.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -11,12 +11,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/ _____
Modified: trunk/reactos/drivers/fs/vfat/vfat.h --- trunk/reactos/drivers/fs/vfat/vfat.h 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/vfat.h 2005-01-12 12:33:57 UTC (rev 12960) @@ -2,7 +2,8 @@
#include <ddk/ntifs.h> #include <ddk/ntdddisk.h> -#undef DeleteFile /* FIXME */ +#include <limits.h> +#include <debug.h>
#define USE_ROS_CC_AND_FS
@@ -11,6 +12,7 @@ NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING, CONST STRING *, BOOLEAN); NTSTATUS NTAPI RtlDowncaseUnicodeString(PUNICODE_STRING, PCUNICODE_STRING, BOOLEAN); NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING, PCUNICODE_STRING, BOOLEAN); +#undef DeleteFile /* FIXME */ #endif
#ifdef USE_ROS_CC_AND_FS _____
Modified: trunk/reactos/drivers/fs/vfat/volume.c --- trunk/reactos/drivers/fs/vfat/volume.c 2005-01-12 12:32:06 UTC (rev 12959) +++ trunk/reactos/drivers/fs/vfat/volume.c 2005-01-12 12:33:57 UTC (rev 12960) @@ -11,12 +11,7 @@
/* INCLUDES *****************************************************************/
-#include <ddk/ntddk.h> -#include <wchar.h> - #define NDEBUG -#include <debug.h> - #include "vfat.h"
/* FUNCTIONS ****************************************************************/