Module: wine Branch: master Commit: a6c81e07548aec5777a2a53fbd4c7dca4cec4ba5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a6c81e07548aec5777a2a53fbd...
Author: Aric Stewart aric@codeweavers.com Date: Fri Jun 26 17:01:29 2009 +0900
shell32: Implement SHCreateShellFolderView (ordinal 256).
Used by IE7's Add On management dialog.
---
dlls/shell32/shell32.spec | 2 +- dlls/shell32/shellord.c | 60 ++++++++++++++++++++++++-------------------- include/shlobj.h | 35 ++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 28 deletions(-)
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index b50890b..433ed3a 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -210,7 +210,7 @@ 249 stdcall -noname PathParseIconLocation(ptr) PathParseIconLocationAW 250 stdcall -noname PathRemoveExtension(ptr) PathRemoveExtensionAW 251 stdcall -noname PathRemoveArgs(ptr) PathRemoveArgsAW - 256 stdcall @(ptr ptr) SHELL32_256 + 256 stdcall SHCreateShellFolderView(ptr ptr) 258 stdcall -noname LinkWindow_RegisterClass() 259 stdcall -noname LinkWindow_UnregisterClass() #299 stub Shl1632_ThunkData32 diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 2fef940..44c9c7e 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -1893,33 +1893,6 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc( return hRes; }
- -/************************************************************************* - * SHELL32_256 (SHELL32.256) - */ -HRESULT WINAPI SHELL32_256(LPDWORD lpdw0, LPDWORD lpdw1) -{ - HRESULT ret = S_OK; - - FIXME("stub %p 0x%08x %p\n", lpdw0, lpdw0 ? *lpdw0 : 0, lpdw1); - - if (!lpdw0 || *lpdw0 != 0x10) - ret = E_INVALIDARG; - else - { - LPVOID lpdata = 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/ - - if (!lpdata) - ret = E_OUTOFMEMORY; - else - { - /* Initialize and return unknown lpdata structure */ - } - } - - return ret; -} - /************************************************************************* * SHFindFiles (SHELL32.90) */ @@ -2140,3 +2113,36 @@ HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv) FIXME("STUB: %i %s\n",iImageList,debugstr_guid(riid)); return E_NOINTERFACE; } + +/************************************************************************* + * SHCreateShellFolderView [SHELL32.256] + * + * Create a new instance of the default Shell folder view object. + * + * RETURNS + * Success: S_OK + * Failure: error value + * + * NOTES + * see IShellFolder::CreateViewObject + */ +HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, + IShellView **ppsv) +{ + IShellView * psf; + HRESULT hRes; + + TRACE("sf=%p outer=%p callback=%p\n", + pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb); + + psf = IShellView_Constructor(pcsfv->pshf); + + if (!psf) + return E_OUTOFMEMORY; + + IShellView_AddRef(psf); + hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppsv); + IShellView_Release(psf); + + return hRes; +} diff --git a/include/shlobj.h b/include/shlobj.h index 01f8368..c24c29c 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -514,6 +514,31 @@ DECLARE_INTERFACE_(IACList2,IACList) #define IACList2_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) #endif
+/**************************************************************************** + * IShellFolderViewCB interface + */ + +#define INTERFACE IShellFolderViewCB +DECLARE_INTERFACE_(IShellFolderViewCB,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IShellFolderViewCB methods ***/ + STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IShellFolderViewCB_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IShellFolderViewCB_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IShellFolderViewCB_Release(p) (p)->lpVtbl->Release(p) +/*** IShellFolderViewCB methods ***/ +#define IShellFolderViewCB_MessageSFVCB(p,a,b,c) (p)->lpVtbl->MessageSFVCB(p,a,b,c) +#endif + /* IProgressDialog interface */ #define PROGDLG_NORMAL 0x00000000 #define PROGDLG_MODAL 0x00000001 @@ -737,6 +762,16 @@ HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv); #define SFVM_GET_WEBVIEW_THEME 86 /* undocumented */ #define SFVM_GETDEFERREDVIEWSETTINGS 92 /* undocumented */
+typedef struct _SFV_CREATE +{ + UINT cbSize; + IShellFolder *pshf; + IShellView *psvOuter; + IShellFolderViewCB *psfvcb; +} SFV_CREATE; + +HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pscfv, IShellView **ppsv); + /* Types and definitions for the SFM_* parameters */ #include <pshpack8.h>