From 25dcec8bf344d8fedfa92cd3e24b4b798889db87 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 16 Jun 2012 20:00:55 +0000 Subject: [PATCH] =?UTF-8?q?[SERVICES]=20Improve=20a=20check=20in=20RQueryS?= =?UTF-8?q?erviceConfig2W=20and=20RQueryServiceConfig2A=20Patch=20by=20Her?= =?UTF-8?q?m=C3=A8s=20B=C3=A9lusca.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See issue #7123 for more details. svn path=/trunk/; revision=56739 --- reactos/base/system/services/rpcserver.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index 634f1b1fd4a..71a5de34c2a 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -5268,7 +5268,7 @@ DWORD RQueryServiceConfig2A( } /* Now we can fill the buffer */ - if (dwType == REG_BINARY) + if (dwError != ERROR_FILE_NOT_FOUND && dwType == REG_BINARY) { dwError = RegQueryValueExW(hServiceKey, L"FailureActions", @@ -5284,7 +5284,11 @@ DWORD RQueryServiceConfig2A( } else { - dwError = ERROR_UNSUPPORTED_TYPE; + /* + * The value of the error doesn't really matter, the only + * important thing is that it must be != ERROR_SUCCESS . + */ + dwError = ERROR_INVALID_DATA; } if (dwError == ERROR_SUCCESS) @@ -5492,7 +5496,7 @@ DWORD RQueryServiceConfig2W( } /* Now we can fill the buffer */ - if (dwType == REG_BINARY) + if (dwError != ERROR_FILE_NOT_FOUND && dwType == REG_BINARY) { dwError = RegQueryValueExW(hServiceKey, L"FailureActions", @@ -5508,7 +5512,11 @@ DWORD RQueryServiceConfig2W( } else { - dwError = ERROR_UNSUPPORTED_TYPE; + /* + * The value of the error doesn't really matter, the only + * important thing is that it must be != ERROR_SUCCESS . + */ + dwError = ERROR_INVALID_DATA; } if (dwError == ERROR_SUCCESS)