Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 86 of file where.c.
Referenced by SearchForExecutable().
{ TCHAR szPathBuffer[CMDLINE_LENGTH], *pszPathEnd; LPTSTR s,f; /* initialize full name buffer */ *pFullName = _T('\0'); TRACE ("SearchForExecutableSingle: \'%s\' in dir: \'%s\'\n", debugstr_aw(pFileName), debugstr_aw(pDirectory)); pszPathEnd = szPathBuffer; if (pDirectory != NULL) { _tcscpy(szPathBuffer, pDirectory); pszPathEnd += _tcslen(pszPathEnd); *pszPathEnd++ = _T('\\'); } _tcscpy(pszPathEnd, pFileName); pszPathEnd += _tcslen(pszPathEnd); if (IsExistingFile (szPathBuffer)) { TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer)); _tcscpy (pFullName, szPathBuffer); return TRUE; } s = pPathExt; while (s && *s) { f = _tcschr (s, _T(';')); if (f) { _tcsncpy (pszPathEnd, s, (size_t)(f-s)); pszPathEnd[f-s] = _T('\0'); s = f + 1; } else { _tcscpy (pszPathEnd, s); s = NULL; } if (IsExistingFile (szPathBuffer)) { TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer)); _tcscpy (pFullName, szPathBuffer); return TRUE; } } return FALSE; }