https://git.reactos.org/?p=reactos.git;a=commitdiff;h=35f7267a9712da2b94dfd…
commit 35f7267a9712da2b94dfd2fc0c08d4a021f15b88
Author:     Bișoc George <fraizeraust99(a)gmail.com>
AuthorDate: Wed Feb 13 15:22:28 2019 +0100
Commit:     Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Feb 13 15:22:28 2019 +0100
    [USETUP] Check the status value of BuildInstallPaths() (#1349)
---
 base/setup/usetup/usetup.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c
index a9a4f81174..f10effde10 100644
--- a/base/setup/usetup/usetup.c
+++ b/base/setup/usetup/usetup.c
@@ -3324,6 +3324,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
     WCHAR InstallDir[MAX_PATH];
     WCHAR c;
     ULONG Length, Pos;
+    NTSTATUS Status;
     /* We do not need the filesystem list anymore */
     if (FileSystemList != NULL)
@@ -3360,9 +3361,17 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
      */
     if ((RepairUpdateFlag || IsUnattendedSetup) && IsValidPath(InstallDir))
     {
-        BuildInstallPaths(InstallDir,
-                          DiskEntry,
-                          PartEntry);
+        Status = BuildInstallPaths(InstallDir,
+                                   DiskEntry,
+                                   PartEntry);
+        if (!NT_SUCCESS(Status))
+        {
+            DPRINT1("BuildInstallPaths() failed. Status code: 0x%lx", Status);
+            PopupError("Failed to build the installation paths for the ReactOS
installation directory!",
+                       MUIGetString(STRING_CONTINUE),
+                       Ir, POPUP_WAIT_ENTER);
+            return QUIT_PAGE;
+        }
         /*
          * Check whether the user attempts to install ReactOS within the
@@ -3462,9 +3471,17 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
                 return INSTALL_DIRECTORY_PAGE;
             }
-            BuildInstallPaths(InstallDir,
-                              DiskEntry,
-                              PartEntry);
+            Status = BuildInstallPaths(InstallDir,
+                                       DiskEntry,
+                                       PartEntry);
+            if (!NT_SUCCESS(Status))
+            {
+                DPRINT1("BuildInstallPaths() failed. Status code: 0x%lx",
Status);
+                PopupError("Failed to build the installation paths for the ReactOS
installation directory!",
+                           MUIGetString(STRING_CONTINUE),
+                           Ir, POPUP_WAIT_ENTER);
+                return QUIT_PAGE;
+            }
             /*
              * Check whether the user attempts to install ReactOS within the