winmm: Simply use kernel32.{Release|Restore}ThunkLock instead of using 16bit convolutions.

This commit is contained in:
Eric Pouech 2009-10-22 22:11:01 +02:00 committed by Alexandre Julliard
parent 9709d1c67f
commit 14a68405d3
3 changed files with 4 additions and 13 deletions

View File

@ -90,16 +90,12 @@ BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds,
pFnOpenDriver16 = DRIVER_OpenDriver16;
pFnCloseDriver16 = DRIVER_CloseDriver16;
pFnSendMessage16 = DRIVER_SendMessage16;
pFnReleaseThunkLock = ReleaseThunkLock;
pFnRestoreThunkLock = RestoreThunkLock;
MMDRV_Init16();
break;
case DLL_PROCESS_DETACH:
pFnOpenDriver16 = NULL;
pFnCloseDriver16 = NULL;
pFnSendMessage16 = NULL;
pFnReleaseThunkLock = NULL;
pFnRestoreThunkLock = NULL;
/* FIXME: add equivalent for MMDRV_Init16() */
break;
case DLL_THREAD_ATTACH:

View File

@ -201,8 +201,6 @@ extern WINMM_MapType (*pFnMciMapMsg32WTo16)(WORD,WORD,DWORD,DWORD_PTR*);
extern WINMM_MapType (*pFnMciUnMapMsg32WTo16)(WORD,WORD,DWORD,DWORD_PTR);
extern LRESULT (*pFnCallMMDrvFunc16)(DWORD /* in fact FARPROC16 */,WORD,WORD,LONG,LONG,LONG);
extern unsigned (*pFnLoadMMDrvFunc16)(LPCSTR,LPWINE_DRIVER, LPWINE_MM_DRIVER);
extern void (WINAPI *pFnReleaseThunkLock)(DWORD*);
extern void (WINAPI *pFnRestoreThunkLock)(DWORD);
/* GetDriverFlags() returned bits is not documented (nor the call itself)
* Here are Wine only definitions of the bits

View File

@ -57,9 +57,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(winmm);
void (WINAPI *pFnReleaseThunkLock)(DWORD*);
void (WINAPI *pFnRestoreThunkLock)(DWORD);
/* ========================================================================
* G L O B A L S E T T I N G S
* ========================================================================*/
@ -1748,9 +1745,9 @@ static BOOL MMSYSTEM_MidiStream_PostMessage(WINE_MIDIStream* lpMidiStrm, WORD ms
if (PostThreadMessageA(lpMidiStrm->dwThreadID, msg, pmt1, pmt2)) {
DWORD count;
if (pFnReleaseThunkLock) pFnReleaseThunkLock(&count);
ReleaseThunkLock(&count);
WaitForSingleObject(lpMidiStrm->hEvent, INFINITE);
if (pFnRestoreThunkLock) pFnRestoreThunkLock(count);
RestoreThunkLock(count);
} else {
WARN("bad PostThreadMessageA\n");
return FALSE;
@ -1836,9 +1833,9 @@ MMRESULT WINAPI midiStreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID,
* (meaning the Win16Lock is set), so that it's released and the 32 bit thread running
* MMSYSTEM_MidiStreamPlayer can acquire Win16Lock to create its queue.
*/
if (pFnReleaseThunkLock) pFnReleaseThunkLock(&count);
ReleaseThunkLock(&count);
WaitForSingleObject(lpMidiStrm->hEvent, INFINITE);
if (pFnRestoreThunkLock) pFnRestoreThunkLock(count);
RestoreThunkLock(count);
}
TRACE("=> (%u/%d) hMidi=%p ret=%d lpMidiStrm=%p\n",