From 48250aef6e1fbc00822b338322f8d5fe050fe138 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 9 Dec 2017 21:10:32 +0100 Subject: [PATCH] [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 --- base/system/chkdsk/chkdsk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/base/system/chkdsk/chkdsk.c b/base/system/chkdsk/chkdsk.c index 57a7b26aeff..76dc9750987 100644 --- a/base/system/chkdsk/chkdsk.c +++ b/base/system/chkdsk/chkdsk.c @@ -228,6 +228,7 @@ ChkdskCallback( DWORD Modifier, PVOID Argument) { + BOOLEAN Ret; PDWORD percent; PBOOLEAN status; PTEXTOUTPUT output; @@ -236,6 +237,7 @@ ChkdskCallback( // We get other types of commands, // but we don't have to pay attention to them // + Ret = TRUE; switch (Command) { case UNKNOWN2: @@ -259,7 +261,8 @@ ChkdskCallback( break; case VOLUMEINUSE: - ConPuts(StdOut, L"VOLUMEINUSE\n"); + ConPuts(StdOut, L"Volume is in use and cannot be locked\n"); + Ret = FALSE; break; case UNKNOWN9: @@ -313,7 +316,7 @@ ChkdskCallback( } break; } - return TRUE; + return Ret; } #ifndef FMIFS_IMPORT_DLL