Changeset 9901 for trunk/src


Ignore:
Timestamp:
Mar 5, 2003, 3:48:45 PM (22 years ago)
Author:
sandervl
Message:

better parameter checks in timeBegin/EndPeriod

Location:
trunk/src/winmm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/os2timer.h

    r6933 r9901  
    1 /* $Id: os2timer.h,v 1.11 2001-10-03 13:47:58 sandervl Exp $ */
     1/* $Id: os2timer.h,v 1.12 2003-03-05 14:48:45 sandervl Exp $ */
    22
    33#ifndef __OS2TIMER_H__
     
    3232  we need to add support for dynamic detection of this feature.
    3333  */
    34 #define OS2TIMER_RESOLUTION_MINIMUM 2
     34#define OS2TIMER_RESOLUTION_MINIMUM 1
    3535#define OS2TIMER_RESOLUTION_MAXIMUM 0x7ffffffe
    3636
  • trunk/src/winmm/time.cpp

    r8470 r9901  
    1 /* $Id: time.cpp,v 1.16 2002-05-22 15:50:26 sandervl Exp $ */
     1/* $Id: time.cpp,v 1.17 2003-03-05 14:48:45 sandervl Exp $ */
    22
    33/*
     
    8787MMRESULT WINAPI timeBeginPeriod(UINT cMilliseconds)
    8888{
     89  if (cMilliseconds < OS2TIMER_RESOLUTION_MINIMUM || cMilliseconds > OS2TIMER_RESOLUTION_MAXIMUM)
     90      return TIMERR_NOCANDO;
     91
    8992  if (TRUE == OS2TimerResolution::enterResolutionScope(cMilliseconds))
    9093    return TIMERR_NOERROR;
     
    108111MMRESULT WINAPI timeEndPeriod(UINT cMilliseconds)
    109112{
     113  if (cMilliseconds < OS2TIMER_RESOLUTION_MINIMUM || cMilliseconds > OS2TIMER_RESOLUTION_MAXIMUM)
     114      return TIMERR_NOCANDO;
     115
    110116  if (TRUE == OS2TimerResolution::leaveResolutionScope(cMilliseconds))
    111117    return TIMERR_NOERROR;
Note: See TracChangeset for help on using the changeset viewer.