fixed checking whether Windows 7 was hibernated

On Windows XP and Vista, the system hibernation is identified by the
sequence "hibr" at the beginning of hiberfil.sys. This had been changed
to "HIBR" in Windows 7, so both sequences have to be accepted as
hibernation criteria.
edge.strict_endians
Jean-Pierre André 2012-01-23 17:16:07 +01:00
parent 5593ee2711
commit 3c6e88cb0f
1 changed files with 2 additions and 1 deletions

View File

@ -762,7 +762,8 @@ int ntfs_volume_check_hiberfile(ntfs_volume *vol, int verbose)
errno = EPERM;
goto out;
}
if (memcmp(buf, "hibr", 4) == 0) {
if ((memcmp(buf, "hibr", 4) == 0)
|| (memcmp(buf, "HIBR", 4) == 0)) {
if (verbose)
ntfs_log_error("Windows is hibernated, refused to mount.\n");
errno = EPERM;