Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361#ifndef _PRECOMP_H__#define _PRECOMP_H__
#include <stdarg.h>#include <assert.h>
#define COBJMACROS#define WIN32_NO_STATUS#define _INC_WINDOWS#define COM_NO_WINDOWS_H#define NTOS_MODE_USER
#include <windef.h>#include <winbase.h>#include <winreg.h>#include <winuser.h>#include <wincon.h>#include <commdlg.h>#include <ddeml.h>#include <userenv.h>
#include <shlwapi.h>#include <wininet.h>#include <shlobj.h>#include <shobjidl.h>#include <emptyvc.h>#include <ndk/rtlfuncs.h>#include <fmifs/fmifs.h>#include <tchar.h>#include <strsafe.h>#include <atlbase.h>#include <atlcom.h>#include <atlwin.h>#include <atlstr.h>#include <atlsimpcoll.h>#include <atlcoll.h>#include <powrprof.h>#include <winnetwk.h>#include <objsafe.h>#include <regstr.h>
#include <comctl32_undoc.h>#include <shlguid_undoc.h>#include <shlobj_undoc.h>
#include <shlwapi_undoc.h>#include <ishellfolder_helpers.h>
#include <shellapi.h>#undef ShellExecute#include <undocshell.h>
/* * For versions < Vista+, redefine ShellMessageBoxW to ShellMessageBoxWrapW * (this is needed to avoid a linker error). On Vista+ onwards, shell32.ShellMessageBoxW * redirects to shlwapi.ShellMessageBoxW so the #define should not be needed. * * However our shell32 is built with _WIN32_WINNT set to 0x600 (Vista+), * yet its exports (especially regarding ShellMessageBoxA/W) are Win2003 * compatible. So the #define is still needed, and the check be disabled. */// #if (_WIN32_WINNT < 0x0600)#define ShellMessageBoxW ShellMessageBoxWrapW// #endif
#include <browseui_undoc.h>
#include <shellutils.h>
#include "shellrecyclebin/recyclebin.h"#include "wine/pidl.h"#include "debughlp.h"#include "wine/shell32_main.h"#include "shresdef.h"#include "wine/cpanel.h"#include "CActiveDesktop.h"#include "CEnumIDListBase.h"#include "shfldr.h"#include "CShellItem.h"#include "CShellLink.h"#include "CFolderItemVerbs.h"#include "CFolderItems.h"#include "CFolder.h"#include "CShellDispatch.h"#include "CDropTargetHelper.h"#include "CFolderOptions.h"#include "folders/CFSFolder.h"#include "folders/CDrivesFolder.h"#include "folders/CDesktopFolder.h"#include "folders/CControlPanelFolder.h"#include "folders/CMyDocsFolder.h"#include "folders/CNetFolder.h"#include "folders/CFontsFolder.h"#include "folders/CPrinterFolder.h"#include "folders/CAdminToolsFolder.h"#include "folders/CRecycleBin.h"#include "folders/CRecycleBinFolderViewCB.h"#include "droptargets/CexeDropHandler.h"#include "droptargets/CFSDropTarget.h"#include "COpenWithMenu.h"#include "CNewMenu.h"#include "CSendToMenu.h"#include "CCopyMoveToMenu.h"#include "CCopyAsPathMenu.h"#include "dialogs/filedefext.h"#include "dialogs/drvdefext.h"#include "CQueryAssociations.h"#include "shellmenu/CMenuBand.h"#include "shellmenu/CMenuDeskBar.h"#include "shellmenu/CMenuSite.h"#include "shellmenu/CMergedFolder.h"#include "shellmenu/shellmenu.h"#include "CUserNotification.h"#include "dialogs/folder_options.h"#include "shelldesktop/CChangeNotifyServer.h"#include "utils.h"
#include <wine/debug.h>#include <wine/unicode.h>
extern const GUID CLSID_AdminFolderShortcut;extern const GUID CLSID_FontsFolderShortcut;extern const GUID CLSID_StartMenu;extern const GUID CLSID_MenuBandSite;extern const GUID CLSID_OpenWith;extern const GUID CLSID_UnixFolder;extern const GUID CLSID_UnixDosFolder;extern const GUID SHELL32_AdvtShortcutProduct;extern const GUID SHELL32_AdvtShortcutComponent;
#define VERBKEY_CCHMAX 64 // Note: 63+\0 seems to be the limit on XP
#define MAX_PROPERTY_SHEET_PAGE 32
#define SHV_CHANGE_NOTIFY (WM_USER + 0x1111)#define SHV_UPDATESTATUSBAR (WM_USER + 0x1112)
extern inlineBOOLCALLBACKAddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam){ PROPSHEETHEADERW *pHeader = (PROPSHEETHEADERW *)lParam;
if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE) { pHeader->phpage[pHeader->nPages++] = hPage; return TRUE; }
return FALSE;}
static inline HRESULTAddPropSheetPage(HPROPSHEETPAGE hPage, LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam){ if (!hPage) return E_FAIL; if (pfnAddPage(hPage, lParam)) return S_OK; DestroyPropertySheetPage(hPage); return E_FAIL;}
template<class T> static UINT CALLBACKPropSheetPageLifetimeCallback(HWND hWnd, UINT uMsg, PROPSHEETPAGEW *pPSP){ if (uMsg == PSPCB_RELEASE) ((T*)(pPSP->lParam))->Release(); return TRUE;}
HRESULTSHELL32_ShowPropertiesDialog(IDataObject *pdtobj);HRESULTSHELL32_ShowFilesystemItemPropertiesDialogAsync(IDataObject *pDO);HRESULTSHELL32_ShowFilesystemItemsPropertiesDialogAsync(HWND hOwner, IDataObject *pDO);HRESULTSHELL32_ShowShellExtensionProperties(const CLSID *pClsid, IDataObject *pDO);HRESULTSHELL_ShowItemIDListProperties(LPCITEMIDLIST pidl);
typedef HDSA HDCMA; // DynamicContextMenuArraytypedef struct _DCMENTRY{ IContextMenu *pCM; UINT idCmdFirst; UINT idCmdLast;} DCMENTRY;#define DCMA_Create() ( (HDCMA)DSA_Create(sizeof(DCMENTRY), 4) )void DCMA_Destroy(HDCMA hDCMA);#define DCMA_GetEntry(hDCMA, iItem) ( (DCMENTRY*)DSA_GetItemPtr((HDSA)(hDCMA), (iItem)) )HRESULT DCMA_InvokeCommand(HDCMA hDCMA, CMINVOKECOMMANDINFO *pICI);
UINTDCMA_InsertMenuItems( _In_ HDCMA hDCMA, _In_ HDCIA hDCIA, _In_opt_ LPCITEMIDLIST pidlFolder, _In_opt_ IDataObject *pDO, _In_opt_ HKEY *pKeys, _In_opt_ UINT nKeys, _In_ QCMINFO *pQCMI, _In_opt_ UINT fCmf, _In_opt_ IUnknown *pUnkSite);
HRESULTSHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg);PCSTRMapFcidmCmdToVerb(_In_ UINT_PTR CmdId);UINTMapVerbToDfmCmd(_In_ LPCSTR verba);UINTGetDfmCmd(_In_ IContextMenu *pCM, _In_ LPCSTR verba);#define SHELL_ExecuteControlPanelCPL(hwnd, cpl) SHRunControlPanel((cpl), (hwnd))
// CStubWindow32 --- The owner window of file property sheets.// This window hides taskbar button of property sheet.#define CSTUBWINDOW32_CLASSNAME _T("StubWindow32")class CStubWindow32 : public CWindowImpl<CStubWindow32>{ static HWND FindStubWindow(UINT Type, LPCWSTR Path);public: DECLARE_WND_CLASS_EX(CSTUBWINDOW32_CLASSNAME, 0, COLOR_WINDOWTEXT) enum { TYPE_FORMATDRIVE = 1, TYPE_PROPERTYSHEET, }; static LPCWSTR GetTypePropName() { return L"StubType"; } HRESULT CreateStub(UINT Type, LPCWSTR Path, const POINT *pPt);
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { if (HICON hIco = (HICON)SendMessage(WM_SETICON, ICON_BIG, NULL)) DestroyIcon(hIco); ::RemovePropW(m_hWnd, GetTypePropName()); return 0; }
BEGIN_MSG_MAP(CStubWindow32) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) END_MSG_MAP()};
void PostCabinetMessage(UINT Msg, WPARAM wParam, LPARAM lParam);
BOOL BindCtx_ContainsObject(_In_ IBindCtx *pBindCtx, _In_ LPCWSTR pszName);DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault);BOOL SHSkipJunctionBinding(_In_ IBindCtx *pbc, _In_ CLSID *pclsid);HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData);BOOL Shell_FailForceReturn(_In_ HRESULT hr);
EXTERN_C INTShell_ParseSpecialFolder(_In_ LPCWSTR pszStart, _Out_ LPWSTR *ppch, _Out_ INT *pcch);
EXTERN_CHRESULT SHBindToObject( _In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj);
HRESULTSHBindToObjectEx( _In_opt_ IShellFolder *pShellFolder, _In_ LPCITEMIDLIST pidl, _In_opt_ IBindCtx *pBindCtx, _In_ REFIID riid, _Out_ void **ppvObj);
EXTERN_C HRESULTSHELL_GetUIObjectOfAbsoluteItem( _In_opt_ HWND hWnd, _In_ PCIDLIST_ABSOLUTE pidl, _In_ REFIID riid, _Out_ void **ppvObj);
HRESULTSHELL_DisplayNameOf( _In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_opt_ UINT Flags, _Out_ PWSTR *ppStr);
DWORDSHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes);HRESULT SHELL_GetIDListTarget(_In_ LPCITEMIDLIST pidl, _Out_ PIDLIST_ABSOLUTE *ppidl);HRESULT SHCoInitializeAnyApartment(VOID);
HRESULTSHGetNameAndFlagsW( _In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_opt_ LPWSTR pszText, _In_ UINT cchBuf, _Inout_opt_ DWORD *pdwAttributes);
EXTERN_C HWND BindCtx_GetUIWindow(_In_ IBindCtx *pBindCtx);
EXTERN_C HRESULTBindCtx_RegisterObjectParam( _In_ IBindCtx *pBindCtx, _In_ LPOLESTR pszKey, _In_opt_ IUnknown *punk, _Out_ LPBC *ppbc);
BOOL PathIsDotOrDotDotW(_In_ LPCWSTR pszPath);BOOL PathIsValidElement(_In_ LPCWSTR pszPath);BOOL PathIsDosDevice(_In_ LPCWSTR pszName);HRESULT SHELL32_GetDllFromRundll32CommandLine(LPCWSTR pszCmd, LPWSTR pszOut, SIZE_T cchMax);HRESULT SHILAppend(_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl);
HRESULT DataObject_GetHIDACount(IDataObject *pdo);PIDLIST_ABSOLUTE SHELL_CIDA_ILCloneFull(_In_ const CIDA *pCIDA, _In_ UINT Index);PIDLIST_ABSOLUTE SHELL_DataObject_ILCloneFullItem(_In_ IDataObject *pDO, _In_ UINT Index);HRESULT SHELL_CloneDataObject(_In_ IDataObject *pDO, _Out_ IDataObject **ppDO);
EXTERN_C HRESULTIUnknown_InitializeCommand( _In_ IUnknown *pUnk, _In_ PCWSTR pszCommandName, _In_opt_ IPropertyBag *pPB);EXTERN_C HRESULTInvokeIExecuteCommand( _In_ IExecuteCommand *pEC, _In_ PCWSTR pszCommandName, _In_opt_ IPropertyBag *pPB, _In_opt_ IShellItemArray *pSIA, _In_opt_ LPCMINVOKECOMMANDINFOEX pICI, _In_opt_ IUnknown *pSite);EXTERN_C HRESULTInvokeIExecuteCommandWithDataObject( _In_ IExecuteCommand *pEC, _In_ PCWSTR pszCommandName, _In_opt_ IPropertyBag *pPB, _In_ IDataObject *pDO, _In_opt_ LPCMINVOKECOMMANDINFOEX pICI, _In_opt_ IUnknown *pSite);
typedef enum _FILEOPCALLBACKEVENT { FOCE_STARTOPERATIONS, FOCE_FINISHOPERATIONS, FOCE_PREMOVEITEM, FOCE_POSTMOVEITEM, FOCE_PRECOPYITEM, FOCE_POSTCOPYITEM, FOCE_PREDELETEITEM, FOCE_POSTDELETEITEM, FOCE_PRERENAMEITEM, FOCE_POSTRENAMEITEM, FOCE_PRENEWITEM, FOCE_POSTNEWITEM} FILEOPCALLBACKEVENT;typedef HRESULT (CALLBACK *FILEOPCALLBACK)(FILEOPCALLBACKEVENT Event, LPCWSTR Source, LPCWSTR Destination, UINT Attributes, HRESULT hr, void *CallerData);int SHELL32_FileOperation(LPSHFILEOPSTRUCTW lpFileOp, FILEOPCALLBACK Callback, void *CallerData);HRESULT SHELL_SingleFileOperation(HWND hWnd, UINT Op, PCWSTR Src, PCWSTR Dest, UINT Flags, PWSTR *ppNewName);
#endif /* _PRECOMP_H__ */