- Make CDFS work with msvc/ddk.
authorAlex Ionescu <aionescu@gmail.com>
Sat, 7 Jan 2006 05:59:22 +0000 (05:59 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sat, 7 Jan 2006 05:59:22 +0000 (05:59 +0000)
svn path=/trunk/; revision=20650

reactos/drivers/fs/cdfs/cdfs.h
reactos/drivers/fs/cdfs/dirctl.c
reactos/drivers/fs/cdfs/fsctl.c

index 9096a9b..eca0a4b 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef CDFS_H
 #define CDFS_H
 
-#include <ntddk.h>
 #include <ntifs.h>
+#include <ntddk.h>
 #include <ntddcdrm.h>
 #include <ccros.h>
 
@@ -21,6 +21,7 @@
 #define VOLUME_PARTITION_DESCRIPTOR_TYPE       3
 #define VOLUME_DESCRIPTOR_SET_TERMINATOR       255
 
+#include <pshpack1.h>
 struct _DIR_RECORD
 {
   UCHAR  RecordLength;                 // 1
@@ -42,7 +43,8 @@ struct _DIR_RECORD
   ULONG  VolumeSequenceNumber;         // 29-32
   UCHAR  FileIdLength;                 // 33
   UCHAR  FileId[1];                    // 34
-} __attribute__((packed));
+};
+#include <poppack.h>
 
 typedef struct _DIR_RECORD DIR_RECORD, *PDIR_RECORD;
 
@@ -54,12 +56,13 @@ typedef struct _DIR_RECORD DIR_RECORD, *PDIR_RECORD;
 
 
 /* Volume Descriptor header*/
+#include <pshpack1.h>
 struct _VD_HEADER
 {
   UCHAR  VdType;                       // 1
   UCHAR  StandardId[5];                        // 2-6
   UCHAR  VdVersion;                    // 7
-} __attribute__((packed));
+};
 
 typedef struct _VD_HEADER VD_HEADER, *PVD_HEADER;
 
@@ -93,8 +96,7 @@ struct _PVD
 
   /* more data ... */
 
-} __attribute__((packed));
-
+};
 typedef struct _PVD PVD, *PPVD;
 
 
@@ -125,7 +127,8 @@ struct _SVD
   UCHAR  PublisherIdentifier[128];     // 319-446
 
  // more data ...
-} __attribute__((packed));
+};
+#include <poppack.h>
 
 typedef struct _SVD SVD, *PSVD;
 
@@ -171,6 +174,8 @@ typedef struct
 #define FCB_IS_VOLUME_STREAM    0x0002
 #define FCB_IS_VOLUME           0x0004
 
+#define MAX_PATH                260
+
 typedef struct _FCB
 {
   FSRTL_COMMON_FCB_HEADER RFCB;
index 1fcf82e..50be672 100644 (file)
@@ -381,12 +381,12 @@ CdfsGetNameInformation(PFCB Fcb,
   DPRINT("CdfsGetNameInformation() called\n");
 
   Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
-  if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
+  if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
     return(STATUS_BUFFER_OVERFLOW);
 
   Info->FileNameLength = Length;
   Info->NextEntryOffset =
-    ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
+    ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
   memcpy(Info->FileName, Fcb->ObjectName, Length);
 
   return(STATUS_SUCCESS);
@@ -404,12 +404,12 @@ CdfsGetDirectoryInformation(PFCB Fcb,
   DPRINT("CdfsGetDirectoryInformation() called\n");
 
   Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
-  if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
+  if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
     return(STATUS_BUFFER_OVERFLOW);
 
   Info->FileNameLength = Length;
   Info->NextEntryOffset =
-    ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
+    ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
   memcpy(Info->FileName, Fcb->ObjectName, Length);
 
   /* Convert file times */
@@ -447,7 +447,7 @@ CdfsGetDirectoryInformation(PFCB Fcb,
 static NTSTATUS
 CdfsGetFullDirectoryInformation(PFCB Fcb,
                                PDEVICE_EXTENSION DeviceExt,
-                               PFILE_FULL_DIRECTORY_INFORMATION Info,
+                               PFILE_FULL_DIR_INFORMATION Info,
                                ULONG BufferLength)
 {
   ULONG Length;
@@ -455,12 +455,12 @@ CdfsGetFullDirectoryInformation(PFCB Fcb,
   DPRINT("CdfsGetFullDirectoryInformation() called\n");
 
   Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
-  if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
+  if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
     return(STATUS_BUFFER_OVERFLOW);
 
   Info->FileNameLength = Length;
   Info->NextEntryOffset =
-    ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
+    ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
   memcpy(Info->FileName, Fcb->ObjectName, Length);
 
   /* Convert file times */
@@ -500,7 +500,7 @@ CdfsGetFullDirectoryInformation(PFCB Fcb,
 static NTSTATUS
 CdfsGetBothDirectoryInformation(PFCB Fcb,
                                PDEVICE_EXTENSION DeviceExt,
-                               PFILE_BOTH_DIRECTORY_INFORMATION Info,
+                               PFILE_BOTH_DIR_INFORMATION Info,
                                ULONG BufferLength)
 {
   ULONG Length;
@@ -508,12 +508,12 @@ CdfsGetBothDirectoryInformation(PFCB Fcb,
   DPRINT("CdfsGetBothDirectoryInformation() called\n");
 
   Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
-  if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
+  if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
     return(STATUS_BUFFER_OVERFLOW);
 
   Info->FileNameLength = Length;
   Info->NextEntryOffset =
-    ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
+    ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
   memcpy(Info->FileName, Fcb->ObjectName, Length);
 
   /* Convert file times */
@@ -682,14 +682,14 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
              case FileFullDirectoryInformation:
                Status = CdfsGetFullDirectoryInformation(&TempFcb,
                                                         DeviceExtension,
-                                                        (PFILE_FULL_DIRECTORY_INFORMATION)Buffer,
+                                                        (PFILE_FULL_DIR_INFORMATION)Buffer,
                                                         BufferLength);
                break;
 
              case FileBothDirectoryInformation:
                Status = CdfsGetBothDirectoryInformation(&TempFcb,
                                                         DeviceExtension,
-                                                        (PFILE_BOTH_DIRECTORY_INFORMATION)Buffer,
+                                                        (PFILE_BOTH_DIR_INFORMATION)Buffer,
                                                         BufferLength);
                break;
 
index 05a977a..7c71edc 100644 (file)
@@ -36,7 +36,7 @@
 /* FUNCTIONS ****************************************************************/
 
 static __inline
-int msf_to_lba (BYTE m, BYTE s, BYTE f)
+int msf_to_lba (UCHAR m, UCHAR s, UCHAR f)
 {
    return (((m * 60) + s) * 75 + f) - 150;
 }