Author: hbelusca
Date: Sat Dec 28 22:22:12 2013
New Revision: 61459
URL: 
http://svn.reactos.org/svn/reactos?rev=61459&view=rev
Log:
[NTVDM]: Don't display an error message if the VDD registry key (or value) just
doesn't exist: it significates we just don't have any VDD to load...
Thanks to Lee Schroeder and oldman on the forum for having detected this :)
Modified:
    branches/ntvdm/subsystems/ntvdm/vddsup.c
Modified: branches/ntvdm/subsystems/ntvdm/vddsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.c…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/vddsup.c    [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/vddsup.c    [iso-8859-1] Sat Dec 28 22:22:12 2013
@@ -251,13 +251,20 @@
     HANDLE hVDD;
-    /* Open the VDD registry key */
-    if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
-                      VDDKeyName,
-                      0,
-                      KEY_QUERY_VALUE,
-                      &hVDDKey) != ERROR_SUCCESS)
-    {
+    /* Try to open the VDD registry key */
+    Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                          VDDKeyName,
+                          0,
+                          KEY_QUERY_VALUE,
+                          &hVDDKey);
+    if (Error == ERROR_FILE_NOT_FOUND)
+    {
+        /* If the key just doesn't exist, don't do anything else */
+        return TRUE;
+    }
+    else if (Error != ERROR_SUCCESS)
+    {
+        /* The key exists but there was an access error: display an error and quit */
         DisplayMessage(ERROR_REGVDD);
         return FALSE;
     }
@@ -272,8 +279,18 @@
                              &Type,
                              NULL,
                              &BufSize);
-    if (Error != ERROR_SUCCESS || Type != REG_MULTI_SZ)
-    {
+    if (Error == ERROR_FILE_NOT_FOUND)
+    {
+        /* If the value just doesn't exist, don't do anything else */
+        Success = TRUE;
+        goto Quit;
+    }
+    else if (Error != ERROR_SUCCESS || Type != REG_MULTI_SZ)
+    {
+        /*
+         * The value exists but there was an access error or
+         * is of the wrong type: display an error and quit.
+         */
         DisplayMessage(ERROR_REGVDD);
         Success = FALSE;
         goto Quit;