* 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.14 2003/11/13 15:25:08 ekohl Exp $
+/* $Id: dirctl.c,v 1.15 2004/05/23 13:31:25 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
&Info->FileAttributes);
+ if (CdfsFCBIsDirectory(Fcb))
+ {
+ Info->EndOfFile.QuadPart = 0LL;
+ Info->AllocationSize.QuadPart = 0LL;
+ }
+ else
+ {
+ Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
- Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
-
- /* Make AllocSize a rounded up multiple of the sector size */
- Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+ /* Make AllocSize a rounded up multiple of the sector size */
+ Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+ }
// Info->FileIndex=;
CdfsFileFlagsToAttributes(Fcb,
&Info->FileAttributes);
- Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
+ if (CdfsFCBIsDirectory(Fcb))
+ {
+ Info->EndOfFile.QuadPart = 0LL;
+ Info->AllocationSize.QuadPart = 0LL;
+ }
+ else
+ {
+ Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
- /* Make AllocSize a rounded up multiple of the sector size */
- Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+ /* Make AllocSize a rounded up multiple of the sector size */
+ Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+ }
// Info->FileIndex=;
Info->EaSize = 0;
CdfsFileFlagsToAttributes(Fcb,
&Info->FileAttributes);
- Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
+ if (CdfsFCBIsDirectory(Fcb))
+ {
+ Info->EndOfFile.QuadPart = 0LL;
+ Info->AllocationSize.QuadPart = 0LL;
+ }
+ else
+ {
+ Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
- /* Make AllocSize a rounded up multiple of the sector size */
- Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+ /* Make AllocSize a rounded up multiple of the sector size */
+ Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+ }
// Info->FileIndex=;
Info->EaSize = 0;
* 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.9 2004/03/08 08:51:26 ekohl Exp $
+/* $Id: finfo.c,v 1.10 2004/05/23 13:31:25 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
RtlZeroMemory(StandardInfo,
sizeof(FILE_STANDARD_INFORMATION));
- StandardInfo->AllocationSize = Fcb->RFCB.AllocationSize;
- StandardInfo->EndOfFile = Fcb->RFCB.FileSize;
+ if (CdfsFCBIsDirectory(Fcb))
+ {
+ StandardInfo->AllocationSize.QuadPart = 0LL;;
+ StandardInfo->EndOfFile.QuadPart = 0LL;
+ StandardInfo->Directory = TRUE;
+ }
+ else
+ {
+ StandardInfo->AllocationSize = Fcb->RFCB.AllocationSize;
+ StandardInfo->EndOfFile = Fcb->RFCB.FileSize;
+ StandardInfo->Directory = TRUE;
+ }
StandardInfo->NumberOfLinks = 0;
StandardInfo->DeletePending = FALSE;
- StandardInfo->Directory = Fcb->Entry.FileFlags & 0x02 ? TRUE : FALSE;
*BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
return(STATUS_SUCCESS);
&NetworkInfo->LastWriteTime);
CdfsDateTimeToFileTime(Fcb,
&NetworkInfo->ChangeTime);
- NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
- NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
+ if (CdfsFCBIsDirectory(Fcb))
+ {
+ NetworkInfo->AllocationSize.QuadPart = 0LL;;
+ NetworkInfo->EndOfFile.QuadPart = 0LL;
+ }
+ else
+ {
+ NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
+ NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
+ }
CdfsFileFlagsToAttributes(Fcb,
&NetworkInfo->FileAttributes);
&Info->BasicInformation.FileAttributes);
/* Standard Information */
- Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
- Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+ if (CdfsFCBIsDirectory(Fcb))
+ {
+ Info->StandardInformation.AllocationSize.QuadPart = 0LL;
+ Info->StandardInformation.EndOfFile.QuadPart = 0LL;
+ Info->StandardInformation.Directory = TRUE;
+ }
+ else
+ {
+ Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
+ Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+ Info->StandardInformation.Directory = FALSE;
+ }
Info->StandardInformation.NumberOfLinks = 0;
Info->StandardInformation.DeletePending = FALSE;
- Info->StandardInformation.Directory = Fcb->Entry.FileFlags & FILE_FLAG_DIRECTORY ? TRUE : FALSE;
/* Internal Information */
Info->InternalInformation.IndexNumber.QuadPart = Fcb->IndexNumber.QuadPart;
/*
- * $Id: dir.c,v 1.33 2003/12/13 14:25:04 ekohl Exp $
+ * $Id: dir.c,v 1.34 2004/05/23 13:34:32 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate,
DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
pInfo->ChangeTime = pInfo->LastWriteTime;
- pInfo->EndOfFile.u.HighPart = 0;
- pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
- /* Make allocsize a rounded up multiple of BytesPerCluster */
- pInfo->AllocationSize.u.HighPart = 0;
- pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
- pInfo->FileAttributes = DirContext->FatDirEntry.Attrib;
+ if (DirContext->FatDirEntry.Attrib & FILE_ATTRIBUTE_DIRECTORY)
+ {
+ pInfo->EndOfFile.QuadPart = 0LL;
+ pInfo->AllocationSize.QuadPart = 0LL;
+ }
+ else
+ {
+ pInfo->EndOfFile.u.HighPart = 0;
+ pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
+ /* Make allocsize a rounded up multiple of BytesPerCluster */
+ pInfo->AllocationSize.u.HighPart = 0;
+ pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
+ }
+ pInfo->FileAttributes = DirContext->FatDirEntry.Attrib & 0x3f;
return STATUS_SUCCESS;
}
/* Make allocsize a rounded up multiple of BytesPerCluster */
pInfo->AllocationSize.u.HighPart = 0;
pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
- pInfo->FileAttributes = DirContext->FatDirEntry.Attrib;
+ pInfo->FileAttributes = DirContext->FatDirEntry.Attrib & 0x3f;
// pInfo->EaSize=;
return STATUS_SUCCESS;
}
FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate,
DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
pInfo->ChangeTime = pInfo->LastWriteTime;
- pInfo->EndOfFile.u.HighPart = 0;
- pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
- /* Make allocsize a rounded up multiple of BytesPerCluster */
- pInfo->AllocationSize.u.HighPart = 0;
- pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
- pInfo->FileAttributes = DirContext->FatDirEntry.Attrib;
-// pInfo->EaSize=;
+ if (DirContext->FatDirEntry.Attrib & FILE_ATTRIBUTE_DIRECTORY)
+ {
+ pInfo->EndOfFile.QuadPart = 0LL;
+ pInfo->AllocationSize.QuadPart = 0LL;
+ }
+ else
+ {
+ pInfo->EndOfFile.u.HighPart = 0;
+ pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
+ /* Make allocsize a rounded up multiple of BytesPerCluster */
+ pInfo->AllocationSize.u.HighPart = 0;
+ pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
+ }
+ pInfo->FileAttributes = DirContext->FatDirEntry.Attrib & 0x3f;
+ pInfo->EaSize=0;
return STATUS_SUCCESS;
}
-/* $Id: finfo.c,v 1.34 2003/10/11 17:51:56 hbirr Exp $
+/* $Id: finfo.c,v 1.35 2004/05/23 13:34:32 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
assert (StandardInfo != NULL);
assert (FCB != NULL);
- RtlZeroMemory(StandardInfo,
- sizeof(FILE_STANDARD_INFORMATION));
-
- StandardInfo->AllocationSize = FCB->RFCB.AllocationSize;
- StandardInfo->EndOfFile = FCB->RFCB.FileSize;
+ if (vfatFCBIsDirectory(FCB))
+ {
+ StandardInfo->AllocationSize.QuadPart = 0LL;
+ StandardInfo->EndOfFile.QuadPart = 0LL;
+ StandardInfo->Directory = TRUE;
+ }
+ else
+ {
+ StandardInfo->AllocationSize = FCB->RFCB.AllocationSize;
+ StandardInfo->EndOfFile = FCB->RFCB.FileSize;
+ StandardInfo->Directory = FALSE;
+ }
StandardInfo->NumberOfLinks = 0;
StandardInfo->DeletePending = FCB->Flags & FCB_DELETE_PENDING ? TRUE : FALSE;
- StandardInfo->Directory = FCB->entry.Attrib & 0x10 ? TRUE : FALSE;
*BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
return(STATUS_SUCCESS);
(TIME *)&BasicInfo->LastWriteTime);
BasicInfo->ChangeTime = BasicInfo->LastWriteTime;
- BasicInfo->FileAttributes = FCB->entry.Attrib;
+ BasicInfo->FileAttributes = FCB->entry.Attrib & 0x3f;
/* Synthesize FILE_ATTRIBUTE_NORMAL */
if (0 == (BasicInfo->FileAttributes & (FILE_ATTRIBUTE_DIRECTORY |
FILE_ATTRIBUTE_ARCHIVE |
Fcb->entry.UpdateTime,
&NetworkInfo->LastWriteTime);
NetworkInfo->ChangeTime = NetworkInfo->LastWriteTime;
- NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
- NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
- NetworkInfo->FileAttributes = Fcb->entry.Attrib;
+ if (vfatFCBIsDirectory(Fcb))
+ {
+ NetworkInfo->EndOfFile.QuadPart = 0L;
+ NetworkInfo->AllocationSize.QuadPart = 0L;
+ }
+ else
+ {
+ NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
+ NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
+ }
+ NetworkInfo->FileAttributes = Fcb->entry.Attrib & 0x3f;
*BufferLength -= sizeof(FILE_NETWORK_OPEN_INFORMATION);
return STATUS_SUCCESS;
Fcb->entry.UpdateTime,
(TIME *)&Info->BasicInformation.LastWriteTime);
Info->BasicInformation.ChangeTime = Info->BasicInformation.LastWriteTime;
- Info->BasicInformation.FileAttributes = Fcb->entry.Attrib;
+ Info->BasicInformation.FileAttributes = Fcb->entry.Attrib & 0x3f;
/* Standard Information */
- Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
- Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+ if (vfatFCBIsDirectory(Fcb))
+ {
+ Info->StandardInformation.AllocationSize.QuadPart = 0LL;
+ Info->StandardInformation.EndOfFile.QuadPart = 0LL;
+ Info->StandardInformation.Directory = TRUE;
+ }
+ else
+ {
+ Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
+ Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+ Info->StandardInformation.Directory = FALSE;
+ }
Info->StandardInformation.NumberOfLinks = 0;
Info->StandardInformation.DeletePending = Fcb->Flags & FCB_DELETE_PENDING ? TRUE : FALSE;
- Info->StandardInformation.Directory = Fcb->entry.Attrib & 0x10 ? TRUE : FALSE;
/* Internal Information */
/* FIXME: get a real index, that can be used in a create operation */