From 63fecde98bd3228fdda78f7ebb704ffacd425f5d Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Tue, 2 Sep 2003 01:01:06 +0000 Subject: [PATCH] Declare LPCITEMIDLIST as 'const' pointer and adjust shell32 implementation to the corrected type. --- dlls/commdlg/filedlg95.c | 2 +- dlls/commdlg/filedlgbrowser.c | 4 +-- dlls/commdlg/filedlgbrowser.h | 2 +- dlls/shell32/brsfolder.c | 14 ++++---- dlls/shell32/changenotify.c | 4 +-- dlls/shell32/dataobject.c | 2 +- dlls/shell32/debughlp.c | 11 +++---- dlls/shell32/iconcache.c | 2 +- dlls/shell32/pidl.c | 60 +++++++++++++++++------------------ dlls/shell32/pidl.h | 2 +- dlls/shell32/shell32_main.c | 6 ++-- dlls/shell32/shell32_main.h | 8 ++--- dlls/shell32/shfldr.h | 6 ++-- dlls/shell32/shlfolder.c | 14 ++++---- dlls/shell32/shlmenu.c | 8 ++--- dlls/shell32/shlview.c | 14 ++++---- dlls/shell32/shv_bg_cmenu.c | 2 +- dlls/shell32/shv_item_cmenu.c | 4 +-- dlls/shell32/undocshell.h | 16 +++++----- include/shlobj.h | 5 +-- 20 files changed, 94 insertions(+), 92 deletions(-) diff --git a/dlls/commdlg/filedlg95.c b/dlls/commdlg/filedlg95.c index 995e1398ce7..bde2686e923 100644 --- a/dlls/commdlg/filedlg95.c +++ b/dlls/commdlg/filedlg95.c @@ -3109,7 +3109,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPWSTR lpcstrFileName) /* */ -BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl) +BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl) { ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; HRESULT ret; diff --git a/dlls/commdlg/filedlgbrowser.c b/dlls/commdlg/filedlgbrowser.c index c53ec21a932..75f5219749d 100644 --- a/dlls/commdlg/filedlgbrowser.c +++ b/dlls/commdlg/filedlgbrowser.c @@ -102,7 +102,7 @@ static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos) } /* copied from shell32 to avoid linking to it */ -static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl) +static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPCITEMIDLIST pidl) { TRACE("dest=%p len=0x%lx strret=%p pidl=%p stub\n",dest,len,src,pidl); @@ -722,7 +722,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowse HRESULT hRes; ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; - IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); + IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, (LPCITEMIDLIST *)&pidl, &ulAttr); if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) ) { hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE); diff --git a/dlls/commdlg/filedlgbrowser.h b/dlls/commdlg/filedlgbrowser.h index 2c4c65a27e5..5e611517634 100644 --- a/dlls/commdlg/filedlgbrowser.h +++ b/dlls/commdlg/filedlgbrowser.h @@ -151,7 +151,7 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex); UINT GetNumSelected(IDataObject *doSelected); /* pidl handling */ -BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl); +BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl); /* Functions used by the EDIT box */ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd); diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 9d9edfa91fa..abb669d0f45 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -40,7 +40,7 @@ static LPBROWSEINFOW lpBrowseInfo; static LPITEMIDLIST pidlRet; static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST lpifq, HTREEITEM hParent, IEnumIDList* lpe); -static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPITEMIDLIST pidl, LPITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent); +static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent); #define SUPPORTEDFLAGS (BIF_STATUSTEXT | \ BIF_BROWSEFORCOMPUTER | \ @@ -153,7 +153,7 @@ typedef struct tagID IEnumIDList* pEnumIL; } TV_ITEMDATA, *LPTV_ITEMDATA; -static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName) +static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName) { BOOL bSuccess=TRUE; STRRET str; @@ -173,7 +173,7 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPWSTR return bSuccess; } -static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPITEMIDLIST pidl, LPITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent) +static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent) { TVITEMW tvi; TVINSERTSTRUCTW tvins; @@ -212,7 +212,7 @@ static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPITEMIDLIST pidl, LPIT static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent, IEnumIDList* lpe) { HTREEITEM hPrev = 0; - LPITEMIDLIST pidlTemp=0; + LPITEMIDLIST pidlTemp = 0; ULONG ulFetched; HRESULT hr; HWND hwnd=GetParent(hwndTreeView); @@ -226,7 +226,7 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER; IEnumIDList* pEnumIL = NULL; IShellFolder* pSFChild = NULL; - IShellFolder_GetAttributesOf(lpsf, 1, &pidlTemp, &ulAttrs); + IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs); if (ulAttrs & SFGAO_FOLDER) { hr = IShellFolder_BindToObject(lpsf,pidlTemp,NULL,&IID_IShellFolder,(LPVOID*)&pSFChild); @@ -278,14 +278,14 @@ static void BrsFolder_CheckValidSelection(HWND hWndTree, LPTV_ITEMDATA lptvid) if (lpBrowseInfo->ulFlags & BIF_RETURNFSANCESTORS) { dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; - if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, &lptvid->lpi, &dwAttributes)) || + if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes)) || !dwAttributes) bEnabled = FALSE; } if (lpBrowseInfo->ulFlags & BIF_RETURNONLYFSDIRS) { dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM; - if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, &lptvid->lpi, &dwAttributes)) || + if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes)) || (dwAttributes != (SFGAO_FOLDER | SFGAO_FILESYSTEM))) bEnabled = FALSE; } diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index 67369818724..4c5f20f0e1d 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -48,7 +48,7 @@ typedef struct _NOTIFICATIONLIST LONG wEventMask; /* subscribed events */ LONG wSignalledEvent; /* event that occurred */ DWORD dwFlags; /* client flags */ - LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/ + LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/ } NOTIFICATIONLIST, *LPNOTIFICATIONLIST; @@ -424,7 +424,7 @@ DWORD WINAPI NTSHChangeNotifyRegister( HANDLE WINAPI SHChangeNotification_Lock( HANDLE hChange, DWORD dwProcessId, - LPITEMIDLIST **lppidls, + LPCITEMIDLIST **lppidls, LPLONG lpwEventId) { DWORD i; diff --git a/dlls/shell32/dataobject.c b/dlls/shell32/dataobject.c index f482b288bb7..b6dc7da94e7 100644 --- a/dlls/shell32/dataobject.c +++ b/dlls/shell32/dataobject.c @@ -226,7 +226,7 @@ static struct ICOM_VTABLE(IDataObject) dtovt; /************************************************************************** * IDataObject_Constructor */ -LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPITEMIDLIST pMyPidl, LPITEMIDLIST * apidl, UINT cidl) +LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl) { IDataObjectImpl* dto; diff --git a/dlls/shell32/debughlp.c b/dlls/shell32/debughlp.c index 9cac1dcbf18..6ff3bacbce6 100644 --- a/dlls/shell32/debughlp.c +++ b/dlls/shell32/debughlp.c @@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(pidl); -LPITEMIDLIST _dbg_ILGetNext(LPITEMIDLIST pidl) +LPITEMIDLIST _dbg_ILGetNext(LPCITEMIDLIST pidl) { WORD len; @@ -41,8 +41,7 @@ LPITEMIDLIST _dbg_ILGetNext(LPITEMIDLIST pidl) len = pidl->mkid.cb; if (len) { - pidl = (LPITEMIDLIST) (((LPBYTE)pidl)+len); - return pidl; + return (LPITEMIDLIST) (((LPBYTE)pidl)+len); } } return NULL; @@ -53,7 +52,7 @@ BOOL _dbg_ILIsDesktop(LPCITEMIDLIST pidl) return ( !pidl || (pidl && pidl->mkid.cb == 0x00) ); } -LPPIDLDATA _dbg_ILGetDataPointer(LPITEMIDLIST pidl) +LPPIDLDATA _dbg_ILGetDataPointer(LPCITEMIDLIST pidl) { if(pidl && pidl->mkid.cb != 0x00) return (LPPIDLDATA) &(pidl->mkid.abID); @@ -174,7 +173,7 @@ DWORD _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize) void pdump (LPCITEMIDLIST pidl) { - LPITEMIDLIST pidltemp = pidl; + LPCITEMIDLIST pidltemp = pidl; if (!TRACE_ON(pidl)) return; @@ -220,7 +219,7 @@ void pdump (LPCITEMIDLIST pidl) BOOL pcheck (LPCITEMIDLIST pidl) { DWORD type, ret=TRUE; - LPITEMIDLIST pidltemp = pidl; + LPCITEMIDLIST pidltemp = pidl; if (pidltemp && pidltemp->mkid.cb) { do diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index e73b4f3add3..2ae067662d0 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -320,7 +320,7 @@ BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList) */ BOOL PidlToSicIndex ( IShellFolder * sh, - LPITEMIDLIST pidl, + LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, UINT * pIndex) diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 4419f6c5d6e..96a76267017 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -87,7 +87,7 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa { LPSHELLFOLDER psfParent, lsf = psf; HRESULT ret = NO_ERROR; - LPITEMIDLIST pidllast; + LPCITEMIDLIST pidllast; STRRET strret; DWORD flag; @@ -176,8 +176,8 @@ BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl, LPVOID path) * NOTES * observed: pidl=Desktop return=pidl */ -LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl) -{ LPITEMIDLIST pidlLast = pidl; +LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl) +{ LPCITEMIDLIST pidlLast = pidl; TRACE("(pidl=%p)\n",pidl); @@ -186,7 +186,7 @@ LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl) pidlLast = pidl; pidl = ILGetNext(pidl); } - return pidlLast; + return (LPITEMIDLIST)pidlLast; } /************************************************************************* * ILRemoveLastID [SHELL32.17] @@ -319,7 +319,7 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl) */ HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl) { - LPITEMIDLIST pidl; + LPCITEMIDLIST pidl; WORD wLen = 0; HRESULT ret = E_FAIL; @@ -445,8 +445,8 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) char szData1[MAX_PATH]; char szData2[MAX_PATH]; - LPITEMIDLIST pidltemp1 = pidl1; - LPITEMIDLIST pidltemp2 = pidl2; + LPCITEMIDLIST pidltemp1 = pidl1; + LPCITEMIDLIST pidltemp2 = pidl2; TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2); @@ -490,8 +490,8 @@ BOOL WINAPI ILIsParent( LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL char szData1[MAX_PATH]; char szData2[MAX_PATH]; - LPITEMIDLIST pParent = pidlParent; - LPITEMIDLIST pChild = pidlChild; + LPCITEMIDLIST pParent = pidlParent; + LPCITEMIDLIST pChild = pidlChild; TRACE("%p %p %x\n", pidlParent, pidlChild, bImmediate); @@ -528,14 +528,14 @@ BOOL WINAPI ILIsParent( LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL * pidl2 shorter pidl1 0 * pidl2 equal pidl1 pointer to last 0x00-element of pidl2 */ -LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1,LPCITEMIDLIST pidl2) +LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) { char szData1[MAX_PATH]; char szData2[MAX_PATH]; - LPITEMIDLIST pidltemp1 = pidl1; - LPITEMIDLIST pidltemp2 = pidl2; - LPITEMIDLIST ret=NULL; + LPCITEMIDLIST pidltemp1 = pidl1; + LPCITEMIDLIST pidltemp2 = pidl2; + LPCITEMIDLIST ret=NULL; TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2); @@ -572,7 +572,7 @@ LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1,LPCITEMIDLIST pidl2) } } TRACE_(shell)("--- %p\n", ret); - return ret; /* pidl 1 is shorter */ + return (LPITEMIDLIST)ret; /* pidl 1 is shorter */ } /************************************************************************* @@ -662,9 +662,9 @@ LPITEMIDLIST WINAPI SHLogILFromFSIL(LPITEMIDLIST pidl) * NOTES * exported by ordinal */ -DWORD WINAPI ILGetSize(LPITEMIDLIST pidl) +DWORD WINAPI ILGetSize(LPCITEMIDLIST pidl) { - LPSHITEMID si = &(pidl->mkid); + LPCSHITEMID si = &(pidl->mkid); DWORD len=0; if (pidl) @@ -688,7 +688,7 @@ DWORD WINAPI ILGetSize(LPITEMIDLIST pidl) * simple pidl -> pointer to 0x0000 element * */ -LPITEMIDLIST WINAPI ILGetNext(LPITEMIDLIST pidl) +LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl) { WORD len; @@ -701,7 +701,7 @@ LPITEMIDLIST WINAPI ILGetNext(LPITEMIDLIST pidl) { pidl = (LPITEMIDLIST) (((LPBYTE)pidl)+len); TRACE("-- %p\n", pidl); - return pidl; + return (LPITEMIDLIST)pidl; } } return NULL; @@ -764,7 +764,7 @@ DWORD WINAPI ILFree(LPITEMIDLIST pidl) * ILGlobalFree [SHELL32.156] * */ -void WINAPI ILGlobalFree( LPCITEMIDLIST pidl) +void WINAPI ILGlobalFree( LPITEMIDLIST pidl) { TRACE("%p\n",pidl); @@ -1363,14 +1363,14 @@ LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) case PT_SPECIAL: case PT_MYCOMP: - pData =_ILGetDataPointer(pidlOut); + pData = _ILGetDataPointer(pidlOut); pData->type = type; memcpy(&(pData->u.mycomp.guid), pIn, uInSize); TRACE("-- create GUID-pidl %s\n", debugstr_guid(&(pData->u.mycomp.guid))); break; case PT_DRIVE: - pData =_ILGetDataPointer(pidlOut); + pData = _ILGetDataPointer(pidlOut); pData->type = type; pszDest = _ILGetTextPointer(pidlOut); memcpy(pszDest, pIn, uInSize); @@ -1379,7 +1379,7 @@ LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) case PT_FOLDER: case PT_VALUE: - pData =_ILGetDataPointer(pidlOut); + pData = _ILGetDataPointer(pidlOut); pData->type = type; pszDest = _ILGetTextPointer(pidlOut); memcpy(pszDest, pIn, uInSize); @@ -1588,7 +1588,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) ************************************************************************** * _ILGetDataPointer() */ -LPPIDLDATA _ILGetDataPointer(LPITEMIDLIST pidl) +LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl) { if(pidl && pidl->mkid.cb != 0x00) return (LPPIDLDATA) &(pidl->mkid.abID); @@ -1602,7 +1602,7 @@ LPPIDLDATA _ILGetDataPointer(LPITEMIDLIST pidl) LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl) {/* TRACE(pidl,"(pidl%p)\n", pidl);*/ - LPPIDLDATA pdata =_ILGetDataPointer(pidl); + LPPIDLDATA pdata = _ILGetDataPointer(pidl); if (pdata) { @@ -1707,7 +1707,7 @@ REFIID _ILGetGUIDPointer(LPCITEMIDLIST pidl) */ BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt) { - LPPIDLDATA pdata =_ILGetDataPointer(pidl); + LPPIDLDATA pdata = _ILGetDataPointer(pidl); if(! pdata) return FALSE; @@ -1762,7 +1762,7 @@ BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) */ DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) { - LPPIDLDATA pdata =_ILGetDataPointer(pidl); + LPPIDLDATA pdata = _ILGetDataPointer(pidl); DWORD dwSize; if(! pdata) return 0; @@ -1782,7 +1782,7 @@ BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) { char szTemp[MAX_PATH]; const char * pPoint; - LPITEMIDLIST pidlTemp=pidl; + LPCITEMIDLIST pidlTemp=pidl; TRACE("pidl=%p\n",pidl); @@ -1864,7 +1864,7 @@ void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) */ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) { - LPPIDLDATA pData =_ILGetDataPointer(pidl); + LPPIDLDATA pData = _ILGetDataPointer(pidl); WORD wAttrib = 0; int i; @@ -1929,7 +1929,7 @@ void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl) * * copies an aPidl struct */ -LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl) +LPITEMIDLIST* _ILCopyaPidl(LPCITEMIDLIST * apidlsrc, UINT cidl) { UINT i; LPITEMIDLIST * apidldest = (LPITEMIDLIST*)SHAlloc(cidl * sizeof(LPITEMIDLIST)); @@ -1946,7 +1946,7 @@ LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl) * * creates aPidl from CIDA */ -LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida) +LPITEMIDLIST* _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida) { UINT i; LPITEMIDLIST * dst = (LPITEMIDLIST*)SHAlloc(cida->cidl * sizeof(LPITEMIDLIST)); diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index 65605d4f521..b96338285be 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -198,7 +198,7 @@ BOOL pcheck (LPCITEMIDLIST pidl); * aPidl helper */ void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl); -LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl); +LPITEMIDLIST * _ILCopyaPidl(LPCITEMIDLIST * apidlsrc, UINT cidl); LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida); BOOL WINAPI ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type); diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 2800beceb86..bfdff492010 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -317,7 +317,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, { /* get the parent shellfolder */ if (pidl) { - hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent, &pidlLast); + hr = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&pidlLast); ILFree(pidl); } else { ERR("pidl is null!\n"); @@ -332,7 +332,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, { psfi->dwAttributes = 0xffffffff; } - IShellFolder_GetAttributesOf(psfParent, 1 , &pidlLast, &(psfi->dwAttributes)); + IShellFolder_GetAttributesOf(psfParent, 1, (LPCITEMIDLIST*)&pidlLast, &(psfi->dwAttributes)); } /* get the displayname */ @@ -387,7 +387,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION )) { UINT uDummy,uFlags; - hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, &pidlLast, &IID_IExtractIconA, &uDummy, (LPVOID*)&pei); + hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, &uDummy, (LPVOID*)&pei); if (SUCCEEDED(hr)) { diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 50cd7eca0d4..8d21f035b92 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -52,7 +52,7 @@ BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList) #define INVALID_INDEX -1 BOOL SIC_Initialize(void); void SIC_Destroy(void); -BOOL PidlToSicIndex (IShellFolder * sh, LPITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, UINT * pIndex); +BOOL PidlToSicIndex (IShellFolder * sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, UINT * pIndex); INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex ); /* Classes Root */ @@ -78,7 +78,7 @@ DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len); /**************************************************************************** * Class constructors */ -LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPITEMIDLIST myPidl, LPITEMIDLIST * apidl, UINT cidl); +LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST myPidl, LPCITEMIDLIST * apidl, UINT cidl); LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []); LPCLASSFACTORY IClassFactory_Constructor(REFCLSID); @@ -99,8 +99,8 @@ HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPENUMIDLIST IEnumIDList_Constructor(LPCSTR,DWORD,DWORD); -LPEXTRACTICONA IExtractIconA_Constructor(LPITEMIDLIST); -LPEXTRACTICONW IExtractIconW_Constructor(LPITEMIDLIST); +LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST); +LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST); HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm); /* FIXME: rename the functions when the shell32.dll has it's own exports namespace */ diff --git a/dlls/shell32/shfldr.h b/dlls/shell32/shfldr.h index 474072920ba..7c7ed5693e6 100644 --- a/dlls/shell32/shfldr.h +++ b/dlls/shell32/shfldr.h @@ -34,10 +34,10 @@ typedef struct { LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut); HRESULT SHELL32_ParseNextElement (HWND hwndOwner, IShellFolder2 * psf, LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes); -HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPITEMIDLIST pidl, LPDWORD pdwAttributes); -HRESULT SHELL32_CoCreateInitSF (LPITEMIDLIST pidlRoot, LPITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid, +HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes); +HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid, LPVOID * ppvOut); -HRESULT SHELL32_CoCreateInitSFEx (LPITEMIDLIST pidlRoot, LPCSTR pathRoot, LPITEMIDLIST pidlChild, REFCLSID clsid, +HRESULT SHELL32_CoCreateInitSFEx (LPCITEMIDLIST pidlRoot, LPCSTR pathRoot, LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid, LPVOID * ppvOut); HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTR szOut, DWORD dwOutLen); diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 13bffa2699e..7616e672c37 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -139,8 +139,8 @@ HRESULT SHELL32_ParseNextElement (HWND hwndOwner, * This function is meant for virtual forders not backed by a file system * folder. */ -HRESULT SHELL32_CoCreateInitSF (LPITEMIDLIST pidlRoot, - LPITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid, LPVOID * ppvOut) +HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, + LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid, LPVOID * ppvOut) { HRESULT hr; @@ -177,8 +177,8 @@ HRESULT SHELL32_CoCreateInitSF (LPITEMIDLIST pidlRoot, * pathRoot can be NULL for Folders beeing a drive. * In this case the absolute path is build from pidlChild (eg. C:) */ -HRESULT SHELL32_CoCreateInitSFEx (LPITEMIDLIST pidlRoot, - LPCSTR pathRoot, LPITEMIDLIST pidlChild, REFCLSID clsid, REFIID riid, LPVOID * ppvOut) +HRESULT SHELL32_CoCreateInitSFEx (LPCITEMIDLIST pidlRoot, + LPCSTR pathRoot, LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID riid, LPVOID * ppvOut) { HRESULT hr; IPersistFolder3 *ppf; @@ -203,7 +203,9 @@ HRESULT SHELL32_CoCreateInitSFEx (LPITEMIDLIST pidlRoot, } else { szDestPath[0] = '\0'; } - lstrcatA (szDestPath, _ILGetTextPointer (pidlChild)); + + if (pidlChild) + lstrcatA (szDestPath, _ILGetTextPointer (pidlChild)); /* fill the PERSIST_FOLDER_TARGET_INFO */ ppfti.dwAttributes = -1; @@ -330,7 +332,7 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, * * This functions does not set flags!! It only resets flags when nessesary. */ -HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPITEMIDLIST pidl, LPDWORD pdwAttributes) +HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes) { GUID const *clsid; DWORD dwAttributes; diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c index eb3f79c03b3..2f47d004b61 100644 --- a/dlls/shell32/shlmenu.c +++ b/dlls/shell32/shlmenu.c @@ -120,12 +120,12 @@ static LPFMINFO FM_SetMenuParameter( * FM_InitMenuPopup [internal] * */ -static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) +static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl) { IShellFolder *lpsf, *lpsf2; ULONG ulItemAttr = SFGAO_FOLDER; UINT uID, uFlags, uEnumFlags; LPFNFMCALLBACK lpfnCallback; - LPITEMIDLIST pidl; + LPCITEMIDLIST pidl; char sTemp[MAX_PATH]; int NumberOfItems = 0, iIcon; MENUINFO MenuInfo; @@ -150,7 +150,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) if (menudata->bInitialized) return 0; - pidl = ((pAlternatePidl) ? pAlternatePidl : menudata->pidl); + pidl = (pAlternatePidl? pAlternatePidl: menudata->pidl); if (!pidl) return 0; @@ -176,7 +176,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) while ((!bAbortInit) && (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))) { - if (SUCCEEDED (IShellFolder_GetAttributesOf(lpsf, 1, &pidlTemp, &ulItemAttr))) + if (SUCCEEDED (IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulItemAttr))) { ILGetDisplayNameExA(NULL, pidlTemp, sTemp, ILGDN_FORPARSING); if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, 0, &iIcon))) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 37dc2695c59..5c7bf518b7e 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -813,7 +813,7 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL /* look, what's selected and create a context menu object of it*/ if( ShellView_GetSelections(This) ) { - IShellFolder_GetUIObjectOf( This->pSFParent, This->hWndParent, This->cidl, This->apidl, + IShellFolder_GetUIObjectOf( This->pSFParent, This->hWndParent, This->cidl, (LPCITEMIDLIST*)This->apidl, (REFIID)&IID_IContextMenu, NULL, (LPVOID *)&pContextMenu); if(pContextMenu) @@ -1217,11 +1217,11 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn if(GetShellOle() && pDoDragDrop) { - if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, This->apidl, &IID_IDataObject,0,(LPVOID *)&pda))) + if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, (LPCITEMIDLIST*)This->apidl, &IID_IDataObject,0,(LPVOID *)&pda))) { IDropSource * pds = (IDropSource*)&(This->lpvtblDropSource); /* own DropSource interface */ - if (SUCCEEDED(IShellFolder_GetAttributesOf(This->pSFParent, This->cidl, This->apidl, &dwAttributes))) + if (SUCCEEDED(IShellFolder_GetAttributesOf(This->pSFParent, This->cidl, (LPCITEMIDLIST*)This->apidl, &dwAttributes))) { if (dwAttributes & SFGAO_CANLINK) { @@ -1247,7 +1247,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn TRACE("-- LVN_BEGINLABELEDITA %p\n",This); - IShellFolder_GetAttributesOf(This->pSFParent, 1, &pidl, &dwAttr); + IShellFolder_GetAttributesOf(This->pSFParent, 1, (LPCITEMIDLIST*)&pidl, &dwAttr); if (SFGAO_CANRENAME & dwAttr) { return FALSE; @@ -1355,7 +1355,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn } /* perform the item deletion */ - ISFHelper_DeleteItems(psfhlp, i, pItems); + ISFHelper_DeleteItems(psfhlp, i, (LPCITEMIDLIST*)pItems); /* free pidl array memory */ HeapFree(GetProcessHeap(), 0, pItems); @@ -1841,7 +1841,7 @@ static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, case SVGIO_SELECTION: ShellView_GetSelections(This); - IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, This->apidl, riid, 0, ppvOut); + IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, (LPCITEMIDLIST*)This->apidl, riid, 0, ppvOut); break; } TRACE("-- (%p)->(interface=%p)\n",This, *ppvOut); @@ -1853,7 +1853,7 @@ static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, static HRESULT WINAPI IShellView_fnEditItem( IShellView * iface, - LPITEMIDLIST pidl) + LPCITEMIDLIST pidl) { ICOM_THIS(IShellViewImpl, iface); int i; diff --git a/dlls/shell32/shv_bg_cmenu.c b/dlls/shell32/shv_bg_cmenu.c index f8963ce66a0..926d7843a66 100644 --- a/dlls/shell32/shv_bg_cmenu.c +++ b/dlls/shell32/shv_bg_cmenu.c @@ -263,7 +263,7 @@ static BOOL DoPaste( /* do the copy/move */ if (psfhlpdst && psfhlpsrc) { - ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, apidl); + ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl); /* FIXME handle move ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl); */ diff --git a/dlls/shell32/shv_item_cmenu.c b/dlls/shell32/shv_item_cmenu.c index c7ccb27aabd..d83b76c0602 100644 --- a/dlls/shell32/shv_item_cmenu.c +++ b/dlls/shell32/shv_item_cmenu.c @@ -65,7 +65,7 @@ static BOOL ISvItemCm_CanRenameItems(ItemCmImpl *This) for(i = 0; i < This->cidl; i++){} if(i > 1) return FALSE; /* can't rename more than one item at a time*/ dwAttributes = SFGAO_CANRENAME; - IShellFolder_GetAttributesOf(This->pSFParent, 1, This->apidl, &dwAttributes); + IShellFolder_GetAttributesOf(This->pSFParent, 1, (LPCITEMIDLIST*)This->apidl, &dwAttributes); return dwAttributes & SFGAO_CANRENAME; } return FALSE; @@ -339,7 +339,7 @@ static void DoDelete(IContextMenu *iface) IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp); if (psfhlp) { - ISFHelper_DeleteItems(psfhlp, This->cidl, This->apidl); + ISFHelper_DeleteItems(psfhlp, This->cidl, (LPCITEMIDLIST *)This->apidl); ISFHelper_Release(psfhlp); } } diff --git a/dlls/shell32/undocshell.h b/dlls/shell32/undocshell.h index 2d7cd540cfc..595b95bd8bf 100644 --- a/dlls/shell32/undocshell.h +++ b/dlls/shell32/undocshell.h @@ -37,10 +37,10 @@ LPITEMIDLIST WINAPI ILCombine( LPCITEMIDLIST iil1, LPCITEMIDLIST iil2); -DWORD WINAPI ILGetSize(LPITEMIDLIST pidl); +DWORD WINAPI ILGetSize(LPCITEMIDLIST pidl); -LPITEMIDLIST WINAPI ILGetNext(LPITEMIDLIST pidl); -LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl); +LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl); +LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl); BOOL WINAPI ILRemoveLastID(LPCITEMIDLIST pidl); LPITEMIDLIST WINAPI ILFindChild( @@ -87,7 +87,7 @@ HRESULT WINAPI ILLoadFromStream( LPITEMIDLIST *ppidl); LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl); -void WINAPI ILGlobalFree(LPCITEMIDLIST pidl); +void WINAPI ILGlobalFree(LPITEMIDLIST pidl); LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath); @@ -144,7 +144,7 @@ HRESULT WINAPI StrRetToStrNAW ( typedef struct { - LPCITEMIDLIST pidlPath; + LPITEMIDLIST pidlPath; BOOL bWatchSubtree; } NOTIFYREGISTER, *LPNOTIFYREGISTER; @@ -163,7 +163,7 @@ HANDLE WINAPI SHChangeNotifyRegister( LONG wEventMask, UINT uMsg, int cItems, - LPCNOTIFYREGISTER lpItems); + LPNOTIFYREGISTER lpItems); BOOL WINAPI SHChangeNotifyDeregister(HANDLE hNotify); @@ -424,8 +424,8 @@ BOOL WINAPI FileMenu_TrackPopupMenuEx( BOOL WINAPI FileMenu_GetLastSelectedItemPidls( UINT uReserved, - LPITEMIDLIST *ppidlFolder, - LPITEMIDLIST *ppidlItem); + LPCITEMIDLIST *ppidlFolder, + LPCITEMIDLIST *ppidlItem); LRESULT WINAPI FileMenu_MeasureItem( HWND hWnd, diff --git a/include/shlobj.h b/include/shlobj.h index 4493ebe3eb3..c01709cd070 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -42,12 +42,13 @@ typedef struct WORD cb; /* nr of bytes in this item */ BYTE abID[1]; /* first byte in this item */ } SHITEMID, *LPSHITEMID; -typedef LPSHITEMID const LPCSHITEMID; +typedef const SHITEMID *LPCSHITEMID; typedef struct _ITEMIDLIST { SHITEMID mkid; /* first itemid in list */ -} ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST; +} ITEMIDLIST,*LPITEMIDLIST; +typedef const ITEMIDLIST *LPCITEMIDLIST; #include BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath);