Alexander Morozov : shell32: Partially implement Folder::get_Title.
Alexandre Julliard
julliard at winehq.org
Fri Jan 28 12:30:16 CST 2011
Module: wine
Branch: master
Commit: 6fb10a6e9196d6f9025f5391cab577336d78c79e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6fb10a6e9196d6f9025f5391cab577336d78c79e
Author: Alexander Morozov <amorozov at etersoft.ru>
Date: Tue Jan 18 21:37:39 2011 +0300
shell32: Partially implement Folder::get_Title.
---
dlls/shell32/shelldispatch.c | 17 +++++++++++++++--
dlls/shell32/tests/shelldispatch.c | 4 ----
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 3ec5347..67501ae 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -180,10 +180,23 @@ static HRESULT WINAPI FolderImpl_Invoke(Folder3 *iface, DISPID dispIdMember,
static HRESULT WINAPI FolderImpl_get_Title(Folder3 *iface, BSTR *pbs)
{
- FIXME("(%p,%p)\n", iface, pbs);
+ FolderImpl *This = impl_from_Folder(iface);
+ WCHAR *p;
+ int len;
+
+ TRACE("(%p,%p)\n", iface, pbs);
*pbs = NULL;
- return E_NOTIMPL;
+
+ if (V_VT(&This->dir) == VT_I4)
+ {
+ FIXME("special folder constants are not supported\n");
+ return E_NOTIMPL;
+ }
+ p = PathFindFileNameW(V_BSTR(&This->dir));
+ len = lstrlenW(p);
+ *pbs = SysAllocStringLen(p, p[len - 1] == '\\' ? len - 1 : len);
+ return *pbs ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI FolderImpl_get_Application(Folder3 *iface,
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index a34ec39..f253627 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -148,11 +148,9 @@ static void test_namespace(void)
if (r == S_OK)
{
r = Folder_get_Title(folder, &title);
- todo_wine
ok(r == S_OK, "Folder::get_Title failed: %08x\n", r);
if (r == S_OK)
{
- todo_wine
ok(!lstrcmpW(title, winetestW), "bad title: %s\n",
wine_dbgstr_w(title));
SysFreeString(title);
@@ -172,11 +170,9 @@ static void test_namespace(void)
if (r == S_OK)
{
r = Folder_get_Title(folder, &title);
- todo_wine
ok(r == S_OK, "Folder::get_Title failed: %08x\n", r);
if (r == S_OK)
{
- todo_wine
ok(!lstrcmpW(title, winetestW), "bad title: %s\n",
wine_dbgstr_w(title));
SysFreeString(title);
More information about the wine-cvs
mailing list