- Make sure that filesystem-specific data and time are converted to/from system time.
- Replace assert() by ASSERT().
svn path=/trunk/; revision=11555
ULONG Count);
VOID
-CdfsDateTimeToFileTime(PFCB Fcb,
- TIME *FileTime);
+CdfsDateTimeToSystemTime(PFCB Fcb,
+ PLARGE_INTEGER SystemTime);
VOID
CdfsFileFlagsToAttributes(PFCB Fcb,
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: create.c,v 1.12 2004/09/14 21:46:39 ekohl Exp $
+/* $Id: create.c,v 1.13 2004/11/06 13:41:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
DPRINT("try related for %wZ\n", RelativeFileName);
Fcb = FileObject->FsContext;
- assert(Fcb);
+ ASSERT(Fcb);
/* verify related object is a directory and target name
don't start with \. */
sizeof(WCHAR) +
RelativeFileName->Length +
sizeof(WCHAR);
-// assert(wcslen (Fcb->PathName) + 1 + wcslen (pRelativeFileName) + 1
+// ASSERT(wcslen (Fcb->PathName) + 1 + wcslen (pRelativeFileName) + 1
// <= MAX_PATH);
// rcName = ExAllocatePool(NonPagedPool, MAX_PATH * sizeof(WCHAR));
// if (!rcName)
DPRINT("CdfsCreateFile() called\n");
DeviceExt = DeviceObject->DeviceExtension;
- assert (DeviceExt);
+ ASSERT(DeviceExt);
Stack = IoGetCurrentIrpStackLocation (Irp);
- assert (Stack);
+ ASSERT(Stack);
RequestedDisposition = ((Stack->Parameters.Create.Options >> 24) & 0xff);
RequestedOptions = Stack->Parameters.Create.Options & FILE_VALID_OPTION_FLAGS;
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dirctl.c,v 1.16 2004/09/14 21:46:39 ekohl Exp $
+/* $Id: dirctl.c,v 1.17 2004/11/06 13:41:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
memcpy(Info->FileName, Fcb->ObjectName, Length);
/* Convert file times */
- CdfsDateTimeToFileTime(Fcb,
- &Info->CreationTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->LastAccessTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->LastWriteTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->ChangeTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->CreationTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->LastAccessTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->LastWriteTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->ChangeTime);
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
memcpy(Info->FileName, Fcb->ObjectName, Length);
/* Convert file times */
- CdfsDateTimeToFileTime(Fcb,
- &Info->CreationTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->LastAccessTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->LastWriteTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->ChangeTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->CreationTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->LastAccessTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->LastWriteTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->ChangeTime);
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
memcpy(Info->FileName, Fcb->ObjectName, Length);
/* Convert file times */
- CdfsDateTimeToFileTime(Fcb,
- &Info->CreationTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->LastAccessTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->LastWriteTime);
- CdfsDateTimeToFileTime(Fcb,
- &Info->ChangeTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->CreationTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->LastAccessTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->LastWriteTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->ChangeTime);
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fcb.c,v 1.19 2004/09/14 21:46:39 ekohl Exp $
+/* $Id: fcb.c,v 1.20 2004/11/06 13:41:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
GENERATE_NAME_CONTEXT NameContext;
- assert(DeviceExt);
- assert(DirectoryFcb);
- assert(FileToFind);
+ ASSERT(DeviceExt);
+ ASSERT(DirectoryFcb);
+ ASSERT(FileToFind);
DPRINT("CdfsDirFindFile(VCB:%p, dirFCB:%p, File:%wZ)\n",
DeviceExt,
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: finfo.c,v 1.11 2004/05/23 15:49:56 hbirr Exp $
+/* $Id: finfo.c,v 1.12 2004/11/06 13:41:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
return STATUS_BUFFER_OVERFLOW;
/* PRECONDITION */
- assert(StandardInfo != NULL);
- assert(Fcb != NULL);
+ ASSERT(StandardInfo != NULL);
+ ASSERT(Fcb != NULL);
RtlZeroMemory(StandardInfo,
sizeof(FILE_STANDARD_INFORMATION));
if (*BufferLength < sizeof(FILE_BASIC_INFORMATION))
return STATUS_BUFFER_OVERFLOW;
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&BasicInfo->CreationTime);
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&BasicInfo->LastAccessTime);
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&BasicInfo->LastWriteTime);
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&BasicInfo->ChangeTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &BasicInfo->CreationTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &BasicInfo->LastAccessTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &BasicInfo->LastWriteTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &BasicInfo->ChangeTime);
CdfsFileFlagsToAttributes(Fcb,
&BasicInfo->FileAttributes);
DPRINT("CdfsGetNameInformation() called\n");
- assert(NameInfo != NULL);
- assert(Fcb != NULL);
+ ASSERT(NameInfo != NULL);
+ ASSERT(Fcb != NULL);
NameLength = wcslen(Fcb->PathName) * sizeof(WCHAR);
if (*BufferLength < sizeof(FILE_NAME_INFORMATION) + NameLength)
{
DPRINT("CdfsGetInternalInformation() called\n");
- assert(InternalInfo);
- assert(Fcb);
+ ASSERT(InternalInfo);
+ ASSERT(Fcb);
if (*BufferLength < sizeof(FILE_INTERNAL_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
PFILE_NETWORK_OPEN_INFORMATION NetworkInfo,
PULONG BufferLength)
{
- assert(NetworkInfo);
- assert(Fcb);
+ ASSERT(NetworkInfo);
+ ASSERT(Fcb);
if (*BufferLength < sizeof(FILE_NETWORK_OPEN_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
- CdfsDateTimeToFileTime(Fcb,
- &NetworkInfo->CreationTime);
- CdfsDateTimeToFileTime(Fcb,
- &NetworkInfo->LastAccessTime);
- CdfsDateTimeToFileTime(Fcb,
- &NetworkInfo->LastWriteTime);
- CdfsDateTimeToFileTime(Fcb,
- &NetworkInfo->ChangeTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &NetworkInfo->CreationTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &NetworkInfo->LastAccessTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &NetworkInfo->LastWriteTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &NetworkInfo->ChangeTime);
if (CdfsFCBIsDirectory(Fcb))
{
NetworkInfo->AllocationSize.QuadPart = 0LL;;
{
ULONG NameLength;
- assert(Info);
- assert(Fcb);
+ ASSERT(Info);
+ ASSERT(Fcb);
NameLength = wcslen(Fcb->PathName) * sizeof(WCHAR);
if (*BufferLength < sizeof(FILE_ALL_INFORMATION) + NameLength)
return(STATUS_BUFFER_OVERFLOW);
/* Basic Information */
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&Info->BasicInformation.CreationTime);
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&Info->BasicInformation.LastAccessTime);
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&Info->BasicInformation.LastWriteTime);
- CdfsDateTimeToFileTime(Fcb,
- (TIME *)&Info->BasicInformation.ChangeTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->BasicInformation.CreationTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->BasicInformation.LastAccessTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->BasicInformation.LastWriteTime);
+ CdfsDateTimeToSystemTime(Fcb,
+ &Info->BasicInformation.ChangeTime);
CdfsFileFlagsToAttributes(Fcb,
&Info->BasicInformation.FileAttributes);
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: misc.c,v 1.8 2004/09/14 21:46:39 ekohl Exp $
+/* $Id: misc.c,v 1.9 2004/11/06 13:41:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
VOID
-CdfsDateTimeToFileTime(PFCB Fcb,
- TIME *FileTime)
+CdfsDateTimeToSystemTime(PFCB Fcb,
+ PLARGE_INTEGER SystemTime)
{
TIME_FIELDS TimeFields;
+ LARGE_INTEGER LocalTime;
TimeFields.Milliseconds = 0;
TimeFields.Second = Fcb->Entry.Second;
TimeFields.Year = Fcb->Entry.Year + 1900;
RtlTimeFieldsToTime(&TimeFields,
- (PLARGE_INTEGER)FileTime);
+ &LocalTime);
+ ExLocalTimeToSystemTime(&LocalTime, SystemTime);
}
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: create.c,v 1.74 2004/08/31 16:08:37 navaraf Exp $
+/* $Id: create.c,v 1.75 2004/11/06 13:44:56 ekohl Exp $
*
* PROJECT: ReactOS kernel
* FILE: drivers/fs/vfat/create.c
*/
{
NTSTATUS Status;
-
- assert (IrpContext);
-
+
+ ASSERT(IrpContext);
+
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
{
/* DeviceObject represents FileSystem instead of logical volume */
VfatFreeIrpContext(IrpContext);
return(STATUS_SUCCESS);
}
-
+
if (!(IrpContext->Flags & IRPCONTEXT_CANWAIT))
{
return(VfatQueueRequest (IrpContext));
}
-
+
IrpContext->Irp->IoStatus.Information = 0;
ExAcquireResourceExclusiveLite (&IrpContext->DeviceExt->DirResource, TRUE);
Status = VfatCreateFile (IrpContext->DeviceObject, IrpContext->Irp);
/*
- * $Id: dir.c,v 1.34 2004/05/23 13:34:32 hbirr Exp $
+ * $Id: dir.c,v 1.35 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
// function like DosDateTimeToFileTime
-BOOL FsdDosDateTimeToFileTime (WORD wDosDate, WORD wDosTime, TIME * FileTime)
+BOOL
+FsdDosDateTimeToSystemTime (WORD wDosDate, WORD wDosTime, PLARGE_INTEGER SystemTime)
{
PDOSTIME pdtime = (PDOSTIME) & wDosTime;
PDOSDATE pddate = (PDOSDATE) & wDosDate;
TIME_FIELDS TimeFields;
+ LARGE_INTEGER LocalTime;
- if (FileTime == NULL)
+ if (SystemTime == NULL)
return FALSE;
TimeFields.Milliseconds = 0;
TimeFields.Month = pddate->Month;
TimeFields.Year = 1980 + pddate->Year;
- RtlTimeFieldsToTime (&TimeFields, (PLARGE_INTEGER) FileTime);
+ RtlTimeFieldsToTime (&TimeFields, &LocalTime);
+ ExLocalTimeToSystemTime(&LocalTime, SystemTime);
return TRUE;
}
// function like FileTimeToDosDateTime
BOOL
-FsdFileTimeToDosDateTime (TIME * FileTime, WORD * pwDosDate, WORD * pwDosTime)
+FsdSystemTimeToDosDateTime (PLARGE_INTEGER SystemTime, WORD * pwDosDate, WORD * pwDosTime)
{
PDOSTIME pdtime = (PDOSTIME) pwDosTime;
PDOSDATE pddate = (PDOSDATE) pwDosDate;
TIME_FIELDS TimeFields;
+ LARGE_INTEGER LocalTime;
- if (FileTime == NULL)
+ if (SystemTime == NULL)
return FALSE;
- RtlTimeToTimeFields ((PLARGE_INTEGER) FileTime, &TimeFields);
+ ExSystemTimeToLocalTime (SystemTime, &LocalTime);
+ RtlTimeToTimeFields (&LocalTime, &TimeFields);
if (pdtime)
{
DWORD_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
memcpy (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
// pInfo->FileIndex=;
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.CreationDate,
- DirContext->FatDirEntry.CreationTime, &pInfo->CreationTime);
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.AccessDate, 0,
- &pInfo->LastAccessTime);
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate,
- DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.CreationDate,
+ DirContext->FatDirEntry.CreationTime,
+ &pInfo->CreationTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.AccessDate, 0,
+ &pInfo->LastAccessTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.UpdateDate,
+ DirContext->FatDirEntry.UpdateTime,
+ &pInfo->LastWriteTime);
pInfo->ChangeTime = pInfo->LastWriteTime;
if (DirContext->FatDirEntry.Attrib & FILE_ATTRIBUTE_DIRECTORY)
{
DWORD_ROUND_UP (sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
memcpy (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
// pInfo->FileIndex=;
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.CreationDate,
- DirContext->FatDirEntry.CreationTime, &pInfo->CreationTime);
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.AccessDate,
- 0, &pInfo->LastAccessTime);
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate,
- DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.CreationDate,
+ DirContext->FatDirEntry.CreationTime,
+ &pInfo->CreationTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.AccessDate,
+ 0, &pInfo->LastAccessTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.UpdateDate,
+ DirContext->FatDirEntry.UpdateTime,
+ &pInfo->LastWriteTime);
pInfo->ChangeTime = pInfo->LastWriteTime;
pInfo->EndOfFile.u.HighPart = 0;
pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
pInfo->ShortNameLength = DirContext->ShortNameU.Length;
memcpy (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
// pInfo->FileIndex=;
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.CreationDate,
- DirContext->FatDirEntry.CreationDate, &pInfo->CreationTime);
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.AccessDate, 0,
- &pInfo->LastAccessTime);
- FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate,
- DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.CreationDate,
+ DirContext->FatDirEntry.CreationDate,
+ &pInfo->CreationTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.AccessDate, 0,
+ &pInfo->LastAccessTime);
+ FsdDosDateTimeToSystemTime (DirContext->FatDirEntry.UpdateDate,
+ DirContext->FatDirEntry.UpdateTime,
+ &pInfo->LastWriteTime);
pInfo->ChangeTime = pInfo->LastWriteTime;
if (DirContext->FatDirEntry.Attrib & FILE_ATTRIBUTE_DIRECTORY)
{
-/* $Id: dirwr.c,v 1.41 2004/08/05 02:48:18 navaraf Exp $
+/* $Id: dirwr.c,v 1.42 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
PFAT_DIR_ENTRY PinEntry;
LARGE_INTEGER Offset;
- assert (pFcb);
- assert (pFcb->parentFcb);
+ ASSERT(pFcb);
+ ASSERT(pFcb->parentFcb);
DPRINT ("updEntry PathName \'%wZ\'\n", &pFcb->PathNameU);
BOOLEAN lCaseBase = FALSE, uCaseBase, lCaseExt = FALSE, uCaseExt;
PVFATFCB newFCB;
ULONG CurrentCluster;
- LARGE_INTEGER SystemTime, LocalTime, FileOffset;
+ LARGE_INTEGER SystemTime, FileOffset;
NTSTATUS Status = STATUS_SUCCESS;
PVFATFCB pDirFcb;
ULONG size;
}
/* set dates and times */
KeQuerySystemTime (&SystemTime);
- ExSystemTimeToLocalTime (&SystemTime, &LocalTime);
#if 0
{
TIME_FIELDS tf;
- RtlTimeToTimeFields (&LocalTime, &tf);
+ RtlTimeToTimeFields (&SystemTime, &tf);
DPRINT1("%d.%d.%d %02d:%02d:%02d.%03d '%S'\n",
tf.Day, tf.Month, tf.Year, tf.Hour,
tf.Minute, tf.Second, tf.Milliseconds,
pFileObject->FileName.Buffer);
}
#endif
- FsdFileTimeToDosDateTime ((TIME *) & LocalTime, &DirContext.FatDirEntry.CreationDate,
- &DirContext.FatDirEntry.CreationTime);
+ FsdSystemTimeToDosDateTime (&SystemTime, &DirContext.FatDirEntry.CreationDate,
+ &DirContext.FatDirEntry.CreationTime);
DirContext.FatDirEntry.UpdateDate = DirContext.FatDirEntry.CreationDate;
DirContext.FatDirEntry.UpdateTime = DirContext.FatDirEntry.CreationTime;
DirContext.FatDirEntry.AccessDate = DirContext.FatDirEntry.CreationDate;
LARGE_INTEGER Offset;
FATDirEntry* pDirEntry;
- assert (pFcb);
- assert (pFcb->parentFcb);
+ ASSERT(pFcb);
+ ASSERT(pFcb->parentFcb);
DPRINT ("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU);
DPRINT ("delete entry: %d to %d\n", pFcb->startIndex, pFcb->dirIndex);
{
CcSetDirtyPinnedData(Context, NULL);
CcUnpinData(Context);
- }
+ }
Offset.u.LowPart = (i * sizeof(FATDirEntry) / PAGE_SIZE) * PAGE_SIZE;
CcMapData (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
&Context, (PVOID*)&pDirEntry);
- }
+ }
pDirEntry[i % (PAGE_SIZE / sizeof(FATDirEntry))].Filename[0] = 0xe5;
if (i == pFcb->dirIndex)
{
-/* $Id: fcb.c,v 1.41 2004/08/28 22:19:12 navaraf Exp $
+/* $Id: fcb.c,v 1.42 2004/11/06 13:44:57 ekohl Exp $
*
*
* FILE: drivers/fs/vfat/fcb.c
{
pName--;
}
- assert(*pName == L'\\');
+ ASSERT(*pName == L'\\');
FileNameU->Buffer = pName + 1;
DirNameU->Length = (FileNameU->Buffer - PathNameU->Buffer) * sizeof(WCHAR);
DirNameU->MaximumLength = DirNameU->Length;
BOOLEAN FoundLong = FALSE;
BOOLEAN FoundShort = FALSE;
- assert (pDeviceExt);
- assert (pDirectoryFCB);
- assert (FileToFindU);
+ ASSERT(pDeviceExt);
+ ASSERT(pDirectoryFCB);
+ ASSERT(FileToFindU);
DPRINT ("vfatDirFindFile(VCB:%08x, dirFCB:%08x, File:%wZ)\n",
pDeviceExt,
-/* $Id: finfo.c,v 1.37 2004/08/28 22:19:12 navaraf Exp $
+/* $Id: finfo.c,v 1.38 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
return STATUS_BUFFER_OVERFLOW;
/* PRECONDITION */
- assert (StandardInfo != NULL);
- assert (FCB != NULL);
+ ASSERT(StandardInfo != NULL);
+ ASSERT(FCB != NULL);
if (vfatFCBIsDirectory(FCB))
{
DPRINT ("PositionInfo %x\n", PositionInfo);
DPRINT ("Setting position %d\n", PositionInfo->CurrentByteOffset.u.LowPart);
- memcpy (&FileObject->CurrentByteOffset, &PositionInfo->CurrentByteOffset,
- sizeof (LARGE_INTEGER));
+
+ FileObject->CurrentByteOffset.QuadPart =
+ PositionInfo->CurrentByteOffset.QuadPart;
return (STATUS_SUCCESS);
}
{
DPRINT("VfatSetBasicInformation()\n");
- assert (NULL != FileObject);
- assert (NULL != FCB);
- assert (NULL != DeviceExt);
- assert (NULL != BasicInfo);
+ ASSERT(NULL != FileObject);
+ ASSERT(NULL != FCB);
+ ASSERT(NULL != DeviceExt);
+ ASSERT(NULL != BasicInfo);
/* Check volume label bit */
- assert(0 == (FCB->entry.Attrib & 0x08));
-
- FsdFileTimeToDosDateTime((TIME *)&(BasicInfo->CreationTime),
- &(FCB->entry.CreationDate),
- &(FCB->entry.CreationTime));
- FsdFileTimeToDosDateTime((TIME *)&(BasicInfo->LastAccessTime),
- &(FCB->entry.AccessDate),
- NULL);
- FsdFileTimeToDosDateTime((TIME *)&(BasicInfo->LastWriteTime),
- &(FCB->entry.UpdateDate),
- &(FCB->entry.UpdateTime));
+ ASSERT(0 == (FCB->entry.Attrib & 0x08));
+
+ FsdSystemTimeToDosDateTime(&BasicInfo->CreationTime,
+ &FCB->entry.CreationDate,
+ &FCB->entry.CreationTime);
+ FsdSystemTimeToDosDateTime(&BasicInfo->LastAccessTime,
+ &FCB->entry.AccessDate,
+ NULL);
+ FsdSystemTimeToDosDateTime(&BasicInfo->LastWriteTime,
+ &FCB->entry.UpdateDate,
+ &FCB->entry.UpdateTime);
FCB->entry.Attrib = (unsigned char)((FCB->entry.Attrib &
(FILE_ATTRIBUTE_DIRECTORY | 0x48)) |
if (*BufferLength < sizeof(FILE_BASIC_INFORMATION))
return STATUS_BUFFER_OVERFLOW;
- FsdDosDateTimeToFileTime(FCB->entry.CreationDate,
- FCB->entry.CreationTime,
- (TIME *)&BasicInfo->CreationTime);
- FsdDosDateTimeToFileTime(FCB->entry.AccessDate,
- 0,
- (TIME *)&BasicInfo->LastAccessTime);
- FsdDosDateTimeToFileTime(FCB->entry.UpdateDate,
- FCB->entry.UpdateTime,
- (TIME *)&BasicInfo->LastWriteTime);
+ FsdDosDateTimeToSystemTime(FCB->entry.CreationDate,
+ FCB->entry.CreationTime,
+ &BasicInfo->CreationTime);
+ FsdDosDateTimeToSystemTime(FCB->entry.AccessDate,
+ 0,
+ &BasicInfo->LastAccessTime);
+ FsdDosDateTimeToSystemTime(FCB->entry.UpdateDate,
+ FCB->entry.UpdateTime,
+ &BasicInfo->LastWriteTime);
BasicInfo->ChangeTime = BasicInfo->LastWriteTime;
BasicInfo->FileAttributes = FCB->entry.Attrib & 0x3f;
DPRINT ("FsdSetDispositionInformation()\n");
- assert (DeviceExt != NULL);
- assert (DeviceExt->FatInfo.BytesPerCluster != 0);
- assert (FCB != NULL);
+ ASSERT(DeviceExt != NULL);
+ ASSERT(DeviceExt->FatInfo.BytesPerCluster != 0);
+ ASSERT(FCB != NULL);
if (FCB->entry.Attrib & FILE_ATTRIBUTE_READONLY)
{
* FUNCTION: Retrieve the file name information
*/
{
-
- assert (NameInfo != NULL);
- assert (FCB != NULL);
+ ASSERT(NameInfo != NULL);
+ ASSERT(FCB != NULL);
if (*BufferLength < sizeof(FILE_NAME_INFORMATION) + FCB->PathNameU.Length + sizeof(WCHAR))
return STATUS_BUFFER_OVERFLOW;
PFILE_INTERNAL_INFORMATION InternalInfo,
PULONG BufferLength)
{
- assert (InternalInfo);
- assert (Fcb);
+ ASSERT(InternalInfo);
+ ASSERT(Fcb);
if (*BufferLength < sizeof(FILE_INTERNAL_INFORMATION))
return STATUS_BUFFER_OVERFLOW;
* FUNCTION: Retrieve the file network open information
*/
{
- assert (NetworkInfo);
- assert (Fcb);
+ ASSERT(NetworkInfo);
+ ASSERT(Fcb);
if (*BufferLength < sizeof(FILE_NETWORK_OPEN_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
- FsdDosDateTimeToFileTime(Fcb->entry.CreationDate,
- Fcb->entry.CreationTime,
- &NetworkInfo->CreationTime);
- FsdDosDateTimeToFileTime(Fcb->entry.AccessDate,
- 0,
- &NetworkInfo->LastAccessTime);
- FsdDosDateTimeToFileTime(Fcb->entry.UpdateDate,
- Fcb->entry.UpdateTime,
- &NetworkInfo->LastWriteTime);
- NetworkInfo->ChangeTime = NetworkInfo->LastWriteTime;
+ FsdDosDateTimeToSystemTime(Fcb->entry.CreationDate,
+ Fcb->entry.CreationTime,
+ &NetworkInfo->CreationTime);
+ FsdDosDateTimeToSystemTime(Fcb->entry.AccessDate,
+ 0,
+ &NetworkInfo->LastAccessTime);
+ FsdDosDateTimeToSystemTime(Fcb->entry.UpdateDate,
+ Fcb->entry.UpdateTime,
+ &NetworkInfo->LastWriteTime);
+ NetworkInfo->ChangeTime.QuadPart = NetworkInfo->LastWriteTime.QuadPart;
if (vfatFCBIsDirectory(Fcb))
{
NetworkInfo->EndOfFile.QuadPart = 0L;
* FUNCTION: Retrieve the all file information
*/
{
-
- assert (Info);
- assert (Fcb);
+ ASSERT(Info);
+ ASSERT(Fcb);
if (*BufferLength < sizeof(FILE_ALL_INFORMATION) + Fcb->PathNameU.Length + sizeof(WCHAR))
return(STATUS_BUFFER_OVERFLOW);
/* Basic Information */
- FsdDosDateTimeToFileTime(Fcb->entry.CreationDate,
- Fcb->entry.CreationTime,
- (TIME *)&Info->BasicInformation.CreationTime);
- FsdDosDateTimeToFileTime(Fcb->entry.AccessDate,
- 0,
- (TIME *)&Info->BasicInformation.LastAccessTime);
- FsdDosDateTimeToFileTime(Fcb->entry.UpdateDate,
- Fcb->entry.UpdateTime,
- (TIME *)&Info->BasicInformation.LastWriteTime);
- Info->BasicInformation.ChangeTime = Info->BasicInformation.LastWriteTime;
+ FsdDosDateTimeToSystemTime(Fcb->entry.CreationDate,
+ Fcb->entry.CreationTime,
+ &Info->BasicInformation.CreationTime);
+ FsdDosDateTimeToSystemTime(Fcb->entry.AccessDate,
+ 0,
+ &Info->BasicInformation.LastAccessTime);
+ FsdDosDateTimeToSystemTime(Fcb->entry.UpdateDate,
+ Fcb->entry.UpdateTime,
+ &Info->BasicInformation.LastWriteTime);
+ Info->BasicInformation.ChangeTime.QuadPart = Info->BasicInformation.LastWriteTime.QuadPart;
Info->BasicInformation.FileAttributes = Fcb->entry.Attrib & 0x3f;
/* Standard Information */
ULONG BufferLength;
/* PRECONDITION */
- assert (IrpContext);
+ ASSERT(IrpContext);
/* INITIALIZATION */
FileInformationClass = IrpContext->Stack->Parameters.QueryFile.FileInformationClass;
BOOL CanWait = IrpContext->Flags & IRPCONTEXT_CANWAIT;
/* PRECONDITION */
- assert(IrpContext);
+ ASSERT(IrpContext);
DPRINT("VfatSetInformation(IrpContext %x)\n", IrpContext);
-/* $Id: flush.c,v 1.5 2003/10/11 17:51:56 hbirr Exp $
+/* $Id: flush.c,v 1.6 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
}
Fcb = (PVFATFCB)IrpContext->FileObject->FsContext;
- assert(Fcb);
+ ASSERT(Fcb);
if (Fcb->Flags & FCB_IS_VOLUME)
{
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fsctl.c,v 1.35 2004/08/05 02:48:18 navaraf Exp $
+/* $Id: fsctl.c,v 1.36 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
DPRINT("VfatMount(IrpContext %x)\n", IrpContext);
- assert (IrpContext);
+ ASSERT(IrpContext);
if (IrpContext->DeviceObject != VfatGlobalData->DeviceObject)
{
DPRINT("VfatFileSystemControl(IrpContext %x)\n", IrpContext);
- assert (IrpContext);
- assert (IrpContext->Irp);
- assert (IrpContext->Stack);
+ ASSERT(IrpContext);
+ ASSERT(IrpContext->Irp);
+ ASSERT(IrpContext->Stack);
IrpContext->Irp->IoStatus.Information = 0;
-/* $Id: misc.c,v 1.13 2004/05/15 23:00:02 hbirr Exp $
+/* $Id: misc.c,v 1.14 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
NTSTATUS Status;
DPRINT("VfatLockControl(IrpContext %x)\n", IrpContext);
-
- assert(IrpContext);
+
+ ASSERT(IrpContext);
Fcb = (PVFATFCB)IrpContext->FileObject->FsContext;
{
DPRINT ("VfatDispatchRequest (IrpContext %x), MajorFunction %x\n", IrpContext, IrpContext->MajorFunction);
- assert (IrpContext);
+ ASSERT(IrpContext);
switch (IrpContext->MajorFunction)
{
DPRINT ("VfatBuildRequest (DeviceObject %x, Irp %x)\n", DeviceObject, Irp);
- assert (DeviceObject);
- assert (Irp);
+ ASSERT(DeviceObject);
+ ASSERT(Irp);
IrpContext = VfatAllocateIrpContext(DeviceObject, Irp);
if (IrpContext == NULL)
{
VOID VfatFreeIrpContext (PVFAT_IRP_CONTEXT IrpContext)
{
- assert (IrpContext);
+ ASSERT(IrpContext);
ExFreeToNPagedLookasideList(&VfatGlobalData->IrpContextLookasideList, IrpContext);
}
UCHAR MajorFunction;
DPRINT ("VfatAllocateIrpContext(DeviceObject %x, Irp %x)\n", DeviceObject, Irp);
- assert (DeviceObject);
- assert (Irp);
+ ASSERT(DeviceObject);
+ ASSERT(Irp);
IrpContext = ExAllocateFromNPagedLookasideList(&VfatGlobalData->IrpContextLookasideList);
if (IrpContext)
IrpContext->DeviceObject = DeviceObject;
IrpContext->DeviceExt = DeviceObject->DeviceExtension;
IrpContext->Stack = IoGetCurrentIrpStackLocation(Irp);
- assert (IrpContext->Stack);
+ ASSERT(IrpContext->Stack);
MajorFunction = IrpContext->MajorFunction = IrpContext->Stack->MajorFunction;
IrpContext->MinorFunction = IrpContext->Stack->MinorFunction;
IrpContext->FileObject = IrpContext->Stack->FileObject;
InterlockedIncrement(&QueueCount);
DPRINT ("VfatQueueRequest (IrpContext %x), %d\n", IrpContext, QueueCount);
- assert (IrpContext != NULL);
- assert (IrpContext->Irp != NULL);
+ ASSERT(IrpContext != NULL);
+ ASSERT(IrpContext->Irp != NULL);
IrpContext->Flags |= IRPCONTEXT_CANWAIT;
IoMarkIrpPending (IrpContext->Irp);
PVOID VfatGetUserBuffer(IN PIRP Irp)
{
- assert(Irp);
+ ASSERT(Irp);
if (Irp->MdlAddress)
{
NTSTATUS VfatLockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
{
- assert(Irp);
+ ASSERT(Irp);
if (Irp->MdlAddress)
{
-/* $Id: rw.c,v 1.70 2004/09/28 10:52:55 ekohl Exp $
+/* $Id: rw.c,v 1.71 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
ULONG LastOffset;
/* PRECONDITION */
- assert (IrpContext);
+ ASSERT(IrpContext);
DeviceExt = IrpContext->DeviceExt;
- assert (DeviceExt);
- assert (DeviceExt->FatInfo.BytesPerCluster);
- assert (IrpContext->FileObject);
- assert (IrpContext->FileObject->FsContext2 != NULL);
+ ASSERT(DeviceExt);
+ ASSERT(DeviceExt->FatInfo.BytesPerCluster);
+ ASSERT(IrpContext->FileObject);
+ ASSERT(IrpContext->FileObject->FsContext2 != NULL);
DPRINT("VfatReadFileData(DeviceExt %x, FileObject %x, "
"Length %d, ReadOffset 0x%I64x)\n", DeviceExt,
BytesPerSector = DeviceExt->FatInfo.BytesPerSector;
BytesPerCluster = DeviceExt->FatInfo.BytesPerCluster;
- assert(ReadOffset.QuadPart + Length <= ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector));
- assert(ReadOffset.u.LowPart % BytesPerSector == 0);
- assert(Length % BytesPerSector == 0);
+ ASSERT(ReadOffset.QuadPart + Length <= ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector));
+ ASSERT(ReadOffset.u.LowPart % BytesPerSector == 0);
+ ASSERT(Length % BytesPerSector == 0);
/* Is this a read of the FAT? */
if (Fcb->Flags & FCB_IS_FAT)
ULONG LastOffset;
/* PRECONDITION */
- assert (IrpContext);
+ ASSERT(IrpContext);
DeviceExt = IrpContext->DeviceExt;
- assert (DeviceExt);
- assert (DeviceExt->FatInfo.BytesPerCluster);
- assert (IrpContext->FileObject);
- assert (IrpContext->FileObject->FsContext2 != NULL);
+ ASSERT(DeviceExt);
+ ASSERT(DeviceExt->FatInfo.BytesPerCluster);
+ ASSERT(IrpContext->FileObject);
+ ASSERT(IrpContext->FileObject->FsContext2 != NULL);
Ccb = (PVFATCCB)IrpContext->FileObject->FsContext2;
Fcb = IrpContext->FileObject->FsContext;
IrpContext->FileObject, Length, WriteOffset,
&Fcb->PathNameU);
- assert(WriteOffset.QuadPart + Length <= Fcb->RFCB.AllocationSize.QuadPart);
- assert(WriteOffset.u.LowPart % BytesPerSector == 0);
- assert(Length % BytesPerSector == 0)
+ ASSERT(WriteOffset.QuadPart + Length <= Fcb->RFCB.AllocationSize.QuadPart);
+ ASSERT(WriteOffset.u.LowPart % BytesPerSector == 0);
+ ASSERT(Length % BytesPerSector == 0)
// Is this a write of the volume ?
if (Fcb->Flags & FCB_IS_VOLUME)
if (FirstCluster == 1)
{
- assert(WriteOffset.u.LowPart + Length <= DeviceExt->FatInfo.rootDirectorySectors * BytesPerSector);
+ ASSERT(WriteOffset.u.LowPart + Length <= DeviceExt->FatInfo.rootDirectorySectors * BytesPerSector);
// Directory of FAT12/16 needs a special handling
WriteOffset.u.LowPart += DeviceExt->FatInfo.rootStart * BytesPerSector;
// Fire up the write command
PDEVICE_OBJECT DeviceToVerify;
ULONG BytesPerSector;
- assert(IrpContext);
+ ASSERT(IrpContext);
DPRINT("VfatRead(IrpContext %x)\n", IrpContext);
- assert(IrpContext->DeviceObject);
+ ASSERT(IrpContext->DeviceObject);
// This request is not allowed on the main device object
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
goto ByeBye;
}
- assert(IrpContext->DeviceExt);
- assert(IrpContext->FileObject);
+ ASSERT(IrpContext->DeviceExt);
+ ASSERT(IrpContext->FileObject);
Fcb = IrpContext->FileObject->FsContext;
- assert(Fcb);
+ ASSERT(Fcb);
DPRINT("<%wZ>\n", &Fcb->PathNameU);
PVOID Buffer;
ULONG BytesPerSector;
- assert (IrpContext);
+ ASSERT(IrpContext);
DPRINT("VfatWrite(IrpContext %x)\n", IrpContext);
- assert(IrpContext->DeviceObject);
+ ASSERT(IrpContext->DeviceObject);
// This request is not allowed on the main device object
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
goto ByeBye;
}
- assert(IrpContext->DeviceExt);
- assert(IrpContext->FileObject);
+ ASSERT(IrpContext->DeviceExt);
+ ASSERT(IrpContext->FileObject);
Fcb = IrpContext->FileObject->FsContext;
- assert(Fcb);
+ ASSERT(Fcb);
DPRINT("<%wZ>\n", &Fcb->PathNameU);
{
if(!(Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY))
{
- LARGE_INTEGER SystemTime, LocalTime;
+ LARGE_INTEGER SystemTime;
// set dates and times
KeQuerySystemTime (&SystemTime);
- ExSystemTimeToLocalTime (&SystemTime, &LocalTime);
- FsdFileTimeToDosDateTime ((TIME*)&LocalTime, &Fcb->entry.UpdateDate,
- &Fcb->entry.UpdateTime);
+ FsdSystemTimeToDosDateTime (&SystemTime, &Fcb->entry.UpdateDate,
+ &Fcb->entry.UpdateTime);
Fcb->entry.AccessDate = Fcb->entry.UpdateDate;
/* set date and times to dirty */
Fcb->Flags |= FCB_IS_DIRTY;
-/* $Id: vfat.h,v 1.68 2004/08/28 22:19:12 navaraf Exp $ */
+/* $Id: vfat.h,v 1.69 2004/11/06 13:44:57 ekohl Exp $ */
#include <ddk/ntifs.h>
NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT);
-BOOL FsdDosDateTimeToFileTime (WORD wDosDate,
- WORD wDosTime,
- TIME *FileTime);
+BOOL FsdDosDateTimeToSystemTime (WORD wDosDate,
+ WORD wDosTime,
+ PLARGE_INTEGER SystemTime);
-BOOL FsdFileTimeToDosDateTime (TIME *FileTime,
- WORD *pwDosDate,
- WORD *pwDosTime);
+BOOL FsdSystemTimeToDosDateTime (PLARGE_INTEGER SystemTime,
+ WORD *pwDosDate,
+ WORD *pwDosTime);
/* -------------------------------------------------------- create.c */
-/* $Id: volume.c,v 1.26 2004/08/01 21:57:18 navaraf Exp $
+/* $Id: volume.c,v 1.27 2004/11/06 13:44:57 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
ULONG BufferLength;
/* PRECONDITION */
- assert(IrpContext);
+ ASSERT(IrpContext);
DPRINT("VfatQueryVolumeInformation(IrpContext %x)\n", IrpContext);
PEXTENDED_IO_STACK_LOCATION Stack = (PEXTENDED_IO_STACK_LOCATION) IrpContext->Stack;
/* PRECONDITION */
- assert(IrpContext);
+ ASSERT(IrpContext);
DPRINT1("VfatSetVolumeInformation(IrpContext %x)\n", IrpContext);