Implemented the mmTask* functions.
This commit is contained in:
parent
1b53ecba89
commit
f2ea78cdfb
|
@ -3233,7 +3233,7 @@ struct mm_starter
|
||||||
HANDLE event;
|
HANDLE event;
|
||||||
};
|
};
|
||||||
|
|
||||||
DWORD WINAPI mmTaskRun(void* pmt)
|
static DWORD WINAPI mmTaskRun(void* pmt)
|
||||||
{
|
{
|
||||||
struct mm_starter mms;
|
struct mm_starter mms;
|
||||||
|
|
||||||
|
@ -3244,6 +3244,9 @@ DWORD WINAPI mmTaskRun(void* pmt)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************
|
||||||
|
* mmTaskCreate (WINMM.@)
|
||||||
|
*/
|
||||||
MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
|
MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
|
||||||
{
|
{
|
||||||
HANDLE hThread;
|
HANDLE hThread;
|
||||||
|
@ -3251,7 +3254,7 @@ MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
|
||||||
struct mm_starter *mms;
|
struct mm_starter *mms;
|
||||||
|
|
||||||
mms = HeapAlloc(GetProcessHeap(), 0, sizeof(struct mm_starter));
|
mms = HeapAlloc(GetProcessHeap(), 0, sizeof(struct mm_starter));
|
||||||
if (mms == NULL) { return TASKERR_OUTOFMEMORY; }
|
if (mms == NULL) return TASKERR_OUTOFMEMORY;
|
||||||
|
|
||||||
mms->cb = cb;
|
mms->cb = cb;
|
||||||
mms->client = client;
|
mms->client = client;
|
||||||
|
@ -3268,3 +3271,38 @@ MMRESULT WINAPI mmTaskCreate(LPTASKCALLBACK cb, HANDLE* ph, DWORD client)
|
||||||
CloseHandle(hThread);
|
CloseHandle(hThread);
|
||||||
return 0;
|
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 mixerMessage(long long long long)
|
||||||
@ stdcall mixerOpen(ptr long long long long)
|
@ stdcall mixerOpen(ptr long long long long)
|
||||||
@ stdcall mixerSetControlDetails(long ptr long)
|
@ stdcall mixerSetControlDetails(long ptr long)
|
||||||
|
@ stdcall mmGetCurrentTask()
|
||||||
@ stdcall mmioAdvance(long ptr long)
|
@ stdcall mmioAdvance(long ptr long)
|
||||||
@ stdcall mmioAscend(long ptr long)
|
@ stdcall mmioAscend(long ptr long)
|
||||||
@ stdcall mmioClose(long long)
|
@ stdcall mmioClose(long long)
|
||||||
|
@ -135,7 +136,10 @@
|
||||||
@ stdcall mmioStringToFOURCCW(wstr long)
|
@ stdcall mmioStringToFOURCCW(wstr long)
|
||||||
@ stdcall mmioWrite(long ptr long)
|
@ stdcall mmioWrite(long ptr long)
|
||||||
@ stdcall mmsystemGetVersion()
|
@ stdcall mmsystemGetVersion()
|
||||||
|
@ stdcall mmTaskBlock(long)
|
||||||
@ stdcall mmTaskCreate(ptr ptr long)
|
@ stdcall mmTaskCreate(ptr ptr long)
|
||||||
|
@ stdcall mmTaskSignal(long)
|
||||||
|
@ stdcall mmTaskYield()
|
||||||
@ stdcall sndPlaySoundA(ptr long)
|
@ stdcall sndPlaySoundA(ptr long)
|
||||||
@ stdcall sndPlaySoundW(ptr long)
|
@ stdcall sndPlaySoundW(ptr long)
|
||||||
@ stdcall timeBeginPeriod(long)
|
@ stdcall timeBeginPeriod(long)
|
||||||
|
|
Loading…
Reference in New Issue