https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4fe7aafe106c2f711058e…
commit 4fe7aafe106c2f711058ec15857f05e925fd662f
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Aug 19 09:55:03 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Aug 19 09:56:12 2018 +0200
[FASTFAT] Magic values--
---
drivers/filesystems/fastfat/dirwr.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/filesystems/fastfat/dirwr.c b/drivers/filesystems/fastfat/dirwr.c
index b4a2a94b59..ba791fbc60 100644
--- a/drivers/filesystems/fastfat/dirwr.c
+++ b/drivers/filesystems/fastfat/dirwr.c
@@ -806,9 +806,11 @@ FATAddEntry(
{
RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster);
/* create '.' and '..' */
- RtlCopyMemory(&pFatEntry[0].Attrib, &DirContext.DirEntry.Fat.Attrib,
sizeof(FAT_DIR_ENTRY) - 11);
+ RtlCopyMemory(&pFatEntry[0].Attrib, &DirContext.DirEntry.Fat.Attrib,
+ sizeof(FAT_DIR_ENTRY) - FIELD_OFFSET(FAT_DIR_ENTRY, Attrib));
RtlCopyMemory(pFatEntry[0].ShortName, ". ", 11);
- RtlCopyMemory(&pFatEntry[1].Attrib, &DirContext.DirEntry.Fat.Attrib,
sizeof(FAT_DIR_ENTRY) - 11);
+ RtlCopyMemory(&pFatEntry[1].Attrib, &DirContext.DirEntry.Fat.Attrib,
+ sizeof(FAT_DIR_ENTRY) - FIELD_OFFSET(FAT_DIR_ENTRY, Attrib));
RtlCopyMemory(pFatEntry[1].ShortName, ".. ", 11);
}