[EVENTCREATE]: Check for a better last error after the GetModuleFileNameW call.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 29 Sep 2016 17:42:20 +0000 (17:42 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 29 Sep 2016 17:42:20 +0000 (17:42 +0000)
svn path=/trunk/; revision=72856

reactos/base/applications/cmdutils/eventcreate/eventcreate.c

index eb591a0..4228d60 100644 (file)
@@ -249,7 +249,7 @@ InstallEventSource(
      * - In case of failure, use a default path.
      */
     PathSize = GetModuleFileNameW(NULL, ExePath, ARRAYSIZE(ExePath));
-    if ((PathSize == 0) || (GetLastError() != ERROR_SUCCESS))
+    if ((PathSize == 0) || (GetLastError() == ERROR_INSUFFICIENT_BUFFER))
     {
         /* We failed, copy the default value */
         StringCchCopyW(ExePath, ARRAYSIZE(ExePath),