Ignore:
Timestamp:
Jun 26, 2002, 9:42:35 AM (23 years ago)
Author:
sandervl
Message:

There are no bugs in the WGSS SystemTimeToFileTime & DosDateTimeToFileTime functions; Real problem lies in the fact that the times returned by DosFindFirst, DosFindNext, DosQueryPathInfo & DosQueryFileInfo are in local time; we must convert them to file time (UTC)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/oslibdos.cpp

    r8600 r8777  
    1 /* $Id: oslibdos.cpp,v 1.104 2002-06-08 11:40:15 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.105 2002-06-26 07:42:34 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    860860BOOL OSLibDosDelete(char *lpszFileName)
    861861{
    862  APIRET rc;
    863  char lOemFileName[260];
    864 
    865  CharToOemA(lpszFileName, lOemFileName);
    866 
    867   rc = DosDelete(lOemFileName);
    868   if(rc) {
    869       SetLastError(error2WinError(rc));
    870       return FALSE;
    871   }
    872   return TRUE;
     862    APIRET rc;
     863    char lOemFileName[260];
     864
     865    CharToOemA(lpszFileName, lOemFileName);
     866
     867    rc = DosDelete(lOemFileName);
     868    if(rc) {
     869        SetLastError(error2WinError(rc));
     870        return FALSE;
     871    }
     872    return TRUE;
    873873}
    874874//******************************************************************************
     
    876876BOOL pmDateTimeToFileTime(FDATE *pDate,FTIME *pTime,FILETIME *pFT)
    877877{
    878   register USHORT dosTime, dosDate;
    879 
    880   dosTime = *(USHORT*)pTime;
    881   dosDate = *(USHORT*)pDate;
    882 
    883   // PH: probably replace with faster implementation than calling Open32
    884   // through the external interface!
    885   return DosDateTimeToFileTime(dosDate,dosTime,pFT);
     878    USHORT   dosTime, dosDate;
     879    BOOL     ret;
     880    FILETIME dummy;
     881
     882    dosTime = *(USHORT*)pTime;
     883    dosDate = *(USHORT*)pDate;
     884
     885    ret = DosDateTimeToFileTime(dosDate, dosTime, &dummy);
     886    if(ret == FALSE) {
     887        return FALSE;
     888    }
     889    //time we get from OS2 is local time; win32 expects file time (UTC)
     890    ret = LocalFileTimeToFileTime(&dummy, pFT);
     891    return ret;
    886892}
    887893//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.