Commit f2ea78cd authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Implemented the mmTask* functions.

parent 1b53ecba
......@@ -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();
}
......@@ -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)
......
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