[CHKDSK] Don't continue repair if volume is in use

This makes use of previous commit vfatlib improvements that allow
caller to stop chkdsk if locking fail, which will happen if volume is in use.
That way, ReactOS users won't be able any longer to f*** up their C:\ volume
by attempting to chkdsk -f it!

CORE-14087
This commit is contained in:
Pierre Schweitzer 2017-12-09 21:10:32 +01:00
parent 6a224a38a1
commit 48250aef6e
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -228,6 +228,7 @@ ChkdskCallback(
DWORD Modifier, DWORD Modifier,
PVOID Argument) PVOID Argument)
{ {
BOOLEAN Ret;
PDWORD percent; PDWORD percent;
PBOOLEAN status; PBOOLEAN status;
PTEXTOUTPUT output; PTEXTOUTPUT output;
@ -236,6 +237,7 @@ ChkdskCallback(
// We get other types of commands, // We get other types of commands,
// but we don't have to pay attention to them // but we don't have to pay attention to them
// //
Ret = TRUE;
switch (Command) switch (Command)
{ {
case UNKNOWN2: case UNKNOWN2:
@ -259,7 +261,8 @@ ChkdskCallback(
break; break;
case VOLUMEINUSE: case VOLUMEINUSE:
ConPuts(StdOut, L"VOLUMEINUSE\n"); ConPuts(StdOut, L"Volume is in use and cannot be locked\n");
Ret = FALSE;
break; break;
case UNKNOWN9: case UNKNOWN9:
@ -313,7 +316,7 @@ ChkdskCallback(
} }
break; break;
} }
return TRUE; return Ret;
} }
#ifndef FMIFS_IMPORT_DLL #ifndef FMIFS_IMPORT_DLL