ReactOS  0.4.14-dev-368-gfa26425
time.c File Reference
#include "winemm.h"
Include dependency graph for time.c:

Go to the source code of this file.

Classes

struct  tagWINE_TIMERENTRY
 

Macros

#define MMSYSTIME_MININTERVAL   (1)
 
#define MMSYSTIME_MAXINTERVAL   (65535)
 

Typedefs

typedef struct tagWINE_TIMERENTRY WINE_TIMERENTRY
 
typedef struct tagWINE_TIMERENTRYLPWINE_TIMERENTRY
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mmtime)
 
static void TIME_TriggerCallBack (LPWINE_TIMERENTRY lpTimer)
 
static DWORD CALLBACK TIME_MMSysTimeCallback ()
 
static DWORD CALLBACK TIME_MMSysTimeThread (LPVOID arg)
 
void TIME_MMTimeStart (void)
 
void TIME_MMTimeStop (void)
 
MMRESULT WINAPI timeGetSystemTime (LPMMTIME lpTime, UINT wSize)
 
WORD TIME_SetEventInternal (UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, DWORD dwUser, UINT wFlags)
 
MMRESULT WINAPI timeSetEvent (UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, DWORD_PTR dwUser, UINT wFlags)
 
MMRESULT WINAPI timeKillEvent (UINT wID)
 
MMRESULT WINAPI timeGetDevCaps (LPTIMECAPS lpCaps, UINT wSize)
 
MMRESULT WINAPI timeBeginPeriod (UINT wPeriod)
 
MMRESULT WINAPI timeEndPeriod (UINT wPeriod)
 
DWORD WINAPI timeGetTime (void)
 

Variables

static HANDLE TIME_hMMTimer
 
static LPWINE_TIMERENTRY TIME_TimersList
 
static HANDLE TIME_hKillEvent
 
static HANDLE TIME_hWakeEvent
 
static BOOL TIME_TimeToDie = TRUE
 

Macro Definition Documentation

◆ MMSYSTIME_MAXINTERVAL

#define MMSYSTIME_MAXINTERVAL   (65535)

Definition at line 78 of file time.c.

◆ MMSYSTIME_MININTERVAL

#define MMSYSTIME_MININTERVAL   (1)

Definition at line 77 of file time.c.

Typedef Documentation

◆ LPWINE_TIMERENTRY

◆ WINE_TIMERENTRY

Function Documentation

◆ TIME_MMSysTimeCallback()

static DWORD CALLBACK TIME_MMSysTimeCallback ( )
static

Definition at line 112 of file time.c.

113 {
114 static int nSizeLpTimers;
115 static LPWINE_TIMERENTRY lpTimers;
116 
117  LPWINE_TIMERENTRY timer, *ptimer, *next_ptimer;
118  int idx;
119  DWORD cur_time;
120  DWORD delta_time;
121  DWORD ret_time = INFINITE;
122  DWORD adjust_time;
123 
124 
125  /* optimize for the most frequent case - no events */
126  if (! TIME_TimersList)
127  return(ret_time);
128 
129  /* since timeSetEvent() and timeKillEvent() can be called
130  * from 16 bit code, there are cases where win16 lock is
131  * locked upon entering timeSetEvent(), and then the mm timer
132  * critical section is locked. This function cannot call the
133  * timer callback with the crit sect locked (because callback
134  * may need to acquire Win16 lock, thus providing a deadlock
135  * situation).
136  * To cope with that, we just copy the WINE_TIMERENTRY struct
137  * that need to trigger the callback, and call it without the
138  * mm timer crit sect locked.
139  * the hKillTimeEvent is used to mark the section where we
140  * handle the callbacks so we can do synchronous kills.
141  * EPP 99/07/13, updated 04/01/10
142  */
143  idx = 0;
145 
147  for (ptimer = &TIME_TimersList; *ptimer != NULL; ) {
148  timer = *ptimer;
149  next_ptimer = &timer->lpNext;
150  if (cur_time >= timer->dwTriggerTime)
151  {
152  if (timer->lpFunc) {
153  if (idx == nSizeLpTimers) {
154  if (lpTimers)
155  lpTimers = (LPWINE_TIMERENTRY)
156  HeapReAlloc(GetProcessHeap(), 0, lpTimers,
157  ++nSizeLpTimers * sizeof(WINE_TIMERENTRY));
158  else
159  lpTimers = (LPWINE_TIMERENTRY)
161  ++nSizeLpTimers * sizeof(WINE_TIMERENTRY));
162  }
163  lpTimers[idx++] = *timer;
164 
165  }
166 
167  /* Update the time after we make the copy to preserve
168  the original trigger time */
169  timer->dwTriggerTime += timer->wDelay;
170 
171  /* TIME_ONESHOT is defined as 0 */
172  if (!(timer->wFlags & TIME_PERIODIC))
173  {
174  /* unlink timer from timers list */
175  *ptimer = *next_ptimer;
176  HeapFree(GetProcessHeap(), 0, timer);
177 
178  /* We don't need to trigger oneshots again */
179  delta_time = INFINITE;
180  }
181  else
182  {
183  /* Compute when this event needs this function
184  to be called again */
185  if (timer->dwTriggerTime <= cur_time)
186  delta_time = 0;
187  else
188  delta_time = timer->dwTriggerTime - cur_time;
189  }
190  }
191  else
192  delta_time = timer->dwTriggerTime - cur_time;
193 
194  /* Determine when we need to return to this function */
195  ret_time = min(ret_time, delta_time);
196 
197  ptimer = next_ptimer;
198  }
201 
202  while (idx > 0) TIME_TriggerCallBack(&lpTimers[--idx]);
204 
205  /* Finally, adjust the recommended wait time downward
206  by the amount of time the processing routines
207  actually took */
208  adjust_time = GetTickCount() - cur_time;
209  if (adjust_time > ret_time)
210  ret_time = 0;
211  else
212  ret_time -= adjust_time;
213 
214  /* We return the amount of time our caller should sleep
215  before needing to check in on us again */
216  return(ret_time);
217 }
LPTIMECALLBACK lpFunc
Definition: time.c:37
struct tagWINE_TIMERENTRY * lpNext
Definition: time.c:42
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
time_t cur_time
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
struct tagWINE_TIMERENTRY * LPWINE_TIMERENTRY
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
struct tagWINE_TIMERENTRY WINE_TIMERENTRY
UINT16 wFlags
Definition: time.c:39
unsigned int idx
Definition: utils.c:41
DWORD dwTriggerTime
Definition: time.c:41
static HANDLE TIME_hKillEvent
Definition: time.c:47
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static LPWINE_TIMERENTRY TIME_TimersList
Definition: time.c:46
CRITICAL_SECTION WINMM_cs
Definition: winmm.c:54
unsigned long DWORD
Definition: ntddk_ex.h:95
static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer)
Definition: time.c:81
#define HeapReAlloc
Definition: compat.h:401
#define min(a, b)
Definition: monoChain.cc:55
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define TIME_PERIODIC
Definition: mmsystem.h:422
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by TIME_MMSysTimeThread().

◆ TIME_MMSysTimeThread()

static DWORD CALLBACK TIME_MMSysTimeThread ( LPVOID  arg)
static

Definition at line 222 of file time.c.

223 {
224  DWORD sleep_time;
225  DWORD rc;
226 
227  TRACE("Starting main winmm thread\n");
228 
229  /* FIXME: As an optimization, we could have
230  this thread die when there are no more requests
231  pending, and then get recreated on the first
232  new event; it's not clear if that would be worth
233  it or not. */
234 
235  while (! TIME_TimeToDie)
236  {
237  sleep_time = TIME_MMSysTimeCallback();
238 
239  if (sleep_time == 0)
240  continue;
241 
242  rc = WaitForSingleObject(TIME_hWakeEvent, sleep_time);
243  if (rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0)
244  {
245  FIXME("Unexpected error %ld(%ld) in timer thread\n", rc, GetLastError());
246  break;
247  }
248  }
249  TRACE("Exiting main winmm thread\n");
250  return 0;
251 }
static DWORD CALLBACK TIME_MMSysTimeCallback()
Definition: time.c:112
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL TIME_TimeToDie
Definition: time.c:49
#define TRACE(s)
Definition: solgame.cpp:4
#define WAIT_OBJECT_0
Definition: winbase.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_TIMEOUT
Definition: dderror.h:14
static HANDLE TIME_hWakeEvent
Definition: time.c:48

Referenced by TIME_MMTimeStart().

◆ TIME_MMTimeStart()

void TIME_MMTimeStart ( void  )

Definition at line 256 of file time.c.

257 {
258  if (!TIME_hMMTimer) {
264  }
265 }
static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg)
Definition: time.c:222
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static BOOL TIME_TimeToDie
Definition: time.c:49
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:699
static LPWINE_TIMERENTRY TIME_TimersList
Definition: time.c:46
#define THREAD_PRIORITY_TIME_CRITICAL
Definition: winbase.h:278
static HANDLE TIME_hWakeEvent
Definition: time.c:48
static HANDLE TIME_hMMTimer
Definition: time.c:45

Referenced by TIME_SetEventInternal().

◆ TIME_MMTimeStop()

void TIME_MMTimeStop ( void  )

Definition at line 270 of file time.c.

271 {
272  if (TIME_hMMTimer) {
273 
276 
277  /* FIXME: in the worst case, we're going to wait 65 seconds here :-( */
279 
282  TIME_hMMTimer = 0;
284  }
285 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:416
static BOOL TIME_TimeToDie
Definition: time.c:49
static LPWINE_TIMERENTRY TIME_TimersList
Definition: time.c:46
static HANDLE TIME_hWakeEvent
Definition: time.c:48
static HANDLE TIME_hMMTimer
Definition: time.c:45
#define INFINITE
Definition: serial.h:102

Referenced by WINMM_DeleteIData().

◆ TIME_SetEventInternal()

WORD TIME_SetEventInternal ( UINT  wDelay,
UINT  wResol,
LPTIMECALLBACK  lpFunc,
DWORD  dwUser,
UINT  wFlags 
)

Definition at line 305 of file time.c.

307 {
308  WORD wNewID = 0;
309  LPWINE_TIMERENTRY lpNewTimer;
310  LPWINE_TIMERENTRY lpTimer;
311 
312  TRACE("(%u, %u, %p, %08lX, %04X);\n", wDelay, wResol, lpFunc, dwUser, wFlags);
313 
314  if (wDelay < MMSYSTIME_MININTERVAL || wDelay > MMSYSTIME_MAXINTERVAL)
315  return 0;
316 
317  lpNewTimer = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_TIMERENTRY));
318  if (lpNewTimer == NULL)
319  return 0;
320 
322 
323  lpNewTimer->wDelay = wDelay;
324  lpNewTimer->dwTriggerTime = GetTickCount() + wDelay;
325 
326  /* FIXME - wResol is not respected, although it is not clear
327  that we could change our precision meaningfully */
328  lpNewTimer->wResol = wResol;
329  lpNewTimer->lpFunc = lpFunc;
330  lpNewTimer->dwUser = dwUser;
331  lpNewTimer->wFlags = wFlags;
332 
334 
335  if ((wFlags & TIME_KILL_SYNCHRONOUS) && !TIME_hKillEvent)
337 
338  for (lpTimer = TIME_TimersList; lpTimer != NULL; lpTimer = lpTimer->lpNext) {
339  wNewID = max(wNewID, lpTimer->wTimerID);
340  }
341 
342  lpNewTimer->lpNext = TIME_TimersList;
343  TIME_TimersList = lpNewTimer;
344  lpNewTimer->wTimerID = wNewID + 1;
345 
347 
348  /* Wake the service thread in case there is work to be done */
350 
351  TRACE("=> %u\n", wNewID + 1);
352 
353  return wNewID + 1;
354 }
LPTIMECALLBACK lpFunc
Definition: time.c:37
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
struct tagWINE_TIMERENTRY * lpNext
Definition: time.c:42
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
UINT16 wFlags
Definition: time.c:39
DWORD dwTriggerTime
Definition: time.c:41
void TIME_MMTimeStart(void)
Definition: time.c:256
static HANDLE TIME_hKillEvent
Definition: time.c:47
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static LPWINE_TIMERENTRY TIME_TimersList
Definition: time.c:46
CRITICAL_SECTION WINMM_cs
Definition: winmm.c:54
UINT16 wTimerID
Definition: time.c:40
unsigned short WORD
Definition: ntddk_ex.h:93
static HANDLE TIME_hWakeEvent
Definition: time.c:48
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define MMSYSTIME_MAXINTERVAL
Definition: time.c:78
DWORD dwUser
Definition: time.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by timeSetEvent().

◆ TIME_TriggerCallBack()

static void TIME_TriggerCallBack ( LPWINE_TIMERENTRY  lpTimer)
static

Definition at line 81 of file time.c.

82 {
83  TRACE("%04lx:CallBack => lpFunc=%p wTimerID=%04X dwUser=%08lX dwTriggerTime %ld(delta %ld)\n",
84  GetCurrentThreadId(), lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser,
85  lpTimer->dwTriggerTime, GetTickCount() - lpTimer->dwTriggerTime);
86 
87  /* - TimeProc callback that is called here is something strange, under Windows 3.1x it is called
88  * during interrupt time, is allowed to execute very limited number of API calls (like
89  * PostMessage), and must reside in DLL (therefore uses stack of active application). So I
90  * guess current implementation via SetTimer has to be improved upon.
91  */
92  switch (lpTimer->wFlags & 0x30) {
94  (lpTimer->lpFunc)(lpTimer->wTimerID, 0, lpTimer->dwUser, 0, 0);
95  break;
97  SetEvent((HANDLE)lpTimer->lpFunc);
98  break;
100  PulseEvent((HANDLE)lpTimer->lpFunc);
101  break;
102  default:
103  FIXME("Unknown callback type 0x%04x for mmtime callback (%p), ignored.\n",
104  lpTimer->wFlags, lpTimer->lpFunc);
105  break;
106  }
107 }
LPTIMECALLBACK lpFunc
Definition: time.c:37
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define TIME_CALLBACK_EVENT_PULSE
Definition: mmsystem.h:425
UINT16 wFlags
Definition: time.c:39
BOOL WINAPI DECLSPEC_HOTPATCH PulseEvent(IN HANDLE hEvent)
Definition: synch.c:695
#define FIXME(fmt,...)
Definition: debug.h:110
DWORD dwTriggerTime
Definition: time.c:41
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define TRACE(s)
Definition: solgame.cpp:4
UINT16 wTimerID
Definition: time.c:40
DWORD dwUser
Definition: time.c:38
#define TIME_CALLBACK_FUNCTION
Definition: mmsystem.h:423
#define TIME_CALLBACK_EVENT_SET
Definition: mmsystem.h:424

Referenced by TIME_MMSysTimeCallback().

◆ timeBeginPeriod()

MMRESULT WINAPI timeBeginPeriod ( UINT  wPeriod)

Definition at line 422 of file time.c.

423 {
424  if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL)
425  return TIMERR_NOCANDO;
426 
427  if (wPeriod > MMSYSTIME_MININTERVAL)
428  {
429  WARN("Stub; we set our timer resolution at minimum\n");
430  }
431 
432  return 0;
433 }
#define WARN(fmt,...)
Definition: debug.h:111
#define TIMERR_NOCANDO
Definition: mmsystem.h:419
#define MMSYSTIME_MININTERVAL
Definition: time.c:77
#define MMSYSTIME_MAXINTERVAL
Definition: time.c:78

Referenced by DirectSoundDevice_Initialize(), and test_timer().

◆ timeEndPeriod()

MMRESULT WINAPI timeEndPeriod ( UINT  wPeriod)

Definition at line 438 of file time.c.

439 {
440  if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL)
441  return TIMERR_NOCANDO;
442 
443  if (wPeriod > MMSYSTIME_MININTERVAL)
444  {
445  WARN("Stub; we set our timer resolution at minimum\n");
446  }
447  return 0;
448 }
#define WARN(fmt,...)
Definition: debug.h:111
#define TIMERR_NOCANDO
Definition: mmsystem.h:419
#define MMSYSTIME_MININTERVAL
Definition: time.c:77
#define MMSYSTIME_MAXINTERVAL
Definition: time.c:78

Referenced by DirectSoundDevice_Release(), DSOUND_timer(), and test_timer().

◆ timeGetDevCaps()

MMRESULT WINAPI timeGetDevCaps ( LPTIMECAPS  lpCaps,
UINT  wSize 
)

Definition at line 400 of file time.c.

401 {
402  TRACE("(%p, %u)\n", lpCaps, wSize);
403 
404  if (lpCaps == 0) {
405  WARN("invalid lpCaps\n");
406  return TIMERR_NOCANDO;
407  }
408 
409  if (wSize < sizeof(TIMECAPS)) {
410  WARN("invalid wSize\n");
411  return TIMERR_NOCANDO;
412  }
413 
416  return TIMERR_NOERROR;
417 }
#define TIMERR_NOERROR
Definition: mmsystem.h:418
#define WARN(fmt,...)
Definition: debug.h:111
#define TIMERR_NOCANDO
Definition: mmsystem.h:419
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSTIME_MININTERVAL
Definition: time.c:77
UINT wPeriodMax
Definition: mmsystem.h:1395
#define MMSYSTIME_MAXINTERVAL
Definition: time.c:78
UINT wPeriodMin
Definition: mmsystem.h:1394

Referenced by DirectSoundDevice_Initialize(), and test_timeGetDevCaps().

◆ timeGetSystemTime()

MMRESULT WINAPI timeGetSystemTime ( LPMMTIME  lpTime,
UINT  wSize 
)

Definition at line 290 of file time.c.

291 {
292 
293  if (wSize >= sizeof(*lpTime)) {
294  lpTime->wType = TIME_MS;
295  lpTime->u.ms = GetTickCount();
296 
297  }
298 
299  return 0;
300 }
UINT wType
Definition: mmsystem.h:965
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
#define TIME_MS
Definition: mmsystem.h:28
union mmtime_tag::@2933 u
DWORD ms
Definition: mmsystem.h:967

◆ timeGetTime()

DWORD WINAPI timeGetTime ( void  )

Definition at line 454 of file time.c.

455 {
456 #if defined(COMMENTOUTPRIORTODELETING)
457  DWORD count;
458 
459  /* FIXME: releasing the win16 lock here is a temporary hack (I hope)
460  * that lets mciavi.drv run correctly
461  */
462  if (pFnReleaseThunkLock) pFnReleaseThunkLock(&count);
463  if (pFnRestoreThunkLock) pFnRestoreThunkLock(count);
464 #endif
465 
466  return GetTickCount();
467 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by NS_AddRemoteComputerAsNameServer(), NS_PruneSessionCache(), and testTimeProc().

◆ timeKillEvent()

MMRESULT WINAPI timeKillEvent ( UINT  wID)

Definition at line 369 of file time.c.

370 {
371  LPWINE_TIMERENTRY lpSelf = NULL, *lpTimer;
372 
373  TRACE("(%u)\n", wID);
375  /* remove WINE_TIMERENTRY from list */
376  for (lpTimer = &TIME_TimersList; *lpTimer; lpTimer = &(*lpTimer)->lpNext) {
377  if (wID == (*lpTimer)->wTimerID) {
378  lpSelf = *lpTimer;
379  /* unlink timer of id 'wID' */
380  *lpTimer = (*lpTimer)->lpNext;
381  break;
382  }
383  }
385 
386  if (!lpSelf)
387  {
388  WARN("wID=%u is not a valid timer ID\n", wID);
389  return MMSYSERR_INVALPARAM;
390  }
391  if (lpSelf->wFlags & TIME_KILL_SYNCHRONOUS)
393  HeapFree(GetProcessHeap(), 0, lpSelf);
394  return TIMERR_NOERROR;
395 }
#define TIMERR_NOERROR
Definition: mmsystem.h:418
struct tagWINE_TIMERENTRY * lpNext
Definition: time.c:42
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
UINT16 wFlags
Definition: time.c:39
static HANDLE TIME_hKillEvent
Definition: time.c:47
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
static LPWINE_TIMERENTRY TIME_TimersList
Definition: time.c:46
CRITICAL_SECTION WINMM_cs
Definition: winmm.c:54
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DirectSoundDevice_Release(), DSOUND_timer(), ScreenSaverProc(), test_priority(), and test_timer().

◆ timeSetEvent()

MMRESULT WINAPI timeSetEvent ( UINT  wDelay,
UINT  wResol,
LPTIMECALLBACK  lpFunc,
DWORD_PTR  dwUser,
UINT  wFlags 
)

Definition at line 359 of file time.c.

361 {
362  return TIME_SetEventInternal(wDelay, wResol, lpFunc,
363  dwUser, wFlags);
364 }
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
WORD TIME_SetEventInternal(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, DWORD dwUser, UINT wFlags)
Definition: time.c:305

Referenced by DirectSoundDevice_Initialize(), ScreenSaverProc(), test_priority(), and test_timer().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mmtime  )

Variable Documentation

◆ TIME_hKillEvent

HANDLE TIME_hKillEvent
static

Definition at line 47 of file time.c.

Referenced by TIME_MMSysTimeCallback(), TIME_SetEventInternal(), and timeKillEvent().

◆ TIME_hMMTimer

HANDLE TIME_hMMTimer
static

Definition at line 45 of file time.c.

Referenced by TIME_MMTimeStart(), and TIME_MMTimeStop().

◆ TIME_hWakeEvent

HANDLE TIME_hWakeEvent
static

◆ TIME_TimersList

LPWINE_TIMERENTRY TIME_TimersList
static

◆ TIME_TimeToDie

BOOL TIME_TimeToDie = TRUE
static

Definition at line 49 of file time.c.

Referenced by TIME_MMSysTimeThread(), TIME_MMTimeStart(), and TIME_MMTimeStop().