Fix a segfault that crept in to win32_io.c due to being too rush.

(Logical change 1.523)
edge.strict_endians
!uv 2004-09-03 12:42:03 +00:00
parent 56bb2ea35d
commit 76236c5916
1 changed files with 5 additions and 3 deletions

View File

@ -56,7 +56,7 @@ typedef struct ntfs_volume ntfs_volume;
#ifndef DiskGeometryGetPartition
#define DiskGeometryGetPartition(Geometry) \
((PDISK_PARTITION_INFO)((Geometry) + 1))
((PDISK_PARTITION_INFO)(&((PDISK_GEOMETRY_EX)buf)->Data))
#endif
#ifndef DiskGeometryGetDetect
@ -1056,8 +1056,10 @@ static int ntfs_device_win32_close(struct ntfs_device *dev)
}
if (fd->vol_handle != INVALID_HANDLE_VALUE) {
ntfs_device_win32_dismount(fd->vol_handle);
ntfs_device_win32_unlock(fd->vol_handle);
if (!NDevReadOnly(dev)) {
ntfs_device_win32_dismount(fd->vol_handle);
ntfs_device_win32_unlock(fd->vol_handle);
}
if (!CloseHandle(fd->vol_handle))
Dputs("Error: CloseHandle failed for volume.");
}