From b6e4109ff1cc4c33870a693ec5935fc5ea45c29b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 13 May 2017 22:47:59 +0000 Subject: [PATCH] [MKHIVE] - Fail when something goes wrong instead of pretending everything's peachy. CORE-13241 #resolve svn path=/trunk/; revision=74540 --- reactos/sdk/tools/mkhive/mkhive.c | 5 ++++- reactos/sdk/tools/mkhive/reginf.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/sdk/tools/mkhive/mkhive.c b/reactos/sdk/tools/mkhive/mkhive.c index 5d657ef05aa..a1d6ef4474f 100644 --- a/reactos/sdk/tools/mkhive/mkhive.c +++ b/reactos/sdk/tools/mkhive/mkhive.c @@ -101,7 +101,10 @@ int main (int argc, char *argv[]) for (i = 2; i < argc; i++) { convert_path (FileName, argv[i]); - ImportRegistryFile (FileName); + if (!ImportRegistryFile (FileName)) + { + return 1; + } } convert_path (FileName, argv[1]); diff --git a/reactos/sdk/tools/mkhive/reginf.c b/reactos/sdk/tools/mkhive/reginf.c index 7783d94c12e..36b1f95359f 100644 --- a/reactos/sdk/tools/mkhive/reginf.c +++ b/reactos/sdk/tools/mkhive/reginf.c @@ -501,11 +501,15 @@ ImportRegistryFile(PCHAR FileName) if (!registry_callback (hInf, (PWCHAR)DelReg, TRUE)) { DPRINT1 ("registry_callback() for DelReg failed\n"); + InfHostCloseFile (hInf); + return FALSE; } if (!registry_callback (hInf, (PWCHAR)AddReg, FALSE)) { DPRINT1 ("registry_callback() for AddReg failed\n"); + InfHostCloseFile (hInf); + return FALSE; } InfHostCloseFile (hInf);