[FASTFAT] Fix size checking in VfatGetFileNameInformation()
[reactos.git] / drivers / filesystems / fastfat / dir.c
index 284c04b..1e657f1 100644 (file)
@@ -101,17 +101,17 @@ VfatGetFileNameInformation(
     *Written = 0;
     Status = STATUS_BUFFER_OVERFLOW;
 
     *Written = 0;
     Status = STATUS_BUFFER_OVERFLOW;
 
-    if (FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName) > BufferLength)
+    if (FIELD_OFFSET(FILE_NAME_INFORMATION, FileName) > BufferLength)
         return Status;
 
         return Status;
 
-    if (First || (BufferLength >= FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName) + DirContext->LongNameU.Length))
+    if (First || (BufferLength >= FIELD_OFFSET(FILE_NAME_INFORMATION, FileName) + DirContext->LongNameU.Length))
     {
         pInfo->FileNameLength = DirContext->LongNameU.Length;
 
     {
         pInfo->FileNameLength = DirContext->LongNameU.Length;
 
-        *Written = FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName);
-        if (BufferLength > FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName))
+        *Written = FIELD_OFFSET(FILE_NAME_INFORMATION, FileName);
+        if (BufferLength > FIELD_OFFSET(FILE_NAME_INFORMATION, FileName))
         {
         {
-            BytesToCopy = min(DirContext->LongNameU.Length, BufferLength - FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName));
+            BytesToCopy = min(DirContext->LongNameU.Length, BufferLength - FIELD_OFFSET(FILE_NAME_INFORMATION, FileName));
             RtlCopyMemory(pInfo->FileName,
                          DirContext->LongNameU.Buffer,
                          BytesToCopy);
             RtlCopyMemory(pInfo->FileName,
                          DirContext->LongNameU.Buffer,
                          BytesToCopy);