Nikolay Sivov : scrrun: Implement Name() property for File.

Alexandre Julliard julliard at winehq.org
Tue Jan 7 13:21:17 CST 2014


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Jan  7 03:25:48 2014 +0400

scrrun: Implement Name() property for File.

---

 dlls/scrrun/filesystem.c |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index a2562ef..1c0c6c3 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -1559,11 +1559,29 @@ static HRESULT WINAPI file_get_Path(IFile *iface, BSTR *pbstrPath)
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI file_get_Name(IFile *iface, BSTR *pbstrName)
+static HRESULT WINAPI file_get_Name(IFile *iface, BSTR *name)
 {
     struct file *This = impl_from_IFile(iface);
-    FIXME("(%p)->(%p)\n", This, pbstrName);
-    return E_NOTIMPL;
+    WCHAR *ptr;
+
+    TRACE("(%p)->(%p)\n", This, name);
+
+    if(!name)
+        return E_POINTER;
+
+    *name = NULL;
+
+    ptr = strrchrW(This->path, '\\');
+    if (ptr)
+    {
+        *name = SysAllocString(ptr+1);
+        TRACE("%s\n", debugstr_w(*name));
+        if (!*name) return E_OUTOFMEMORY;
+    }
+    else
+        return E_FAIL;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI file_put_Name(IFile *iface, BSTR pbstrName)




More information about the wine-cvs mailing list