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);
109 _tcscpy (pFullName, szPathBuffer);
121 pszPathEnd[
f-
s] =
_T(
'\0');
133 _tcscpy (pFullName, szPathBuffer);
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)
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
BOOL IsExistingFile(IN LPCTSTR pszPath)
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
size_t __cdecl _tcslen(const _TCHAR *str)
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
#define cmd_realloc(ptr, size)
#define GetEnvironmentVariable
BOOL SearchForExecutableSingle(LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pPathExt, LPTSTR pDirectory)