From 3fb1deb13bf78378ab8a90a7f8342569f1eb50b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 17 Apr 2015 09:21:58 +0200 Subject: [PATCH] Fixed getting sector size from a partition image (Windows variant) On Windows, when processing a partition image, get the sector size from the boot sector instead of the containing partition. --- libntfs-3g/win32_io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/win32_io.c b/libntfs-3g/win32_io.c index 9c84ec67..c4c09d7d 100644 --- a/libntfs-3g/win32_io.c +++ b/libntfs-3g/win32_io.c @@ -1881,7 +1881,11 @@ static int ntfs_device_win32_ioctl(struct ntfs_device *dev, int request, #ifdef BLKSSZGET case BLKSSZGET: ntfs_log_debug("BLKSSZGET detected.\n"); - return ntfs_win32_blksszget(dev, (int *)argp); + if (fd && !fd->ntdll) { + *(int*)argp = fd->geo_sector_size; + return (0); + } else + return ntfs_win32_blksszget(dev, (int *)argp); #endif #ifdef BLKBSZSET case BLKBSZSET: