From c7c74e14046a4f8737e55092ce2c4fdc1636be7e Mon Sep 17 00:00:00 2001 From: sesse Date: Mon, 8 Mar 2010 13:00:59 +0000 Subject: [PATCH] Implement ResumeThread and SignalObjectAndWait. Relatively simplistic implementations of ResumeThread (stub) and SignalObjectAndWait (bAlertable is ignored). Both are needed for ProRes 4:2:2 support on Linux. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30861 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/loader/win32.c b/loader/win32.c index ef6f6ba23f..d540e6dfe2 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -659,6 +659,13 @@ static void* WINAPI expCreateThread(void* pSecAttr, long dwStackSize, return pth; } +static DWORD WINAPI expResumeThread(HANDLE hThread) +{ + int ret = 1; + dbgprintf("ResumeThread(0x%x) => 0x%x\n", hThread, ret); + return ret; +} + struct mutex_list_t; struct mutex_list_t @@ -1980,6 +1987,28 @@ static int WINAPI expReleaseMutex(HANDLE hMutex) return 1; } +static DWORD WINAPI expSignalObjectAndWait(HANDLE hObjectToSignal, + HANDLE hObjectToWaitOn, + DWORD dwMilliseconds, + WIN_BOOL bAlertable) { + mutex_list* mlist = (mutex_list*)hObjectToSignal; + + switch (mlist->type) { + case 0: // Event + expSetEvent(mlist); + break; + case 1: // Semaphore + expReleaseSemaphore(mlist, 1, NULL); + break; + case 2: // Mutex + expReleaseMutex(mlist); + break; + default: + dbgprintf("Signalling unknown object type %d!\n", hObjectToSignal); + } + return expWaitForSingleObject(hObjectToWaitOn, dwMilliseconds); +} + static long WINAPI expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey) { long result=RegOpenKeyExA(key, subkey, reserved, access, newkey); @@ -5099,6 +5128,7 @@ struct exports exp_kernel32[]= FF(IsBadStringPtrA, -1) FF(DisableThreadLibraryCalls, -1) FF(CreateThread, -1) + FF(ResumeThread, -1) FF(CreateEventA, -1) FF(SetEvent, -1) FF(ResetEvent, -1) @@ -5152,6 +5182,7 @@ struct exports exp_kernel32[]= FF(ReleaseSemaphore, -1) FF(CreateMutexA, -1) FF(ReleaseMutex, -1) + FF(SignalObjectAndWait, -1) FF(FindResourceA, -1) FF(LockResource, -1) FF(FreeResource, -1)