[FREELDR] Improve some *GetFileInformation() traces.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 29 Jul 2019 22:57:22 +0000 (00:57 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 29 Jul 2019 22:57:22 +0000 (00:57 +0200)
boot/freeldr/freeldr/arch/i386/hwdisk.c
boot/freeldr/freeldr/disk/ramdisk.c
boot/freeldr/freeldr/disk/scsiport.c
boot/freeldr/freeldr/lib/fs/btrfs.c
boot/freeldr/freeldr/lib/fs/ext2.c
boot/freeldr/freeldr/lib/fs/fat.c
boot/freeldr/freeldr/lib/fs/iso.c
boot/freeldr/freeldr/lib/fs/ntfs.c
boot/freeldr/freeldr/lib/fs/pxe.c

index bae615b..853d37f 100644 (file)
@@ -64,7 +64,7 @@ DiskGetFileInformation(ULONG FileId, FILEINFORMATION* Information)
 {
     DISKCONTEXT* Context = FsGetDeviceSpecific(FileId);
 
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.QuadPart = Context->SectorCount * Context->SectorSize;
     Information->CurrentAddress.QuadPart = Context->SectorNumber * Context->SectorSize;
 
index 4b2677a..b1a6f09 100644 (file)
@@ -34,7 +34,7 @@ static ARC_STATUS RamDiskGetFileInformation(ULONG FileId, FILEINFORMATION* Infor
     //
     // Give current seek offset and ram disk size to caller
     //
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.LowPart = gRamDiskSize;
     Information->CurrentAddress.LowPart = gRamDiskOffset;
 
index 0c0a0fa..8fc967d 100644 (file)
@@ -179,7 +179,7 @@ static ARC_STATUS DiskGetFileInformation(ULONG FileId, FILEINFORMATION* Informat
 {
     DISKCONTEXT* Context = FsGetDeviceSpecific(FileId);
 
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.QuadPart = Context->SectorCount * Context->SectorSize;
     Information->CurrentAddress.QuadPart = Context->SectorNumber * Context->SectorSize;
 
index f3a8619..1258454 100644 (file)
@@ -1123,16 +1123,12 @@ ARC_STATUS BtrFsGetFileInformation(ULONG FileId, FILEINFORMATION *Information)
 {
     pbtrfs_file_info phandle = FsGetDeviceSpecific(FileId);
 
-    TRACE("BtrFsGetFileInformation %lu\n", FileId);
-
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.QuadPart = phandle->inode.size;
     Information->CurrentAddress.QuadPart = phandle->position;
 
-    TRACE("BtrFsGetFileInformation() FileSize = %llu\n",
-          Information->EndingAddress.QuadPart);
-    TRACE("BtrFsGetFileInformation() FilePointer = %llu\n",
-          Information->CurrentAddress.QuadPart);
+    TRACE("BtrFsGetFileInformation(%lu) -> FileSize = %llu, FilePointer = 0x%llx\n",
+          FileId, Information->EndingAddress.QuadPart, Information->CurrentAddress.QuadPart);
 
     return ESUCCESS;
 }
index 3428bd4..30ec019 100644 (file)
@@ -1207,14 +1207,12 @@ ARC_STATUS Ext2GetFileInformation(ULONG FileId, FILEINFORMATION* Information)
 {
     PEXT2_FILE_INFO FileHandle = FsGetDeviceSpecific(FileId);
 
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.QuadPart = FileHandle->FileSize;
     Information->CurrentAddress.QuadPart = FileHandle->FilePointer;
 
-    TRACE("Ext2GetFileInformation() FileSize = %d\n",
-        Information->EndingAddress.LowPart);
-    TRACE("Ext2GetFileInformation() FilePointer = %d\n",
-        Information->CurrentAddress.LowPart);
+    TRACE("Ext2GetFileInformation(%lu) -> FileSize = %llu, FilePointer = 0x%llx\n",
+          FileId, Information->EndingAddress.QuadPart, Information->CurrentAddress.QuadPart);
 
     return ESUCCESS;
 }
index 6daa1a0..17f341c 100644 (file)
@@ -1411,14 +1411,12 @@ ARC_STATUS FatGetFileInformation(ULONG FileId, FILEINFORMATION* Information)
 {
     PFAT_FILE_INFO FileHandle = FsGetDeviceSpecific(FileId);
 
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.LowPart = FileHandle->FileSize;
     Information->CurrentAddress.LowPart = FileHandle->FilePointer;
 
-    TRACE("FatGetFileInformation() FileSize = %d\n",
-        Information->EndingAddress.LowPart);
-    TRACE("FatGetFileInformation() FilePointer = %d\n",
-        Information->CurrentAddress.LowPart);
+    TRACE("FatGetFileInformation(%lu) -> FileSize = %lu, FilePointer = 0x%lx\n",
+          FileId, Information->EndingAddress.LowPart, Information->CurrentAddress.LowPart);
 
     return ESUCCESS;
 }
index cc5a980..cdf0281 100644 (file)
@@ -253,13 +253,13 @@ ARC_STATUS IsoGetFileInformation(ULONG FileId, FILEINFORMATION* Information)
 {
     PISO_FILE_INFO FileHandle = FsGetDeviceSpecific(FileId);
 
-    TRACE("IsoGetFileInformation() FileSize = %d\n", FileHandle->FileSize);
-    TRACE("IsoGetFileInformation() FilePointer = %d\n", FileHandle->FilePointer);
-
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.LowPart = FileHandle->FileSize;
     Information->CurrentAddress.LowPart = FileHandle->FilePointer;
 
+    TRACE("IsoGetFileInformation(%lu) -> FileSize = %lu, FilePointer = 0x%lx\n",
+          FileId, Information->EndingAddress.LowPart, Information->CurrentAddress.LowPart);
+
     return ESUCCESS;
 }
 
index 5b0b510..359bebc 100644 (file)
@@ -766,14 +766,12 @@ ARC_STATUS NtfsGetFileInformation(ULONG FileId, FILEINFORMATION* Information)
 {
     PNTFS_FILE_HANDLE FileHandle = FsGetDeviceSpecific(FileId);
 
-    RtlZeroMemory(Information, sizeof(FILEINFORMATION));
+    RtlZeroMemory(Information, sizeof(*Information));
     Information->EndingAddress.QuadPart = NtfsGetAttributeSize(&FileHandle->DataContext->Record);
     Information->CurrentAddress.QuadPart = FileHandle->Offset;
 
-    TRACE("NtfsGetFileInformation() FileSize = %d\n",
-        Information->EndingAddress.LowPart);
-    TRACE("NtfsGetFileInformation() FilePointer = %d\n",
-        Information->CurrentAddress.LowPart);
+    TRACE("NtfsGetFileInformation(%lu) -> FileSize = %llu, FilePointer = 0x%llx\n",
+          FileId, Information->EndingAddress.QuadPart, Information->CurrentAddress.QuadPart);
 
     return ESUCCESS;
 }
index 4b5aac9..dedc315 100644 (file)
@@ -145,6 +145,9 @@ static ARC_STATUS PxeGetFileInformation(ULONG FileId, FILEINFORMATION* Informati
     Information->EndingAddress.LowPart = _FileSize;
     Information->CurrentAddress.LowPart = _FilePosition;
 
+    TRACE("PxeGetFileInformation(%lu) -> FileSize = %lu, FilePointer = 0x%lx\n",
+          FileId, Information->EndingAddress.LowPart, Information->CurrentAddress.LowPart);
+
     return ESUCCESS;
 }