1 #ifndef _PRECOMP_H__ 2 #define _PRECOMP_H__ 3 4 #include <stdarg.h> 5 #include <assert.h> 6 7 #define COBJMACROS 8 #define WIN32_NO_STATUS 9 #define _INC_WINDOWS 10 #define COM_NO_WINDOWS_H 11 #define NTOS_MODE_USER 12 13 #include <windef.h> 14 #include <winbase.h> 15 #include <winreg.h> 16 #include <winuser.h> 17 #include <wincon.h> 18 #include <commdlg.h> 19 #include <ddeml.h> 20 #include <userenv.h> 21 22 #include <shlwapi.h> 23 #include <wininet.h> 24 #include <shlobj.h> 25 #include <shobjidl.h> 26 #include <ndk/rtlfuncs.h> 27 #include <fmifs/fmifs.h> 28 #include <tchar.h> 29 #include <strsafe.h> 30 #include <atlbase.h> 31 #include <atlcom.h> 32 #include <atlwin.h> 33 #include <atlstr.h> 34 #include <atlsimpcoll.h> 35 #include <atlcoll.h> 36 #include <powrprof.h> 37 #include <winnetwk.h> 38 #include <objsafe.h> 39 #include <regstr.h> 40 41 #include <comctl32_undoc.h> 42 #include <shlguid_undoc.h> 43 #include <shlobj_undoc.h> 44 45 #define SHLWAPI_ISHELLFOLDER_HELPERS 46 #include <shlwapi_undoc.h> 47 48 #include <shellapi.h> 49 #undef ShellExecute 50 #include <undocshell.h> 51 52 /* 53 * For versions < Vista+, redefine ShellMessageBoxW to ShellMessageBoxWrapW 54 * (this is needed to avoid a linker error). On Vista+ onwards, shell32.ShellMessageBoxW 55 * redirects to shlwapi.ShellMessageBoxW so the #define should not be needed. 56 * 57 * However our shell32 is built with _WIN32_WINNT set to 0x600 (Vista+), 58 * yet its exports (especially regarding ShellMessageBoxA/W) are Win2003 59 * compatible. So the #define is still needed, and the check be disabled. 60 */ 61 // #if (_WIN32_WINNT < 0x0600) 62 #define ShellMessageBoxW ShellMessageBoxWrapW 63 // #endif 64 65 #include <browseui_undoc.h> 66 67 #include <shellutils.h> 68 69 #include "shellrecyclebin/recyclebin.h" 70 #include "wine/pidl.h" 71 #include "debughlp.h" 72 #include "wine/shell32_main.h" 73 #include "shresdef.h" 74 #include "wine/cpanel.h" 75 #include "CActiveDesktop.h" 76 #include "CEnumIDListBase.h" 77 #include "shfldr.h" 78 #include "CShellItem.h" 79 #include "CShellLink.h" 80 #include "CFolderItemVerbs.h" 81 #include "CFolderItems.h" 82 #include "CFolder.h" 83 #include "CShellDispatch.h" 84 #include "CDropTargetHelper.h" 85 #include "CFolderOptions.h" 86 #include "folders/CFSFolder.h" 87 #include "folders/CDrivesFolder.h" 88 #include "folders/CDesktopFolder.h" 89 #include "folders/CControlPanelFolder.h" 90 #include "folders/CMyDocsFolder.h" 91 #include "folders/CNetFolder.h" 92 #include "folders/CFontsFolder.h" 93 #include "folders/CPrinterFolder.h" 94 #include "folders/CAdminToolsFolder.h" 95 #include "folders/CRecycleBin.h" 96 #include "droptargets/CexeDropHandler.h" 97 #include "droptargets/CFSDropTarget.h" 98 #include "COpenWithMenu.h" 99 #include "CNewMenu.h" 100 #include "CSendToMenu.h" 101 #include "CCopyMoveToMenu.h" 102 #include "CCopyAsPathMenu.h" 103 #include "dialogs/filedefext.h" 104 #include "dialogs/drvdefext.h" 105 #include "CQueryAssociations.h" 106 #include "shellmenu/CMenuBand.h" 107 #include "shellmenu/CMenuDeskBar.h" 108 #include "shellmenu/CMenuSite.h" 109 #include "shellmenu/CMergedFolder.h" 110 #include "shellmenu/shellmenu.h" 111 #include "CUserNotification.h" 112 #include "dialogs/folder_options.h" 113 #include "shelldesktop/CChangeNotifyServer.h" 114 115 #include <wine/debug.h> 116 #include <wine/unicode.h> 117 118 extern const GUID CLSID_AdminFolderShortcut; 119 extern const GUID CLSID_FontsFolderShortcut; 120 extern const GUID CLSID_StartMenu; 121 extern const GUID CLSID_MenuBandSite; 122 extern const GUID CLSID_OpenWith; 123 extern const GUID CLSID_UnixFolder; 124 extern const GUID CLSID_UnixDosFolder; 125 extern const GUID SHELL32_AdvtShortcutProduct; 126 extern const GUID SHELL32_AdvtShortcutComponent; 127 128 #define MAX_PROPERTY_SHEET_PAGE 32 129 130 #define VERBKEY_CCHMAX 64 // Note: 63+\0 seems to be the limit on XP 131 132 extern inline 133 BOOL 134 CALLBACK 135 AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam) 136 { 137 PROPSHEETHEADERW *pHeader = (PROPSHEETHEADERW *)lParam; 138 139 if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE) 140 { 141 pHeader->phpage[pHeader->nPages++] = hPage; 142 return TRUE; 143 } 144 145 return FALSE; 146 } 147 148 HRESULT 149 SHELL32_ShowPropertiesDialog(IDataObject *pdtobj); 150 HRESULT 151 SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg); 152 UINT 153 MapVerbToDfmCmd(_In_ LPCSTR verba); 154 UINT 155 GetDfmCmd(_In_ IContextMenu *pCM, _In_ LPCSTR verba); 156 #define SHELL_ExecuteControlPanelCPL(hwnd, cpl) SHRunControlPanel((cpl), (hwnd)) 157 158 #define CmicFlagsToSeeFlags(flags) ((flags) & SEE_CMIC_COMMON_FLAGS) 159 static inline UINT SeeFlagsToCmicFlags(UINT flags) 160 { 161 if (flags & SEE_MASK_CLASSNAME) 162 flags &= ~(SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE); 163 return flags & SEE_CMIC_COMMON_FLAGS; 164 } 165 166 167 // CStubWindow32 --- The owner window of file property sheets. 168 // This window hides taskbar button of property sheet. 169 class CStubWindow32 : public CWindowImpl<CStubWindow32> 170 { 171 public: 172 DECLARE_WND_CLASS_EX(_T("StubWindow32"), 0, COLOR_WINDOWTEXT) 173 174 BEGIN_MSG_MAP(CStubWindow32) 175 END_MSG_MAP() 176 }; 177 178 void PostCabinetMessage(UINT Msg, WPARAM wParam, LPARAM lParam); 179 180 HRESULT 181 Shell_TranslateIDListAlias( 182 _In_ LPCITEMIDLIST pidl, 183 _In_ HANDLE hToken, 184 _Out_ LPITEMIDLIST *ppidlAlias, 185 _In_ DWORD dwFlags); 186 187 BOOL BindCtx_ContainsObject(_In_ IBindCtx *pBindCtx, _In_ LPCWSTR pszName); 188 DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault); 189 BOOL SHSkipJunctionBinding(_In_ IBindCtx *pbc, _In_ CLSID *pclsid); 190 HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData); 191 BOOL Shell_FailForceReturn(_In_ HRESULT hr); 192 193 EXTERN_C INT 194 Shell_ParseSpecialFolder(_In_ LPCWSTR pszStart, _Out_ LPWSTR *ppch, _Out_ INT *pcch); 195 196 HRESULT 197 Shell_DisplayNameOf( 198 _In_ IShellFolder *psf, 199 _In_ LPCITEMIDLIST pidl, 200 _In_ DWORD dwFlags, 201 _Out_ LPWSTR pszBuf, 202 _In_ UINT cchBuf); 203 204 EXTERN_C 205 HRESULT SHBindToObject( 206 _In_opt_ IShellFolder *psf, 207 _In_ LPCITEMIDLIST pidl, 208 _In_ REFIID riid, 209 _Out_ void **ppvObj); 210 211 HRESULT 212 SHBindToObjectEx( 213 _In_opt_ IShellFolder *pShellFolder, 214 _In_ LPCITEMIDLIST pidl, 215 _In_opt_ IBindCtx *pBindCtx, 216 _In_ REFIID riid, 217 _Out_ void **ppvObj); 218 219 DWORD 220 SHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes); 221 HRESULT SHCoInitializeAnyApartment(VOID); 222 223 HRESULT 224 SHGetNameAndFlagsW( 225 _In_ LPCITEMIDLIST pidl, 226 _In_ DWORD dwFlags, 227 _Out_opt_ LPWSTR pszText, 228 _In_ UINT cchBuf, 229 _Inout_opt_ DWORD *pdwAttributes); 230 231 EXTERN_C HWND BindCtx_GetUIWindow(_In_ IBindCtx *pBindCtx); 232 233 EXTERN_C HRESULT 234 BindCtx_RegisterObjectParam( 235 _In_ IBindCtx *pBindCtx, 236 _In_ LPOLESTR pszKey, 237 _In_opt_ IUnknown *punk, 238 _Out_ LPBC *ppbc); 239 240 BOOL PathIsDotOrDotDotW(_In_ LPCWSTR pszPath); 241 BOOL PathIsValidElement(_In_ LPCWSTR pszPath); 242 BOOL PathIsDosDevice(_In_ LPCWSTR pszName); 243 HRESULT SHILAppend(_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl); 244 245 PIDLIST_ABSOLUTE SHELL_CIDA_ILCloneFull(_In_ const CIDA *pCIDA, _In_ UINT Index); 246 PIDLIST_ABSOLUTE SHELL_DataObject_ILCloneFullItem(_In_ IDataObject *pDO, _In_ UINT Index); 247 248 EXTERN_C HRESULT 249 IUnknown_InitializeCommand( 250 _In_ IUnknown *pUnk, 251 _In_ PCWSTR pszCommandName, 252 _In_opt_ IPropertyBag *pPB); 253 EXTERN_C HRESULT 254 InvokeIExecuteCommand( 255 _In_ IExecuteCommand *pEC, 256 _In_ PCWSTR pszCommandName, 257 _In_opt_ IPropertyBag *pPB, 258 _In_opt_ IShellItemArray *pSIA, 259 _In_opt_ LPCMINVOKECOMMANDINFOEX pICI, 260 _In_opt_ IUnknown *pSite); 261 EXTERN_C HRESULT 262 InvokeIExecuteCommandWithDataObject( 263 _In_ IExecuteCommand *pEC, 264 _In_ PCWSTR pszCommandName, 265 _In_opt_ IPropertyBag *pPB, 266 _In_ IDataObject *pDO, 267 _In_opt_ LPCMINVOKECOMMANDINFOEX pICI, 268 _In_opt_ IUnknown *pSite); 269 270 #endif /* _PRECOMP_H__ */ 271