Author: mbosma
Date: Mon May 15 23:50:43 2006
New Revision: 21914
URL:
http://svn.reactos.ru/svn/reactos?rev=21914&view=rev
Log:
Merge r21839
Modified:
branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/direntry.c
branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/finfo.c
branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/vfat.h
Modified: branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/direntry.c
URL:
http://svn.reactos.ru/svn/reactos/branches/cache_manager_rewrite/reactos/dr…
==============================================================================
--- branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/direntry.c (original)
+++ branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/direntry.c Mon May 15
23:50:43 2006
@@ -22,8 +22,8 @@
if (pDeviceExt->FatInfo.FatType == FAT32)
{
- cluster = pFatDirEntry->Fat.FirstCluster +
- pFatDirEntry->Fat.FirstClusterHigh * 65536;
+ cluster = pFatDirEntry->Fat.FirstCluster |
+ (pFatDirEntry->Fat.FirstClusterHigh << 16);
}
else if (pDeviceExt->Flags & VCB_IS_FATX)
{
Modified: branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/finfo.c
URL:
http://svn.reactos.ru/svn/reactos/branches/cache_manager_rewrite/reactos/dr…
==============================================================================
--- branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/finfo.c (original)
+++ branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/finfo.c Mon May 15
23:50:43 2006
@@ -4,7 +4,6 @@
* FILE: drivers/fs/vfat/finfo.c
* PURPOSE: VFAT Filesystem
* PROGRAMMER: Jason Filby (jasonfilby(a)yahoo.com)
- * Hartmut Birr
* Herve Poussineau (reactos(a)poussine.freesurf.fr)
*
*/
@@ -100,34 +99,6 @@
}
static NTSTATUS
-VfatGetAttributeTagInformation(PVFATFCB FCB,
- PFILE_ATTRIBUTE_TAG_INFORMATION AttributeTagInfo,
- PULONG BufferLength)
-{
- if (*BufferLength < sizeof(FILE_ATTRIBUTE_TAG_INFORMATION))
- return STATUS_BUFFER_OVERFLOW;
-
- /* PRECONDITION */
- ASSERT(AttributeTagInfo != NULL);
- ASSERT(FCB != NULL);
-
- AttributeTagInfo->FileAttributes = *FCB->Attributes & 0x3f;
- /* Synthesize FILE_ATTRIBUTE_NORMAL */
- if (0 == (AttributeTagInfo->FileAttributes & (FILE_ATTRIBUTE_DIRECTORY |
- FILE_ATTRIBUTE_ARCHIVE |
- FILE_ATTRIBUTE_SYSTEM |
- FILE_ATTRIBUTE_HIDDEN |
- FILE_ATTRIBUTE_READONLY)))
- {
- AttributeTagInfo->FileAttributes |= FILE_ATTRIBUTE_NORMAL;
- }
- AttributeTagInfo->ReparseTag = 0;
-
- *BufferLength -= sizeof(FILE_ATTRIBUTE_TAG_INFORMATION);
- return(STATUS_SUCCESS);
-}
-
-static NTSTATUS
VfatSetPositionInformation(PFILE_OBJECT FileObject,
PFILE_POSITION_INFORMATION PositionInfo)
{
@@ -470,6 +441,28 @@
*BufferLength -= sizeof(FILE_NETWORK_OPEN_INFORMATION);
return STATUS_SUCCESS;
+}
+
+
+static NTSTATUS
+VfatGetEaInformation(PFILE_OBJECT FileObject,
+ PVFATFCB Fcb,
+ PDEVICE_OBJECT DeviceObject,
+ PFILE_EA_INFORMATION Info,
+ PULONG BufferLength)
+{
+ PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
+
+ /* FIXME - use SEH to access the buffer! */
+ Info->EaSize = 0;
+ *BufferLength -= sizeof(*Info);
+ if (DeviceExt->FatInfo.FatType == FAT12 ||
+ DeviceExt->FatInfo.FatType == FAT16)
+ {
+ /* FIXME */
+ DPRINT1("VFAT: FileEaInformation not implemented!\n");
+ }
+ return STATUS_SUCCESS;
}
@@ -614,8 +607,16 @@
}
else
{
- Fcb->entry.Fat.FirstCluster = (unsigned short)(FirstCluster &
0x0000FFFF);
- Fcb->entry.Fat.FirstClusterHigh = (unsigned short)((FirstCluster &
0xFFFF0000) >> 16);
+ if (DeviceExt->FatInfo.FatType == FAT32)
+ {
+ Fcb->entry.Fat.FirstCluster = (unsigned short)(FirstCluster &
0x0000FFFF);
+ Fcb->entry.Fat.FirstClusterHigh = FirstCluster >> 16;
+ }
+ else
+ {
+ ASSERT((FirstCluster >> 16) == 0);
+ Fcb->entry.Fat.FirstCluster = (unsigned short)(FirstCluster &
0x0000FFFF);
+ }
}
}
else
@@ -699,8 +700,15 @@
}
else
{
- Fcb->entry.Fat.FirstCluster = 0;
- Fcb->entry.Fat.FirstClusterHigh = 0;
+ if (DeviceExt->FatInfo.FatType == FAT32)
+ {
+ Fcb->entry.Fat.FirstCluster = 0;
+ Fcb->entry.Fat.FirstClusterHigh = 0;
+ }
+ else
+ {
+ Fcb->entry.Fat.FirstCluster = 0;
+ }
}
NCluster = Cluster = FirstCluster;
@@ -809,10 +817,12 @@
&BufferLength);
break;
- case FileAttributeTagInformation:
- RC = VfatGetAttributeTagInformation(FCB,
- SystemBuffer,
- &BufferLength);
+ case FileEaInformation:
+ RC = VfatGetEaInformation(IrpContext->FileObject,
+ FCB,
+ IrpContext->DeviceObject,
+ SystemBuffer,
+ &BufferLength);
break;
case FileAlternateNameInformation:
@@ -901,7 +911,6 @@
SystemBuffer);
break;
case FileRenameInformation:
- case FileAttributeTagInformation:
RC = STATUS_NOT_IMPLEMENTED;
break;
default:
Modified: branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/vfat.h
URL:
http://svn.reactos.ru/svn/reactos/branches/cache_manager_rewrite/reactos/dr…
==============================================================================
--- branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/vfat.h (original)
+++ branches/cache_manager_rewrite/reactos/drivers/filesystems/vfat/vfat.h Mon May 15
23:50:43 2006
@@ -97,11 +97,50 @@
unsigned char lCase;
unsigned char CreationTimeMs;
unsigned short CreationTime,CreationDate,AccessDate;
- unsigned short FirstClusterHigh; // higher
+ union
+ {
+ unsigned short FirstClusterHigh; // FAT32
+ unsigned short ExtendedAttributes; // FAT12/FAT16
+ };
unsigned short UpdateTime; //time create/update
unsigned short UpdateDate; //date create/update
unsigned short FirstCluster;
unsigned long FileSize;
+};
+
+#define FAT_EAFILE "EA DATA. SF"
+
+typedef struct _EAFileHeader FAT_EA_FILE_HEADER, *PFAT_EA_FILE_HEADER;
+
+struct _EAFileHeader
+{
+ unsigned short Signature; // ED
+ unsigned short Unknown[15];
+ unsigned short EASetTable[240];
+};
+
+typedef struct _EASetHeader FAT_EA_SET_HEADER, *PFAT_EA_SET_HEADER;
+
+struct _EASetHeader
+{
+ unsigned short Signature; // EA
+ unsigned short Offset; // relative offset, same value as in the EASetTable
+ unsigned short Unknown1[2];
+ char TargetFileName[12];
+ unsigned short Unknown2[3];
+ unsigned int EALength;
+ // EA Header
+};
+
+typedef struct _EAHeader FAT_EA_HEADER, *PFAT_EA_HEADER;
+
+struct _EAHeader
+{
+ unsigned char Unknown;
+ unsigned char EANameLength;
+ unsigned short EAValueLength;
+ // Name Data
+ // Value Data
};
typedef struct _FATDirEntry FAT_DIR_ENTRY, *PFAT_DIR_ENTRY;