Commit 3d463b8f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Hold platform lock for async results lifetime.

parent e87faa1a
......@@ -38,6 +38,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static LONG platform_lock;
static const WCHAR transform_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
'T','r','a','n','s','f','o','r','m','s',0};
static const WCHAR categories_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
......@@ -450,6 +452,27 @@ HRESULT WINAPI MFStartup(ULONG version, DWORD flags)
HRESULT WINAPI MFShutdown(void)
{
FIXME("(): stub\n");
return S_OK;
}
/***********************************************************************
* MFLockPlatform (mfplat.@)
*/
HRESULT WINAPI MFLockPlatform(void)
{
InterlockedIncrement(&platform_lock);
return S_OK;
}
/***********************************************************************
* MFUnlockPlatform (mfplat.@)
*/
HRESULT WINAPI MFUnlockPlatform(void)
{
InterlockedDecrement(&platform_lock);
return S_OK;
}
......
......@@ -118,7 +118,7 @@
@ stub MFInitVideoFormat_RGB
@ stub MFInvokeCallback
@ stub MFJoinIoPort
@ stub MFLockPlatform
@ stdcall MFLockPlatform()
@ stub MFLockWorkQueue
@ stub MFPutWorkItem
@ stub MFPutWorkItemEx
......@@ -146,7 +146,7 @@
@ stub MFTraceError
@ stub MFTraceFuncEnter
@ stub MFUnblockThread
@ stub MFUnlockPlatform
@ stdcall MFUnlockPlatform()
@ stub MFUnlockWorkQueue
@ stub MFUnwrapMediaType
@ stub MFValidateMediaTypeSize
......
......@@ -83,6 +83,8 @@ static ULONG WINAPI async_result_Release(IMFAsyncResult *iface)
if (result->state)
IUnknown_Release(result->state);
heap_free(result);
MFUnlockPlatform();
}
return refcount;
......@@ -172,6 +174,8 @@ HRESULT WINAPI MFCreateAsyncResult(IUnknown *object, IMFAsyncCallback *callback,
if (!result)
return E_OUTOFMEMORY;
MFLockPlatform();
result->result.AsyncResult.lpVtbl = &async_result_vtbl;
result->refcount = 1;
result->object = object;
......
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