From 725b069e68d288009f1a3d9bcb7120adddfda96b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 4 Sep 2013 10:12:30 +0400 Subject: [PATCH] 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 e2b73d09f9d..c4072b7af02 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 a21a2f3099d..686edb01d79 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 1cff18d877d..36d18bc8173 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 e8d17d14f9a..7ee654802f2 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 2cdd160f6ad..29593f8fdbe 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 4c4edef7c27..fb4ef4ebc55 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*/ {