Herve Poussineau <poussine@freesurf.fr>

Use DDK types instead of Win32 types (BOOL, WORD, DWORD).

svn path=/trunk/; revision=12954
This commit is contained in:
Filip Navara 2005-01-12 10:46:13 +00:00
parent 1f84743388
commit 561f4090e1
11 changed files with 52 additions and 52 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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");

View file

@ -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

View file

@ -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))

View file

@ -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,

View file

@ -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;