Nikolay Sivov : shell32: Fix remaining cases of implementation pointer being returned.

Alexandre Julliard julliard at winehq.org
Wed Sep 4 15:08:31 CDT 2013


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Sep  4 10:12:30 2013 +0400

shell32: Fix remaining cases of implementation pointer being returned.

---

 dlls/shell32/shfldr_desktop.c   |    2 +-
 dlls/shell32/shfldr_mycomp.c    |    2 +-
 dlls/shell32/shfldr_netplaces.c |    2 +-
 dlls/shell32/shfldr_printers.c  |    2 +-
 dlls/shell32/shlview.c          |   14 ++++----------
 dlls/shell32/shlview_cmenu.c    |    2 +-
 6 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c
index e2b73d0..c4072b7 100644
--- a/dlls/shell32/shfldr_desktop.c
+++ b/dlls/shell32/shfldr_desktop.c
@@ -112,7 +112,7 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
         IsEqualIID (riid, &IID_IShellFolder) ||
         IsEqualIID (riid, &IID_IShellFolder2))
     {
-        *ppvObj = This;
+        *ppvObj = &This->IShellFolder2_iface;
     }
     else if (IsEqualIID (riid, &IID_IPersist) ||
              IsEqualIID (riid, &IID_IPersistFolder) ||
diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c
index a21a2f3..686edb0 100644
--- a/dlls/shell32/shfldr_mycomp.c
+++ b/dlls/shell32/shfldr_mycomp.c
@@ -140,7 +140,7 @@ static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 *iface,
         IsEqualIID (riid, &IID_IShellFolder) ||
         IsEqualIID (riid, &IID_IShellFolder2))
     {
-        *ppvObj = This;
+        *ppvObj = &This->IShellFolder2_iface;
     }
     else if (IsEqualIID (riid, &IID_IPersist) ||
              IsEqualIID (riid, &IID_IPersistFolder) ||
diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c
index 1cff18d..36d18bc 100644
--- a/dlls/shell32/shfldr_netplaces.c
+++ b/dlls/shell32/shfldr_netplaces.c
@@ -133,7 +133,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnQueryInterface (IShellFolder2 *iface,
         IsEqualIID (riid, &IID_IShellFolder) ||
         IsEqualIID (riid, &IID_IShellFolder2))
     {
-        *ppvObj = This;
+        *ppvObj = &This->IShellFolder2_iface;
     }
     else if (IsEqualIID (riid, &IID_IPersist) ||
              IsEqualIID (riid, &IID_IPersistFolder) ||
diff --git a/dlls/shell32/shfldr_printers.c b/dlls/shell32/shfldr_printers.c
index e8d17d1..7ee6548 100644
--- a/dlls/shell32/shfldr_printers.c
+++ b/dlls/shell32/shfldr_printers.c
@@ -80,7 +80,7 @@ static HRESULT WINAPI IShellFolder_Printers_fnQueryInterface(IShellFolder2 *ifac
         IsEqualIID (riid, &IID_IShellFolder) ||
         IsEqualIID (riid, &IID_IShellFolder2))
     {
-        *ppvObj = This;
+        *ppvObj = &This->IShellFolder2_iface;
     }
     else if (IsEqualIID (riid, &IID_IPersist) ||
              IsEqualIID (riid, &IID_IPersistFolder) ||
diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 2cdd160..29593f8 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -1751,17 +1751,11 @@ static HRESULT WINAPI IShellView_fnQueryInterface(IShellView2 *iface, REFIID rii
 
 	*ppvObj = NULL;
 
-	if(IsEqualIID(riid, &IID_IUnknown))
+	if(IsEqualIID(riid, &IID_IUnknown) ||
+	   IsEqualIID(riid, &IID_IShellView) ||
+	   IsEqualIID(riid, &IID_IShellView2))
 	{
-	  *ppvObj = This;
-	}
-	else if(IsEqualIID(riid, &IID_IShellView))
-	{
-          *ppvObj = This;
-	}
-	else if(IsEqualIID(riid, &IID_IShellView2))
-	{
-          *ppvObj = This;
+	  *ppvObj = &This->IShellView2_iface;
 	}
 	else if(IsEqualIID(riid, &IID_IShellFolderView))
 	{
diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c
index 4c4edef..fb4ef4e 100644
--- a/dlls/shell32/shlview_cmenu.c
+++ b/dlls/shell32/shlview_cmenu.c
@@ -78,7 +78,7 @@ static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID ri
         IsEqualIID(riid, &IID_IContextMenu2) ||
         IsEqualIID(riid, &IID_IContextMenu3))
     {
-        *ppvObj = This;
+        *ppvObj = &This->IContextMenu3_iface;
     }
     else if (IsEqualIID(riid, &IID_IShellExtInit))  /*IShellExtInit*/
     {




More information about the wine-cvs mailing list