Changeset 9530 for trunk/src/kernel32
- Timestamp:
- Dec 19, 2002, 1:55:27 PM (23 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmfile.cpp
r9453 r9530 1 /* $Id: hmfile.cpp,v 1.3 6 2002-12-03 11:29:27 sandervl Exp $ */1 /* $Id: hmfile.cpp,v 1.37 2002-12-19 12:55:27 sandervl Exp $ */ 2 2 3 3 /* … … 141 141 * Result : 142 142 * Remark : TODO: Check if this implementation is complete and 100% correct 143 * UTC Time or Localtime ? 144 * GetFileTime is changed, Returns UTC-time yet !!!!! 143 145 * Status : NO_ERROR - API succeeded 144 146 * other - what is to be set in SetLastError … … 220 222 &filetime ); 221 223 224 /* UTC Time or Localtime ? GetFileTime Returns UTC-time yet ? !!!!! */ 222 225 FileTimeToDosDateTime(&filetime, 223 226 &filedatetime[0], … … 674 677 } 675 678 676 679 //****************************************************************************** 677 680 /***************************************************************************** 678 681 * Name : BOOL HMDeviceFileClass::SetFileTime … … 687 690 * Status : 688 691 * 689 * Author : Patrick Haller [Wed, 1999/06/17 20:44] 692 * Author : Patrick Haller [Wed, 1999/06/17 20:44] mod. DT 690 693 *****************************************************************************/ 691 694 … … 695 698 LPFILETIME pFT3) 696 699 { 697 WORD creationdate = 0, creationtime = 0;698 WORD lastaccessdate = 0, lastaccesstime = 0;699 WORD lastwritedate = 0, lastwritetime = 0;700 701 700 dprintfl(("KERNEL32: HMDeviceFileClass::SetFileTime %s(%08xh,%08xh,%08xh,%08xh)\n", 702 701 lpHMDeviceName, pHMHandleData, pFT1, pFT2, pFT3)); 703 702 704 if(pFT1 && pFT1->dwLowDateTime && pFT1->dwHighDateTime) { 705 FileTimeToDosDateTime(pFT1, &creationdate, &creationtime); 706 } 707 708 if(pFT2 && pFT2->dwLowDateTime && pFT2->dwHighDateTime) { 709 FileTimeToDosDateTime(pFT2, &lastaccessdate, &lastaccesstime); 710 } 711 712 if(pFT3 && pFT3->dwLowDateTime && pFT3->dwHighDateTime) { 713 FileTimeToDosDateTime(pFT3, &lastwritedate, &lastwritetime); 714 } 715 716 if(OSLibDosSetFileTime(pHMHandleData->hHMHandle, 717 creationdate, creationtime, 718 lastaccessdate, lastaccesstime, 719 lastwritedate, lastwritetime)) 720 { 721 return TRUE; 722 } 703 if(OSLibDosSetFileTime(pHMHandleData->hHMHandle, pFT1, pFT2, pFT3)) return TRUE; 704 723 705 dprintf(("SetFileTime failed with error %d", GetLastError())); 724 706 return FALSE; … … 737 719 * Status : 738 720 * 739 * Author : SvL 721 * Author : SvL mod. DT 740 722 *****************************************************************************/ 741 723 … … 745 727 LPFILETIME pFT3) 746 728 { 747 WORD creationdate, creationtime;748 WORD lastaccessdate, lastaccesstime;749 WORD lastwritedate, lastwritetime;750 BOOL rc;751 752 729 if(!pFT1 && !pFT2 && !pFT3) {//TODO: does NT do this? 753 730 dprintf(("ERROR: GetFileTime: invalid parameter!")); … … 756 733 } 757 734 758 if(OSLibDosGetFileTime(pHMHandleData->hHMHandle, 759 &creationdate, &creationtime, 760 &lastaccessdate, &lastaccesstime, 761 &lastwritedate, &lastwritetime)) 762 { 763 if(pFT1) { 764 DosDateTimeToFileTime(creationdate, creationtime, pFT1); 765 } 766 if(pFT2) { 767 DosDateTimeToFileTime(lastaccessdate, lastaccesstime, pFT2); 768 } 769 if(pFT3) { 770 DosDateTimeToFileTime(lastwritedate, lastwritetime, pFT3); 771 } 772 return TRUE; 773 } 735 if(OSLibDosGetFileTime(pHMHandleData->hHMHandle, pFT1, pFT2, pFT3)) return TRUE; 774 736 dprintf(("GetFileTime failed with error %d", GetLastError())); 775 737 return FALSE; -
trunk/src/kernel32/oslibdos.cpp
r9298 r9530 1 /* $Id: oslibdos.cpp,v 1.1 09 2002-09-26 16:06:07 sandervl Exp $ */1 /* $Id: oslibdos.cpp,v 1.110 2002-12-19 12:55:27 sandervl Exp $ */ 2 2 /* 3 3 * Wrappers for OS/2 Dos* API … … 673 673 dosDate = *(USHORT*)pDate; 674 674 675 //time we get from OS2 is local time; win32 expects file time (UTC) 675 676 ret = DosDateTimeToFileTime(dosDate, dosTime, &dummy); 676 if(ret == FALSE) { 677 return FALSE; 678 } 679 //time we get from OS2 is local time; win32 expects file time (UTC) 680 ret = LocalFileTimeToFileTime(&dummy, pFT); 677 if(ret) ret = LocalFileTimeToFileTime(&dummy, pFT); 678 return ret; 679 } 680 //****************************************************************************** 681 //****************************************************************************** 682 BOOL pmFileTimeToDateTime(FILETIME *pFT, FDATE *pDate, FTIME *pTime) 683 { 684 BOOL ret; 685 FILETIME dummy; 686 //time we get from win32 is file time (UTC); OS2 expects local time 687 ret = FileTimeToLocalFileTime(pFT, &dummy); 688 if (ret) ret = FileTimeToDosDateTime(&dummy, (WORD*)pDate, (WORD*)pTime); 681 689 return ret; 682 690 } … … 1391 1399 //****************************************************************************** 1392 1400 //****************************************************************************** 1393 BOOL OSLibDosSetFileTime(DWORD hFile, WORD creationdate, WORD creationtime, 1394 WORD lastaccessdate, WORD lastaccesstime, 1395 WORD lastwritedate, WORD lastwritetime) 1401 BOOL OSLibDosSetFileTime(DWORD hFile, LPFILETIME pFT1, 1402 LPFILETIME pFT2, LPFILETIME pFT3) 1396 1403 { 1397 1404 FILESTATUS3 fileInfo; … … 1400 1407 rc = DosQueryFileInfo(hFile, FIL_STANDARD, &fileInfo, sizeof(fileInfo)); 1401 1408 1402 if(rc == NO_ERROR) 1403 { 1404 if(creationdate && creationtime) { 1405 fileInfo.fdateCreation = *(FDATE *)&creationdate; 1406 fileInfo.ftimeCreation = *(FTIME *)&creationtime; 1407 } 1408 if(lastaccessdate && lastaccesstime) { 1409 fileInfo.fdateLastAccess = *(FDATE *)&lastaccessdate; 1410 fileInfo.ftimeLastAccess = *(FTIME *)&lastaccesstime; 1411 } 1412 if(lastwritedate && lastwritetime) { 1413 fileInfo.fdateLastWrite = *(FDATE *)&lastwritedate; 1414 fileInfo.ftimeLastWrite = *(FTIME *)&lastwritetime; 1415 } 1409 if (rc == NO_ERROR) 1410 { 1411 if (pFT1) pmFileTimeToDateTime(pFT1, &fileInfo.fdateCreation, &fileInfo.ftimeCreation); 1412 if (pFT2) pmFileTimeToDateTime(pFT2, &fileInfo.fdateLastAccess,&fileInfo.ftimeLastAccess); 1413 if (pFT3) pmFileTimeToDateTime(pFT3, &fileInfo.fdateLastWrite, &fileInfo.ftimeLastWrite); 1416 1414 1417 1415 rc = DosSetFileInfo(hFile, FIL_STANDARD, &fileInfo, sizeof(fileInfo)); … … 1428 1426 //****************************************************************************** 1429 1427 //****************************************************************************** 1430 BOOL OSLibDosGetFileTime(DWORD hFile, WORD *creationdate, WORD *creationtime, 1431 WORD *lastaccessdate, WORD *lastaccesstime, 1432 WORD *lastwritedate, WORD *lastwritetime) 1428 BOOL OSLibDosGetFileTime(DWORD hFile, LPFILETIME pFT1, 1429 LPFILETIME pFT2, LPFILETIME pFT3) 1433 1430 { 1434 1431 FILESTATUS3 fileInfo; … … 1439 1436 if(rc == NO_ERROR) 1440 1437 { 1441 *creationdate = *(WORD *)&fileInfo.fdateCreation; 1442 *creationtime = *(WORD *)&fileInfo.ftimeCreation; 1443 *lastaccessdate = *(WORD *)&fileInfo.fdateLastAccess; 1444 *lastaccesstime = *(WORD *)&fileInfo.ftimeLastAccess; 1445 *lastwritedate = *(WORD *)&fileInfo.fdateLastWrite; 1446 *lastwritetime = *(WORD *)&fileInfo.ftimeLastWrite; 1447 } 1448 1438 if (pFT1) pmDateTimeToFileTime(&fileInfo.fdateCreation, &fileInfo.ftimeCreation, pFT1); 1439 if (pFT2) pmDateTimeToFileTime(&fileInfo.fdateLastAccess,&fileInfo.ftimeLastAccess,pFT2); 1440 if (pFT3) pmDateTimeToFileTime(&fileInfo.fdateLastWrite, &fileInfo.ftimeLastWrite, pFT3); 1441 } 1449 1442 if(rc) 1450 1443 { -
trunk/src/kernel32/oslibdos.h
r9095 r9530 1 /* $Id: oslibdos.h,v 1.4 8 2002-08-22 14:21:27 sandervl Exp $ */1 /* $Id: oslibdos.h,v 1.49 2002-12-19 12:55:27 sandervl Exp $ */ 2 2 3 3 /* … … 99 99 BOOL OSLibDosGetFileInformationByHandle(DWORD hFile, BY_HANDLE_FILE_INFORMATION* pHFI); 100 100 101 BOOL OSLibDosSetFileTime(DWORD hFile, WORD creationdate, WORD creationtime,102 WORD lastaccessdate, WORD lastaccesstime,103 WORD lastwritedate, WORD lastwritetime);104 105 BOOL OSLibDosGetFileTime(DWORD hFile, WORD *creationdate, WORD *creationtime,106 WORD *lastaccessdate, WORD *lastaccesstime,107 WORD *lastwritedate, WORD *lastwritetime);101 BOOL OSLibDosSetFileTime(DWORD hFile, LPFILETIME pFT1, 102 LPFILETIME pFT2, 103 LPFILETIME pFT3); 104 105 BOOL OSLibDosGetFileTime(DWORD hFile, LPFILETIME pFT1, 106 LPFILETIME pFT2, 107 LPFILETIME pFT3); 108 108 109 109 DWORD OSLibDosSetFilePointer(DWORD hFile, DWORD OffsetLow, DWORD *OffsetHigh, DWORD method);
Note:
See TracChangeset
for help on using the changeset viewer.