Implemented the mmTask* functions.

This commit is contained in:
Eric Pouech 2004-08-16 23:19:17 +00:00 committed by Alexandre Julliard
parent 1b53ecba89
commit f2ea78cdfb
2 changed files with 44 additions and 2 deletions

View File

@ -3233,7 +3233,7 @@ struct mm_starter
HANDLE event;
};
DWORD WINAPI mmTaskRun(void* pmt)
static DWORD WINAPI mmTaskRun(void* pmt)
{
struct mm_starter mms;
@ -3244,6 +3244,9 @@ DWORD WINAPI mmTaskRun(void* pmt)
return 0;
}
/******************************************************************
* mmTaskCreate (WINMM.@)
*/
MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
{
HANDLE hThread;
@ -3251,7 +3254,7 @@ MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
struct mm_starter *mms;
mms = HeapAlloc(GetProcessHeap(), 0, sizeof(struct mm_starter));
if (mms == NULL) { return TASKERR_OUTOFMEMORY; }
if (mms == NULL) return TASKERR_OUTOFMEMORY;
mms->cb = cb;
mms->client = client;
@ -3268,3 +3271,38 @@ MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
CloseHandle(hThread);
return 0;
}
/******************************************************************
* mmTaskBlock (WINMM.@)
*/
void WINAPI mmTaskBlock(HANDLE tid)
{
MSG msg;
do
{
GetMessageA(&msg, 0, 0, 0);
if (msg.hwnd) DispatchMessageA(&msg);
} while (msg.message != WM_USER);
}
/******************************************************************
* mmTaskSignal (WINMM.@)
*/
BOOL WINAPI mmTaskSignal(HANDLE tid)
{
return PostThreadMessageW((DWORD)tid, WM_USER, 0, 0);
}
/******************************************************************
* mmTaskYield (WINMM.@)
*/
void WINAPI mmTaskYield(void) {}
/******************************************************************
* mmGetCurrentTask (WINMM.@)
*/
HANDLE WINAPI mmGetCurrentTask(void)
{
return (HANDLE)GetCurrentThreadId();
}

View File

@ -112,6 +112,7 @@
@ stdcall mixerMessage(long long long long)
@ stdcall mixerOpen(ptr long long long long)
@ stdcall mixerSetControlDetails(long ptr long)
@ stdcall mmGetCurrentTask()
@ stdcall mmioAdvance(long ptr long)
@ stdcall mmioAscend(long ptr long)
@ stdcall mmioClose(long long)
@ -135,7 +136,10 @@
@ stdcall mmioStringToFOURCCW(wstr long)
@ stdcall mmioWrite(long ptr long)
@ stdcall mmsystemGetVersion()
@ stdcall mmTaskBlock(long)
@ stdcall mmTaskCreate(ptr ptr long)
@ stdcall mmTaskSignal(long)
@ stdcall mmTaskYield()
@ stdcall sndPlaySoundA(ptr long)
@ stdcall sndPlaySoundW(ptr long)
@ stdcall timeBeginPeriod(long)