Author: hbelusca Date: Wed Oct 10 21:56:27 2012 New Revision: 57534
URL: http://svn.reactos.org/svn/reactos?rev=57534&view=rev Log: [MSVCRT:APITEST] Modify the test for GetModuleFileName, should work better now.
Modified: trunk/rostests/apitests/msvcrt/CommandLine.c
Modified: trunk/rostests/apitests/msvcrt/CommandLine.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/CommandLin... ============================================================================== --- trunk/rostests/apitests/msvcrt/CommandLine.c [iso-8859-1] (original) +++ trunk/rostests/apitests/msvcrt/CommandLine.c [iso-8859-1] Wed Oct 10 21:56:27 2012 @@ -286,17 +286,16 @@ { 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'\');