static VOID ITrayBandSiteImpl_Free(IN OUT ITrayBandSiteImpl *This) { if (This->BandSite != NULL) { IBandSite_Release(This->BandSite); This->BandSite = NULL; } if (This->WindowEventHandler != NULL) { IWinEventHandler_Release(This->WindowEventHandler); This->WindowEventHandler = NULL; } if (This->ContextMenu != NULL) { IContextMenu_Release(This->ContextMenu); This->ContextMenu = NULL; } if (This->punkInner != NULL) { IUnknown_Release(This->punkInner); This->punkInner = NULL; } HeapFree(hProcessHeap, 0, This); }
HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd, UINT cidl, LPCITEMIDLIST *apidl, IShellFolder *psf, LPFNDFMCALLBACK lpfn, UINT nKeys, const HKEY *ahkeys, IContextMenu **ppcm) { IContextMenu *system_menu; HRESULT hres; LPITEMIDLIST folder_pidl; TRACE("(%p,%p,%u,%p,%p,%u,%p,%p)\n",pidlFolder,hwnd,cidl,apidl,psf,nKeys,ahkeys,ppcm); if(!pidlFolder) { IPersistFolder2 *persist; IShellFolder_QueryInterface(psf,&IID_IPersistFolder2,(void**)&persist); IPersistFolder2_GetCurFolder(persist,&folder_pidl); IPersistFolder2_Release(persist); } else folder_pidl=ILClone(pidlFolder); ItemMenu_Constructor(psf, folder_pidl, (const LPCITEMIDLIST*)apidl, cidl, &IID_IContextMenu, (void**)&system_menu); hres= SHELL_CreateContextMenu(hwnd,system_menu,psf,folder_pidl,apidl,cidl,ahkeys,nKeys,&IID_IContextMenu,(void**)ppcm); IContextMenu_Release(system_menu); ILFree(folder_pidl); return hres; }
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv) { IShellFolder *folder=pdcm->psf; LPITEMIDLIST folder_pidl; HRESULT ret; IContextMenu *system_menu; TRACE("(%p,%s,%p)\n",pdcm,shdebugstr_guid(riid),ppv); if(!pdcm->pidlFolder) { IPersistFolder2 *persist; IShellFolder_QueryInterface(folder,&IID_IPersistFolder2,(void**)&persist); IPersistFolder2_GetCurFolder(persist,&folder_pidl); IPersistFolder2_Release(persist); } else folder_pidl=ILClone(pdcm->pidlFolder); if(pdcm->cKeys==0) FIXME("Loading shell extensions using IQueryAssociations not yet supported\n"); ItemMenu_Constructor(folder, folder_pidl, (const LPCITEMIDLIST*)pdcm->apidl, pdcm->cidl, &IID_IContextMenu, (void**)&system_menu); ret = SHELL_CreateContextMenu(pdcm->hwnd,system_menu,folder,folder_pidl,(LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl,pdcm->aKeys,pdcm->cKeys,riid,ppv); IContextMenu_Release(system_menu); ILFree(folder_pidl); return ret; }
static void CompositeCMenu_Destroy(CompositeCMenu *This) { UINT i; for(i=0;i<This->menu_count;i++) IContextMenu_Release(This->menus[i]); HeapFree(GetProcessHeap(),0,This->menus); HeapFree(GetProcessHeap(),0,This->offsets); HeapFree(GetProcessHeap(),0,This); }