[EVENTCREATE]: Check for a better last error after the GetModuleFileNameW call.

svn path=/trunk/; revision=72856
This commit is contained in:
Hermès Bélusca-Maïto 2016-09-29 17:42:20 +00:00
parent fbebe613b7
commit a8badad1fa

View 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),