- Timestamp:
- Oct 25, 2012, 12:39:39 PM (13 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmfile.cpp
r22025 r22040 1348 1348 1349 1349 HMFileInfo *fileInfo = (HMFileInfo *)pHMHandleData->dwUserData; 1350 dprintf(("*** %s", fileInfo->lpszFileName));1351 1350 if(OSLibDosGetFileInformationByHandle(fileInfo->lpszFileName, 1352 1351 INVALID_HANDLE_VALUE, -
trunk/src/kernel32/oslibmisc.cpp
r21648 r22040 267 267 //****************************************************************************** 268 268 //****************************************************************************** 269 char *OSLibStripPath(char *path) 270 { 271 /* @@@PH what does this function do ? Strip the path from a FQFN name ? */ 272 char *pszFilename; 273 char *pszFilename1; 274 275 pszFilename = strrchr(path, '\\'); /* find rightmost backslash */ 276 pszFilename1 = strrchr(path, '/'); /* find rightmost slash */ 277 if(pszFilename > pszFilename1 && pszFilename != NULL) 278 return (++pszFilename); /* return pointer to next character */ 279 280 if (pszFilename1 != NULL) 281 return (++pszFilename1); /* return pointer to next character */ 282 283 return (path); /* default return value */ 269 const char *OSLibStripPath(const char *path) 270 { 271 const char *pszName; 272 register char ch; 273 274 /* 275 * Search the filename string finding the modulename start and end. 276 * The loop ends when we have passed one char left of the module name. 277 */ 278 pszName = path + strlen(path) - 1; 279 while (pszName >= path 280 && (ch = *pszName) != '\\' 281 && ch != '/' 282 && ch != ':' 283 ) 284 { 285 pszName--; 286 } 287 pszName++; 288 289 return pszName; 284 290 } 285 291 //****************************************************************************** -
trunk/src/kernel32/oslibmisc.h
r21308 r22040 18 18 #endif 19 19 20 c har *OSLibStripPath(char *path);20 const char *OSLibStripPath(const char *path); 21 21 22 22 ULONG OSLibiGetModuleHandleA(char *pszModule); … … 109 109 #endif 110 110 111 #ifdef __cplusplus 112 inline char *OSLibStripPath(char *path) 113 { 114 return (char *)OSLibStripPath((const char *)path); 115 } 111 116 #endif 117 118 #endif -
trunk/src/kernel32/winimagebase.cpp
r21916 r22040 557 557 BOOL Win32ImageBase::matchModName(const char *pszFilename) const 558 558 { 559 const char *pszModName; /* Pointer to the modulename. */ 560 const char *pszModNameEnd = NULL; /* Pointer to the dot starting the extention. (if any) */ 561 register char ch; 562 563 /** @sketch 564 * Search the filename string finding the modulename start and end. 565 * The loop ends when we have passed one char left of the module name. 566 */ 567 pszModName = pszFilename + strlen(pszFilename) - 1; 568 while (pszModName >= pszFilename 569 && (ch = *pszModName) != '\\' 570 && ch != '/' 571 && ch != ':' 572 ) 573 { 574 pszModName--; 575 } 576 pszModName++; 577 578 /** @sketch 559 /* 579 560 * Compare the names caseinsensitivly. 580 561 */ 581 return stricmp( pszModName, szModule) == 0;562 return stricmp(OSLibStripPath(pszFilename), OSLibStripPath(szModule)) == 0; 582 563 } 583 564
Note:
See TracChangeset
for help on using the changeset viewer.