[Wine-devel] Eter's patch is applied to winehq repo 02/09/11

builder на builder.office.etersoft.ru builder на builder.office.etersoft.ru
Ср Фев 9 07:20:23 MSK 2011


New Etersoft's patches since last build time:
commit 9ba0f5c52ea87c2e268f779794bf410f74d3ab0f
Author: Alexander Morozov <amorozov на etersoft.ru>

    shell32: Partially implement FolderItem::get_Path.

commit 7921522718e66155398437af80d37b1f29d824fd
Author: Alexander Morozov <amorozov на etersoft.ru>

    shell32: Implement Folder2::get_Self.

---

commit 9ba0f5c52ea87c2e268f779794bf410f74d3ab0f
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Wed Feb 2 21:12:15 2011 +0300

    shell32: Partially implement FolderItem::get_Path.

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index f6ad59f..0ad3b1d 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -225,10 +225,38 @@ static HRESULT WINAPI FolderItemImpl_put_Name(FolderItem *iface, BSTR bs)
 
 static HRESULT WINAPI FolderItemImpl_get_Path(FolderItem *iface, BSTR *pbs)
 {
-    FIXME("(%p,%p)\n", iface, pbs);
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+    HRESULT ret = S_OK;
+    WCHAR *pathW;
+    int len;
+
+    TRACE("(%p,%p)\n", iface, pbs);
 
     *pbs = NULL;
-    return E_NOTIMPL;
+    if (V_VT(&This->dir) == VT_I4)
+    {
+        pathW = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
+        if (!pathW) return E_OUTOFMEMORY;
+        ret = SHGetFolderPathW(NULL, V_I4(&This->dir), NULL, SHGFP_TYPE_CURRENT,
+                pathW);
+        if (ret == S_OK)
+            *pbs = SysAllocString(pathW);
+        else if (ret == E_INVALIDARG)
+        {
+            FIXME("not implemented for %#x\n", V_I4(&This->dir));
+            ret = E_NOTIMPL;
+        }
+        HeapFree(GetProcessHeap(), 0, pathW);
+    }
+    else /* VT_BSTR */
+    {
+        pathW = V_BSTR(&This->dir);
+        len = lstrlenW(pathW);
+        *pbs = SysAllocStringLen(pathW, pathW[len - 1] == '\\' ? len - 1 : len);
+    }
+    if (ret == S_OK && !*pbs)
+        ret = E_OUTOFMEMORY;
+    return ret;
 }
 
 static HRESULT WINAPI FolderItemImpl_get_GetLink(FolderItem *iface,
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index 294b3a9..a2b649a 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -150,10 +150,8 @@ static void test_namespace(void)
             if (r == S_OK)
             {
                 r = FolderItem_get_Path(item, &item_path);
-                todo_wine
                 ok(r == S_OK, "FolderItem::get_Path failed: %08x\n", r);
                 if (pSHGetFolderPathW)
-                    todo_wine
                     ok(!lstrcmpW(item_path, path), "expected %s, got %s\n",
                      wine_dbgstr_w(path), wine_dbgstr_w(item_path));
                 SysFreeString(item_path);
@@ -239,10 +237,8 @@ static void test_namespace(void)
             if (r == S_OK)
             {
                 r = FolderItem_get_Path(item, &item_path);
-                todo_wine
                 ok(r == S_OK, "FolderItem::get_Path failed: %08x\n", r);
                 if (long_pathW)
-                    todo_wine
                     ok(!lstrcmpW(item_path, long_pathW),
                      "expected %s, got %s\n", wine_dbgstr_w(long_pathW),
                      wine_dbgstr_w(item_path));
@@ -284,10 +280,8 @@ static void test_namespace(void)
                 if (r == S_OK)
                 {
                     r = FolderItem_get_Path(item, &item_path);
-                    todo_wine
                     ok(r == S_OK, "FolderItem::get_Path failed: %08x\n", r);
                     if (long_pathW)
-                        todo_wine
                         ok(!lstrcmpW(item_path, long_pathW),
                          "expected %s, got %s\n", wine_dbgstr_w(long_pathW),
                          wine_dbgstr_w(item_path));

commit 7921522718e66155398437af80d37b1f29d824fd
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Wed Feb 2 20:11:19 2011 +0300

    shell32: Implement Folder2::get_Self.

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 4458252..f6ad59f 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -52,6 +52,13 @@ typedef struct {
     VARIANT dir;
 } FolderImpl;
 
+typedef struct {
+    FolderItem FolderItem_iface;
+    LONG ref;
+    ITypeInfo *iTypeInfo;
+    VARIANT dir;
+} FolderItemImpl;
+
 static inline ShellDispatch *impl_from_IShellDispatch(IShellDispatch *iface)
 {
     return CONTAINING_RECORD(iface, ShellDispatch, IShellDispatch_iface);
@@ -62,6 +69,11 @@ static inline FolderImpl *impl_from_Folder(Folder3 *iface)
     return CONTAINING_RECORD(iface, FolderImpl, Folder_iface);
 }
 
+static inline FolderItemImpl *impl_from_FolderItem(FolderItem *iface)
+{
+    return CONTAINING_RECORD(iface, FolderItemImpl, FolderItem_iface);
+}
+
 static HRESULT load_type_info(REFGUID guid, ITypeInfo **pptinfo)
 {
     ITypeLib *typelib;
@@ -82,6 +94,299 @@ static HRESULT load_type_info(REFGUID guid, ITypeInfo **pptinfo)
     return ret;
 }
 
+static HRESULT WINAPI FolderItemImpl_QueryInterface(FolderItem *iface,
+        REFIID riid, LPVOID *ppv)
+{
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+
+    TRACE("(%p,%p,%p)\n", iface, riid, ppv);
+
+    if (!ppv) return E_INVALIDARG;
+
+    if (IsEqualIID(&IID_IUnknown, riid) ||
+        IsEqualIID(&IID_IDispatch, riid) ||
+        IsEqualIID(&IID_FolderItem, riid))
+        *ppv = This;
+    else
+    {
+        FIXME("not implemented for %s\n", shdebugstr_guid(riid));
+        *ppv = NULL;
+        return E_NOINTERFACE;
+    }
+    IUnknown_AddRef((IUnknown*)*ppv);
+    return S_OK;
+}
+
+static ULONG WINAPI FolderItemImpl_AddRef(FolderItem *iface)
+{
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
+
+    TRACE("(%p), new refcount=%i\n", iface, ref);
+
+    return ref;
+}
+
+static ULONG WINAPI FolderItemImpl_Release(FolderItem *iface)
+{
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+    ULONG ref = InterlockedDecrement(&This->ref);
+
+    TRACE("(%p), new refcount=%i\n", iface, ref);
+
+    if (!ref)
+    {
+        VariantClear(&This->dir);
+        ITypeInfo_Release(This->iTypeInfo);
+        HeapFree(GetProcessHeap(), 0, This);
+    }
+    return ref;
+}
+
+static HRESULT WINAPI FolderItemImpl_GetTypeInfoCount(FolderItem *iface,
+        UINT *pctinfo)
+{
+    TRACE("(%p,%p)\n", iface, pctinfo);
+
+    *pctinfo = 1;
+    return S_OK;
+}
+
+static HRESULT WINAPI FolderItemImpl_GetTypeInfo(FolderItem *iface, UINT iTInfo,
+        LCID lcid, ITypeInfo **ppTInfo)
+{
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+
+    TRACE("(%p,%u,%d,%p)\n", iface, iTInfo, lcid, ppTInfo);
+
+    ITypeInfo_AddRef(This->iTypeInfo);
+    *ppTInfo = This->iTypeInfo;
+    return S_OK;
+}
+
+static HRESULT WINAPI FolderItemImpl_GetIDsOfNames(FolderItem *iface,
+        REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
+        DISPID *rgDispId)
+{
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+
+    TRACE("(%p,%p,%p,%u,%d,%p)\n", iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+
+    return ITypeInfo_GetIDsOfNames(This->iTypeInfo, rgszNames, cNames, rgDispId);
+}
+
+static HRESULT WINAPI FolderItemImpl_Invoke(FolderItem *iface,
+        DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
+        DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
+        UINT *puArgErr)
+{
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+
+    TRACE("(%p,%d,%p,%d,%u,%p,%p,%p,%p)\n", iface, dispIdMember, riid, lcid,
+            wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+
+    return ITypeInfo_Invoke(This->iTypeInfo, This, dispIdMember, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI FolderItemImpl_get_Application(FolderItem *iface,
+        IDispatch **ppid)
+{
+    FIXME("(%p,%p)\n", iface, ppid);
+
+    *ppid = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_Parent(FolderItem *iface,
+        IDispatch **ppid)
+{
+    FIXME("(%p,%p)\n", iface, ppid);
+
+    *ppid = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_Name(FolderItem *iface, BSTR *pbs)
+{
+    FIXME("(%p,%p)\n", iface, pbs);
+
+    *pbs = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_put_Name(FolderItem *iface, BSTR bs)
+{
+    FIXME("(%p,%s)\n", iface, debugstr_w(bs));
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_Path(FolderItem *iface, BSTR *pbs)
+{
+    FIXME("(%p,%p)\n", iface, pbs);
+
+    *pbs = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_GetLink(FolderItem *iface,
+        IDispatch **ppid)
+{
+    FIXME("(%p,%p)\n", iface, ppid);
+
+    *ppid = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_GetFolder(FolderItem *iface,
+        IDispatch **ppid)
+{
+    FIXME("(%p,%p)\n", iface, ppid);
+
+    *ppid = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_IsLink(FolderItem *iface,
+        VARIANT_BOOL *pb)
+{
+    FIXME("(%p,%p)\n", iface, pb);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_IsFolder(FolderItem *iface,
+        VARIANT_BOOL *pb)
+{
+    FIXME("(%p,%p)\n", iface, pb);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_IsFileSystem(FolderItem *iface,
+        VARIANT_BOOL *pb)
+{
+    FIXME("(%p,%p)\n", iface, pb);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_IsBrowsable(FolderItem *iface,
+        VARIANT_BOOL *pb)
+{
+    FIXME("(%p,%p)\n", iface, pb);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_ModifyDate(FolderItem *iface,
+        DATE *pdt)
+{
+    FIXME("(%p,%p)\n", iface, pdt);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_put_ModifyDate(FolderItem *iface, DATE dt)
+{
+    FIXME("(%p,%f)\n", iface, dt);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_Size(FolderItem *iface, LONG *pul)
+{
+    FIXME("(%p,%p)\n", iface, pul);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_get_Type(FolderItem *iface, BSTR *pbs)
+{
+    FIXME("(%p,%p)\n", iface, pbs);
+
+    *pbs = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_Verbs(FolderItem *iface,
+        FolderItemVerbs **ppfic)
+{
+    FIXME("(%p,%p)\n", iface, ppfic);
+
+    *ppfic = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI FolderItemImpl_InvokeVerb(FolderItem *iface,
+        VARIANT vVerb)
+{
+    FIXME("(%p)\n", iface);
+
+    return E_NOTIMPL;
+}
+
+static const FolderItemVtbl FolderItemImpl_Vtbl = {
+    FolderItemImpl_QueryInterface,
+    FolderItemImpl_AddRef,
+    FolderItemImpl_Release,
+    FolderItemImpl_GetTypeInfoCount,
+    FolderItemImpl_GetTypeInfo,
+    FolderItemImpl_GetIDsOfNames,
+    FolderItemImpl_Invoke,
+    FolderItemImpl_get_Application,
+    FolderItemImpl_get_Parent,
+    FolderItemImpl_get_Name,
+    FolderItemImpl_put_Name,
+    FolderItemImpl_get_Path,
+    FolderItemImpl_get_GetLink,
+    FolderItemImpl_get_GetFolder,
+    FolderItemImpl_get_IsLink,
+    FolderItemImpl_get_IsFolder,
+    FolderItemImpl_get_IsFileSystem,
+    FolderItemImpl_get_IsBrowsable,
+    FolderItemImpl_get_ModifyDate,
+    FolderItemImpl_put_ModifyDate,
+    FolderItemImpl_get_Size,
+    FolderItemImpl_get_Type,
+    FolderItemImpl_Verbs,
+    FolderItemImpl_InvokeVerb
+};
+
+static HRESULT FolderItem_Constructor(VARIANT *dir, FolderItem **ppfi)
+{
+    FolderItemImpl *This;
+    HRESULT ret;
+
+    *ppfi = NULL;
+
+    This = HeapAlloc(GetProcessHeap(), 0, sizeof(FolderItemImpl));
+    if (!This) return E_OUTOFMEMORY;
+    This->FolderItem_iface.lpVtbl = &FolderItemImpl_Vtbl;
+    This->ref = 1;
+
+    ret = load_type_info(&IID_FolderItem, &This->iTypeInfo);
+    if (FAILED(ret))
+    {
+        HeapFree(GetProcessHeap(), 0, This);
+        return ret;
+    }
+
+    VariantInit(&This->dir);
+    ret = VariantCopy(&This->dir, dir);
+    if (FAILED(ret))
+    {
+        ITypeInfo_Release(This->iTypeInfo);
+        HeapFree(GetProcessHeap(), 0, This);
+        return E_OUTOFMEMORY;
+    }
+
+    *ppfi = (FolderItem*)This;
+    return ret;
+}
+
 static HRESULT WINAPI FolderImpl_QueryInterface(Folder3 *iface, REFIID riid,
         LPVOID *ppv)
 {
@@ -276,10 +581,11 @@ static HRESULT WINAPI FolderImpl_GetDetailsOf(Folder3 *iface, VARIANT vItem,
 
 static HRESULT WINAPI FolderImpl_get_Self(Folder3 *iface, FolderItem **ppfi)
 {
-    FIXME("(%p,%p)\n", iface, ppfi);
+    FolderImpl *This = impl_from_Folder(iface);
 
-    *ppfi = NULL;
-    return E_NOTIMPL;
+    TRACE("(%p,%p)\n", iface, ppfi);
+
+    return FolderItem_Constructor(&This->dir, ppfi);
 }
 
 static HRESULT WINAPI FolderImpl_get_OfflineStatus(Folder3 *iface, LONG *pul)
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index 0200e86..294b3a9 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -146,7 +146,6 @@ static void test_namespace(void)
         if (r == S_OK)
         {
             r = Folder2_get_Self(folder2, &item);
-            todo_wine
             ok(r == S_OK, "Folder::get_Self failed: %08x\n", r);
             if (r == S_OK)
             {
@@ -180,7 +179,6 @@ static void test_namespace(void)
         if (r == S_OK)
         {
             r = Folder2_get_Self(folder2, &item);
-            todo_wine
             ok(r == S_OK, "Folder::get_Self failed: %08x\n", r);
             if (r == S_OK)
             {
@@ -237,7 +235,6 @@ static void test_namespace(void)
         if (r == S_OK)
         {
             r = Folder2_get_Self(folder2, &item);
-            todo_wine
             ok(r == S_OK, "Folder::get_Self failed: %08x\n", r);
             if (r == S_OK)
             {
@@ -283,7 +280,6 @@ static void test_namespace(void)
             if (r == S_OK)
             {
                 r = Folder2_get_Self(folder2, &item);
-                todo_wine
                 ok(r == S_OK, "Folder::get_Self failed: %08x\n", r);
                 if (r == S_OK)
                 {


Подробная информация о списке рассылки Wine-devel