Ignore:
Timestamp:
Apr 30, 2002, 11:21:33 AM (23 years ago)
Author:
sandervl
Message:

PF: FileTimeToSystemTime, DosDateTimeToFileTime & SystemTimeToFileTime bugfixes

File:
1 edited

Legend:

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

    r7854 r8336  
    1 /* $Id: time.cpp,v 1.17 2002-02-09 17:27:32 sandervl Exp $ */
     1/* $Id: time.cpp,v 1.18 2002-04-30 09:21:33 sandervl Exp $ */
    22
    33/*
     
    3131#include <string.h>
    3232#include <stdio.h>
     33#include <time.h>
    3334#include "unicode.h"
    3435
     
    104105    return O32_FileTimeToDosDateTime(arg1, arg2, arg3);
    105106}
    106 //******************************************************************************
    107 //******************************************************************************
    108 BOOL WIN32API FileTimeToLocalFileTime(const FILETIME * arg1, LPFILETIME arg2)
    109 {
    110     dprintf(("KERNEL32:  FileTimeToLocalFileTime\n"));
    111     return O32_FileTimeToLocalFileTime(arg1, arg2);
     107
     108//******************************************************************************
     109//******************************************************************************
     110BOOL WIN32API FileTimeToLocalFileTime(const FILETIME * utcft, LPFILETIME localft)
     111{
     112   return O32_FileTimeToLocalFileTime(utcft,localft);
    112113}
    113114//******************************************************************************
     
    122123BOOL WIN32API FileTimeToSystemTime(const FILETIME * arg1, LPSYSTEMTIME arg2)
    123124{
    124   return O32_FileTimeToSystemTime(arg1, arg2);
     125   /* Another WGSS bug it expects not UCT on input but LocalTime! */
     126   FILETIME dummy;
     127   FileTimeToLocalFileTime(arg1,&dummy);
     128   return O32_FileTimeToSystemTime(&dummy, arg2);
    125129}
    126130//******************************************************************************
     
    128132BOOL WIN32API DosDateTimeToFileTime(WORD arg1, WORD arg2, LPFILETIME arg3)
    129133{
    130     return O32_DosDateTimeToFileTime(arg1, arg2, arg3);
     134    BOOL rc;
     135    rc = O32_DosDateTimeToFileTime(arg1, arg2, arg3);
     136    /* Bug in WGSS after that we must have UCT file time on return,
     137       instead we have local! */
     138    if (rc)
     139    {
     140      FILETIME dummy;
     141      /* Convert it to UCT */
     142      rc = LocalFileTimeToFileTime(arg3,&dummy);
     143      memcpy(arg3,&dummy,sizeof(FILETIME));
     144    }
     145    return rc;
    131146}
    132147//******************************************************************************
     
    154169                                   LPFILETIME arg2)
    155170{
    156   return O32_SystemTimeToFileTime(arg1, arg2);
     171    BOOL rc;
     172    rc = O32_SystemTimeToFileTime(arg1, arg2);
     173    /* Bug in WGSS after that we must have UCT file time on return,
     174       instead we have local! */
     175    if (rc)
     176    {
     177      FILETIME dummy;
     178      /* Convert it to local */
     179      rc = LocalFileTimeToFileTime(arg2,&dummy);
     180      memcpy(arg2,&dummy,sizeof(FILETIME));
     181    }
     182    return rc;
    157183}
    158184//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.