summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-12-13 08:59:58 +0000
committerDave Chapman <dave@dchapman.com>2006-12-13 08:59:58 +0000
commit8a55822ae3e6150e57bd80fc225e196761453bfc (patch)
treea7ad1515996e21d6f3806a9e6a7b0c6ddc2cdd58 /tools
parent206238d947ae1727a994e9cb8cf6401f40763a48 (diff)
downloadrockbox-8a55822ae3e6150e57bd80fc225e196761453bfc.tar.gz
rockbox-8a55822ae3e6150e57bd80fc225e196761453bfc.tar.bz2
rockbox-8a55822ae3e6150e57bd80fc225e196761453bfc.zip
Version 0.4b from 11 Dec 2006 - 0.4 broke win2k/winnt support, this patch restores it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11747 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/ipodpatcher/ipodpatcher.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/tools/ipodpatcher/ipodpatcher.c b/tools/ipodpatcher/ipodpatcher.c
index 2614849260..32c1291ab4 100644
--- a/tools/ipodpatcher/ipodpatcher.c
+++ b/tools/ipodpatcher/ipodpatcher.c
@@ -311,13 +311,14 @@ int main(int argc, char* argv[])
int p = 0;
int diskno = -1;
int sector_size;
- DISK_GEOMETRY_EX diskgeometry;
+ DISK_GEOMETRY_EX diskgeometry_ex;
+ DISK_GEOMETRY diskgeometry;
char diskname[32];
HANDLE dh;
char* filename = NULL;
off_t inputsize;
- fprintf(stderr,"ipodpatcher v0.4 - (C) Dave Chapman 2006\n");
+ fprintf(stderr,"ipodpatcher v0.4b - (C) Dave Chapman 2006\n");
fprintf(stderr,"This is free software; see the source for copying conditions. There is NO\n");
fprintf(stderr,"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
@@ -385,16 +386,27 @@ int main(int argc, char* argv[])
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
NULL,
0,
- &diskgeometry,
- sizeof(diskgeometry),
+ &diskgeometry_ex,
+ sizeof(diskgeometry_ex),
&n,
NULL)) {
- error(" Error reading disk geometry: ");
- return 2;
+ if (!DeviceIoControl(dh,
+ IOCTL_DISK_GET_DRIVE_GEOMETRY,
+ NULL,
+ 0,
+ &diskgeometry,
+ sizeof(diskgeometry),
+ &n,
+ NULL)) {
+ error(" Error reading disk geometry: ");
+ return 2;
+ } else {
+ sector_size=diskgeometry.BytesPerSector;
+ }
+ } else {
+ sector_size=diskgeometry_ex.Geometry.BytesPerSector;
}
- sector_size=diskgeometry.Geometry.BytesPerSector;
-
fprintf(stderr,"[INFO] Reading partition table from %s\n",diskname);
fprintf(stderr,"[INFO] Sector size is %d bytes\n",sector_size);