Commit 7d2d5a25 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

qedit: Implement IMediaDet_get_Filename.

parent dc3d6fbe
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = qedit.dll
IMPORTS = ole32 advapi32 kernel32
IMPORTS = oleaut32 ole32 advapi32 kernel32
EXTRALIBS = -lstrmiids -luuid
C_SRCS = \
......
......@@ -17,6 +17,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "qedit_private.h"
#include "wine/debug.h"
......@@ -137,8 +146,37 @@ static HRESULT WINAPI MediaDet_get_StreamLength(IMediaDet* iface, double *pVal)
static HRESULT WINAPI MediaDet_get_Filename(IMediaDet* iface, BSTR *pVal)
{
MediaDetImpl *This = (MediaDetImpl *)iface;
FIXME("(%p)->(%p): not implemented!\n", This, pVal);
return E_NOTIMPL;
IFileSourceFilter *file;
LPOLESTR name;
HRESULT hr;
TRACE("(%p)\n", This);
if (!pVal)
return E_POINTER;
*pVal = NULL;
/* MSDN says it should return E_FAIL if no file is open, but tests
show otherwise. */
if (!This->source)
return S_OK;
hr = IBaseFilter_QueryInterface(This->source, &IID_IFileSourceFilter,
(void **) &file);
if (FAILED(hr))
return hr;
hr = IFileSourceFilter_GetCurFile(file, &name, NULL);
IFileSourceFilter_Release(file);
if (FAILED(hr))
return hr;
*pVal = SysAllocString(name);
CoTaskMemFree(name);
if (!*pVal)
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI MediaDet_put_Filename(IMediaDet* iface, BSTR newVal)
......
......@@ -93,6 +93,18 @@ static void test_mediadet(void)
ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
ok(pM != NULL, "pM is NULL\n");
filename = NULL;
hr = IMediaDet_get_Filename(pM, &filename);
/* Despite what MSDN claims, this returns S_OK. */
ok(hr == S_OK, "IMediaDet_get_Filename\n");
ok(filename == NULL, "IMediaDet_get_Filename\n");
filename = (BSTR) -1;
hr = IMediaDet_get_Filename(pM, &filename);
/* Despite what MSDN claims, this returns S_OK. */
ok(hr == S_OK, "IMediaDet_get_Filename\n");
ok(filename == NULL, "IMediaDet_get_Filename\n");
filename = SysAllocString(test_avi_filename);
hr = IMediaDet_put_Filename(pM, filename);
ok(hr == S_OK, "IMediaDet_put_Filename -> %x\n", hr);
......@@ -104,11 +116,14 @@ static void test_mediadet(void)
filename = NULL;
hr = IMediaDet_get_Filename(pM, &filename);
todo_wine ok(hr == S_OK, "IMediaDet_get_Filename\n");
todo_wine ok(lstrcmpW(filename, test_avi_filename) == 0,
"IMediaDet_get_Filename\n");
ok(hr == S_OK, "IMediaDet_get_Filename\n");
ok(lstrcmpW(filename, test_avi_filename) == 0,
"IMediaDet_get_Filename\n");
SysFreeString(filename);
hr = IMediaDet_get_Filename(pM, NULL);
ok(hr == E_POINTER, "IMediaDet_get_Filename\n");
hr = IMediaDet_put_CurrentStream(pM, 0);
todo_wine ok(hr == S_OK, "IMediaDet_put_CurrentStream\n");
......
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