From 833bace73a274ca66289f1e00845acbdd703da60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 10 Oct 2012 21:56:27 +0000 Subject: [PATCH] [MSVCRT:APITEST] Modify the test for GetModuleFileName, should work better now. svn path=/trunk/; revision=57534 --- rostests/apitests/msvcrt/CommandLine.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rostests/apitests/msvcrt/CommandLine.c b/rostests/apitests/msvcrt/CommandLine.c index 0a35f0e90f7..96bef12d234 100644 --- a/rostests/apitests/msvcrt/CommandLine.c +++ b/rostests/apitests/msvcrt/CommandLine.c @@ -286,17 +286,16 @@ START_TEST(CommandLine) { ULONG i; - DWORD dwError; + DWORD dwRet; LPWSTR p = NULL; /* * Initialize the UtilityProgramDirectory variable. */ - GetModuleFileNameW(NULL, UtilityProgramDirectory, COUNT_OF(UtilityProgramDirectory)); - dwError = GetLastError(); - ok(dwError == ERROR_SUCCESS, "ERROR: Cannot retrieve the path to the current running process, last error %lu\n", dwError); - if (dwError != ERROR_SUCCESS) return; + dwRet = GetModuleFileNameW(NULL, UtilityProgramDirectory, COUNT_OF(UtilityProgramDirectory)); + ok(dwRet != 0, "ERROR: Cannot retrieve the path to the current running process, last error %lu\n", GetLastError()); + if (dwRet == 0) return; /* Path : executable.exe or "executable.exe" or C:\path\executable.exe or "C:\path\executable.exe" */ p = wcsrchr(UtilityProgramDirectory, L'\\');