diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2010-01-26 16:00:26 -0500 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2010-01-26 16:00:26 -0500 |
commit | 546a9c7c369df465021feecb20f6a8f81b6df6bc (patch) | |
tree | 280a7cd1fda2a5614582f8675e415d4043fe5e93 /mbr.h | |
parent | add79a6e1b3a1af1305f02d51eb3aa148f580caa (diff) | |
download | sgdisk-546a9c7c369df465021feecb20f6a8f81b6df6bc.tar.gz |
New files to support disk I/O restructuring and (currently broken)
Windows version.
Diffstat (limited to 'mbr.h')
-rw-r--r-- | mbr.h | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -5,8 +5,8 @@ #include <stdint.h> #include <sys/types.h> -#include <sys/ioctl.h> #include "gptpart.h" +#include "diskio.h" #ifndef __MBRSTRUCTS #define __MBRSTRUCTS @@ -41,9 +41,7 @@ struct MBRRecord { }; // struct MBRRecord // A 512-byte data structure into which the MBR can be loaded in one -// go, for the benefit of FreeBSD which seems to flake out when loading -// from block devices in multiples other than the block size. -// Also used when loading logical partitions. +// go. Also used when loading logical partitions. #pragma pack(1) struct TempMBR { uint8_t code[440]; @@ -72,6 +70,7 @@ protected: uint64_t diskSize; // size in blocks uint64_t numHeads; // number of heads, in CHS scheme uint64_t numSecspTrack; // number of sectors per track, in CHS scheme + DiskIO* myDisk; char device[256]; MBRValidity state; struct MBRRecord* GetPartition(int i); // Return primary or logical partition @@ -82,13 +81,13 @@ public: // File I/O functions... int ReadMBRData(char* deviceFilename); - void ReadMBRData(int fd, int checkBlockSize = 1); + void ReadMBRData(DiskIO * theDisk, int checkBlockSize = 1); // ReadLogicalPart() returns last partition # read to logicals[] array, // or -1 if there was a problem.... - int ReadLogicalPart(int fd, uint32_t extendedStart, uint32_t diskOffset, + int ReadLogicalPart(uint32_t extendedStart, uint32_t diskOffset, int partNum); int WriteMBRData(void); - void WriteMBRData(int fd); + int WriteMBRData(DiskIO *theDisk); int WriteMBRData(char* deviceFilename); // Display data for user... |