Fix various warnings

svn path=/trunk/; revision=13734
This commit is contained in:
Hervé Poussineau 2005-02-24 20:47:07 +00:00
parent a6d6b56960
commit 60cb1041df
9 changed files with 72 additions and 72 deletions

View file

@ -15,7 +15,7 @@
/* FUNCTIONS ***************************************************************/
NTSTATUS STDCALL
static NTSTATUS STDCALL
VfatReadWritePartialCompletion (IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context)
@ -272,9 +272,9 @@ VfatWriteDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext,
NTSTATUS
VfatBlockDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
IN ULONG CtlCode,
IN PVOID InputBuffer,
IN PVOID InputBuffer OPTIONAL,
IN ULONG InputBufferSize,
IN OUT PVOID OutputBuffer,
IN OUT PVOID OutputBuffer OPTIONAL,
IN OUT PULONG OutputBufferSize,
IN BOOLEAN Override)
{

View file

@ -186,7 +186,7 @@ FindFile (PDEVICE_EXTENSION DeviceExt,
*/
{
PWCHAR PathNameBuffer;
ULONG PathNameBufferLength;
USHORT PathNameBufferLength;
NTSTATUS Status;
PVOID Context = NULL;
PVOID Page;

View file

@ -33,7 +33,7 @@ FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, USHORT DosDate, USHORT
TimeFields.Day = pddate->Day;
TimeFields.Month = pddate->Month;
TimeFields.Year = DeviceExt->BaseDateYear + pddate->Year;
TimeFields.Year = (CSHORT)(DeviceExt->BaseDateYear + pddate->Year);
RtlTimeFieldsToTime (&TimeFields, &LocalTime);
ExLocalTimeToSystemTime(&LocalTime, SystemTime);
@ -261,7 +261,7 @@ VfatGetFileBothInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
pInfo->NextEntryOffset =
ULONG_ROUND_UP (sizeof (FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length);
RtlCopyMemory(pInfo->ShortName, DirContext->ShortNameU.Buffer, DirContext->ShortNameU.Length);
pInfo->ShortNameLength = DirContext->ShortNameU.Length;
pInfo->ShortNameLength = (CCHAR)DirContext->ShortNameU.Length;
RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
// pInfo->FileIndex=;
FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.CreationDate,

View file

@ -45,7 +45,7 @@ VfatUpdateEntry (PVFATFCB pFcb)
return STATUS_SUCCESS;
}
ASSERT (pFcb->parrentFcb);
ASSERT (pFcb->parentFcb);
Offset.u.HighPart = 0;
Offset.u.LowPart = dirIndex * SizeDirEntry;

View file

@ -72,7 +72,7 @@ vfatSplitPathName(PUNICODE_STRING PathNameU, PUNICODE_STRING DirNameU, PUNICODE_
VOID
vfatInitFcb(PVFATFCB Fcb, PUNICODE_STRING NameU)
{
ULONG PathNameBufferLength;
USHORT PathNameBufferLength;
if (NameU)
PathNameBufferLength = NameU->Length + sizeof(WCHAR);
@ -460,7 +460,7 @@ vfatMakeFCBFromDirEntry(PVCB vcb,
{
PVFATFCB rcFCB;
PWCHAR PathNameBuffer;
ULONG PathNameLength;
USHORT PathNameLength;
ULONG Size;
ULONG hash;
@ -583,7 +583,7 @@ vfatAttachFCBToFileObject (PDEVICE_EXTENSION vcb,
fileObject->SectionObjectPointer = &fcb->SectionObjectPointers;
fileObject->FsContext = fcb;
fileObject->FsContext2 = newCCB;
DPRINT ("file open: fcb:%x PathName:%wZ file size: %d\n", fcb, &fcb->PathNameU, fcb->entry.FileSize);
DPRINT ("file open: fcb:%x PathName:%wZ\n", fcb, &fcb->PathNameU);
return STATUS_SUCCESS;
}

View file

@ -109,8 +109,8 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
}
else if (DiskGeometry.MediaType == RemovableMedia &&
PartitionInfo.PartitionNumber > 0 &&
PartitionInfo.StartingOffset.QuadPart == 0LL &&
PartitionInfo.PartitionLength.QuadPart > 0LL)
PartitionInfo.StartingOffset.QuadPart == 0 &&
PartitionInfo.PartitionLength.QuadPart > 0)
{
/* This is possible a removable media formated as super floppy */
*RecognizedFS = TRUE;
@ -298,7 +298,7 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
FatInfo.SectorsPerCluster = BootFatX->SectorsPerCluster;
FatInfo.rootDirectorySectors = BootFatX->SectorsPerCluster;
FatInfo.BytesPerCluster = BootFatX->SectorsPerCluster * DiskGeometry.BytesPerSector;
FatInfo.Sectors = PartitionInfo.PartitionLength.QuadPart / DiskGeometry.BytesPerSector;
FatInfo.Sectors = (ULONG)(PartitionInfo.PartitionLength.QuadPart / DiskGeometry.BytesPerSector);
if (FatInfo.Sectors / FatInfo.SectorsPerCluster < 65525)
{
DPRINT("FATX16\n");

View file

@ -12,13 +12,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <ntos/minmax.h>
#define NDEBUG
#include <debug.h>
#include "vfat.h"
/*
@ -728,7 +722,7 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext)
{
DPRINT("VfatReadFile returned STATUS_VERIFY_REQUIRED\n");
DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
IoSetDeviceToVerify(PsGetCurrentThread(), DeviceToVerify);
Status = IoVerifyVolume (DeviceToVerify, FALSE);
if (NT_SUCCESS(Status))

View file

@ -28,6 +28,7 @@ typedef struct _ROS_QUERY_LCN_MAPPING { LARGE_INTEGER LcnDiskOffset; } ROS_QUERY
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
#include <pshpack1.h>
struct _BootSector
{
unsigned char magic0, res0, magic1;
@ -45,7 +46,7 @@ struct _BootSector
unsigned char VolumeLabel[11], SysType[8];
unsigned char Res2[448];
unsigned short Signatur1;
} __attribute__((packed));
};
struct _BootSector32
{
@ -73,7 +74,7 @@ struct _BootSector32
unsigned char VolumeLabel[11], SysType[8]; // 71
unsigned char Res2[420]; // 90
unsigned short Signature1; // 510
} __attribute__((packed));
};
struct _BootSectorFatX
{
@ -83,7 +84,7 @@ struct _BootSectorFatX
unsigned short FATCount; // 12
unsigned long Unknown; // 14
unsigned char Unused[4078]; // 18
} __attribute__((packed));
};
struct _FsInfoSector
{
@ -94,10 +95,61 @@ struct _FsInfoSector
unsigned long NextCluster; // 492
unsigned char Res7[12]; // 496
unsigned long Signatur2; // 508
} __attribute__((packed));
};
typedef struct _BootSector BootSector;
struct _FATDirEntry
{
union
{
struct { unsigned char Filename[8], Ext[3]; };
unsigned char ShortName[11];
};
unsigned char Attrib;
unsigned char lCase;
unsigned char CreationTimeMs;
unsigned short CreationTime,CreationDate,AccessDate;
unsigned short FirstClusterHigh; // higher
unsigned short UpdateTime; //time create/update
unsigned short UpdateDate; //date create/update
unsigned short FirstCluster;
unsigned long FileSize;
};
typedef struct _FATDirEntry FAT_DIR_ENTRY, *PFAT_DIR_ENTRY;
struct _FATXDirEntry
{
unsigned char FilenameLength; // 0
unsigned char Attrib; // 1
unsigned char Filename[42]; // 2
unsigned long FirstCluster; // 44
unsigned long FileSize; // 48
unsigned short UpdateTime; // 52
unsigned short UpdateDate; // 54
unsigned short CreationTime; // 56
unsigned short CreationDate; // 58
unsigned short AccessTime; // 60
unsigned short AccessDate; // 62
};
struct _slot
{
unsigned char id; // sequence number for slot
WCHAR name0_4[5]; // first 5 characters in name
unsigned char attr; // attribute byte
unsigned char reserved; // always 0
unsigned char alias_checksum; // checksum for 8.3 alias
WCHAR name5_10[6]; // 6 more characters in name
unsigned char start[2]; // starting cluster number
WCHAR name11_12[2]; // last 2 characters in name
};
typedef struct _slot slot;
#include <poppack.h>
#define VFAT_CASE_LOWER_BASE 8 // base is lower case
#define VFAT_CASE_LOWER_EXT 16 // extension is lower case
@ -120,37 +172,6 @@ typedef struct _BootSector BootSector;
#define FAT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FAT_DIR_ENTRY))
#define FATX_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FATX_DIR_ENTRY))
struct _FATDirEntry
{
unsigned char Filename[8], Ext[3];
unsigned char Attrib;
unsigned char lCase;
unsigned char CreationTimeMs;
unsigned short CreationTime,CreationDate,AccessDate;
unsigned short FirstClusterHigh; // higher
unsigned short UpdateTime; //time create/update
unsigned short UpdateDate; //date create/update
unsigned short FirstCluster;
unsigned long FileSize;
} __attribute__((packed));
typedef struct _FATDirEntry FAT_DIR_ENTRY, *PFAT_DIR_ENTRY;
struct _FATXDirEntry
{
unsigned char FilenameLength; // 0
unsigned char Attrib; // 1
unsigned char Filename[42]; // 2
unsigned long FirstCluster; // 44
unsigned long FileSize; // 48
unsigned short UpdateTime; // 52
unsigned short UpdateDate; // 54
unsigned short CreationTime; // 56
unsigned short CreationDate; // 58
unsigned short AccessTime; // 60
unsigned short AccessDate; // 62
} __attribute__((packed));
typedef struct _FATXDirEntry FATX_DIR_ENTRY, *PFATX_DIR_ENTRY;
union _DIR_ENTRY
@ -161,21 +182,6 @@ union _DIR_ENTRY
typedef union _DIR_ENTRY DIR_ENTRY, *PDIR_ENTRY;
struct _slot
{
unsigned char id; // sequence number for slot
WCHAR name0_4[5]; // first 5 characters in name
unsigned char attr; // attribute byte
unsigned char reserved; // always 0
unsigned char alias_checksum; // checksum for 8.3 alias
WCHAR name5_10[6]; // 6 more characters in name
unsigned char start[2]; // starting cluster number
WCHAR name11_12[2]; // last 2 characters in name
} __attribute__((packed));
typedef struct _slot slot;
#define BLOCKSIZE 512
#define FAT16 (1)

View file

@ -204,7 +204,7 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
LabelLen = FsLabelInfo->VolumeLabelLength / sizeof(WCHAR);
RtlZeroMemory(&VolumeLabelDirEntry, SizeDirEntry);
StringW.Buffer = FsLabelInfo->VolumeLabel;
StringW.Length = StringW.MaximumLength = FsLabelInfo->VolumeLabelLength;
StringW.Length = StringW.MaximumLength = (USHORT)FsLabelInfo->VolumeLabelLength;
StringO.Buffer = cString;
StringO.Length = 0;
StringO.MaximumLength = 42;
@ -288,7 +288,7 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
}
/* Update volume label in memory */
DeviceObject->Vpb->VolumeLabelLength = FsLabelInfo->VolumeLabelLength;
DeviceObject->Vpb->VolumeLabelLength = (USHORT)FsLabelInfo->VolumeLabelLength;
RtlCopyMemory(DeviceObject->Vpb->VolumeLabel, FsLabelInfo->VolumeLabel, DeviceObject->Vpb->VolumeLabelLength);
return Status;