From 3ee9f2407b8fede4ddcfbf455660488b2ae856e0 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 7 Jan 2014 03:25:48 +0400 Subject: [PATCH] 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 a2562ef4ee8..1c0c6c3d946 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)