- Timestamp:
- Jul 7, 2009, 7:40:22 PM (16 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r21302 r21329 1179 1179 DWORD sp = 0, lp = 0,attr; 1180 1180 LPSTR tmpshortpath,tmplongpath; 1181 LPSTR lpszShortPath1, lpszLongPath1; 1181 1182 1182 1183 dprintf(("GetLongPathNameA %s %x %d", lpszShortPath, lpszLongPath, cchBuffer)); … … 1196 1197 return 0; 1197 1198 } 1198 1199 lstrcpyA(tmpshortpath,lpszShortPath); 1199 1200 lpszShortPath1 = ODINHelperStripUNC((char*)lpszShortPath); 1201 lpszLongPath1 = ODINHelperStripUNC((char*)lpszLongPath); 1202 1203 lstrcpyA(tmpshortpath,lpszShortPath1); 1200 1204 1201 1205 /* check for drive letter */ 1202 if ( lpszShortPath[1] == ':' ) { 1203 tmplongpath[0] = lpszShortPath[0]; 1206 if ( lpszShortPath1[1] == ':' ) { 1207 tmplongpath[0] = lpszShortPath1[0]; 1208 1204 1209 tmplongpath[1] = ':'; 1205 1210 sp = 2; … … 1209 1214 //todo: check drive validity! 1210 1215 1211 while ( lpszShortPath [lp] ) {1216 while ( lpszShortPath1[lp] ) { 1212 1217 1213 1218 /* check for path delimiters and reproduce them */ 1214 if ( lpszShortPath [lp] == '\\' || lpszShortPath[lp] == '/' ) {1219 if ( lpszShortPath1[lp] == '\\' || lpszShortPath1[lp] == '/' ) { 1215 1220 if (!sp || tmplongpath[sp-1]!= '\\') 1216 1221 { … … 1224 1229 } 1225 1230 1226 tmplen = strcspn ( lpszShortPath + lp, "\\/" );1227 lstrcpynA ( tmplongpath+sp, lpszShortPath + lp, tmplen+1 );1231 tmplen = strcspn ( lpszShortPath1 + lp, "\\/" ); 1232 lstrcpynA ( tmplongpath+sp, lpszShortPath1 + lp, tmplen+1 ); 1228 1233 1229 1234 attr = GetFileAttributesA(tmplongpath); … … 1266 1271 DOSFS_Hash(FindFileData.cFileName, short_name, FALSE, TRUE ); 1267 1272 //this happens on files like [hello world] 1268 if (!lstrncmpA(short_name, lpszShortPath +lp, (lpszShortPath+lp+tmplen)[-1] == '.' ? tmplen-1 : tmplen ))1273 if (!lstrncmpA(short_name, lpszShortPath1+lp, (lpszShortPath1+lp+tmplen)[-1] == '.' ? tmplen-1 : tmplen )) 1269 1274 { 1270 1275 strcpy( tmplongpath+sp, FindFileData.cFileName); … … 1299 1304 tmplongpath[sp] = 0; 1300 1305 1301 lstrcpynA ( lpszLongPath , tmplongpath, cchBuffer );1306 lstrcpynA ( lpszLongPath1, tmplongpath, cchBuffer ); 1302 1307 dprintf(("returning %s\n", lpszLongPath)); 1303 1308 tmplen = strlen ( lpszLongPath ); -
trunk/src/kernel32/KERNEL32.DEF
r21324 r21329 1224 1224 vsnprintfW @2030 NONAME 1225 1225 snprintfW @2031 NONAME 1226 sprintfW @2032 NONAME 1226 1227 1227 1228 ; custom dll hook installer … … 1264 1265 1265 1266 _ODIN_SetProcessDword@12 @3118 NONAME 1267 1268 ; required for Mozilla plugin 1269 1270 _ODIN_ThreadEnterOdinContext@8 = _ODIN_ThreadEnterOdinContext@8 @3119 1271 _ODIN_ThreadLeaveOdinContext@8 = _ODIN_ThreadLeaveOdinContext@8 @3120 1272 _ODIN_ThreadLeaveOdinContextNested@8 = _ODIN_ThreadLeaveOdinContextNested@8 @3121 1273 _ODIN_ThreadEnterOdinContextNested@12 = _ODIN_ThreadEnterOdinContextNested@12 @3122 1266 1274 1267 1275 ; Char functions (forwarders from user32) … … 1299 1307 _IsCharUpperW@4 @3160 NONAME 1300 1308 1301 SetFilePointerEx = _SetFilePointerEx@20@31611302 SetWaitableTimer = _SetWaitableTimer@24@31621309 SetFilePointerEx = _SetFilePointerEx@20 @3161 1310 SetWaitableTimer = _SetWaitableTimer@24 @3162 1303 1311 1304 1312 ; RAS functions … … 1332 1340 RasCountObjects = _RasCountObjects@12 @3527 1333 1341 RasGetTrackHandle = _RasGetTrackHandle@4 @3528 1334 1342 -
trunk/src/kernel32/exceptions.cpp
r21302 r21329 352 352 353 353 // walk the exception chain 354 while( (pFrame != NULL) && ( pFrame != ((void *)0xFFFFFFFF)) )354 while( (pFrame != NULL) && ((ULONG)((ULONG)pFrame & 0xFFFFF000) != 0xFFFFF000) ) 355 355 { 356 356 dprintf(("KERNEL32: RtlDispatchException - pframe=%08X, pframe->Prev=%08X", pFrame, pFrame->Prev)); … … 492 492 PrintWin32ExceptionChain(frame); 493 493 494 while (( frame != (PWINEXCEPTION_FRAME)0xffffffff) && (frame != pEndFrame))494 while (((ULONG)((ULONG)frame & 0xFFFFF000) != 0xFFFFF000) && (frame != pEndFrame)) 495 495 { 496 496 /* Check frame address */ … … 711 711 // any local buffers also can be made static to save 712 712 // stack space and possibly avoid out of stack exception. 713 if(pERepRec->ExceptionNum == XCPT_GUARD_PAGE_VIOLATION) 713 if(pERepRec->ExceptionNum == XCPT_GUARD_PAGE_VIOLATION) 714 714 { 715 715 strcpy(szTrapDump, "Guard Page Violation"); 716 716 return; 717 717 } 718 718 719 719 PSZ pszExceptionName = "<unknown>"; /* points to name/type excpt */ 720 720 APIRET rc = XCPT_CONTINUE_SEARCH; /* excpt-dep. code */ … … 963 963 static char szSYMInfo[260]; 964 964 static char Name[260]; 965 965 966 966 DosQueryModuleName(ulModule, sizeof(Name), Name); 967 967 … … 1294 1294 1295 1295 map = Win32MemMapNotify::findMapByView(pERepRec->ExceptionInfo[1], &offset, accessflag); 1296 if(!map) 1296 if(!map) 1297 1297 goto continueFail; 1298 1298 … … 1309 1309 } 1310 1310 continueFail: 1311 1312 /* 1313 * vladest: OK, try to implement write AUTOCOMMIT 1314 * last chance after MMAP commit is failed 1315 */ 1316 if (XCPT_ACCESS_VIOLATION == pERepRec->ExceptionNum && 1317 (/*pERepRec->ExceptionInfo[0] == XCPT_READ_ACCESS ||*/ 1318 pERepRec->ExceptionInfo[0] == XCPT_WRITE_ACCESS) && 1319 pERepRec->ExceptionInfo[1] != XCPT_DATA_UNKNOWN) 1320 { 1321 ULONG offset, accessflag; 1322 1323 DosQueryMem((PVOID) pERepRec->ExceptionInfo[1], 1324 &offset, &accessflag); 1325 dprintf(("KERNEL32: OS2ExceptionHandler: failed address info 0x%X size 0x%X. flag %X\n", 1326 pERepRec->ExceptionInfo[1], offset, accessflag)); 1327 /* check for valid address */ 1328 if (!pERepRec->ExceptionInfo[1] || 1329 pERepRec->ExceptionInfo[1] == 0xAAAAAAAA || 1330 !offset || offset == 0xAAAAAAAA) 1331 goto CrashAndBurn; 1332 /* memory committed, but no write access */ 1333 if (accessflag & PAG_GUARD) 1334 accessflag &=~PAG_GUARD; 1335 1336 DosSetMem((PVOID) pERepRec->ExceptionInfo[1], offset, 1337 accessflag | PAG_WRITE | PAG_COMMIT); 1338 dprintf(("KERNEL32: OS2ExceptionHandler: commiting 0x%X size 0x%X\n", 1339 pERepRec->ExceptionInfo[1], offset)); 1340 goto continueexecution; 1341 } 1342 1311 1343 1312 1344 ////#define DEBUGSTACK … … 1344 1376 USHORT *eip = (USHORT *)pCtxRec->ctx_RegEip; 1345 1377 1346 if(teb && eip && *eip == SETTHREADCONTEXT_INVALID_LOCKOPCODE) 1378 if(teb && eip && *eip == SETTHREADCONTEXT_INVALID_LOCKOPCODE) 1347 1379 { 1348 1380 //Is this a pending SetThreadContext exception? 1349 1381 //(see detailed description in the HMDeviceThreadClass::SetThreadContext method) 1350 if(teb->o.odin.context.ContextFlags) 1382 if(teb->o.odin.context.ContextFlags) 1351 1383 { 1352 1384 dprintfException(pERepRec, pERegRec, pCtxRec, p); … … 1488 1520 //Make sure we detect a stack overflow condition before the system does 1489 1521 if(!fIsOS2Image && 1490 pERepRec->ExceptionInfo[1] >= stackbottom && 1522 pERepRec->ExceptionInfo[1] >= stackbottom && 1491 1523 pERepRec->ExceptionInfo[1] < stacktop 1492 ) 1524 ) 1493 1525 {//this is a guard page exception for the thread stack 1494 1526 APIRET rc; 1495 1527 ULONG ulAddress, cbSize, ulMemFlags; 1496 1528 1497 1529 //round down to page boundary 1498 1530 ulAddress = pERepRec->ExceptionInfo[1] & ~0xFFF; … … 1506 1538 #endif 1507 1539 1508 if(ulAddress == stackbottom + PAGE_SIZE) 1540 if(ulAddress == stackbottom + PAGE_SIZE) 1509 1541 {//we don't have any stack left, throw an XCPT_UNABLE_TO_GROW_STACK 1510 1542 //exception … … 1550 1582 if(ret == TRUE) 1551 1583 goto continueexecution; 1552 } 1584 } 1553 1585 } 1554 1586 … … 1565 1597 //#ifdef DEBUG 1566 1598 // dprintfException(pERepRec, pERegRec, pCtxRec, p); 1567 //#endif 1599 //#endif 1568 1600 goto continuesearch; 1569 1601 } … … 1653 1685 PEXCEPTIONREGISTRATIONRECORD pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)QueryExceptionChain(); 1654 1686 1655 while(pExceptRec != 0 && (ULONG)pExceptRec != -1) 1687 while(pExceptRec != 0 && (ULONG)pExceptRec != -1) 1656 1688 { 1657 if(pExceptRec->ExceptionHandler == OS2ExceptionHandler) 1689 if(pExceptRec->ExceptionHandler == OS2ExceptionHandler) 1658 1690 { 1659 1691 fFound = TRUE; … … 1662 1694 pExceptRec = pExceptRec->prev_structure; 1663 1695 } 1664 if(!fFound) 1696 if(!fFound) 1665 1697 { 1666 1698 OS2SetExceptionHandler(pExceptionRegRec); … … 1670 1702 //***************************************************************************** 1671 1703 // Remove exception handler if it was registered previously 1672 // 1704 // 1673 1705 //***************************************************************************** 1674 1706 void WIN32API ODIN_UnsetExceptionHandler(void *pExceptionRegRec) … … 1678 1710 BOOL fFound = FALSE; 1679 1711 1680 while(pExceptRec != 0 && (ULONG)pExceptRec != -1) 1712 while(pExceptRec != 0 && (ULONG)pExceptRec != -1) 1681 1713 { 1682 if(pExceptRec == pExceptionRegRec) 1714 if(pExceptRec == pExceptionRegRec) 1683 1715 { 1684 1716 fFound = TRUE; … … 1691 1723 pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)QueryExceptionChain(); 1692 1724 1693 if(fFound && pExceptRec != (PEXCEPTIONREGISTRATIONRECORD)pExceptionRegRec) 1725 if(fFound && pExceptRec != (PEXCEPTIONREGISTRATIONRECORD)pExceptionRegRec) 1694 1726 { 1695 1727 dprintf(("ERROR: ODIN_UnsetExceptionHandler: INSIDE!!!: exc rec %p, head %p\n", pExceptionRegRec, pExceptRec)); -
trunk/src/kernel32/hmfile.cpp
r21302 r21329 851 851 dwMoveMethod)); 852 852 853 if(fileInfo && fileInfo->dwLXOffset) 853 if(fileInfo && fileInfo->dwLXOffset) 854 854 { 855 855 switch(dwMoveMethod) … … 868 868 } 869 869 } 870 870 871 ret = OSLibDosSetFilePointer(pHMHandleData->hHMHandle, 871 872 lDistanceToMove, -
trunk/src/kernel32/kernel32dbg.def
r21324 r21329 1225 1225 vsnprintfW @2030 NONAME 1226 1226 snprintfW @2031 NONAME 1227 sprintfW @2032 NONAME 1227 1228 1228 1229 ; custom dll hook installer … … 1263 1264 1264 1265 _ODIN_SetProcessDword@12 @3118 NONAME 1266 1267 ; required for Mozilla plugin 1268 1269 _ODIN_ThreadEnterOdinContext@8 = _ODIN_ThreadEnterOdinContext@8 @3119 1270 _ODIN_ThreadLeaveOdinContext@8 = _ODIN_ThreadLeaveOdinContext@8 @3120 1271 _ODIN_ThreadLeaveOdinContextNested@8 = _ODIN_ThreadLeaveOdinContextNested@8 @3121 1272 _ODIN_ThreadEnterOdinContextNested@12 = _ODIN_ThreadEnterOdinContextNested@12 @3122 1265 1273 1266 1274 ; Char functions (forwarders from user32) … … 1297 1305 _DbgIsCharUpperA@4 @3159 NONAME 1298 1306 _DbgIsCharUpperW@4 @3160 NONAME 1299 1300 SetFilePointerEx = _SetFilePointerEx@20 @3161 1301 SetWaitableTimer = _SetWaitableTimer@24 @3162 1307 SetFilePointerEx = _SetFilePointerEx@20 @3161 1308 SetWaitableTimer = _SetWaitableTimer@24 @3162 1302 1309 1303 1310 ; RAS functions … … 1331 1338 RasCountObjects = _RasCountObjects@12 @3527 1332 1339 RasGetTrackHandle = _RasGetTrackHandle@4 @3528 1333 1340 -
trunk/src/kernel32/oslibdos.cpp
r21302 r21329 1 /* $Id: oslibdos.cpp,v 1.120 2003 -06-02 16:25:19 sandervl Exp $ */1 /* $Id: oslibdos.cpp,v 1.120 2003/06/02 16:25:19 sandervl Exp $ */ 2 2 /* 3 3 * Wrappers for OS/2 Dos* API … … 95 95 96 96 97 97 char* ODINHelperStripUNC(char* strUNC) 98 { 99 char *retStr = strUNC; 100 101 if (!strUNC) return NULL; 102 103 /* first possible case */ 104 if (strUNC[0] == '\\' && 105 (strUNC[1] == '?' || (strUNC[1] >= 'A' && strUNC[1] <= 'Z' )) && 106 strUNC[2] == '\\') 107 { 108 109 retStr = &strUNC[3]; 110 } 111 /* second possible case */ 112 if (strUNC[0] == '\\' && strUNC[1] == '\\' && 113 (strUNC[2] == '?' || (strUNC[2] >= 'A' && strUNC[2] <= 'Z' )) && 114 strUNC[3] == '\\') 115 { 116 117 retStr = &strUNC[4]; 118 } 119 return retStr; 120 } 98 121 99 122 //****************************************************************************** … … 171 194 USHORT sel = RestoreOS2FS(); 172 195 char OemFileName[260]; 173 CharToOemA( pszFileName, OemFileName);196 CharToOemA(ODINHelperStripUNC((char*)pszFileName), OemFileName); 174 197 175 198 if(DosOpenLProc) { … … 266 289 return ERROR_WRONG_DISK_W; 267 290 291 case ERROR_SHARING_BUFFER_EXCEEDED: //36 292 return ERROR_SHARING_BUFFER_EXCEEDED_W; 293 268 294 case ERROR_BAD_NETPATH: //53 269 295 return ERROR_BAD_NETPATH_W; 270 271 case ERROR_SHARING_BUFFER_EXCEEDED: //36272 return ERROR_SHARING_BUFFER_EXCEEDED_W;273 296 274 297 case ERROR_CANNOT_MAKE: //82 … … 439 462 char lOemFileName[260]; 440 463 441 CharToOemA( lpszFileName, lOemFileName);464 CharToOemA(ODINHelperStripUNC(lpszFileName), lOemFileName); 442 465 443 466 if(flags & OSLIB_ACCESS_READONLY) … … 508 531 char lOemOldFile[260], lOemNewFile[260]; 509 532 510 CharToOemA( lpszOldFile, lOemOldFile);511 CharToOemA( lpszNewFile, lOemNewFile);533 CharToOemA(ODINHelperStripUNC((char*)lpszOldFile), lOemOldFile); 534 CharToOemA(ODINHelperStripUNC((char*)lpszNewFile), lOemNewFile); 512 535 513 536 rc = DosCopy((PSZ)lOemOldFile, (PSZ)lOemNewFile, fFailIfExist ? 0: DCPY_EXISTING); … … 522 545 char lOemOldFile[260], lOemNewFile[260]; 523 546 524 CharToOemA( lpszOldFile, lOemOldFile);525 CharToOemA( lpszNewFile, lOemNewFile);547 CharToOemA(ODINHelperStripUNC((char*)lpszOldFile), lOemOldFile); 548 CharToOemA(ODINHelperStripUNC((char*)lpszNewFile), lOemNewFile); 526 549 527 550 // we need to know the current drive for relative paths … … 574 597 char lOemDir[260]; 575 598 576 CharToOemA( lpszDir, lOemDir);599 CharToOemA(ODINHelperStripUNC((char*)lpszDir), lOemDir); 577 600 578 601 rc = DosDeleteDir((PSZ)lOemDir); … … 587 610 char lOemDir[260]; 588 611 589 CharToOemA( lpszDir, lOemDir);612 CharToOemA(ODINHelperStripUNC((char*)lpszDir), lOemDir); 590 613 591 614 rc = DosCreateDir((PSZ)lOemDir, NULL); … … 697 720 char lOemFileName[260]; 698 721 699 CharToOemA( lpszFileName, lOemFileName);722 CharToOemA(ODINHelperStripUNC(lpszFileName), lOemFileName); 700 723 701 724 rc = DosDelete(lOemFileName); … … 775 798 776 799 // Note: we only handle standard "GetFileExInfoStandard" requests 777 rc = DosQueryPathInfo( pszName, /* query the file information */800 rc = DosQueryPathInfo(ODINHelperStripUNC(pszName), /* query the file information */ 778 801 FIL_STANDARD, 779 802 &fs3, … … 804 827 switch(cmd) { 805 828 case OSLIB_SEARCHDIR: 806 if(DosSearchPath(SEARCH_IGNORENETERRS, path,829 if(DosSearchPath(SEARCH_IGNORENETERRS, ODINHelperStripUNC(path), 807 830 name, full_name, length_fullname) != 0) { 808 831 return 0; … … 812 835 813 836 case OSLIB_SEARCHCURDIR: 814 if(DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_CUR_DIRECTORY, path,837 if(DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_CUR_DIRECTORY, ODINHelperStripUNC(path), 815 838 name, full_name, length_fullname) != 0) { 816 839 return 0; … … 822 845 FILESTATUS3 fileinfo; 823 846 824 if(DosQueryPathInfo( name, FIL_STANDARD, &fileinfo, sizeof(fileinfo)) != 0) {847 if(DosQueryPathInfo(ODINHelperStripUNC(name), FIL_STANDARD, &fileinfo, sizeof(fileinfo)) != 0) { 825 848 return 0; 826 849 } … … 858 881 ULONG cbInfoBuf) 859 882 { 860 APIRET rc = DosQueryPathInfo( pszPathName, ulInfoLevel,883 APIRET rc = DosQueryPathInfo( ODINHelperStripUNC(pszPathName), ulInfoLevel, 861 884 pInfoBuf, cbInfoBuf ); 862 885 … … 888 911 ULONG openFlag = 0; 889 912 ULONG openMode = OPEN_FLAGS_NOINHERIT; //default is not inherited by child processes 890 APIRET rc = ERROR_NOT_ENOUGH_MEMORY;; 913 APIRET rc = ERROR_NOT_ENOUGH_MEMORY; 914 915 CHAR* lpszFileLoc = ODINHelperStripUNC(lpszFile); 891 916 892 917 //TODO: lpSecurityAttributes (inheritance) … … 980 1005 #endif 981 1006 982 if(strlen(lpszFile ) == 2 && lpszFile[1] == ':') {1007 if(strlen(lpszFileLoc) == 2 && lpszFileLoc[1] == ':') { 983 1008 //app tries to open logical volume/partition 984 1009 openMode |= OPEN_FLAGS_DASD; 985 1010 } 1011 986 1012 int retry = 0; 987 1013 while (retry < 3) 988 1014 { 989 dprintf(("DosOpen %s openFlag=%x openMode=%x", lpszFile , openFlag, openMode));990 rc = OdinDosOpenL((PSZ)lpszFile ,1015 dprintf(("DosOpen %s openFlag=%x openMode=%x", lpszFileLoc, openFlag, openMode)); 1016 rc = OdinDosOpenL((PSZ)lpszFileLoc, 991 1017 &hFile, 992 1018 &actionTaken, … … 1048 1074 // @@@AH 2001-06-02 Win2k SP2 returns error 2 in this case 1049 1075 int winError = error2WinError(rc); 1050 if (winError == ERROR_OPEN_FAILED_W )1076 if (winError == ERROR_OPEN_FAILED_W || winError == ERROR_PATH_NOT_FOUND_W) 1051 1077 { 1052 1078 //Windows returns ERROR_FILE_EXISTS if create new & file exists … … 1303 1329 break; 1304 1330 } 1305 1331 #if 0 1306 1332 // PH Note: for a negative 32-bit seek, the OS/2 64-bit version 1307 1333 // needs to be skipped. 1308 if( (f64BitIO) && (OffsetHigh) ) 1334 if( (f64BitIO) && (OffsetHigh) && 1335 (*OffsetHigh != 0xAAAAAAAA) && 1336 (*OffsetHigh != 0)) //workaround for flash10 video 1309 1337 { 1310 1338 offsetL.ulLo = OffsetLow; … … 1316 1344 newoffset = newoffsetL.ulLo; 1317 1345 } 1318 else rc = DosSetFilePtr(hFile, OffsetLow, method, &newoffset); 1346 else 1347 #endif 1348 rc = DosSetFilePtr(hFile, OffsetLow, method, &newoffset); 1319 1349 1320 1350 if(rc) … … 2235 2265 char lOemFileName[260]; 2236 2266 2237 CharToOemA( lpFileName, lOemFileName);2267 CharToOemA(ODINHelperStripUNC((char*)lpFileName), lOemFileName); 2238 2268 2239 2269 APIRET rc = DosFindFirst((PSZ)lOemFileName,&hDir,attrs,&result,sizeof(result),&searchCount,FIL_STANDARD); … … 2241 2271 //check root: skip "." and ".." (HPFS, not on FAT) 2242 2272 //check in OSLibDosFindNext not necessary: "." and ".." are the first two entries 2243 if ((rc == 0) && isRoot((LPSTR) lpFileName))2273 if ((rc == 0) && isRoot((LPSTR)ODINHelperStripUNC((char*)lpFileName))) 2244 2274 { 2245 2275 while ((strcmp(result.achName,".") == 0) || … … 2294 2324 char lOemFileName[260]; 2295 2325 2296 CharToOemA( lpFileName, lOemFileName);2326 CharToOemA(ODINHelperStripUNC((char*)lpFileName), lOemFileName); 2297 2327 APIRET rc = DosFindFirst((PSZ)lOemFileName,&hDir,attrs,result,searchCount*sizeof(FILEFINDBUF3),&searchCount,FIL_STANDARD); 2298 2328 SetErrorMode(oldmode); … … 2386 2416 { 2387 2417 FILESTATUS3 statusBuf; 2388 char *lOemFileName;2418 char lOemFileName[CCHMAXPATH]; 2389 2419 char *lpszBackslash, *lpszColon; 2390 2420 APIRET rc; 2391 2421 2392 lOemFileName = (char *)malloc(strlen(lpFileName)+64); 2393 lOemFileName[0] = 0; 2422 //testestest 2423 if(strlen(lpFileName) > CCHMAXPATH) DebugInt3(); 2424 //testestset 2394 2425 2395 2426 //Convert file name from Windows to OS/2 codepage 2396 CharToOemA( lpFileName, lOemFileName);2427 CharToOemA(ODINHelperStripUNC(lpFileName), lOemFileName); 2397 2428 lpszBackslash = CharPrevA(lOemFileName, lOemFileName + strlen(lOemFileName)); 2398 2429 if(lpszBackslash) … … 2401 2432 { 2402 2433 lpszColon = CharPrevA(lOemFileName, lpszBackslash); 2403 if( strlen(lOemFileName) > 1 &&lpszColon && *lpszColon != ':')2434 if(lpszColon && *lpszColon != ':') 2404 2435 {//only rootdir is allowed to have terminating backslash 2405 2436 *lpszBackslash = 0; … … 2422 2453 rc = DosQueryPathInfo(lOemFileName, FIL_STANDARD, &statusBuf, sizeof(statusBuf)); 2423 2454 } 2424 free(lOemFileName);2425 2455 2426 2456 if(rc == NO_ERROR) -
trunk/src/kernel32/oslibdos.h
r9945 r21329 16 16 extern "C" { 17 17 #endif 18 19 char* ODINHelperStripUNC(char* strUNC); 18 20 19 21 #ifdef OS2_INCLUDED -
trunk/src/kernel32/unicode/string.c
r9963 r21329 404 404 return retval; 405 405 } 406 407 int sprintfW( WCHAR *str, const WCHAR *format, ...) 408 { 409 int retval; 410 va_list valist; 411 va_start(valist, format); 412 retval = vsnprintfW(str, INT_MAX, format, valist); 413 va_end(valist); 414 return retval; 415 }
Note:
See TracChangeset
for help on using the changeset viewer.