diff options
Diffstat (limited to 'src/Common/Password.c')
-rw-r--r-- | src/Common/Password.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Common/Password.c b/src/Common/Password.c index 8ba91374..5643cef0 100644 --- a/src/Common/Password.c +++ b/src/Common/Password.c @@ -187,7 +187,6 @@ int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, BOOL bTimeStampValid = FALSE; LARGE_INTEGER headerOffset; BOOL backupHeader; - DISK_GEOMETRY_EX driveInfo; if (oldPassword->Length == 0 || newPassword->Length == 0) return -1; @@ -236,12 +235,13 @@ int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, } else { + BYTE dgBuffer[256]; PARTITION_INFORMATION diskInfo; DWORD dwResult; BOOL bResult; bResult = DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, - &driveInfo, sizeof (driveInfo), &dwResult, NULL); + dgBuffer, sizeof (dgBuffer), &dwResult, NULL); if (!bResult) goto error; @@ -254,7 +254,7 @@ int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, } else { - hostSize = driveInfo.DiskSize.QuadPart; + hostSize = ((PDISK_GEOMETRY_EX) dgBuffer)->DiskSize.QuadPart; } if (hostSize == 0) |