From f0dbd3addc3140e3b92785ca42c1c1df00469f30 Mon Sep 17 00:00:00 2001 From: Vijay Kiran Kamuju Date: Sat, 29 Feb 2020 21:55:59 +0100 Subject: [PATCH] wmvcore: Add semi-stub implementation for WMIsContentProtected. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48683 Signed-off-by: Vijay Kiran Kamuju Signed-off-by: Alexandre Julliard --- dlls/wmvcore/tests/wmvcore.c | 18 ++++++++++++++++++ dlls/wmvcore/wmvcore.spec | 2 +- dlls/wmvcore/wmvcore_main.c | 12 ++++++++++++ include/wmsdkidl.idl | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 8af34e22b6b..2b5a4555a35 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -338,6 +338,23 @@ static void test_urlextension(void) todo_wine ok(hr == S_OK, "WMCheckURLExtension failed 0x%08x\n", hr); } +static void test_iscontentprotected(void) +{ + HRESULT hr; + const WCHAR mp3file[] = {'t','e','s','t','.','m','p','3',0}; + BOOL drm; + + hr = WMIsContentProtected(NULL, NULL); + ok(hr == E_INVALIDARG, "WMIsContentProtected failed 0x%08x\n", hr); + hr = WMIsContentProtected(NULL, &drm); + ok(hr == E_INVALIDARG, "WMIsContentProtected failed 0x%08x\n", hr); + hr = WMIsContentProtected(mp3file, NULL); + ok(hr == E_INVALIDARG, "WMIsContentProtected failed 0x%08x\n", hr); + hr = WMIsContentProtected(mp3file, &drm); + ok(hr == S_FALSE, "WMIsContentProtected failed 0x%08x\n", hr); + ok(drm == FALSE, "got %0dx\n", drm); +} + START_TEST(wmvcore) { HRESULT hr; @@ -353,6 +370,7 @@ START_TEST(wmvcore) test_profile_manager_interfaces(); test_WMCreateWriterPriv(); test_urlextension(); + test_iscontentprotected(); CoUninitialize(); } diff --git a/dlls/wmvcore/wmvcore.spec b/dlls/wmvcore/wmvcore.spec index 65e0807b61a..8c3e62bbb14 100644 --- a/dlls/wmvcore/wmvcore.spec +++ b/dlls/wmvcore/wmvcore.spec @@ -17,4 +17,4 @@ @ stub WMCreateWriterNetworkSink @ stdcall WMCreateWriterPriv(ptr) @ stub WMCreateWriterPushSink -@ stub WMIsContentProtected +@ stdcall WMIsContentProtected(wstr ptr) diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index af23ab88b8a..4dafcf8055a 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -86,6 +86,18 @@ HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **lic return E_NOTIMPL; } +HRESULT WINAPI WMIsContentProtected(const WCHAR *filename, BOOL *protected) +{ + FIXME("(%s %p): semi-stub\n", wine_dbgstr_w(filename), protected); + + if (!filename || !protected) + return E_INVALIDARG; + + *protected = FALSE; + + return S_FALSE; +} + typedef struct { IWMProfileManager2 IWMProfileManager2_iface; LONG ref; diff --git a/include/wmsdkidl.idl b/include/wmsdkidl.idl index 4ee166a9d43..d1e0445470d 100644 --- a/include/wmsdkidl.idl +++ b/include/wmsdkidl.idl @@ -1896,6 +1896,7 @@ cpp_quote("HRESULT WINAPI WMCreateSyncReader(IUnknown*,DWORD,IWMSyncReader**);") cpp_quote("HRESULT WINAPI WMCreateEditor(IWMMetadataEditor**);") cpp_quote("HRESULT WINAPI WMCreateBackupRestorer(IUnknown*,IWMLicenseBackup**);") cpp_quote("HRESULT WINAPI WMCreateProfileManager(IWMProfileManager**);") +cpp_quote("HRESULT WINAPI WMIsContentProtected(const WCHAR*, BOOL*);") cpp_quote("EXTERN_GUID(WMMEDIASUBTYPE_Base, 0x00000000,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71);")