[mdi] Rename structures
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 2 Jan 2011 05:55:25 +0000 (00:55 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 2 Jan 2011 05:56:47 +0000 (00:56 -0500)
mdi__patch_area to WV_S_MDI_PATCH_AREA and mdi__mbft
to WV_S_MDI_MBFT.

src/include/mdi.h
src/winvblock/ramdisk/memdisk.c

index a2020d7..8d9e3c7 100644 (file)
 /**
  * @file
  *
- * MEMDISK Information/Installation structure
- *
+ * MEMDISK Information/Installation structure.
  */
 
-#  ifdef _MSC_VER
-#    pragma pack(1)
-#  endif
-winvblock__def_struct ( mdi__patch_area )
-{
-  winvblock__uint16 mdi_bytes;
-  winvblock__uint8 mdi_version_minor;
-  winvblock__uint8 mdi_version_major;
-  winvblock__uint32 diskbuf;
-  winvblock__uint32 disksize;
-  winvblock__uint16 cmdline_off,
-   cmdline_seg;
-
-  winvblock__uint32 oldint13;
-  winvblock__uint32 oldint15;
-
-  winvblock__uint16 olddosmem;
-  winvblock__uint8 bootloaderid;
-  winvblock__uint8 _pad1;
+#ifdef _MSC_VER
+#  pragma pack(1)
+#endif
+struct WV_MDI_PATCH_AREA {
+    winvblock__uint16 mdi_bytes;
+    winvblock__uint8 mdi_version_minor;
+    winvblock__uint8 mdi_version_major;
+    winvblock__uint32 diskbuf;
+    winvblock__uint32 disksize;
+    winvblock__uint16 cmdline_off, cmdline_seg;
 
-  winvblock__uint16 dpt_ptr;
-  /*
-   * End of the official MemDisk_Info 
-   */
-  winvblock__uint8 driveshiftlimit;
-  winvblock__uint8 _pad2;
-  winvblock__uint16 _pad3;
-  winvblock__uint16 memint1588;
+    winvblock__uint32 oldint13;
+    winvblock__uint32 oldint15;
 
-  winvblock__uint16 cylinders;
-  winvblock__uint16 heads;
-  winvblock__uint32 sectors;
+    winvblock__uint16 olddosmem;
+    winvblock__uint8 bootloaderid;
+    winvblock__uint8 _pad1;
 
-  winvblock__uint32 mem1mb;
-  winvblock__uint32 mem16mb;
+    winvblock__uint16 dpt_ptr;
+    /* End of the official MemDisk_Info */
+    winvblock__uint8 driveshiftlimit;
+    winvblock__uint8 _pad2;
+    winvblock__uint16 _pad3;
+    winvblock__uint16 memint1588;
 
-  winvblock__uint8 driveno;
-  /*
-   * WinVBlock does not need anything more 
-   */
-}
+    winvblock__uint16 cylinders;
+    winvblock__uint16 heads;
+    winvblock__uint32 sectors;
 
-__attribute__ ( ( __packed__ ) );
-#  ifdef _MSC_VER
-#    pragma pack()
-#  endif
+    winvblock__uint32 mem1mb;
+    winvblock__uint32 mem16mb;
 
-#  ifdef _MSC_VER
-#    pragma pack(1)
-#  endif
-winvblock__def_struct ( mdi__mbft )
-{
-  winvblock__uint8 Signature[4];       /* ("mBFT") */
-  winvblock__uint32 Length;
-  winvblock__uint8 Revision;
-  winvblock__uint8 Checksum;
-  winvblock__uint8 OEMID[6];
-  winvblock__uint8 OEMTableID[8];
-  winvblock__uint8 Reserved1[12];
-  winvblock__uint32 SafeHook;
-  mdi__patch_area mdi;
-}
+    winvblock__uint8 driveno;
+    /* WinVBlock does not need anything more. */
+  } __attribute__((__packed__));
+typedef struct WV_MDI_PATCH_AREA WV_S_MDI_PATCH_AREA, * WV_SP_MDI_PATCH_AREA;
+#ifdef _MSC_VER
+#  pragma pack()
+#endif
 
-__attribute__ ( ( __packed__ ) );
-#  ifdef _MSC_VER
-#    pragma pack()
-#  endif
+#ifdef _MSC_VER
+#  pragma pack(1)
+#endif
+struct WV_MDI_MBFT {
+    winvblock__uint8 Signature[4];     /* ("mBFT") */
+    winvblock__uint32 Length;
+    winvblock__uint8 Revision;
+    winvblock__uint8 Checksum;
+    winvblock__uint8 OEMID[6];
+    winvblock__uint8 OEMTableID[8];
+    winvblock__uint8 Reserved1[12];
+    winvblock__uint32 SafeHook;
+    WV_S_MDI_PATCH_AREA mdi;
+  } __attribute__((__packed__));
+typedef struct WV_MDI_MBFT WV_S_MDI_MBFT, * WV_SP_MDI_MBFT;
+#ifdef _MSC_VER
+#  pragma pack()
+#endif
 
 #endif  /* WV_M_MDI_H_ */
index f8d5344..aecc4e5 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (C) 2009-2010, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
+ * Copyright (C) 2009-2011, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
  *
  * This file is part of WinVBlock, derived from WinAoE.
  *
@@ -42,7 +42,7 @@ static winvblock__bool STDCALL WvMemdiskCheckMbft_(
     winvblock__uint8_ptr phys_mem,
     winvblock__uint32 offset
   ) {
-    mdi__mbft_ptr mbft = (mdi__mbft_ptr) (phys_mem + offset);
+    WV_SP_MDI_MBFT mbft = (WV_SP_MDI_MBFT) (phys_mem + offset);
     winvblock__uint32 i;
     winvblock__uint8 chksum = 0;
     WV_SP_PROBE_SAFE_MBR_HOOK assoc_hook;