mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[FASTFAT]
Do not set file attributes in case they are set to 0 or -1 svn path=/trunk/; revision=50995
This commit is contained in:
parent
69b1f9091e
commit
ff0651e441
1 changed files with 57 additions and 32 deletions
|
@ -155,36 +155,60 @@ VfatSetBasicInformation(PFILE_OBJECT FileObject,
|
|||
ASSERT(0 == (*FCB->Attributes & _A_VOLID));
|
||||
|
||||
if (FCB->Flags & FCB_IS_FATX_ENTRY)
|
||||
{
|
||||
if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1)
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||
&BasicInfo->CreationTime,
|
||||
&FCB->entry.FatX.CreationDate,
|
||||
&FCB->entry.FatX.CreationTime);
|
||||
}
|
||||
|
||||
if (BasicInfo->LastAccessTime.QuadPart != 0 && BasicInfo->LastAccessTime.QuadPart != -1)
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||
&BasicInfo->LastAccessTime,
|
||||
&FCB->entry.FatX.AccessDate,
|
||||
&FCB->entry.FatX.AccessTime);
|
||||
}
|
||||
|
||||
if (BasicInfo->LastWriteTime.QuadPart != 0 && BasicInfo->LastWriteTime.QuadPart != -1)
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||
&BasicInfo->LastWriteTime,
|
||||
&FCB->entry.FatX.UpdateDate,
|
||||
&FCB->entry.FatX.UpdateTime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1)
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||
&BasicInfo->CreationTime,
|
||||
&FCB->entry.Fat.CreationDate,
|
||||
&FCB->entry.Fat.CreationTime);
|
||||
}
|
||||
|
||||
if (BasicInfo->LastAccessTime.QuadPart != 0 && BasicInfo->LastAccessTime.QuadPart != -1)
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||
&BasicInfo->LastAccessTime,
|
||||
&FCB->entry.Fat.AccessDate,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (BasicInfo->LastWriteTime.QuadPart != 0 && BasicInfo->LastWriteTime.QuadPart != -1)
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||
&BasicInfo->LastWriteTime,
|
||||
&FCB->entry.Fat.UpdateDate,
|
||||
&FCB->entry.Fat.UpdateTime);
|
||||
}
|
||||
}
|
||||
|
||||
if (BasicInfo->FileAttributes)
|
||||
{
|
||||
*FCB->Attributes = (unsigned char)((*FCB->Attributes &
|
||||
(FILE_ATTRIBUTE_DIRECTORY | 0x48)) |
|
||||
(BasicInfo->FileAttributes &
|
||||
|
@ -193,6 +217,7 @@ VfatSetBasicInformation(PFILE_OBJECT FileObject,
|
|||
FILE_ATTRIBUTE_HIDDEN |
|
||||
FILE_ATTRIBUTE_READONLY)));
|
||||
DPRINT("Setting attributes 0x%02x\n", *FCB->Attributes);
|
||||
}
|
||||
|
||||
VfatUpdateEntry(FCB);
|
||||
|
||||
|
|
Loading…
Reference in a new issue