From e8d3c3e4bd9f02f5200ae4201b4de1a833900fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 28 Dec 2013 22:22:12 +0000 Subject: [PATCH] [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 :) svn path=/branches/ntvdm/; revision=61459 --- subsystems/ntvdm/vddsup.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/subsystems/ntvdm/vddsup.c b/subsystems/ntvdm/vddsup.c index 89424c78664..2964c1e9ad8 100644 --- a/subsystems/ntvdm/vddsup.c +++ b/subsystems/ntvdm/vddsup.c @@ -251,13 +251,20 @@ BOOL LoadInstallableVDD(VOID) 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 @@ BOOL LoadInstallableVDD(VOID) &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;