ReactOS 0.4.16-dev-197-g92996da
shell32_main.h
Go to the documentation of this file.
1/*
2 * internal Shell32 Library definitions
3 *
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#ifndef __WINE_SHELL_MAIN_H
23#define __WINE_SHELL_MAIN_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include "shell32_version.h"
30
31#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
32
33/*******************************************
34* global SHELL32.DLL variables
35*/
38
39BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
40
41/* Iconcache */
42#define INVALID_INDEX -1
46INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags ) DECLSPEC_HIDDEN;
47
48/* Classes Root */
49BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN;
51BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) DECLSPEC_HIDDEN;
52BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx);
54
55#ifdef __REACTOS__
56/* Current User */
57BOOL HCU_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx) DECLSPEC_HIDDEN;
58
59/* Local Machine */
60BOOL HLM_GetIconW(int reg_idx, LPWSTR szDest, DWORD len, int* picon_idx) DECLSPEC_HIDDEN;
61#endif
62
63/* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
64BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN;
65BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int* picon_idx);
67
69
72
73/****************************************************************************
74 * Class constructors
75 */
76HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, PCUITEMID_CHILD_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject);
77HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator);
78
80IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount);
82IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey);
83IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
86
90HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN;
91HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN;
92
93/* initialisation for FORMATETC */
94#define InitFormatEtc(fe, cf, med) \
95 {\
96 (fe).cfFormat=cf;\
97 (fe).dwAspect=DVASPECT_CONTENT;\
98 (fe).ptd=NULL;\
99 (fe).tymed=med;\
100 (fe).lindex=-1;\
101 };
102
103#define KeyStateToDropEffect(kst)\
104 ((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\
105 (((kst)&(MK_CONTROL)) ? DROPEFFECT_COPY :\
106 (((kst)&(MK_SHIFT)) ? DROPEFFECT_MOVE :\
107 DROPEFFECT_NONE)))
108
109
114
115/* Change Notification */
118
119/* file operation */
120#define ASK_DELETE_FILE 1
121#define ASK_DELETE_FOLDER 2
122#define ASK_DELETE_MULTIPLE_ITEM 3
123#define ASK_CREATE_FOLDER 4
124#define ASK_OVERWRITE_FILE 5
125#define ASK_DELETE_SELECTED 6
126#define ASK_TRASH_FILE 7
127#define ASK_TRASH_FOLDER 8
128#define ASK_TRASH_MULTIPLE_ITEM 9
129#define ASK_CANT_TRASH_ITEM 10
130#define ASK_OVERWRITE_FOLDER 11
131
133BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir);
134
135void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
136 UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState);
137
138static __inline BOOL SHELL_OsIsUnicode(void)
139{
140 /* if high-bit of version is 0, we are emulating NT */
141 return !(GetVersion() & 0x80000000);
142}
143
144#define __SHFreeAndNil(ptr) \
145 {\
146 SHFree(*ptr); \
147 *ptr = NULL; \
148 };
149static __inline void __SHCloneStrA(char **target, const char *source)
150{
151 *target = (char *)SHAlloc(strlen(source) + 1);
153}
154
155static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source)
156{
157 int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
158 *target = (char *)SHAlloc(len);
160}
161
162static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source)
163{
164 *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) );
166}
167
168static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
169{
170 int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
171 *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
173 return *target;
174}
175
176/* handle conversions */
177#define HICON_16(h32) (LOWORD(h32))
178#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
179#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
180#define HINSTANCE_16(h32) (LOWORD(h32))
181
183
187
188/* Default shell folder value registration */
190
191/* Detect Shell Links */
193
201
204
205#ifdef __cplusplus
206} /* extern "C" */
207#endif
208
209#endif /* __WINE_SHELL_MAIN_H */
#define shell32_hInstance
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define DLGPROC
Definition: maze.c:62
#define NULL
Definition: types.h:112
UINT uFlags
Definition: api.c:59
#define CP_ACP
Definition: compat.h:109
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
const GUID CLSID_UnixDosFolder
const GUID CLSID_UnixFolder
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
FxAutoRegKey hKey
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLsizei len
Definition: glext.h:6722
GLenum target
Definition: glext.h:7315
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HICON
Definition: imagelist.c:80
static HMODULE huser32
Definition: profile.c:34
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4565
unsigned int UINT
Definition: ndis.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
long LONG
Definition: pedump.c:60
static const WCHAR szName[]
Definition: powrprof.c:45
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
short sh
Definition: format.c:272
HRESULT SHELL_RegisterShellFolders(void) DECLSPEC_HIDDEN
Definition: shellpath.c:3064
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN
Definition: classes.c:49
INT_PTR CALLBACK SH_FileVersionDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT WINAPI CShellDispatch_Constructor(REFIID riid, LPVOID *ppvOut)
HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID *ppvOut)
void SIC_Destroy(void) DECLSPEC_HIDDEN
Definition: iconcache.cpp:629
HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID)
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:203
LPWSTR SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf)
Definition: filedefext.cpp:266
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:135
BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI)
static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source)
Definition: shell32_main.h:155
BOOL PidlToSicIndex(IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex) DECLSPEC_HIDDEN
Definition: iconcache.cpp:709
HRESULT WINAPI DoUnregisterServer(void)
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:481
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:297
HRESULT WINAPI DoRegisterServer(void)
INT_PTR CALLBACK SH_FileGeneralDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount)
HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, PCUITEMID_CHILD_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
BOOL SH_ShowRecycleBinProperties(WCHAR sDrive)
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:83
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:480
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes) DECLSPEC_HIDDEN
Definition: classes.c:573
HRESULT WINAPI IShellLink_ConstructFromFile(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv)
HPROPSHEETPAGE SH_CreatePropertySheetPage(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle)
Definition: filedefext.cpp:302
void FreeChangeNotifications(void) DECLSPEC_HIDDEN
HGLOBAL RenderSHELLIDLIST(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:148
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:138
static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
Definition: shell32_main.h:168
BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, IDataObject *pDataObj)
Definition: fprop.cpp:83
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags) DECLSPEC_HIDDEN
Definition: iconcache.cpp:440
BOOL SH_ShowDriveProperties(WCHAR *drive, IDataObject *pDataObj)
Definition: drive.cpp:251
HRESULT WINAPI IShellLink_ConstructFromPath(WCHAR *path, REFIID riid, LPVOID *ppv)
BOOL UNIXFS_is_rooted_at_desktop(void) DECLSPEC_HIDDEN
BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir)
Definition: shlfileop.cpp:332
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:117
HMODULE huser32 DECLSPEC_HIDDEN
Definition: shell32_main.h:37
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:683
IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey)
HRESULT WINAPI INewItem_Constructor(IUnknown *pUnkOuter, REFIID riif, LPVOID *ppv)
HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN
BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int *picon_idx)
Definition: classes.c:322
HGLOBAL RenderFILENAMEA(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:190
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:56
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:405
void InitChangeNotifications(void) DECLSPEC_HIDDEN
BOOL SHELL_IsShortcut(LPCITEMIDLIST) DECLSPEC_HIDDEN
Definition: shell32_main.c:382
HGLOBAL RenderFILENAMEW(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:222
IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop)
static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source)
Definition: shell32_main.h:162
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN
Definition: classes.c:91
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator)
static __inline void __SHCloneStrA(char **target, const char *source)
Definition: shell32_main.h:149
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
DWORD dwAttributes
Definition: vdmdbg.h:34
static HMENU hmenu
Definition: win.c:66
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185