Commit 42d2b519 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

scrrun: Implement Name() property for Folder.

parent b99b69aa
...@@ -892,8 +892,26 @@ static HRESULT WINAPI folder_get_Path(IFolder *iface, BSTR *path) ...@@ -892,8 +892,26 @@ static HRESULT WINAPI folder_get_Path(IFolder *iface, BSTR *path)
static HRESULT WINAPI folder_get_Name(IFolder *iface, BSTR *name) static HRESULT WINAPI folder_get_Name(IFolder *iface, BSTR *name)
{ {
struct folder *This = impl_from_IFolder(iface); struct folder *This = impl_from_IFolder(iface);
FIXME("(%p)->(%p): stub\n", This, name); WCHAR *ptr;
return E_NOTIMPL;
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 folder_put_Name(IFolder *iface, BSTR name) static HRESULT WINAPI folder_put_Name(IFolder *iface, BSTR name)
...@@ -1072,6 +1090,8 @@ HRESULT create_folder(const WCHAR *path, IFolder **folder) ...@@ -1072,6 +1090,8 @@ HRESULT create_folder(const WCHAR *path, IFolder **folder)
*folder = NULL; *folder = NULL;
TRACE("%s\n", debugstr_w(path));
This = heap_alloc(sizeof(struct folder)); This = heap_alloc(sizeof(struct folder));
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
......
...@@ -882,6 +882,12 @@ if (hr == S_OK) { ...@@ -882,6 +882,12 @@ if (hr == S_OK) {
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IFolder, (void**)&folder); hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IFolder, (void**)&folder);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
str = NULL;
hr = IFolder_get_Name(folder, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
IFolder_Release(folder); IFolder_Release(folder);
VariantClear(&var); VariantClear(&var);
......
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