#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#define NO_SHLWAPI_STREAM
#include "shlwapi.h"
#include "filedlgbrowser.h"
#include "cdlg.h"
#include "shlguid.h"
#include "servprov.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
typedef struct
{
IShellBrowser IShellBrowser_iface;
ICommDlgBrowser ICommDlgBrowser_iface;
IServiceProvider IServiceProvider_iface;
LONG ref;
HWND hwndOwner;
} IShellBrowserImpl;
static inline IShellBrowserImpl *impl_from_IShellBrowser(IShellBrowser *iface)
{
return CONTAINING_RECORD(iface, IShellBrowserImpl, IShellBrowser_iface);
}
static inline IShellBrowserImpl *impl_from_ICommDlgBrowser( ICommDlgBrowser *iface )
{
return CONTAINING_RECORD(iface, IShellBrowserImpl, ICommDlgBrowser_iface);
}
static inline IShellBrowserImpl *impl_from_IServiceProvider( IServiceProvider *iface )
{
return CONTAINING_RECORD(iface, IShellBrowserImpl, IServiceProvider_iface);
}
static const IShellBrowserVtbl IShellBrowserImpl_Vtbl;
static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl;
static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl;
#define add_flag(a) if (flags & a) {strcat(str, #a );strcat(str," ");}
static void COMDLG32_DumpSBSPFlags(UINT uflags)
{
if (TRACE_ON(commdlg))
{
unsigned int i;
static const struct {
DWORD mask;
const char *name;
} flags[] = {
#define FE(x) { x, #x}
FE(SBSP_SAMEBROWSER),
FE(SBSP_NEWBROWSER),
FE(SBSP_OPENMODE),
FE(SBSP_EXPLOREMODE),
FE(SBSP_HELPMODE),
FE(SBSP_NOTRANSFERHIST),
FE(SBSP_RELATIVE),
FE(SBSP_PARENT),
FE(SBSP_NAVIGATEBACK),
FE(SBSP_NAVIGATEFORWARD),
FE(SBSP_ALLOW_AUTONAVIGATE),
FE(SBSP_NOAUTOSELECT),
FE(SBSP_WRITENOHISTORY),
FE(SBSP_REDIRECT),
FE(SBSP_INITIATEDBYHLINKFRAME),
};
#undef FE
TRACE("SBSP Flags: %08x =", uflags);
for (i = 0; i < ARRAY_SIZE(flags); i++)
if (flags[i].mask & uflags)
TRACE("%s ", flags[i].name);
TRACE("\n");
}
}
static void COMDLG32_UpdateCurrentDir(const FileOpenDlgInfos *fodInfos)
{
LPSHELLFOLDER psfDesktop;
STRRET strret;
HRESULT res;
res = SHGetDesktopFolder(&psfDesktop);
if (FAILED(res))
return;
res = IShellFolder_GetDisplayNameOf(psfDesktop, fodInfos->ShellInfos.pidlAbsCurrent,
SHGDN_FORPARSING, &strret);
if (SUCCEEDED(res)) {
WCHAR wszCurrentDir[MAX_PATH];
res = StrRetToBufW(&strret, fodInfos->ShellInfos.pidlAbsCurrent, wszCurrentDir, MAX_PATH);
if (SUCCEEDED(res))
SetCurrentDirectoryW(wszCurrentDir);
}
IShellFolder_Release(psfDesktop);
}
IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
{
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndOwner);
IShellBrowserImpl *sb;
sb = heap_alloc(sizeof(*sb));
sb->ref=1;
sb->hwndOwner = hwndOwner;
sb->IShellBrowser_iface.lpVtbl = &IShellBrowserImpl_Vtbl;
sb->ICommDlgBrowser_iface.lpVtbl = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
sb->IServiceProvider_iface.lpVtbl = &IShellBrowserImpl_IServiceProvider_Vtbl;
SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
&fodInfos->ShellInfos.pidlAbsCurrent);
TRACE("%p\n", sb);
return &sb->IShellBrowser_iface;
}
static HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, REFIID riid, void **ppvObj)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown))
*ppvObj = &This->IShellBrowser_iface;
else if(IsEqualIID(riid, &IID_IOleWindow))
*ppvObj = &This->IShellBrowser_iface;
else if(IsEqualIID(riid, &IID_IShellBrowser))
*ppvObj = &This->IShellBrowser_iface;
else if(IsEqualIID(riid, &IID_ICommDlgBrowser))
*ppvObj = &This->ICommDlgBrowser_iface;
else if(IsEqualIID(riid, &IID_IServiceProvider))
*ppvObj = &This->IServiceProvider_iface;
if(*ppvObj) {
IUnknown_AddRef((IUnknown*)*ppvObj);
return S_OK;
}
FIXME("unsupported interface, %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p,%lu)\n", This, ref - 1);
return ref;
}
static ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p,%lu)\n", This, ref + 1);
if (!ref)
heap_free(This);
return ref;
}
static HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
HWND * phwnd)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
if(!This->hwndOwner)
return E_FAIL;
*phwnd = This->hwndOwner;
return (*phwnd) ? S_OK : E_UNEXPECTED;
}
static HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
BOOL fEnterMode)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
LPCITEMIDLIST pidl,
UINT wFlags)
{
HRESULT hRes;
IShellFolder *folder;
IShellView *psvTmp;
FileOpenDlgInfos *fodInfos;
LPITEMIDLIST pidlTmp;
HWND hwndView;
HWND hDlgWnd;
BOOL bViewHasFocus;
RECT rectView;
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)(pidl=%p,flags=0x%08x)\n", This, pidl, wFlags);
COMDLG32_DumpSBSPFlags(wFlags);
fodInfos = get_filedlg_infoptr(This->hwndOwner);
if(wFlags & SBSP_RELATIVE)
{
if (FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
pidl, NULL, &IID_IShellFolder, (void **)&folder)))
{
ERR("bind to object failed\n");
return hRes;
}
pidlTmp = ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, pidl);
}
else if(wFlags & SBSP_PARENT)
{
pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
folder = GetShellFolderFromPidl(pidlTmp);
}
else
{
pidlTmp = ILClone(pidl);
folder = GetShellFolderFromPidl(pidlTmp);
}
if (!folder)
{
ERR("could not browse to folder\n");
ILFree(pidlTmp);
return E_FAIL;
}
if (ILIsEqual(pidlTmp, fodInfos->ShellInfos.pidlAbsCurrent))
{
IShellFolder_Release(folder);
ILFree(pidlTmp);
TRACE("keep current folder\n");
return S_OK;
}
if (fodInfos->Shell.FOIDataObject)
{
IDataObject_Release(fodInfos->Shell.FOIDataObject);
fodInfos->Shell.FOIDataObject = NULL;
}
TRACE("create view object\n");
if (FAILED(hRes = IShellFolder_CreateViewObject(folder, fodInfos->ShellInfos.hwndOwner,
&IID_IShellView, (void **)&psvTmp)))
{
IShellFolder_Release(folder);
ILFree(pidlTmp);
return hRes;
}
bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus());
if(fodInfos->Shell.FOIShellView)
IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings);
if(fodInfos->Shell.FOIShellView)
{
IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
IShellView_Release(fodInfos->Shell.FOIShellView);
}
fodInfos->Shell.FOIShellView = psvTmp;
if (fodInfos->Shell.FOIShellFolder)
IShellFolder_Release(fodInfos->Shell.FOIShellFolder);
fodInfos->Shell.FOIShellFolder = folder;
ILFree(fodInfos->ShellInfos.pidlAbsCurrent);
fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
COMDLG32_UpdateCurrentDir(fodInfos);
GetWindowRect(GetDlgItem(This->hwndOwner, IDC_SHELLSTATIC), &rectView);
MapWindowPoints(0, This->hwndOwner, (LPPOINT)&rectView, 2);
TRACE("create view window\n");
if (FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL,
&fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser,
&rectView, &hwndView)))
{
WARN("Failed to create view window, hr %#lx.\n", hRes);
return hRes;
}
fodInfos->ShellInfos.hwndView = hwndView;
SetWindowLongPtrW(hwndView, GWLP_ID, lst2);
SendMessageW( hwndView, WM_SETFONT, SendMessageW( GetParent(hwndView), WM_GETFONT, 0, 0 ), FALSE );
FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
if (bViewHasFocus)
SetFocus(fodInfos->ShellInfos.hwndView);
return hRes;
}
static HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
BOOL fEnable)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
UINT id,
HWND *lphwnd)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
DWORD grfMode,
LPSTREAM *ppStrm)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
FIXME("(%p 0x%08lx %p)\n", This, grfMode, ppStrm);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
IShellView *ppshv)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
IShellView **ppshv)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
FileOpenDlgInfos *fodInfos;
TRACE("(%p)\n", This);
fodInfos = get_filedlg_infoptr(This->hwndOwner);
if(!(*ppshv = fodInfos->Shell.FOIShellView))
{
return E_FAIL;
}
IShellView_AddRef(fodInfos->Shell.FOIShellView);
return NOERROR;
}
static HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
HMENU hmenuShared)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
UINT id,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT *pret)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
LRESULT lres;
TRACE("(%p)->(0x%08x 0x%08x 0x%08Ix 0x%08Ix %p)\n", This, id, uMsg, wParam, lParam, pret);
switch (id)
{
case FCW_TOOLBAR:
lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
break;
default:
FIXME("ctrl id: %x\n", id);
return E_NOTIMPL;
}
if (pret) *pret = lres;
return S_OK;
}
static HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
HMENU hmenuShared,
HOLEMENU holemenuReserved,
HWND hwndActiveObject)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
LPCOLESTR lpszStatusText)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
LPTBBUTTON lpButtons,
UINT nButtons,
UINT uFlags)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
LPMSG lpmsg,
WORD wID)
{
IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
}
static const IShellBrowserVtbl IShellBrowserImpl_Vtbl =
{
IShellBrowserImpl_QueryInterface,
IShellBrowserImpl_AddRef,
IShellBrowserImpl_Release,
IShellBrowserImpl_GetWindow,
IShellBrowserImpl_ContextSensitiveHelp,
IShellBrowserImpl_InsertMenusSB,
IShellBrowserImpl_SetMenuSB,
IShellBrowserImpl_RemoveMenusSB,
IShellBrowserImpl_SetStatusTextSB,
IShellBrowserImpl_EnableModelessSB,
IShellBrowserImpl_TranslateAcceleratorSB,
IShellBrowserImpl_BrowseObject,
IShellBrowserImpl_GetViewStateStream,
IShellBrowserImpl_GetControlWindow,
IShellBrowserImpl_SendControlMsg,
IShellBrowserImpl_QueryActiveShellView,
IShellBrowserImpl_OnViewWindowActive,
IShellBrowserImpl_SetToolbarItems
};
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
ICommDlgBrowser *iface,
REFIID riid,
LPVOID *ppvObj)
{
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppvObj);
}
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
{
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
return IShellBrowserImpl_AddRef(&This->IShellBrowser_iface);
}
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
{
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
return IShellBrowserImpl_Release(&This->IShellBrowser_iface);
}
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
IShellView *ppshv)
{
LPITEMIDLIST pidl;
FileOpenDlgInfos *fodInfos;
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
fodInfos = get_filedlg_infoptr(This->hwndOwner);
if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
{
HRESULT hRes;
ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, (LPCITEMIDLIST *)&pidl, &ulAttr);
if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
{
hRes = IShellBrowser_BrowseObject(&This->IShellBrowser_iface,pidl,SBSP_RELATIVE);
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
SendCustomDlgNotificationMessage(This->hwndOwner, CDN_FOLDERCHANGE);
}
else
{
PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);
hRes = S_OK;
}
ILFree(pidl);
return hRes;
}
return E_FAIL;
}
static HRESULT IShellBrowserImpl_OnSelChange(IShellBrowserImpl *This, const IShellView *ppshv)
{
FileOpenDlgInfos *fodInfos;
fodInfos = get_filedlg_infoptr(This->hwndOwner);
TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
if (fodInfos->Shell.FOIDataObject)
IDataObject_Release(fodInfos->Shell.FOIDataObject);
if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
&IID_IDataObject, (void**)&fodInfos->Shell.FOIDataObject)))
return E_FAIL;
FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
return S_OK;
}
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
IShellView *ppshv,
ULONG uChange)
{
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p shv=%p)\n", This, ppshv);
switch (uChange)
{
case CDBOSC_SETFOCUS:
SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
break;
case CDBOSC_KILLFOCUS:
{
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(This->hwndOwner);
if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
{
WCHAR szSave[16];
LoadStringW(COMDLG32_hInstance, IDS_SAVE_BUTTON, szSave, ARRAY_SIZE(szSave));
SetDlgItemTextW(fodInfos->ShellInfos.hwndOwner, IDOK, szSave);
}
}
break;
case CDBOSC_SELCHANGE:
return IShellBrowserImpl_OnSelChange(This, ppshv);
case CDBOSC_RENAME:
break;
}
return NOERROR;
}
static LRESULT send_includeitem_notification(HWND hwndParentDlg, LPCITEMIDLIST pidl)
{
LRESULT hook_result = 0;
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndParentDlg);
if(!fodInfos) return 0;
if(fodInfos->DlgInfos.hwndCustomDlg)
{
TRACE("call notify CDN_INCLUDEITEM for pidl=%p\n", pidl);
if(fodInfos->unicode)
{
OFNOTIFYEXW ofnNotify;
ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
ofnNotify.pidl = (LPITEMIDLIST)pidl;
ofnNotify.hdr.hwndFrom = hwndParentDlg;
ofnNotify.hdr.idFrom = 0;
ofnNotify.hdr.code = CDN_INCLUDEITEM;
ofnNotify.lpOFN = fodInfos->ofnInfos;
hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
}
else
{
OFNOTIFYEXA ofnNotify;
ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
ofnNotify.pidl = (LPITEMIDLIST)pidl;
ofnNotify.hdr.hwndFrom = hwndParentDlg;
ofnNotify.hdr.idFrom = 0;
ofnNotify.hdr.code = CDN_INCLUDEITEM;
ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
}
}
TRACE("Retval: 0x%08Ix\n", hook_result);
return hook_result;
}
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
IShellView * ppshv,
LPCITEMIDLIST pidl)
{
FileOpenDlgInfos *fodInfos;
ULONG ulAttr;
STRRET str;
WCHAR szPathW[MAX_PATH];
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
fodInfos = get_filedlg_infoptr(This->hwndOwner);
ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
if( (ulAttr & SFGAO_HIDDEN) ||
!(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR)))
return S_FALSE;
if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
return S_OK;
if(fodInfos->ofnInfos->Flags & OFN_ENABLEINCLUDENOTIFY &&
send_includeitem_notification(This->hwndOwner, pidl))
return S_OK;
if(!fodInfos->ShellInfos.lpstrCurrentFilter || !fodInfos->ShellInfos.lpstrCurrentFilter[0])
return S_OK;
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str)))
{
if (SUCCEEDED(StrRetToBufW(&str, pidl, szPathW, MAX_PATH)))
{
if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
return S_OK;
}
}
return S_FALSE;
}
static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl =
{
IShellBrowserImpl_ICommDlgBrowser_QueryInterface,
IShellBrowserImpl_ICommDlgBrowser_AddRef,
IShellBrowserImpl_ICommDlgBrowser_Release,
IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand,
IShellBrowserImpl_ICommDlgBrowser_OnStateChange,
IShellBrowserImpl_ICommDlgBrowser_IncludeObject
};
static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
IServiceProvider *iface,
REFIID riid,
LPVOID *ppvObj)
{
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n", This);
return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppvObj);
}
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
{
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n", This);
return IShellBrowserImpl_AddRef(&This->IShellBrowser_iface);
}
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
{
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n", This);
return IShellBrowserImpl_Release(&This->IShellBrowser_iface);
}
static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
IServiceProvider * iface,
REFGUID guidService,
REFIID riid,
void** ppv)
{
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
*ppv = NULL;
if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppv);
FIXME("(%p) unknown interface requested\n", This);
return E_NOINTERFACE;
}
static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl =
{
IShellBrowserImpl_IServiceProvider_QueryInterface,
IShellBrowserImpl_IServiceProvider_AddRef,
IShellBrowserImpl_IServiceProvider_Release,
IShellBrowserImpl_IServiceProvider_QueryService
};