mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 12:24:48 +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));
|
ASSERT(0 == (*FCB->Attributes & _A_VOLID));
|
||||||
|
|
||||||
if (FCB->Flags & FCB_IS_FATX_ENTRY)
|
if (FCB->Flags & FCB_IS_FATX_ENTRY)
|
||||||
|
{
|
||||||
|
if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1)
|
||||||
{
|
{
|
||||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||||
&BasicInfo->CreationTime,
|
&BasicInfo->CreationTime,
|
||||||
&FCB->entry.FatX.CreationDate,
|
&FCB->entry.FatX.CreationDate,
|
||||||
&FCB->entry.FatX.CreationTime);
|
&FCB->entry.FatX.CreationTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BasicInfo->LastAccessTime.QuadPart != 0 && BasicInfo->LastAccessTime.QuadPart != -1)
|
||||||
|
{
|
||||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||||
&BasicInfo->LastAccessTime,
|
&BasicInfo->LastAccessTime,
|
||||||
&FCB->entry.FatX.AccessDate,
|
&FCB->entry.FatX.AccessDate,
|
||||||
&FCB->entry.FatX.AccessTime);
|
&FCB->entry.FatX.AccessTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BasicInfo->LastWriteTime.QuadPart != 0 && BasicInfo->LastWriteTime.QuadPart != -1)
|
||||||
|
{
|
||||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||||
&BasicInfo->LastWriteTime,
|
&BasicInfo->LastWriteTime,
|
||||||
&FCB->entry.FatX.UpdateDate,
|
&FCB->entry.FatX.UpdateDate,
|
||||||
&FCB->entry.FatX.UpdateTime);
|
&FCB->entry.FatX.UpdateTime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1)
|
||||||
{
|
{
|
||||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||||
&BasicInfo->CreationTime,
|
&BasicInfo->CreationTime,
|
||||||
&FCB->entry.Fat.CreationDate,
|
&FCB->entry.Fat.CreationDate,
|
||||||
&FCB->entry.Fat.CreationTime);
|
&FCB->entry.Fat.CreationTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BasicInfo->LastAccessTime.QuadPart != 0 && BasicInfo->LastAccessTime.QuadPart != -1)
|
||||||
|
{
|
||||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||||
&BasicInfo->LastAccessTime,
|
&BasicInfo->LastAccessTime,
|
||||||
&FCB->entry.Fat.AccessDate,
|
&FCB->entry.Fat.AccessDate,
|
||||||
NULL);
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BasicInfo->LastWriteTime.QuadPart != 0 && BasicInfo->LastWriteTime.QuadPart != -1)
|
||||||
|
{
|
||||||
FsdSystemTimeToDosDateTime(DeviceExt,
|
FsdSystemTimeToDosDateTime(DeviceExt,
|
||||||
&BasicInfo->LastWriteTime,
|
&BasicInfo->LastWriteTime,
|
||||||
&FCB->entry.Fat.UpdateDate,
|
&FCB->entry.Fat.UpdateDate,
|
||||||
&FCB->entry.Fat.UpdateTime);
|
&FCB->entry.Fat.UpdateTime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BasicInfo->FileAttributes)
|
||||||
|
{
|
||||||
*FCB->Attributes = (unsigned char)((*FCB->Attributes &
|
*FCB->Attributes = (unsigned char)((*FCB->Attributes &
|
||||||
(FILE_ATTRIBUTE_DIRECTORY | 0x48)) |
|
(FILE_ATTRIBUTE_DIRECTORY | 0x48)) |
|
||||||
(BasicInfo->FileAttributes &
|
(BasicInfo->FileAttributes &
|
||||||
|
@ -193,6 +217,7 @@ VfatSetBasicInformation(PFILE_OBJECT FileObject,
|
||||||
FILE_ATTRIBUTE_HIDDEN |
|
FILE_ATTRIBUTE_HIDDEN |
|
||||||
FILE_ATTRIBUTE_READONLY)));
|
FILE_ATTRIBUTE_READONLY)));
|
||||||
DPRINT("Setting attributes 0x%02x\n", *FCB->Attributes);
|
DPRINT("Setting attributes 0x%02x\n", *FCB->Attributes);
|
||||||
|
}
|
||||||
|
|
||||||
VfatUpdateEntry(FCB);
|
VfatUpdateEntry(FCB);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue