Vijay Kiran Kamuju : wmvcore: Add semi-stub implementation for WMIsContentProtected.

Alexandre Julliard julliard at winehq.org
Tue Mar 17 17:21:08 CDT 2020


Module: wine
Branch: master
Commit: f0dbd3addc3140e3b92785ca42c1c1df00469f30
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f0dbd3addc3140e3b92785ca42c1c1df00469f30

Author: Vijay Kiran Kamuju <infyquest at gmail.com>
Date:   Sat Feb 29 21:55:59 2020 +0100

wmvcore: Add semi-stub implementation for WMIsContentProtected.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48683
Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 8af34e22b6..2b5a4555a3 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 65e0807b61..8c3e62bbb1 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 af23ab88b8..4dafcf8055 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 4ee166a9d4..d1e0445470 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);")




More information about the wine-cvs mailing list