Nikolay Sivov : scrrun: Implement Path() property for Folder.

Alexandre Julliard julliard at winehq.org
Wed Mar 12 15:23:43 CDT 2014


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Mar 12 10:07:24 2014 +0400

scrrun: Implement Path() property for Folder.

---

 dlls/scrrun/filesystem.c       |   10 ++++++++--
 dlls/scrrun/tests/filesystem.c |   10 +++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index a48b630..d87ba30 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -1826,8 +1826,14 @@ static HRESULT WINAPI folder_Invoke(IFolder *iface, DISPID dispIdMember,
 static HRESULT WINAPI folder_get_Path(IFolder *iface, BSTR *path)
 {
     struct folder *This = impl_from_IFolder(iface);
-    FIXME("(%p)->(%p): stub\n", This, path);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, path);
+
+    if(!path)
+        return E_POINTER;
+
+    *path = SysAllocString(This->path);
+    return *path ? S_OK : E_OUTOFMEMORY;
 }
 
 static HRESULT WINAPI folder_get_Name(IFolder *iface, BSTR *name)
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 8502934..c62b2bc 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -795,7 +795,7 @@ static void test_GetFolder(void)
 /* Please keep the tests for IFolderCollection and IFileCollection in sync */
 static void test_FolderCollection(void)
 {
-    static const WCHAR fooW[] = {'\\','f','o','o',0};
+    static const WCHAR fooW[] = {'f','o','o',0};
     static const WCHAR aW[] = {'\\','a',0};
     static const WCHAR bW[] = {'\\','b',0};
     static const WCHAR cW[] = {'\\','c',0};
@@ -824,6 +824,14 @@ static void test_FolderCollection(void)
     hr = IFolder_get_SubFolders(folder, NULL);
     ok(hr == E_POINTER, "got 0x%08x\n", hr);
 
+    hr = IFolder_get_Path(folder, NULL);
+    ok(hr == E_POINTER, "got 0x%08x\n", hr);
+
+    hr = IFolder_get_Path(folder, &str);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(!lstrcmpW(buffW, str), "got %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(buffW));
+    SysFreeString(str);
+
     lstrcpyW(pathW, buffW);
     lstrcatW(pathW, aW);
     CreateDirectoryW(pathW, NULL);




More information about the wine-cvs mailing list