Changeset 4285 for trunk/src/kernel32/Fileio.cpp
- Timestamp:
- Sep 20, 2000, 11:32:58 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r4279 r4285 1 /* $Id: Fileio.cpp,v 1.4 0 2000-09-18 19:26:15 sandervlExp $ */1 /* $Id: Fileio.cpp,v 1.41 2000-09-20 21:32:50 hugh Exp $ */ 2 2 3 3 /* … … 91 91 dprintf(("FindFirstFileA %s", lpFileName)); 92 92 if(lpFileName == NULL || lpFindFileData == NULL) { 93 94 93 SetLastError(ERROR_INVALID_PARAMETER); 94 return -1; 95 95 } 96 96 namelen = strlen(lpFileName); 97 97 if(lpFileName[namelen-1] == '\\') { 98 99 100 101 } 102 else 98 filename = (char *)alloca(namelen+1); 99 strcpy(filename, lpFileName); 100 filename[namelen-1] = 0; 101 } 102 else filename = (char *)lpFileName; 103 103 104 104 return (HANDLE)OSLibDosFindFirst(filename,lpFindFileData); … … 244 244 { 245 245 if (lpft1 == NULL || lpft2 == NULL) { 246 247 248 } 246 SetLastError(ERROR_INVALID_PARAMETER); 247 return -1; 248 } 249 249 250 250 if(lpft1->dwHighDateTime > lpft2->dwHighDateTime) 251 251 return 1; 252 252 253 253 if(lpft1->dwHighDateTime < lpft2->dwHighDateTime) 254 254 return -1; 255 255 256 256 if(lpft1->dwLowDateTime > lpft2->dwLowDateTime) 257 257 return 1; 258 258 259 259 if(lpft1->dwLowDateTime < lpft2->dwLowDateTime) 260 260 return -1; 261 261 262 262 return 0; //equal … … 342 342 if((dwCopyFlags & COPY_FILE_FAIL_IF_EXISTS) != 0) 343 343 { 344 344 failIfExists = TRUE; 345 345 } 346 346 … … 416 416 rc = OSLibDosDelete((LPSTR)lpszFile); 417 417 if(!rc) { 418 419 420 421 422 } 418 dprintf(("DeleteFileA %s returned FALSE; last error %x", lpszFile, GetLastError())); 419 if(GetLastError() == 20) { 420 return TRUE; 421 } 422 } 423 423 else dprintf(("DeleteFileA %s", lpszFile)); 424 424 … … 509 509 //****************************************************************************** 510 510 //****************************************************************************** 511 ODINFUNCTION5(BOOL, ReadFileEx, 511 ODINFUNCTION5(BOOL, ReadFileEx, 512 512 HANDLE, hFile, 513 513 LPVOID, lpBuffer, … … 557 557 *****************************************************************************/ 558 558 559 ODINFUNCTION5(BOOL, WriteFileEx, 559 ODINFUNCTION5(BOOL, WriteFileEx, 560 560 HANDLE, hFile, 561 561 LPVOID, lpBuffer, … … 599 599 } 600 600 else { 601 602 603 604 601 rc = O32_GetFileAttributes((LPSTR)lpszFileName); 602 if(rc == -1 && lpszFileName[strlen(lpszFileName)-1] != '\\') { 603 char *filename = (char *)alloca(strlen(lpszFileName)+2); //+2!!!!!! 604 strcpy(filename, lpszFileName); 605 605 strcat(filename, "\\"); 606 607 606 rc = O32_GetFileAttributes((LPSTR)filename); 607 } 608 608 } 609 609 //SvL: Open32 returns FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_NORMAL for 610 610 // directories whereas NT 4 (SP6) only returns FILE_ATTRIBUTE_DIRECTORY 611 611 if(rc != -1 && (rc & FILE_ATTRIBUTE_DIRECTORY)) { 612 612 rc = FILE_ATTRIBUTE_DIRECTORY; 613 613 } 614 614 … … 671 671 { 672 672 char *ptr; 673 dprintf(("KERNEL32: GetFullPathName %s\n", arg1)); 673 DWORD rc; 674 dprintf(("KERNEL32: GetFullPathName called with %s %d %s \n", arg1, arg2, arg3)); 674 675 while((ptr = strchr(arg1, '/')) != NULL) 675 676 *ptr = '\\'; … … 913 914 length = lstrlenA(lpszLongPath) + 1; 914 915 if(length > cchBuffer) { 915 916 917 916 if(lpszShortPath) { 917 *lpszShortPath = 0; 918 } 918 919 return(length); //return length required (including 0 terminator) 919 920 } … … 938 939 length = lstrlenW(lpszLongPath) + 1; 939 940 if(length > cchBuffer) { 940 941 942 941 if(lpszShortPath) { 942 *lpszShortPath = 0; 943 } 943 944 return(length); //return length required (including 0 terminator) 944 945 } … … 1142 1143 1143 1144 lpAsciiPath = UnicodeToAsciiString( (LPWSTR) lpPathName); 1144 hChange = FindFirstChangeNotificationA(lpAsciiPath, bWatchSubtree, 1145 hChange = FindFirstChangeNotificationA(lpAsciiPath, bWatchSubtree, 1145 1146 dwNotifyFilter ); 1146 1147 if (lpAsciiPath) FreeAsciiString(lpAsciiPath);
Note:
See TracChangeset
for help on using the changeset viewer.