- Timestamp:
- Apr 16, 2000, 6:19:58 AM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimagebase.cpp
r3391 r3397 1 /* $Id: winimagebase.cpp,v 1.1 4 2000-04-15 21:08:36bird Exp $ */1 /* $Id: winimagebase.cpp,v 1.15 2000-04-16 04:19:57 bird Exp $ */ 2 2 3 3 /* … … 132 132 return 0x40000; //NT 4 133 133 } 134 //****************************************************************************** 134 135 135 136 /** 136 137 * Finds a executable module (or really any file) using the DLL search order. … … 161 162 * the name. 162 163 * @param pszFullname Pointer to output buffer, this will hold the 163 * filename upon return. 164 * a fully qualified, uppercased, filename upon 165 * successful return. 164 166 * @param cchFullname Size of the buffer pointer to by pszFullname. 165 167 * (A length of at least CCHMAXPATH is recommended.) 168 * @parm pszAltPath Pointer to alternate first path. If this is NULL 169 * (which is it by default) the executable path 170 * is used. If this is specified, this path is used 171 * instead. This is intented used to implement the 172 * LoadLibraryEx flag LOAD_WITH_ALTERED_SEARCH_PATH. 166 173 * 167 174 * @status Completely implemented. … … 170 177 * @remark 171 178 */ 172 BOOL Win32ImageBase::findDll(const char *pszFileName, char *pszFullName, int cchFullName) 179 BOOL Win32ImageBase::findDll(const char *pszFileName, 180 char *pszFullName, int cchFullName, 181 const char *pszAltPath /*=NULL*/) 173 182 { 174 183 BOOL fRet = FALSE; /* Return value. (Pessimistic attitude! Init it to FALSE...) */ … … 249 258 { 250 259 case FINDDLL_EXECUTABLEDIR: 251 //ASSUMES: getFullPath allways returns a fully qualified path, ie. with at least one backslash. 252 // and that all slashes are backslashes! 253 pszPath = strcpy(plv->szPath, WinExe->getFullPath()); 254 psz = strrchr(plv->szPath, '\\'); 255 dassert(psz, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): " 256 "WinExe->getFullPath returned a path not fully qualified: %s", 257 pszFileName, pszFullName, cchFullName, pszPath)); 258 if (psz) 259 *psz = '\0'; 260 if (!pszAltPath) 261 { 262 /* ASSUMES: getFullPath allways returns a fully qualified 263 * path, ie. with at least one backslash. and that all 264 * slashes are backslashes! 265 */ 266 pszPath = strcpy(plv->szPath, WinExe->getFullPath()); 267 psz = strrchr(plv->szPath, '\\'); 268 dassert(psz, ("KERNEL32:Win32ImageBase::findDll(%s, 0x%08x, %d): " 269 "WinExe->getFullPath returned a path not fully qualified: %s", 270 pszFileName, pszFullName, cchFullName, pszPath)); 271 if (psz) 272 *psz = '\0'; 273 else 274 continue; 275 } 260 276 else 261 continue;277 pszPath = pszAltPath; 262 278 break; 263 279 … … 327 343 goto end; 328 344 } 345 329 346 330 347 /** @sketch … … 376 393 * IF the file exists THEN 377 394 * Query Fullpath using OS/2 API. 378 * IF unsuccessful lTHEN return relative name.395 * IF unsuccessful THEN return relative name. 379 396 * Check that the fullname buffer is large enough. 380 397 * Copy the filename found to the fullname buffer. 381 398 * ENDIF 399 * IF successful THEN uppercase the fullname buffer. 382 400 * goto end 383 401 * ENDIF … … 414 432 } 415 433 } 434 if (fRet) strupr(pszFullName); 416 435 goto end; 417 436 } … … 429 448 return fRet; 430 449 } 450 451 431 452 //****************************************************************************** 432 453 //****************************************************************************** -
trunk/src/kernel32/winimagebase.h
r3391 r3397 1 /* $Id: winimagebase.h,v 1. 3 2000-04-15 21:08:37bird Exp $ */1 /* $Id: winimagebase.h,v 1.4 2000-04-16 04:19:58 bird Exp $ */ 2 2 3 3 /* 4 4 * Win32 PE Image base class 5 5 * 6 * Copyright 1998- 1999Sander van Leeuwen (sandervl@xs4all.nl)6 * Copyright 1998-2000 Sander van Leeuwen (sandervl@xs4all.nl) 7 7 * 8 8 * … … 82 82 83 83 static BOOL isPEImage(char *szFileName); 84 static BOOL findDll(const char *pszFileName, char *pszFullName, int cchFullName); 84 static BOOL findDll(const char *pszFileName, char *pszFullName, 85 int cchFullName, const char *pszAltPath = NULL); 85 86 86 87 void setEntryPoint(ULONG startAddress) { entryPoint = startAddress; };
Note:
See TracChangeset
for help on using the changeset viewer.