getsize.c (ext2fs_get_device_size): Allow windows code to get

the resize for filesystems that are in regular files.
bitmap-optimize
Theodore Ts'o 2003-04-29 21:10:15 -04:00
parent 6177c41f99
commit 05a27b1d34
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2003-04-29 Theodore Ts'o <tytso@mit.edu>
* getsize.c (ext2fs_get_device_size): Allow windows code to get
the resize for filesystems that are in regular files.
2003-04-21 Theodore Ts'o <tytso@mit.edu>
* Release of E2fsprogs 1.33

View File

@ -57,6 +57,7 @@ errcode_t ext2fs_get_device_size(const char *file, int blocksize,
PARTITION_INFORMATION pi;
DISK_GEOMETRY gi;
DWORD retbytes;
LARGE_INTEGER filesize;
dev = CreateFile(file, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE ,
@ -80,6 +81,9 @@ errcode_t ext2fs_get_device_size(const char *file, int blocksize,
gi.SectorsPerTrack *
gi.TracksPerCylinder *
gi.Cylinders.QuadPart / blocksize;
} else if (GetFileSizeEx(dev, &filesize)) {
*retblocks = filesize.QuadPart / blocksize;
}
CloseHandle(dev);