[MKHIVE]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 13 May 2017 22:47:59 +0000 (22:47 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 13 May 2017 22:47:59 +0000 (22:47 +0000)
- 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
reactos/sdk/tools/mkhive/reginf.c

index 5d657ef..a1d6ef4 100644 (file)
@@ -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]);
index 7783d94..36b1f95 100644 (file)
@@ -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);