Changeset 7865 for trunk/src/kernel32/oslibdos.cpp
- Timestamp:
- Feb 11, 2002, 2:46:36 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/oslibdos.cpp
r7777 r7865 1 /* $Id: oslibdos.cpp,v 1.9 4 2002-01-18 16:23:35sandervl Exp $ */1 /* $Id: oslibdos.cpp,v 1.95 2002-02-11 13:46:36 sandervl Exp $ */ 2 2 /* 3 3 * Wrappers for OS/2 Dos* API … … 43 43 static PROC_DosOpenL DosOpenLProc = 0; 44 44 static BOOL f64BitIO = FALSE; 45 46 BOOL WINAPI CharToOemA( LPCSTR s, LPSTR d ); 47 BOOL WINAPI OemToCharA( LPCSTR s, LPSTR d ); 48 45 49 //****************************************************************************** 46 50 //****************************************************************************** … … 116 120 APIRET yyrc; 117 121 USHORT sel = RestoreOS2FS(); 122 char OemFileName[260]; 123 CharToOemA(pszFileName, OemFileName); 118 124 119 125 if(DosOpenLProc) { 120 yyrc = DosOpenLProc( pszFileName, phf, pulAction, cbFile, ulAttribute, fsOpenFlags,126 yyrc = DosOpenLProc(OemFileName, phf, pulAction, cbFile, ulAttribute, fsOpenFlags, 121 127 fsOpenMode, peaop2); 122 128 } 123 else yyrc = DosOpen( pszFileName, phf, pulAction, cbFile.ulLo, ulAttribute, fsOpenFlags,129 else yyrc = DosOpen(OemFileName, phf, pulAction, cbFile.ulLo, ulAttribute, fsOpenFlags, 124 130 fsOpenMode, peaop2); 125 131 SetFS(sel); … … 581 587 ULONG ulAction; 582 588 DWORD os2flags = OPEN_FLAGS_NOINHERIT; 589 char lOemFileName[260]; 590 591 CharToOemA(lpszFileName, lOemFileName); 583 592 584 593 … … 599 608 600 609 tryopen: 601 rc = DosOpen(l pszFileName, /* File path name */610 rc = DosOpen(lOemFileName, /* File path name */ 602 611 &hFile, /* File handle */ 603 612 &ulAction, /* Action taken */ … … 648 657 { 649 658 APIRET rc; 650 651 rc = DosCopy((PSZ)lpszOldFile, (PSZ)lpszNewFile, fFailIfExist ? 0: DCPY_EXISTING); 659 char lOemOldFile[260], lOemNewFile[260]; 660 661 CharToOemA(lpszOldFile, lOemOldFile); 662 CharToOemA(lpszNewFile, lOemNewFile); 663 664 rc = DosCopy((PSZ)lOemOldFile, (PSZ)lOemNewFile, fFailIfExist ? 0: DCPY_EXISTING); 652 665 SetLastError(error2WinError(rc)); 653 666 return (rc == NO_ERROR); … … 658 671 { 659 672 APIRET rc; 660 661 rc = DosMove((PSZ)lpszOldFile, (PSZ)lpszNewFile); 673 char lOemOldFile[260], lOemNewFile[260]; 674 675 CharToOemA(lpszOldFile, lOemOldFile); 676 CharToOemA(lpszNewFile, lOemNewFile); 677 678 rc = DosMove((PSZ)lOemOldFile, (PSZ)lOemNewFile); 662 679 SetLastError(error2WinError(rc)); 663 680 return (rc == NO_ERROR); … … 668 685 { 669 686 APIRET rc; 670 671 rc = DosDeleteDir((PSZ)lpszDir); 687 char lOemDir[260]; 688 689 CharToOemA(lpszDir, lOemDir); 690 691 rc = DosDeleteDir((PSZ)lOemDir); 672 692 SetLastError(error2WinError(rc)); 673 693 return (rc == NO_ERROR); … … 678 698 { 679 699 APIRET rc; 680 681 rc = DosCreateDir((PSZ)lpszDir, NULL); 700 char lOemDir[260]; 701 702 CharToOemA(lpszDir, lOemDir); 703 704 rc = DosCreateDir((PSZ)lOemDir, NULL); 682 705 SetLastError(error2WinError(rc)); 683 706 return (rc == NO_ERROR); … … 785 808 { 786 809 APIRET rc; 787 788 rc = DosDelete(lpszFileName); 810 char lOemFileName[260]; 811 812 CharToOemA(lpszFileName, lOemFileName); 813 814 rc = DosDelete(lOemFileName); 789 815 if(rc) { 790 816 SetLastError(error2WinError(rc)); … … 1081 1107 * This problem exist on WS4eB SMP FP1 and Warp4 FP14/Kernel 14059 at least. 1082 1108 */ 1083 rc = DosOpen((PSZ)l pszFile,1109 rc = DosOpen((PSZ)lOemFile, 1084 1110 &hFile, 1085 1111 &actionTaken, … … 2196 2222 { 2197 2223 name++; 2198 strcpy(pFind->cFileName,name); 2224 // strcpy(pFind->cFileName,name); 2225 OemToCharA( name, pFind->cFileName ); 2199 2226 } 2200 2227 else … … 2203 2230 long2ShortName(pFind->cFileName,pFind->cAlternateFileName); 2204 2231 } 2232 2205 2233 2206 2234 VOID translateFindResults(FILEFINDBUF3 *pResult,LPWIN32_FIND_DATAA pFind) … … 2215 2243 pFind->nFileSizeHigh = 0; //CB: fixme 2216 2244 pFind->nFileSizeLow = pResult->cbFile; 2217 strcpy(pFind->cFileName,pResult->achName); 2245 // strcpy(pFind->cFileName,pResult->achName); 2246 OemToCharA( pResult->achName, pFind->cFileName ); 2218 2247 long2ShortName(pFind->cFileName,pFind->cAlternateFileName); 2219 2248 } … … 2231 2260 2232 2261 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2233 APIRET rc = DosFindFirst((PSZ)lpFileName,&hDir,attrs,&result,sizeof(result),&searchCount,FIL_STANDARD); 2262 char lOemFileName[260]; 2263 2264 CharToOemA(lpFileName, lOemFileName); 2265 2266 APIRET rc = DosFindFirst((PSZ)lOemFileName,&hDir,attrs,&result,sizeof(result),&searchCount,FIL_STANDARD); 2234 2267 2235 2268 //check root: skip "." and ".." (HPFS, not on FAT) … … 2281 2314 2282 2315 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2283 APIRET rc = DosFindFirst((PSZ)lpFileName,&hDir,attrs,result,searchCount*sizeof(FILEFINDBUF3),&searchCount,FIL_STANDARD); 2316 char lOemFileName[260]; 2317 2318 CharToOemA(lpFileName, lOemFileName); 2319 APIRET rc = DosFindFirst((PSZ)lOemFileName,&hDir,attrs,result,searchCount*sizeof(FILEFINDBUF3),&searchCount,FIL_STANDARD); 2284 2320 SetErrorMode(oldmode); 2285 2321 if (rc)
Note:
See TracChangeset
for help on using the changeset viewer.