Commit 8b7a45f4 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- let all time related functions make use of low level drivers 16 bit

functions - some renaming (prefixing internal time functions with TIME)
parent 5942f98f
...@@ -2461,8 +2461,8 @@ MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, LPTIMECALLBACK16 ...@@ -2461,8 +2461,8 @@ MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, LPTIMECALLBACK16
if (wFlags & WINE_TIMER_IS32) if (wFlags & WINE_TIMER_IS32)
WARN("Unknown windows flag... wine internally used.. ooch\n"); WARN("Unknown windows flag... wine internally used.. ooch\n");
return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc, return TIME_SetEventInternal(wDelay, wResol, (FARPROC16)lpFunc,
dwUser, wFlags & ~WINE_TIMER_IS32); dwUser, wFlags & ~WINE_TIMER_IS32);
} }
/************************************************************************** /**************************************************************************
......
...@@ -52,10 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmtime); ...@@ -52,10 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmtime);
#define MMSYSTIME_STDINTERVAL (10) /* reasonable value? */ #define MMSYSTIME_STDINTERVAL (10) /* reasonable value? */
/* ### start build ### */
extern WORD CALLBACK TIME_CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
/* ### stop build ### */
static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer) static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer)
{ {
TRACE("before CallBack => lpFunc=%p wTimerID=%04X dwUser=%08lX !\n", TRACE("before CallBack => lpFunc=%p wTimerID=%04X dwUser=%08lX !\n",
...@@ -70,9 +66,9 @@ static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer) ...@@ -70,9 +66,9 @@ static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer)
case TIME_CALLBACK_FUNCTION: case TIME_CALLBACK_FUNCTION:
if (lpTimer->wFlags & WINE_TIMER_IS32) if (lpTimer->wFlags & WINE_TIMER_IS32)
((LPTIMECALLBACK)lpTimer->lpFunc)(lpTimer->wTimerID, 0, lpTimer->dwUser, 0, 0); ((LPTIMECALLBACK)lpTimer->lpFunc)(lpTimer->wTimerID, 0, lpTimer->dwUser, 0, 0);
else else if (pFnCallMMDrvFunc16)
TIME_CallTo16_word_wwlll(lpTimer->lpFunc, lpTimer->wTimerID, 0, pFnCallMMDrvFunc16(lpTimer->lpFunc, lpTimer->wTimerID, 0,
lpTimer->dwUser, 0, 0); lpTimer->dwUser, 0, 0);
break; break;
case TIME_CALLBACK_EVENT_SET: case TIME_CALLBACK_EVENT_SET:
SetEvent((HANDLE)lpTimer->lpFunc); SetEvent((HANDLE)lpTimer->lpFunc);
...@@ -178,10 +174,6 @@ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg) ...@@ -178,10 +174,6 @@ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg)
*/ */
void TIME_MMTimeStart(void) void TIME_MMTimeStart(void)
{ {
if (IsBadWritePtr(WINMM_IData, sizeof(WINE_MM_IDATA))) {
ERR("iData is not correctly set, please report. Expect failure.\n");
return;
}
/* one could think it's possible to stop the service thread activity when no more /* one could think it's possible to stop the service thread activity when no more
* mm timers are active, but this would require to keep mmSysTimeMS up-to-date * mm timers are active, but this would require to keep mmSysTimeMS up-to-date
* without being incremented within the service thread callback. * without being incremented within the service thread callback.
...@@ -191,7 +183,6 @@ void TIME_MMTimeStart(void) ...@@ -191,7 +183,6 @@ void TIME_MMTimeStart(void)
WINMM_IData->lpTimerList = NULL; WINMM_IData->lpTimerList = NULL;
WINMM_IData->hMMTimer = CreateThread(NULL, 0, TIME_MMSysTimeThread, WINMM_IData, 0, NULL); WINMM_IData->hMMTimer = CreateThread(NULL, 0, TIME_MMSysTimeThread, WINMM_IData, 0, NULL);
} }
} }
/************************************************************************** /**************************************************************************
...@@ -199,10 +190,6 @@ void TIME_MMTimeStart(void) ...@@ -199,10 +190,6 @@ void TIME_MMTimeStart(void)
*/ */
void TIME_MMTimeStop(void) void TIME_MMTimeStop(void)
{ {
if (IsBadWritePtr(WINMM_IData, sizeof(WINE_MM_IDATA))) {
ERR("WINMM_IData is not correctly set, please report. Expect failure.\n");
return;
}
if (WINMM_IData->hMMTimer) { if (WINMM_IData->hMMTimer) {
HANDLE hMMTimer = WINMM_IData->hMMTimer; HANDLE hMMTimer = WINMM_IData->hMMTimer;
WINMM_IData->hMMTimer = 0; WINMM_IData->hMMTimer = 0;
...@@ -230,10 +217,10 @@ MMRESULT WINAPI timeGetSystemTime(LPMMTIME lpTime, UINT wSize) ...@@ -230,10 +217,10 @@ MMRESULT WINAPI timeGetSystemTime(LPMMTIME lpTime, UINT wSize)
} }
/************************************************************************** /**************************************************************************
* timeSetEventInternal [internal] * TIME_SetEventInternal [internal]
*/ */
WORD timeSetEventInternal(UINT wDelay, UINT wResol, WORD TIME_SetEventInternal(UINT wDelay, UINT wResol,
FARPROC16 lpFunc, DWORD dwUser, UINT wFlags) FARPROC16 lpFunc, DWORD dwUser, UINT wFlags)
{ {
WORD wNewID = 0; WORD wNewID = 0;
LPWINE_TIMERENTRY lpNewTimer; LPWINE_TIMERENTRY lpNewTimer;
...@@ -283,8 +270,8 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, ...@@ -283,8 +270,8 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc,
if (wFlags & WINE_TIMER_IS32) if (wFlags & WINE_TIMER_IS32)
WARN("Unknown windows flag... wine internally used.. ooch\n"); WARN("Unknown windows flag... wine internally used.. ooch\n");
return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc, return TIME_SetEventInternal(wDelay, wResol, (FARPROC16)lpFunc,
dwUser, wFlags|WINE_TIMER_IS32); dwUser, wFlags|WINE_TIMER_IS32);
} }
/************************************************************************** /**************************************************************************
......
...@@ -275,9 +275,6 @@ UINT MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, ...@@ -275,9 +275,6 @@ UINT MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType,
const LPWAVEFORMATEX lpFormat, DWORD dwCallback, const LPWAVEFORMATEX lpFormat, DWORD dwCallback,
DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); DWORD dwInstance, DWORD dwFlags, BOOL bFrom32);
WORD timeSetEventInternal(UINT wDelay, UINT wResol,
FARPROC16 lpFunc, DWORD dwUser, UINT wFlags);
HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo,
DWORD dwOpenFlags, enum mmioProcType type); DWORD dwOpenFlags, enum mmioProcType type);
LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc,
...@@ -288,6 +285,8 @@ LPWINE_MMIO MMIO_Get(HMMIO h); ...@@ -288,6 +285,8 @@ LPWINE_MMIO MMIO_Get(HMMIO h);
BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode); BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode);
WORD TIME_SetEventInternal(UINT wDelay, UINT wResol,
FARPROC16 lpFunc, DWORD dwUser, UINT wFlags);
void TIME_MMTimeStart(void); void TIME_MMTimeStart(void);
void TIME_MMTimeStop(void); void TIME_MMTimeStop(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment