Ignore:
Timestamp:
Jul 30, 2001, 12:19:54 PM (24 years ago)
Author:
sandervl
Message:

rewrote time apis

File:
1 edited

Legend:

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

    r5364 r6408  
    1 /* $Id: time.cpp,v 1.11 2001-03-24 13:23:48 sandervl Exp $ */
     1/* $Id: time.cpp,v 1.12 2001-07-30 10:19:54 sandervl Exp $ */
    22
    33/*
     
    205205}
    206206
     207ULONG OPEN32API WinGetCurrentTime(ULONG hab);
     208
     209inline ULONG _WinGetCurrentTime(ULONG a)
     210{
     211 ULONG yyrc;
     212 USHORT sel = RestoreOS2FS();
     213
     214    yyrc = WinGetCurrentTime(a);
     215    SetFS(sel);
     216
     217    return yyrc;
     218}
     219
     220#undef  WinGetCurrentTime
     221#define WinGetCurrentTime _WinGetCurrentTime
    207222
    208223/*****************************************************************************
     
    219234
    220235ODINFUNCTION2(MMRESULT, timeGetSystemTime,
    221               LPMMTIME, arg1,
    222               UINT,     arg2)
    223 {
    224   dprintf2(("timeGetSystemTime %x %d", arg1, arg2));
    225   return O32_timeGetSystemTime(arg1, arg2);
     236              LPMMTIME, pTime,
     237              UINT,     cbTime)
     238{
     239  dprintf2(("timeGetSystemTime %x %d", pTime, cbTime));
     240
     241  if(pTime == NULL || cbTime < sizeof(MMTIME)) {
     242      SetLastError(ERROR_INVALID_PARAMETER);
     243      return 0;
     244  }
     245  pTime->wType = TIME_MS;
     246  pTime->u.ms = WinGetCurrentTime(0);
     247
     248  SetLastError(ERROR_SUCCESS);
     249  return 0;
    226250}
    227251
     
    257281#else
    258282  //SvL: TODO: Inaccurate
    259   time = O32_timeGetTime();
     283  time = WinGetCurrentTime(0);
    260284  dprintf2(("timeGetTime %x", time));
    261285#endif
Note: See TracChangeset for help on using the changeset viewer.