Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 Boot loader and format strings

open
nobody
None
5
2009-02-26
2009-02-26
Anonymous
No

Good work guys, I ever wished to get such a small disk imager with bzip2 for windows.

I found only a little bug which was causing to set the bootloader part set to zero. I found out Reset() is called to late in CPartitionInfoMgr::ReadPartitionInfoFromFile:

--- orig\PartitionInfoMgr.cpp Tue Jan 13 23:58:02 2009
+++ PartitionInfoMgr.cpp Thu Feb 26 18:21:10 2009
@@ -227,6 +227,8 @@
THROW_FILEFORMAT_EXC(EFileFormatException::majorVersionError);
}

+ Reset();
+
// read boot loader block
res = SetFilePointer(hDisk, header.bootLoaderOffset, NULL, FILE_BEGIN);
if (res == INVALID_SET_FILE_POINTER)
@@ -238,7 +240,6 @@
res = SetFilePointer(hDisk, header.partInfoOffset, NULL, FILE_BEGIN);
if (res == INVALID_SET_FILE_POINTER)
THROW_OS_EXC_PARAM1((int)::GetLastError(), EWinException::seekError, fileName);
- Reset();
fBuffer = new BYTE[header.partInfoLength];
res = ReadFile(hDisk, fBuffer, header.partInfoLength, &sizeRead, NULL);
CHECK_OS_EX_PARAM1(res, EWinException::readFileError, L"");

The second is just a cosmetic issuse: The format strings did not work, it always showed "d of d".
http://msdn.microsoft.com/en-us/library/aa314330\(VS.60).aspx says it shoud look like this and it works:

Backup disk in progress (%1!d! of %2!d! partitions)...
Restore disk in progress (%1!d! of %2!d! partitions)...

Discussion