[ros-diffs] [ion] 20651: - Make NTFS compile on msvc.

ion at svn.reactos.org ion at svn.reactos.org
Sat Jan 7 07:21:28 CET 2006


- Make NTFS compile on msvc.
Modified: trunk/reactos/drivers/fs/ntfs/mft.c
Modified: trunk/reactos/drivers/fs/ntfs/ntfs.h
Modified: trunk/reactos/drivers/fs/ntfs/volinfo.c
  _____  

Modified: trunk/reactos/drivers/fs/ntfs/mft.c
--- trunk/reactos/drivers/fs/ntfs/mft.c	2006-01-07 05:59:22 UTC (rev
20650)
+++ trunk/reactos/drivers/fs/ntfs/mft.c	2006-01-07 06:20:59 UTC (rev
20651)
@@ -169,6 +169,7 @@

 	       PDEVICE_EXTENSION Vcb,
 	       PDEVICE_OBJECT DeviceObject)
 {
+  PNONRESIDENT_ATTRIBUTE NresAttr = (PNONRESIDENT_ATTRIBUTE)attr;
   if (attr->Nonresident == FALSE)
     {
 	memcpy (buffer,
@@ -176,7 +177,6 @@
 		((PRESIDENT_ATTRIBUTE)attr)->ValueLength);
     }
 
-  PNONRESIDENT_ATTRIBUTE NresAttr = (PNONRESIDENT_ATTRIBUTE)attr;
   ReadExternalAttribute(Vcb, NresAttr, 0, (ULONG)(NresAttr->LastVcn) +
1,
 		buffer);
 }
@@ -194,17 +194,14 @@
   PVOID p;
   ULONG BytesPerFileRecord = Vcb->NtfsInfo.BytesPerFileRecord;
   ULONG clusters = max(BytesPerFileRecord /
Vcb->NtfsInfo.BytesPerCluster, 1);
-
-  p = ExAllocatePool(NonPagedPool, clusters *
Vcb->NtfsInfo.BytesPerCluster);
-
   ULONGLONG vcn = index * BytesPerFileRecord /
Vcb->NtfsInfo.BytesPerCluster;
-
-  ReadVCN (Vcb, Mft, AttributeData, vcn, clusters, p);
-
   LONG m = (Vcb->NtfsInfo.BytesPerCluster / BytesPerFileRecord) - 1;
-
   ULONG n = m > 0 ? (index & m) : 0;
+  
+  p = ExAllocatePool(NonPagedPool, clusters *
Vcb->NtfsInfo.BytesPerCluster);
 
+  ReadVCN (Vcb, Mft, AttributeData, vcn, clusters, p);
+
   memcpy(file, (PVOID)((ULONG_PTR)p + n * BytesPerFileRecord),
BytesPerFileRecord);
 
   ExFreePool(p);
@@ -227,6 +224,7 @@
   ULONGLONG runcount;
   ULONG readcount;
   ULONG left;
+  ULONG n;
 
     PUCHAR bytes = (PUCHAR)buffer;
 
@@ -238,7 +236,7 @@
 		readcount = (ULONG)min (runcount, left);
 
 
-		ULONG n = readcount * Vcb->NtfsInfo.BytesPerCluster;
+		n = readcount * Vcb->NtfsInfo.BytesPerCluster;
 
 		if (lcn == 0)
 			memset(bytes, 0, n);
  _____  

Modified: trunk/reactos/drivers/fs/ntfs/ntfs.h
--- trunk/reactos/drivers/fs/ntfs/ntfs.h	2006-01-07 05:59:22 UTC
(rev 20650)
+++ trunk/reactos/drivers/fs/ntfs/ntfs.h	2006-01-07 06:20:59 UTC
(rev 20651)
@@ -1,8 +1,8 @@

 #ifndef NTFS_H
 #define NTFS_H
 
+#include <ntifs.h>
 #include <ntddk.h>
-#include <ntifs.h>
 #include <ntdddisk.h>
 #include <ccros.h>
 
@@ -10,8 +10,8 @@
 
 
 #define CACHEPAGESIZE(pDeviceExt) \
-	((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGE_SIZE ? \
-	 (pDeviceExt)->NtfsInfo.BytesPerCluster : PAGE_SIZE)
+	((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \
+	 (pDeviceExt)->NtfsInfo.UCHARsPerCluster : PAGE_SIZE)
 
 #ifndef TAG
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
@@ -19,7 +19,7 @@
 
 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
 
-
+#include <pshpack1.h>
 typedef struct _BOOT_SECTOR
 {
   UCHAR     Magic[3];				// 0x00
@@ -37,12 +37,13 @@
   ULONGLONG MftLocation;
   ULONGLONG MftMirrLocation;
   CHAR      ClustersPerMftRecord;
-  BYTE      Unused3[3];
+  UCHAR      Unused3[3];
   CHAR      ClustersPerIndexRecord;
-  BYTE      Unused4[3];
+  UCHAR      Unused4[3];
   ULONGLONG SerialNumber;			// 0x48
   UCHAR     BootCode[432];			// 0x50
-} __attribute__((packed)) BOOT_SECTOR, *PBOOT_SECTOR;
+} BOOT_SECTOR, *PBOOT_SECTOR;
+#include <poppack.h>
 
 //typedef struct _BootSector BootSector;
 
@@ -91,6 +92,7 @@
 #define FCB_CACHE_INITIALIZED   0x0001
 #define FCB_IS_VOLUME_STREAM    0x0002
 #define FCB_IS_VOLUME           0x0004
+#define MAX_PATH                260
 
 typedef struct _FCB
 {
@@ -187,7 +189,7 @@
   ULONG BytesAllocated;         /* Allocated size of the FILE record */
   ULONGLONG BaseFileRecord;     /* File reference to the base FILE
record */
   USHORT NextAttributeNumber;   /* Next Attribute Id */
-  USHORT Pading;                /* Align to 4 byte boundary (XP) */
+  USHORT Pading;                /* Align to 4 UCHAR boundary (XP) */
   ULONG MFTRecordNumber;        /* Number of this MFT Record (XP) */
 } FILE_RECORD_HEADER, *PFILE_RECORD_HEADER;
 
  _____  

Modified: trunk/reactos/drivers/fs/ntfs/volinfo.c
--- trunk/reactos/drivers/fs/ntfs/volinfo.c	2006-01-07 05:59:22 UTC
(rev 20650)
+++ trunk/reactos/drivers/fs/ntfs/volinfo.c	2006-01-07 06:20:59 UTC
(rev 20651)
@@ -27,14 +27,11 @@

 
 /* INCLUDES
*****************************************************************/
 
-#include <ntddk.h>
+#include "ntfs.h"
 
 #define NDEBUG
 #include <debug.h>
 
-#include "ntfs.h"
-
-
 /* FUNCTIONS
****************************************************************/
 
 static NTSTATUS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20060107/ccb1353a/attachment.html


More information about the Ros-diffs mailing list