diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 74e54323636..5e0fc28bc65 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -2546,11 +2546,20 @@ static HRESULT WINAPI file_Invoke(IFile *iface, DISPID dispIdMember, REFIID riid return hr; } -static HRESULT WINAPI file_get_Path(IFile *iface, BSTR *pbstrPath) +static HRESULT WINAPI file_get_Path(IFile *iface, BSTR *path) { struct file *This = impl_from_IFile(iface); - FIXME("(%p)->(%p)\n", This, pbstrPath); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, path); + + if (!path) + return E_POINTER; + + *path = SysAllocString(This->path); + if (!*path) + return E_OUTOFMEMORY; + + return S_OK; } static HRESULT WINAPI file_get_Name(IFile *iface, BSTR *name) diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index 210b90cb38e..987ecba0a5d 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -538,7 +538,7 @@ static void test_GetAbsolutePathName(void) static void test_GetFile(void) { static const WCHAR slW[] = {'\\',0}; - BSTR path; + BSTR path, str; WCHAR pathW[MAX_PATH]; FileAttribute fa; VARIANT size; @@ -572,6 +572,14 @@ static void test_GetFile(void) hr = IFileSystem3_GetFile(fs3, path, &file); ok(hr == S_OK, "GetFile returned %x, expected S_OK\n", hr); + hr = IFile_get_Path(file, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IFile_get_Path(file, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(str, pathW), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + hr = IFile_get_Attributes(file, &fa); gfa = GetFileAttributesW(pathW) & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE |