80#define ENV_BUFFER_SIZE 1024
91 *pFullName =
_T(
'\0');
93 TRACE (
"SearchForExecutableSingle: \'%s\' in dir: \'%s\'\n",
96 pszPathEnd = szPathBuffer;
97 if (pDirectory !=
NULL)
99 _tcscpy(szPathBuffer, pDirectory);
100 pszPathEnd +=
_tcslen(pszPathEnd);
101 *pszPathEnd++ =
_T(
'\\');
103 _tcscpy(pszPathEnd, pFileName);
104 pszPathEnd +=
_tcslen(pszPathEnd);
121 pszPathEnd[
f-
s] =
_T(
'\0');
144 static TCHAR pszDefaultPathExt[] =
_T(
".com;.exe;.bat;.cmd");
145 LPTSTR pszPathExt, pszPath;
154 WARN(
"Cannot allocate memory for pszPathExt!\n");
161 LPTSTR pszOldPathExt = pszPathExt;
165 WARN(
"Cannot reallocate memory for pszPathExt!\n");
172 else if (0 == dwBuffer)
174 _tcscpy(pszPathExt, pszDefaultPathExt);
189 if (pFileName[1] ==
_T(
':') ||
_tcschr(pFileName,
_T(
'\\')))
199 WARN(
"Cannot allocate memory for pszPath!\n");
206 LPTSTR pszOldPath = pszPath;
210 WARN(
"Cannot reallocate memory for pszPath!\n");
BOOL SearchForExecutable(LPCTSTR pFileName, LPTSTR pFullName)
BOOL SearchForExecutableSingle(LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pPathExt, LPTSTR pDirectory)
#define cmd_realloc(ptr, size)
BOOL IsExistingFile(IN LPCTSTR pszPath)
#define GetEnvironmentVariable