diff --git a/reactos/drivers/fs/vfat/blockdev.c b/reactos/drivers/fs/vfat/blockdev.c index cf97ada1242..0a2c68c12df 100644 --- a/reactos/drivers/fs/vfat/blockdev.c +++ b/reactos/drivers/fs/vfat/blockdev.c @@ -71,7 +71,7 @@ VfatReadDisk (IN PDEVICE_OBJECT pDeviceObject, KeInitializeEvent (&event, NotificationEvent, FALSE); - DPRINT ("VfatReadSectors(pDeviceObject %x, Offset %I64x, Length %d, Buffer %x)\n", + DPRINT ("VfatReadDisk(pDeviceObject %x, Offset %I64x, Length %d, Buffer %x)\n", pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer); DPRINT ("Building synchronous FSD Request...\n"); @@ -108,7 +108,7 @@ VfatReadDisk (IN PDEVICE_OBJECT pDeviceObject, if (!NT_SUCCESS (Status)) { - DPRINT ("IO failed!!! VfatReadSectors : Error code: %x\n", Status); + DPRINT ("IO failed!!! VfatReadDisk : Error code: %x\n", Status); DPRINT ("(pDeviceObject %x, Offset %I64x, Size %d, Buffer %x\n", pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer); return (Status); @@ -134,7 +134,7 @@ VfatReadDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext, DPRINT ("Building asynchronous FSD Request...\n"); - Buffer = MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset; + Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset; Irp = IoAllocateIrp(IrpContext->DeviceExt->StorageDevice->StackSize, TRUE); if (Irp == NULL) @@ -212,7 +212,7 @@ VfatWriteDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext, DPRINT ("VfatWriteDiskPartial(IrpContext %x, WriteOffset %I64x, WriteLength %d, BufferOffset %x, Wait %d)\n", IrpContext, WriteOffset->QuadPart, WriteLength, BufferOffset, Wait); - Buffer = MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset; + Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset; DPRINT ("Building asynchronous FSD Request...\n"); Irp = IoAllocateIrp(IrpContext->DeviceExt->StorageDevice->StackSize, TRUE); diff --git a/reactos/drivers/fs/vfat/dir.c b/reactos/drivers/fs/vfat/dir.c index d10ab848dde..b50118595a7 100644 --- a/reactos/drivers/fs/vfat/dir.c +++ b/reactos/drivers/fs/vfat/dir.c @@ -20,7 +20,7 @@ // function like DosDateTimeToFileTime -BOOL +BOOLEAN FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, WORD wDosDate, WORD wDosTime, PLARGE_INTEGER SystemTime) { PDOSTIME pdtime = (PDOSTIME) & wDosTime; @@ -47,11 +47,11 @@ FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, WORD wDosDate, WORD wDo } // function like FileTimeToDosDateTime -BOOL -FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, WORD * pwDosDate, WORD * pwDosTime) +BOOLEAN +FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, USHORT *pDosDate, USHORT *pDosTime) { - PDOSTIME pdtime = (PDOSTIME) pwDosTime; - PDOSDATE pddate = (PDOSDATE) pwDosDate; + PDOSTIME pdtime = (PDOSTIME) pDosTime; + PDOSDATE pddate = (PDOSDATE) pDosDate; TIME_FIELDS TimeFields; LARGE_INTEGER LocalTime; @@ -72,13 +72,13 @@ FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTi { pddate->Day = TimeFields.Day; pddate->Month = TimeFields.Month; - pddate->Year = TimeFields.Year - DeviceExt->BaseDateYear; + pddate->Year = (USHORT) (TimeFields.Year - DeviceExt->BaseDateYear); } return TRUE; } -#define DWORD_ROUND_UP(x) ROUND_UP((x), (sizeof(DWORD))) +#define ULONG_ROUND_UP(x) ROUND_UP((x), (sizeof(ULONG))) NTSTATUS VfatGetFileNameInformation (PVFAT_DIRENTRY_CONTEXT DirContext, @@ -88,7 +88,7 @@ VfatGetFileNameInformation (PVFAT_DIRENTRY_CONTEXT DirContext, return STATUS_BUFFER_OVERFLOW; pInfo->FileNameLength = DirContext->LongNameU.Length; pInfo->NextEntryOffset = - DWORD_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); + ULONG_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length); return STATUS_SUCCESS; } @@ -103,7 +103,7 @@ VfatGetFileDirectoryInformation (PVFAT_DIRENTRY_CONTEXT DirContext, return STATUS_BUFFER_OVERFLOW; pInfo->FileNameLength = DirContext->LongNameU.Length; pInfo->NextEntryOffset = - DWORD_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); + ULONG_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length); // pInfo->FileIndex=; if (DeviceExt->Flags & VCB_IS_FATX) @@ -173,7 +173,7 @@ VfatGetFileFullDirectoryInformation (PVFAT_DIRENTRY_CONTEXT DirContext, return STATUS_BUFFER_OVERFLOW; pInfo->FileNameLength = DirContext->LongNameU.Length; pInfo->NextEntryOffset = - DWORD_ROUND_UP (sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); + ULONG_ROUND_UP (sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length); // pInfo->FileIndex=; if (DeviceExt->Flags & VCB_IS_FATX) @@ -231,7 +231,7 @@ VfatGetFileBothInformation (PVFAT_DIRENTRY_CONTEXT DirContext, pInfo->FileNameLength = DirContext->LongNameU.Length; RtlCopyMemory(pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length); pInfo->NextEntryOffset = - DWORD_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); + ULONG_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); pInfo->ShortName[0] = 0; pInfo->ShortNameLength = 0; // pInfo->FileIndex=; @@ -264,7 +264,7 @@ VfatGetFileBothInformation (PVFAT_DIRENTRY_CONTEXT DirContext, { pInfo->FileNameLength = DirContext->LongNameU.Length; pInfo->NextEntryOffset = - DWORD_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); + ULONG_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length); RtlCopyMemory(pInfo->ShortName, DirContext->ShortNameU.Buffer, DirContext->ShortNameU.Length); pInfo->ShortNameLength = DirContext->ShortNameU.Length; RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length); diff --git a/reactos/drivers/fs/vfat/direntry.c b/reactos/drivers/fs/vfat/direntry.c index 273dd85de14..d6b12e61aac 100644 --- a/reactos/drivers/fs/vfat/direntry.c +++ b/reactos/drivers/fs/vfat/direntry.c @@ -45,7 +45,7 @@ vfatDirEntryGetFirstCluster (PDEVICE_EXTENSION pDeviceExt, return cluster; } -BOOL FATIsDirectoryEmpty(PVFATFCB Fcb) +BOOLEAN FATIsDirectoryEmpty(PVFATFCB Fcb) { LARGE_INTEGER FileOffset; PVOID Context = NULL; @@ -98,7 +98,7 @@ BOOL FATIsDirectoryEmpty(PVFATFCB Fcb) return TRUE; } -BOOL FATXIsDirectoryEmpty(PVFATFCB Fcb) +BOOLEAN FATXIsDirectoryEmpty(PVFATFCB Fcb) { LARGE_INTEGER FileOffset; PVOID Context = NULL; @@ -144,7 +144,7 @@ BOOL FATXIsDirectoryEmpty(PVFATFCB Fcb) return TRUE; } -BOOL VfatIsDirectoryEmpty(PVFATFCB Fcb) +BOOLEAN VfatIsDirectoryEmpty(PVFATFCB Fcb) { if (Fcb->Flags & FCB_IS_FATX_ENTRY) return FATXIsDirectoryEmpty(Fcb); diff --git a/reactos/drivers/fs/vfat/dirwr.c b/reactos/drivers/fs/vfat/dirwr.c index 649a9552201..8fdd988faf0 100644 --- a/reactos/drivers/fs/vfat/dirwr.c +++ b/reactos/drivers/fs/vfat/dirwr.c @@ -151,7 +151,7 @@ vfatFindDirSpace(PDEVICE_EXTENSION DeviceExt, return FALSE; } // clear the new dir cluster - FileOffset.u.LowPart = (DWORD)(pDirFcb->RFCB.FileSize.QuadPart - + FileOffset.u.LowPart = (ULONG)(pDirFcb->RFCB.FileSize.QuadPart - DeviceExt->FatInfo.BytesPerCluster); CcMapData (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, TRUE, &Context, (PVOID*)&pFatEntry); @@ -195,7 +195,7 @@ FATAddEntry (PDEVICE_EXTENSION DeviceExt, PVOID Context = NULL; PFAT_DIR_ENTRY pFatEntry; slot *pSlots; - short nbSlots = 0, j, posCar; + USHORT nbSlots = 0, j, posCar; PUCHAR Buffer; BOOLEAN needTilde = FALSE, needLong = FALSE; BOOLEAN lCaseBase = FALSE, uCaseBase, lCaseExt = FALSE, uCaseExt; @@ -402,11 +402,11 @@ FATAddEntry (PDEVICE_EXTENSION DeviceExt, pSlots[i].attr = 0xf; if (i) { - pSlots[i].id = nbSlots - i - 1; + pSlots[i].id = (unsigned char)(nbSlots - i - 1); } else { - pSlots[i].id = nbSlots - i - 1 + 0x40; + pSlots[i].id = (unsigned char)(nbSlots - i - 1 + 0x40); } pSlots[i].alias_checksum = pSlots[0].alias_checksum; RtlCopyMemory (pSlots[i].name0_4, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13, 10); diff --git a/reactos/drivers/fs/vfat/fcb.c b/reactos/drivers/fs/vfat/fcb.c index e45f4fbd522..2740d879fdc 100644 --- a/reactos/drivers/fs/vfat/fcb.c +++ b/reactos/drivers/fs/vfat/fcb.c @@ -151,13 +151,13 @@ vfatDestroyFCB(PVFATFCB pFCB) ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB); } -BOOL +BOOLEAN vfatFCBIsDirectory(PVFATFCB FCB) { return *FCB->Attributes & FILE_ATTRIBUTE_DIRECTORY; } -BOOL +BOOLEAN vfatFCBIsRoot(PVFATFCB FCB) { return FCB->PathNameU.Length == sizeof(WCHAR) && FCB->PathNameU.Buffer[0] == L'\\' ? TRUE : FALSE; diff --git a/reactos/drivers/fs/vfat/finfo.c b/reactos/drivers/fs/vfat/finfo.c index 3c4b2baa2f3..ed499938c72 100644 --- a/reactos/drivers/fs/vfat/finfo.c +++ b/reactos/drivers/fs/vfat/finfo.c @@ -479,7 +479,7 @@ VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, ULONG ClusterSize = DeviceExt->FatInfo.BytesPerCluster; ULONG NewSize = AllocationSize->u.LowPart; ULONG NCluster; - BOOL AllocSizeChanged = FALSE; + BOOLEAN AllocSizeChanged = FALSE; DPRINT("VfatSetAllocationSizeInformation()\n"); @@ -746,7 +746,7 @@ NTSTATUS VfatSetInformation(PVFAT_IRP_CONTEXT IrpContext) PVFATFCB FCB = NULL; NTSTATUS RC = STATUS_SUCCESS; PVOID SystemBuffer; - BOOL CanWait = IrpContext->Flags & IRPCONTEXT_CANWAIT; + BOOLEAN CanWait = (IrpContext->Flags & IRPCONTEXT_CANWAIT) != 0; /* PRECONDITION */ ASSERT(IrpContext); diff --git a/reactos/drivers/fs/vfat/fsctl.c b/reactos/drivers/fs/vfat/fsctl.c index 24a0f8942a1..f97b05733b0 100644 --- a/reactos/drivers/fs/vfat/fsctl.c +++ b/reactos/drivers/fs/vfat/fsctl.c @@ -56,7 +56,7 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount, LARGE_INTEGER Offset; struct _BootSector* Boot; struct _BootSectorFatX* BootFatX; - BOOL PartitionInfoIsValid = FALSE; + BOOLEAN PartitionInfoIsValid = FALSE; DPRINT("VfatHasFileSystem\n"); diff --git a/reactos/drivers/fs/vfat/iface.c b/reactos/drivers/fs/vfat/iface.c index 0a3928bad9c..124c645b241 100644 --- a/reactos/drivers/fs/vfat/iface.c +++ b/reactos/drivers/fs/vfat/iface.c @@ -45,7 +45,7 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) /* - * FUNCTION: Called by the system to initalize the driver + * FUNCTION: Called by the system to initialize the driver * ARGUMENTS: * DriverObject = object describing this driver * RegistryPath = path to our configuration entries diff --git a/reactos/drivers/fs/vfat/rw.c b/reactos/drivers/fs/vfat/rw.c index bb86e51f576..61a1e6059b4 100644 --- a/reactos/drivers/fs/vfat/rw.c +++ b/reactos/drivers/fs/vfat/rw.c @@ -375,7 +375,7 @@ VfatWriteFileData(PVFAT_IRP_CONTEXT IrpContext, ASSERT(WriteOffset.QuadPart + Length <= Fcb->RFCB.AllocationSize.QuadPart); ASSERT(WriteOffset.u.LowPart % BytesPerSector == 0); - ASSERT(Length % BytesPerSector == 0) + ASSERT(Length % BytesPerSector == 0); // Is this a write of the volume ? if (Fcb->Flags & FCB_IS_VOLUME) @@ -705,7 +705,7 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) CHECKPOINT; if (ByteOffset.QuadPart + Length > ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector)) { - Length = ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector) - ByteOffset.QuadPart; + Length = (ULONG)(ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector) - ByteOffset.QuadPart); } Status = VfatLockUserBuffer(IrpContext->Irp, Length, IoWriteAccess); @@ -719,8 +719,8 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) if (Status == STATUS_VERIFY_REQUIRED) { DPRINT("VfatReadFile returned STATUS_VERIFY_REQUIRED\n"); - DeviceToVerify = IoGetDeviceToVerify((struct _ETHREAD*)KeGetCurrentThread()); - IoSetDeviceToVerify((struct _ETHREAD*)KeGetCurrentThread(), NULL); + DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread()); + IoSetDeviceToVerify(PsGetCurrentThread(), NULL); Status = IoVerifyVolume (DeviceToVerify, FALSE); if (NT_SUCCESS(Status)) diff --git a/reactos/drivers/fs/vfat/vfat.h b/reactos/drivers/fs/vfat/vfat.h index bfa0b22adf6..6588a5a3efa 100644 --- a/reactos/drivers/fs/vfat/vfat.h +++ b/reactos/drivers/fs/vfat/vfat.h @@ -179,7 +179,7 @@ typedef struct ULONG NumberOfClusters; ULONG FatType; ULONG Sectors; - BOOL FixedMedia; + BOOLEAN FixedMedia; } FATINFO, *PFATINFO; struct _VFATFCB; @@ -356,17 +356,17 @@ typedef struct _VFATCCB typedef struct __DOSTIME { - WORD Second:5; - WORD Minute:6; - WORD Hour:5; + USHORT Second:5; + USHORT Minute:6; + USHORT Hour:5; } DOSTIME, *PDOSTIME; typedef struct __DOSDATE { - WORD Day:5; - WORD Month:4; - WORD Year:5; + USHORT Day:5; + USHORT Month:4; + USHORT Year:5; } DOSDATE, *PDOSDATE; @@ -441,15 +441,15 @@ NTSTATUS VfatBlockDeviceIoControl (IN PDEVICE_OBJECT DeviceObject, NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT); -BOOL FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, - WORD wDosDate, - WORD wDosTime, - PLARGE_INTEGER SystemTime); +BOOLEAN FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, + USHORT DosDate, + USHORT DosTime, + PLARGE_INTEGER SystemTime); -BOOL FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, - PLARGE_INTEGER SystemTime, - WORD *pwDosDate, - WORD *pwDosTime); +BOOLEAN FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, + PLARGE_INTEGER SystemTime, + USHORT *pDosDate, + USHORT *pDosTime); /* -------------------------------------------------------- create.c */ @@ -602,7 +602,7 @@ WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG vfatDirEntryGetFirstCluster (PDEVICE_EXTENSION pDeviceExt, PDIR_ENTRY pDirEntry); -BOOL VfatIsDirectoryEmpty(PVFATFCB Fcb); +BOOLEAN VfatIsDirectoryEmpty(PVFATFCB Fcb); NTSTATUS FATGetNextDirEntry(PVOID * pContext, PVOID * pPage, @@ -641,9 +641,9 @@ PVFATFCB vfatMakeRootFCB (PDEVICE_EXTENSION pVCB); PVFATFCB vfatOpenRootFCB (PDEVICE_EXTENSION pVCB); -BOOL vfatFCBIsDirectory (PVFATFCB FCB); +BOOLEAN vfatFCBIsDirectory (PVFATFCB FCB); -BOOL vfatFCBIsRoot(PVFATFCB FCB); +BOOLEAN vfatFCBIsRoot(PVFATFCB FCB); NTSTATUS vfatAttachFCBToFileObject (PDEVICE_EXTENSION vcb, PVFATFCB fcb, diff --git a/reactos/drivers/fs/vfat/volume.c b/reactos/drivers/fs/vfat/volume.c index 5f0b422abc8..cc6cbb88c5b 100644 --- a/reactos/drivers/fs/vfat/volume.c +++ b/reactos/drivers/fs/vfat/volume.c @@ -169,7 +169,7 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject, PDIR_ENTRY Entry; PVFATFCB pRootFcb; LARGE_INTEGER FileOffset; - BOOL LabelFound = FALSE; + BOOLEAN LabelFound = FALSE; DIR_ENTRY VolumeLabelDirEntry; ULONG VolumeLabelDirIndex; ULONG LabelLen;