2011-05-15 15:55:49 +00:00
|
|
|
/*
|
|
|
|
* internal Shell32 Library definitions
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
|
|
|
* Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_SHELL_MAIN_H
|
|
|
|
#define __WINE_SHELL_MAIN_H
|
|
|
|
|
2014-11-03 12:17:30 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-09-22 20:19:14 +00:00
|
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
|
|
|
|
2011-05-15 15:55:49 +00:00
|
|
|
/*******************************************
|
|
|
|
* global SHELL32.DLL variables
|
|
|
|
*/
|
2014-11-06 18:45:30 +00:00
|
|
|
extern HMODULE huser32 DECLSPEC_HIDDEN;
|
|
|
|
extern HINSTANCE shell32_hInstance DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2014-10-31 15:16:51 +00:00
|
|
|
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* Iconcache */
|
|
|
|
#define INVALID_INDEX -1
|
|
|
|
BOOL SIC_Initialize(void);
|
2014-11-06 18:45:30 +00:00
|
|
|
void SIC_Destroy(void) DECLSPEC_HIDDEN;
|
|
|
|
BOOL PidlToSicIndex (IShellFolder * sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int * pIndex) DECLSPEC_HIDDEN;
|
|
|
|
INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags ) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* Classes Root */
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN;
|
|
|
|
BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) DECLSPEC_HIDDEN;
|
|
|
|
BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) DECLSPEC_HIDDEN;
|
2013-12-19 18:52:57 +00:00
|
|
|
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx);
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN;
|
2013-12-19 18:52:57 +00:00
|
|
|
BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int* picon_idx);
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len) DECLSPEC_HIDDEN;
|
|
|
|
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Class constructors
|
|
|
|
*/
|
2015-10-19 15:17:29 +00:00
|
|
|
HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, PCUITEMID_CHILD_ARRAY apidl, UINT cidl, IDataObject **dataObject);
|
2011-05-15 15:55:49 +00:00
|
|
|
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator);
|
|
|
|
|
|
|
|
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
|
|
|
|
IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount);
|
|
|
|
HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riif, LPVOID *ppv);
|
|
|
|
IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey);
|
|
|
|
IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
|
2016-04-10 12:05:06 +00:00
|
|
|
HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID * ppvOut);
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT WINAPI CShellDispatch_Constructor(REFIID riid, LPVOID * ppvOut);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2016-05-03 09:15:36 +00:00
|
|
|
HRESULT WINAPI IShellLink_ConstructFromPath(WCHAR *path, REFIID riid, LPVOID *ppv);
|
|
|
|
HRESULT WINAPI IShellLink_ConstructFromFile(IShellFolder * psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv);
|
2011-05-15 15:55:49 +00:00
|
|
|
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV);
|
2014-11-06 18:45:30 +00:00
|
|
|
HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2017-07-16 15:13:02 +00:00
|
|
|
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv);
|
2016-08-12 12:21:13 +00:00
|
|
|
|
2011-05-15 15:55:49 +00:00
|
|
|
/* initialisation for FORMATETC */
|
|
|
|
#define InitFormatEtc(fe, cf, med) \
|
|
|
|
{\
|
|
|
|
(fe).cfFormat=cf;\
|
|
|
|
(fe).dwAspect=DVASPECT_CONTENT;\
|
|
|
|
(fe).ptd=NULL;\
|
|
|
|
(fe).tymed=med;\
|
|
|
|
(fe).lindex=-1;\
|
|
|
|
};
|
|
|
|
|
|
|
|
#define KeyStateToDropEffect(kst)\
|
|
|
|
((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\
|
2013-12-19 12:51:32 +00:00
|
|
|
(((kst)&(MK_CONTROL)) ? DROPEFFECT_COPY :\
|
|
|
|
(((kst)&(MK_SHIFT)) ? DROPEFFECT_MOVE :\
|
|
|
|
DROPEFFECT_NONE)))
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
|
2014-11-06 18:45:30 +00:00
|
|
|
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN;
|
|
|
|
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN;
|
|
|
|
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN;
|
|
|
|
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* Change Notification */
|
2014-11-06 18:45:30 +00:00
|
|
|
void InitChangeNotifications(void) DECLSPEC_HIDDEN;
|
|
|
|
void FreeChangeNotifications(void) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* file operation */
|
|
|
|
#define ASK_DELETE_FILE 1
|
|
|
|
#define ASK_DELETE_FOLDER 2
|
|
|
|
#define ASK_DELETE_MULTIPLE_ITEM 3
|
|
|
|
#define ASK_CREATE_FOLDER 4
|
|
|
|
#define ASK_OVERWRITE_FILE 5
|
|
|
|
#define ASK_DELETE_SELECTED 6
|
|
|
|
#define ASK_TRASH_FILE 7
|
|
|
|
#define ASK_TRASH_FOLDER 8
|
|
|
|
#define ASK_TRASH_MULTIPLE_ITEM 9
|
|
|
|
#define ASK_CANT_TRASH_ITEM 10
|
|
|
|
#define ASK_OVERWRITE_FOLDER 11
|
|
|
|
|
|
|
|
BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI);
|
|
|
|
BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir);
|
|
|
|
|
|
|
|
void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
|
|
|
|
UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState);
|
|
|
|
|
2014-10-31 15:16:51 +00:00
|
|
|
static __inline BOOL SHELL_OsIsUnicode(void)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
|
|
|
/* if high-bit of version is 0, we are emulating NT */
|
|
|
|
return !(GetVersion() & 0x80000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define __SHFreeAndNil(ptr) \
|
|
|
|
{\
|
|
|
|
SHFree(*ptr); \
|
|
|
|
*ptr = NULL; \
|
|
|
|
};
|
2014-10-31 15:16:51 +00:00
|
|
|
static __inline void __SHCloneStrA(char **target, const char *source)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
|
|
|
*target = (char *)SHAlloc(strlen(source) + 1);
|
|
|
|
strcpy(*target, source);
|
|
|
|
}
|
|
|
|
|
2014-10-31 15:16:51 +00:00
|
|
|
static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
|
|
|
int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
|
|
|
|
*target = (char *)SHAlloc(len);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2014-10-31 15:16:51 +00:00
|
|
|
static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
|
|
|
*target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) );
|
|
|
|
lstrcpyW(*target, source);
|
|
|
|
}
|
|
|
|
|
2014-10-31 15:16:51 +00:00
|
|
|
static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
|
|
|
int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
|
|
|
|
*target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, source, -1, *target, len);
|
|
|
|
return *target;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* handle conversions */
|
|
|
|
#define HICON_16(h32) (LOWORD(h32))
|
|
|
|
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
|
|
|
|
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
|
|
|
|
#define HINSTANCE_16(h32) (LOWORD(h32))
|
|
|
|
|
2014-11-06 18:45:30 +00:00
|
|
|
extern WCHAR swShell32Name[MAX_PATH] DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL UNIXFS_is_rooted_at_desktop(void) DECLSPEC_HIDDEN;
|
|
|
|
extern const GUID CLSID_UnixFolder DECLSPEC_HIDDEN;
|
|
|
|
extern const GUID CLSID_UnixDosFolder DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* Default shell folder value registration */
|
2014-11-06 18:45:30 +00:00
|
|
|
HRESULT SHELL_RegisterShellFolders(void) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/* Detect Shell Links */
|
2014-11-06 18:45:30 +00:00
|
|
|
BOOL SHELL_IsShortcut(LPCITEMIDLIST) DECLSPEC_HIDDEN;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
INT_PTR CALLBACK SH_FileGeneralDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR CALLBACK SH_FileVersionDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2012-01-17 21:28:17 +00:00
|
|
|
HPROPSHEETPAGE SH_CreatePropertySheetPage(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle);
|
2017-11-25 09:27:20 +00:00
|
|
|
HRESULT SH_ShowDriveProperties(WCHAR *drive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl);
|
2011-05-15 15:55:49 +00:00
|
|
|
BOOL SH_ShowRecycleBinProperties(WCHAR sDrive);
|
2016-11-17 14:35:19 +00:00
|
|
|
BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl);
|
2011-11-28 21:54:45 +00:00
|
|
|
LPWSTR SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf);
|
2011-10-10 18:17:25 +00:00
|
|
|
|
2014-11-03 12:17:30 +00:00
|
|
|
HRESULT WINAPI DoRegisterServer(void);
|
|
|
|
HRESULT WINAPI DoUnregisterServer(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
2011-10-10 18:17:25 +00:00
|
|
|
|
2014-01-25 17:24:24 +00:00
|
|
|
#endif /* __WINE_SHELL_MAIN_H */
|