mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:08:19 +00:00
Small fixes.
This commit is contained in:
parent
c17ddc868e
commit
1b4f5bb2ce
|
@ -11,7 +11,6 @@
|
|||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "winbase.h"
|
||||
#include "debugtools.h"
|
||||
#include "shell.h"
|
||||
|
@ -29,10 +28,7 @@ DEFAULT_DEBUG_CHANNEL(pidl)
|
|||
DECLARE_DEBUG_CHANNEL(shell)
|
||||
|
||||
void pdump (LPCITEMIDLIST pidl)
|
||||
{ DWORD type;
|
||||
char * szData;
|
||||
char * szShortName;
|
||||
char szName[MAX_PATH];
|
||||
{
|
||||
BOOL bIsShellDebug;
|
||||
|
||||
LPITEMIDLIST pidltemp = pidl;
|
||||
|
@ -55,13 +51,21 @@ void pdump (LPCITEMIDLIST pidl)
|
|||
{
|
||||
do
|
||||
{
|
||||
type = _ILGetDataPointer(pidltemp)->type;
|
||||
szData = _ILGetTextPointer(pidltemp);
|
||||
szShortName = _ILGetSTextPointer(pidltemp);
|
||||
_ILSimpleGetText(pidltemp, szName, MAX_PATH);
|
||||
DWORD dwAttrib = 0;
|
||||
LPPIDLDATA pData = _ILGetDataPointer(pidltemp);
|
||||
DWORD type = pData->type;
|
||||
LPSTR szLongName = _ILGetTextPointer(pidltemp);
|
||||
LPSTR szShortName = _ILGetSTextPointer(pidltemp);
|
||||
char szName[MAX_PATH];
|
||||
|
||||
MESSAGE ("-- pidl=%p size=%u type=%lx name=%s (%s,%s)\n",
|
||||
pidltemp, pidltemp->mkid.cb,type,szName,debugstr_a(szData), debugstr_a(szShortName));
|
||||
_ILSimpleGetText(pidltemp, szName, MAX_PATH);
|
||||
if( PT_FOLDER == type)
|
||||
dwAttrib = pData->u.folder.uFileAttribs;
|
||||
else if( PT_VALUE == type)
|
||||
dwAttrib = pData->u.file.uFileAttribs;
|
||||
|
||||
MESSAGE ("-- pidl=%p size=%u type=%lx attr=0x%08lx name=%s (%s,%s)\n",
|
||||
pidltemp, pidltemp->mkid.cb,type,dwAttrib,szName,debugstr_a(szLongName), debugstr_a(szShortName));
|
||||
|
||||
pidltemp = ILGetNext(pidltemp);
|
||||
|
||||
|
@ -677,25 +681,23 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl,LPCITEMIDLIST item,BOOL bEnd)
|
|||
* exported by ordinal
|
||||
*/
|
||||
DWORD WINAPI ILFree(LPITEMIDLIST pidl)
|
||||
{ TRACE("(pidl=0x%08lx)\n",(DWORD)pidl);
|
||||
{
|
||||
TRACE("(pidl=0x%08lx)\n",(DWORD)pidl);
|
||||
|
||||
if (!pidl)
|
||||
return FALSE;
|
||||
|
||||
return SHFree(pidl);
|
||||
if(!pidl) return FALSE;
|
||||
SHFree(pidl);
|
||||
return TRUE;
|
||||
}
|
||||
/*************************************************************************
|
||||
* ILGlobalFree [SHELL32.156]
|
||||
*
|
||||
*/
|
||||
DWORD WINAPI ILGlobalFree( LPITEMIDLIST pidl)
|
||||
void WINAPI ILGlobalFree( LPCITEMIDLIST pidl)
|
||||
{
|
||||
TRACE("%p\n",pidl);
|
||||
|
||||
if (!pidl)
|
||||
return FALSE;
|
||||
|
||||
return pCOMCTL32_Free (pidl);
|
||||
if(!pidl) return;
|
||||
pCOMCTL32_Free(pidl);
|
||||
}
|
||||
/*************************************************************************
|
||||
* ILCreateFromPath [SHELL32.157]
|
||||
|
@ -858,7 +860,8 @@ HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int n
|
|||
{
|
||||
TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
|
||||
|
||||
if (! psf || !dest ) return E_INVALIDARG;
|
||||
pdump(pidl);
|
||||
if (!psf || !dest ) return E_INVALIDARG;
|
||||
|
||||
switch (nFormat)
|
||||
{
|
||||
|
@ -894,6 +897,10 @@ HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int n
|
|||
*/
|
||||
HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len)
|
||||
{
|
||||
TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
|
||||
|
||||
pdump(pidl);
|
||||
|
||||
if (! psf || !dest ) return E_INVALIDARG;
|
||||
|
||||
switch (nFormat)
|
||||
|
@ -956,6 +963,11 @@ BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath)
|
|||
{
|
||||
SHGetSpecialFolderPathA(0, pszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
|
||||
}
|
||||
else if (_ILIsSpecialFolder(ILFindLastID(pidl)))
|
||||
{
|
||||
/* we are somewhere in a special folder */
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SHGetDesktopFolder(&shellfolder)==S_OK)
|
||||
|
@ -1539,6 +1551,8 @@ BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
|
|||
{
|
||||
LPPIDLDATA pdata =_ILGetDataPointer(pidl);
|
||||
|
||||
if(! pdata) return FALSE;
|
||||
|
||||
switch (pdata->type)
|
||||
{
|
||||
case PT_FOLDER:
|
||||
|
@ -1587,6 +1601,8 @@ DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
|
|||
LPPIDLDATA pdata =_ILGetDataPointer(pidl);
|
||||
DWORD dwSize;
|
||||
|
||||
if(! pdata) return 0;
|
||||
|
||||
switch (pdata->type)
|
||||
{
|
||||
case PT_VALUE:
|
||||
|
@ -1678,7 +1694,8 @@ void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
|
|||
* RETURNS
|
||||
* Attributes
|
||||
*
|
||||
* NOTES
|
||||
* FIXME
|
||||
* return value 0 in case of error is a valid return value
|
||||
*
|
||||
*/
|
||||
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
|
||||
|
@ -1687,6 +1704,8 @@ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
|
|||
WORD wAttrib = 0;
|
||||
int i;
|
||||
|
||||
if(! pData) return 0;
|
||||
|
||||
switch(pData->type)
|
||||
{
|
||||
case PT_FOLDER:
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
* This is the view visualizing the data provied by the shellfolder.
|
||||
* No direct access to data from pidls should be done from here.
|
||||
*
|
||||
* FIXME: There is not jet a official interface defined to manipulate
|
||||
* the objects shown in the view (rename, move...). This should be
|
||||
* implemented as additional interface to IShellFolder.
|
||||
*
|
||||
* FIXME: The order by part of the background context menu should be
|
||||
* buily according to the columns shown.
|
||||
*
|
||||
|
@ -471,7 +467,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
|
|||
*/
|
||||
static int LV_FindItemByPidl(
|
||||
IShellViewImpl * This,
|
||||
LPITEMIDLIST pidl)
|
||||
LPCITEMIDLIST pidl)
|
||||
{
|
||||
LVITEMA lvItem;
|
||||
ZeroMemory(&lvItem, sizeof(LVITEMA));
|
||||
|
@ -491,11 +487,11 @@ static int LV_FindItemByPidl(
|
|||
/**********************************************************
|
||||
* LV_AddItem()
|
||||
*/
|
||||
static BOOLEAN LV_AddItem(IShellViewImpl * This, LPITEMIDLIST pidl)
|
||||
static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
|
||||
{
|
||||
LVITEMA lvItem;
|
||||
|
||||
FIXME("(%p)(pidl=%p)\n", This, pidl);
|
||||
TRACE("(%p)(pidl=%p)\n", This, pidl);
|
||||
|
||||
ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listview item*/
|
||||
lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/
|
||||
|
@ -509,11 +505,11 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPITEMIDLIST pidl)
|
|||
/**********************************************************
|
||||
* LV_DeleteItem()
|
||||
*/
|
||||
static BOOLEAN LV_DeleteItem(IShellViewImpl * This, LPITEMIDLIST pidl)
|
||||
static BOOLEAN LV_DeleteItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
|
||||
{
|
||||
int nIndex;
|
||||
|
||||
FIXME("(%p)(pidl=%p)\n", This, pidl);
|
||||
TRACE("(%p)(pidl=%p)\n", This, pidl);
|
||||
|
||||
nIndex = LV_FindItemByPidl(This, ILFindLastID(pidl));
|
||||
return (-1==ListView_DeleteItem(This->hWndList, nIndex))? FALSE: TRUE;
|
||||
|
@ -522,12 +518,12 @@ static BOOLEAN LV_DeleteItem(IShellViewImpl * This, LPITEMIDLIST pidl)
|
|||
/**********************************************************
|
||||
* LV_RenameItem()
|
||||
*/
|
||||
static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPITEMIDLIST pidlOld, LPITEMIDLIST pidlNew )
|
||||
static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPCITEMIDLIST pidlOld, LPCITEMIDLIST pidlNew )
|
||||
{
|
||||
int nItem;
|
||||
LVITEMA lvItem;
|
||||
|
||||
FIXME("(%p)(pidlold=%p pidlnew=%p)\n", This, pidlOld, pidlNew);
|
||||
TRACE("(%p)(pidlold=%p pidlnew=%p)\n", This, pidlOld, pidlNew);
|
||||
|
||||
nItem = LV_FindItemByPidl(This, ILFindLastID(pidlOld));
|
||||
if ( -1 != nItem )
|
||||
|
@ -603,13 +599,8 @@ static HRESULT ShellView_FillList(IShellViewImpl * This)
|
|||
|
||||
/* in a commdlg This works as a filemask*/
|
||||
if ( IncludeObject(This, pidl)==S_OK )
|
||||
{
|
||||
if(! LV_AddItem(This, pidl)) SHFree(pidl); /* insert failed: PIDL not owned by the LV */
|
||||
}
|
||||
else
|
||||
{
|
||||
SHFree(pidl); /* not inserted */
|
||||
}
|
||||
LV_AddItem(This, pidl);
|
||||
SHFree(pidl);
|
||||
}
|
||||
|
||||
/*turn the listview's redrawing back on and force it to draw*/
|
||||
|
@ -1199,7 +1190,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
|
|||
if (ShellView_GetSelections(This))
|
||||
{
|
||||
IDataObject * pda;
|
||||
DWORD dwAttributes;
|
||||
DWORD dwAttributes = SFGAO_CANLINK;
|
||||
DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
|
||||
|
||||
if(GetShellOle())
|
||||
|
|
Loading…
Reference in a new issue