Commit a408bba2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplay: Fix IsProtected() return value.

parent 28f9cd5b
......@@ -627,10 +627,13 @@ static HRESULT WINAPI media_item_IsProtected(IMFPMediaItem *iface, BOOL *protect
TRACE("%p, %p.\n", iface, protected);
if (!protected)
return E_POINTER;
EnterCriticalSection(&item->player->cs);
if (SUCCEEDED(hr = media_item_get_pd(item, &pd)))
{
*protected = MFRequireProtectedEnvironment(pd) == S_OK;
*protected = (hr = MFRequireProtectedEnvironment(pd)) == S_OK;
IMFPresentationDescriptor_Release(pd);
}
LeaveCriticalSection(&item->player->cs);
......
......@@ -328,8 +328,10 @@ static void test_media_item(void)
hr = IMFPMediaItem_HasAudio(item, &ret, &selected);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFPMediaItem_IsProtected(item, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFPMediaItem_IsProtected(item, &ret);
todo_wine
ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IMFPMediaItem_GetDuration(item, &MFP_POSITIONTYPE_100NS, &propvar);
......@@ -380,6 +382,9 @@ static void test_media_item(void)
hr = IMFPMediaItem_HasAudio(item, &ret, &selected);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFPMediaItem_IsProtected(item, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFPMediaItem_IsProtected(item, &ret);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
......
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