Commit dd153f17 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

- mostly cleanup after the renaming

- implemented SHILCreateFromPath - small changed to SHGetFileInfo
parent dbf9fba4
......@@ -58,7 +58,7 @@ static DWORD SHELL_GetResourceTable(HFILE hFile,LPBYTE *retptr)
if ((_lread(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) || (mz_header.e_magic != IMAGE_DOS_SIGNATURE))
{ if (mz_header.e_cblp == 1) /* .ICO file ? */
{ *retptr = (LPBYTE)-1; /* ICONHEADER.idType, must be 1 */
return 1;
return 1;
}
else
return 0; /* failed */
......@@ -98,7 +98,7 @@ static DWORD SHELL_GetResourceTable(HFILE hFile,LPBYTE *retptr)
*retptr = pTypeInfo;
return IMAGE_OS2_SIGNATURE;
}
return 0; /* failed */
return 0; /* failed */
}
/*************************************************************************
* SHELL_LoadResource
......@@ -141,7 +141,7 @@ static HGLOBAL16 ICO_GetIconDirectory(HINSTANCE hInst, HFILE hFile, LPicoICONDIR
{ WORD id[3]; /* idReserved, idType, idCount */
LPicoICONDIR lpiID;
int i;
TRACE(shell,"\n");
_llseek( hFile, 0, SEEK_SET );
if( _lread(hFile,(char*)id,sizeof(id)) != sizeof(id) )
......@@ -169,7 +169,7 @@ static HGLOBAL16 ICO_GetIconDirectory(HINSTANCE hInst, HFILE hFile, LPicoICONDIR
for( i=0; i < lpiID->idCount; i++ )
{ memcpy((void*)(lpID->idEntries + i),(void*)(lpiID->idEntries + i), sizeof(ICONDIRENTRY) - 2);
lpID->idEntries[i].icon.wResId = i;
}
}
*lplpiID = lpiID;
return handle;
}
......@@ -215,7 +215,7 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
NE_NAMEINFO* pIconStorage = NULL;
NE_NAMEINFO* pIconDir = NULL;
LPicoICONDIR lpiID = NULL;
if( pData == (BYTE*)-1 )
{ hIcon = ICO_GetIconDirectory(0, hFile, &lpiID); /* check for .ICO file */
if( hIcon )
......@@ -252,7 +252,7 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
hIcon = SHELL_LoadResource( 0, hFile, pIconDir + i, *(WORD*)pData );
RetPtr[i-nIconIndex] = GetIconID16( hIcon, 3 );
GlobalFree16(hIcon);
}
}
for( icon = nIconIndex; icon < nIconIndex + n; icon++ )
{ hIcon = 0;
......@@ -336,7 +336,7 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
{ hRet = iconDirCount;
goto end_3; /* success */
}
if (nIconIndex >= iconDirCount)
{ WARN(shell,"nIconIndex %d is larger than iconDirCount %d\n",nIconIndex,iconDirCount);
goto end_4; /* failure */
......@@ -433,10 +433,11 @@ typedef struct
} SIC_ENTRY, * LPSIC_ENTRY;
/*****************************************************************************
* SIC_CompareEntrys [called by comctl32.dll]
* NOTES
* Callback for DPA_Search
*/
* SIC_CompareEntrys [called by comctl32.dll]
*
* NOTES
* Callback for DPA_Search
*/
INT CALLBACK SIC_CompareEntrys( LPVOID p1, LPVOID p2, LPARAM lparam)
{ TRACE(shell,"%p %p\n", p1, p2);
......@@ -449,10 +450,11 @@ INT CALLBACK SIC_CompareEntrys( LPVOID p1, LPVOID p2, LPARAM lparam)
return 0;
}
/*****************************************************************************
* SIC_IconAppend (internal)
* NOTES
* appends a icon pair to the end of the cache
*/
* SIC_IconAppend [internal]
*
* NOTES
* appends a icon pair to the end of the cache
*/
static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon)
{ LPSIC_ENTRY lpsice;
INT index, index1;
......@@ -468,7 +470,7 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc
if ( INVALID_INDEX == index )
{ SHFree(lpsice);
return INVALID_INDEX;
}
}
index = pImageList_AddIcon (ShellSmallIconList, hSmallIcon);
index1= pImageList_AddIcon (ShellBigIconList, hBigIcon);
......@@ -482,10 +484,11 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc
}
/****************************************************************************
* SIC_LoadIcon [internal]
* NOTES
* gets small/big icon by number from a file
*/
* SIC_LoadIcon [internal]
*
* NOTES
* gets small/big icon by number from a file
*/
static INT SIC_LoadIcon (LPCSTR sSourceFile, INT dwSourceIndex)
{ HICON hiconLarge=0;
HICON hiconSmall=0;
......@@ -501,11 +504,12 @@ static INT SIC_LoadIcon (LPCSTR sSourceFile, INT dwSourceIndex)
return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge);
}
/*****************************************************************************
* SIC_GetIconIndex [internal]
* NOTES
* look in the cache for a proper icon. if not available the icon is taken
* from the file and cached
*/
* SIC_GetIconIndex [internal]
*
* NOTES
* look in the cache for a proper icon. if not available the icon is taken
* from the file and cached
*/
INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
{ SIC_ENTRY sice;
INT index = INVALID_INDEX;
......@@ -527,10 +531,11 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
return ((LPSIC_ENTRY)pDPA_GetPtr(hdpa, index))->dwListIndex;
}
/****************************************************************************
* SIC_LoadIcon [internal]
* NOTES
* retrives the specified icon from the iconcache. if not found try's to load the icon
*/
* SIC_LoadIcon [internal]
*
* NOTES
* retrives the specified icon from the iconcache. if not found try's to load the icon
*/
static HICON SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOOL bSmallIcon )
{ INT index;
......@@ -547,11 +552,12 @@ static HICON SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOOL bSmallIcon
}
/*****************************************************************************
* SIC_Initialize [internal]
* NOTES
* hack to load the resources from the shell32.dll under a different dll name
* will be removed when the resource-compiler is ready
*/
* SIC_Initialize [internal]
*
* NOTES
* hack to load the resources from the shell32.dll under a different dll name
* will be removed when the resource-compiler is ready
*/
BOOL SIC_Initialize(void)
{ CHAR szShellPath[MAX_PATH];
HGLOBAL hSmRet, hLgRet;
......@@ -606,7 +612,7 @@ BOOL SIC_Initialize(void)
}
/*************************************************************************
* Shell_GetImageList [SHELL32.71]
* Shell_GetImageList [SHELL32.71]
*
* PARAMETERS
* imglist[1|2] [OUT] pointer which recive imagelist handles
......@@ -625,7 +631,7 @@ DWORD WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList
}
/*************************************************************************
* SHMapPIDLToSystemImageListIndex [SHELL32.77]
* SHMapPIDLToSystemImageListIndex [SHELL32.77]
*
* PARAMETERS
* x pointer to an instance of IShellFolder
......@@ -679,7 +685,7 @@ DWORD WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,LPITEMIDLIST pidl,
}
/*************************************************************************
* Shell_GetCachedImageIndex [SHELL32.72]
* Shell_GetCachedImageIndex [SHELL32.72]
*
*/
INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, DWORD z)
......@@ -705,20 +711,20 @@ INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, DWORD z)
}
/*************************************************************************
* ExtracticonEx32 [shell32.189]
*/
* ExtracticonExAW [shell32.189]
*/
HICON WINAPI ExtractIconExAW ( LPCVOID lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons )
{ if (VERSION_OsIsUnicode())
return ExtractIconExW ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
return ExtractIconExA ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
}
/*************************************************************************
* ExtracticonEx32A [shell32.190]
* RETURNS
* 0 no icon found
* 1 file is not valid
* HICON32 handle of a icon (phiconLarge/Small == NULL)
*/
* ExtracticonExA [shell32.190]
* RETURNS
* 0 no icon found
* 1 file is not valid
* HICON handle of a icon (phiconLarge/Small == NULL)
*/
HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons )
{ HICON ret=0;
......@@ -749,8 +755,8 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar
return ret;
}
/*************************************************************************
* ExtracticonEx32W [shell32.191]
*/
* ExtracticonExW [shell32.191]
*/
HICON WINAPI ExtractIconExW ( LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons )
{ LPSTR sFile;
DWORD ret;
......
......@@ -134,6 +134,47 @@ LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
return newpidl;
}
/*************************************************************************
* SHILCreateFromPath [SHELL32.28]
*
* NOTES
* wraper for IShellFolder::ParseDisplayName()
*/
HRESULT WINAPI SHILCreateFromPathA (LPSTR path, LPITEMIDLIST * ppidl, DWORD attributes)
{ LPSHELLFOLDER sf;
WCHAR lpszDisplayName[MAX_PATH];
DWORD pchEaten;
HRESULT ret = E_FAIL;
TRACE(shell, "%s %p 0x%08lx\n",path,ppidl,attributes);
LocalToWideChar(lpszDisplayName, path, MAX_PATH);
if (SUCCEEDED (SHGetDesktopFolder(&sf)))
{ ret = sf->lpvtbl->fnParseDisplayName(sf,0, NULL,lpszDisplayName,&pchEaten,ppidl,&attributes);
sf->lpvtbl->fnRelease(sf);
}
return ret;
}
HRESULT WINAPI SHILCreateFromPathW (LPWSTR path, LPITEMIDLIST * ppidl, DWORD attributes)
{ LPSHELLFOLDER sf;
DWORD pchEaten;
HRESULT ret = E_FAIL;
TRACE(shell, "%s %p 0x%08lx\n",debugstr_w(path),ppidl,attributes);
if (SUCCEEDED (SHGetDesktopFolder(&sf)))
{ ret = sf->lpvtbl->fnParseDisplayName(sf,0, NULL, path, &pchEaten, ppidl, &attributes);
sf->lpvtbl->fnRelease(sf);
}
return ret;
}
HRESULT WINAPI SHILCreateFromPathAW (LPVOID path, LPITEMIDLIST * ppidl, DWORD attributes)
{
if ( !VERSION_OsIsUnicode())
return SHILCreateFromPathW (path, ppidl, attributes);
return SHILCreateFromPathA (path, ppidl, attributes);
}
/*************************************************************************
* SHCloneSpecialIDList [SHELL32.89]
......@@ -468,26 +509,28 @@ DWORD WINAPI ILGlobalFree( LPITEMIDLIST pidl)
* ILCreateFromPath [SHELL32.157]
*
*/
LPITEMIDLIST WINAPI ILCreateFromPath(LPVOID path)
{ LPSHELLFOLDER shellfolder;
LPITEMIDLIST pidlnew;
WCHAR lpszDisplayName[MAX_PATH];
DWORD pchEaten;
if ( !VERSION_OsIsUnicode())
{ TRACE(pidl,"(path=%s)\n",(LPSTR)path);
LocalToWideChar(lpszDisplayName, path, MAX_PATH);
}
else
{ TRACE(pidl,"(path=L%s)\n",debugstr_w(path));
lstrcpyW(lpszDisplayName, path);
}
LPITEMIDLIST WINAPI ILCreateFromPathA (LPSTR path)
{ LPITEMIDLIST pidlnew;
if (SHGetDesktopFolder(&shellfolder)==S_OK)
{ shellfolder->lpvtbl->fnParseDisplayName(shellfolder,0, NULL,lpszDisplayName,&pchEaten,&pidlnew,NULL);
shellfolder->lpvtbl->fnRelease(shellfolder);
}
return pidlnew;
TRACE(shell,"%s\n",path);
if (SUCCEEDED (SHILCreateFromPathA (path, &pidlnew, 0)))
return pidlnew;
return FALSE;
}
LPITEMIDLIST WINAPI ILCreateFromPathW (LPWSTR path)
{ LPITEMIDLIST pidlnew;
TRACE(shell,"%s\n",debugstr_w(path));
if (SUCCEEDED (SHILCreateFromPathW (path, &pidlnew, 0)))
return pidlnew;
return FALSE;
}
LPITEMIDLIST WINAPI ILCreateFromPathAW (LPVOID path)
{
if ( !VERSION_OsIsUnicode())
return ILCreateFromPathW (path);
return ILCreateFromPathA (path);
}
/*************************************************************************
* SHSimpleIDListFromPath [SHELL32.162]
......@@ -520,11 +563,33 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPVOID lpszPath)
*
*/
HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len)
{ FIXME(shell,"sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
{ TRACE(shell,"sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
if (! psf || !dest )
return E_INVALIDARG;
switch (nFormat)
{ case SHGDFIL_FINDDATA:
{ WIN32_FIND_DATAA * pfd = dest;
STRRET lpName;
CHAR pszPath[MAX_PATH];
HANDLE handle;
if ( len < sizeof (WIN32_FIND_DATAA))
return E_INVALIDARG;
psf->lpvtbl->fnAddRef(psf);
psf->lpvtbl->fnGetDisplayNameOf( psf, pidl, SHGDN_FORPARSING, &lpName);
psf->lpvtbl->fnRelease(psf);
strcpy(pszPath,lpName.u.cStr);
if ((handle = FindFirstFileA ( pszPath, pfd)))
FindClose (handle);
}
break;
case SHGDFIL_NETRESOURCE:
case SHGDFIL_DESCRIPTIONID:
FIXME(shell, "SHGDFIL %i stub\n", nFormat);
break;
default:
ERR(shell,"Unknown SHGDFIL %i, please report\n", nFormat);
......
......@@ -42,7 +42,14 @@ LPITEMIDLIST WINAPI ILGetNext(LPITEMIDLIST pidl);
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST iil1,LPCITEMIDLIST iil2);
LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl);
DWORD WINAPI ILGetSize(LPITEMIDLIST pidl);
LPITEMIDLIST WINAPI ILCreateFromPath(LPVOID path);
HRESULT WINAPI SHILCreateFromPathA (LPSTR path, LPITEMIDLIST * ppidl, DWORD attributes);
HRESULT WINAPI SHILCreateFromPathW (LPWSTR path, LPITEMIDLIST * ppidl, DWORD attributes);
HRESULT WINAPI SHILCreateFromPathAW (LPVOID path, LPITEMIDLIST * ppidl, DWORD attributes);
LPITEMIDLIST WINAPI ILCreateFromPathA(LPSTR path);
LPITEMIDLIST WINAPI ILCreateFromPathW(LPWSTR path);
LPITEMIDLIST WINAPI ILCreateFromPathAW(LPVOID path);
DWORD WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
......
......@@ -496,7 +496,7 @@ BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
return PathMatchSpecA( name, mask );
}
/*************************************************************************
* PathSetDlgItemPath32AW [SHELL32.48]
* PathSetDlgItemPathAW [SHELL32.48]
* NOTES
* use PathCompactPath to make sure, the path fits into the control
*/
......@@ -516,7 +516,7 @@ BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
}
/*************************************************************************
* PathQualify32AW [SHELL32.49]
* PathQualifyAW [SHELL32.49]
*/
BOOL WINAPI PathQualifyA(LPCSTR pszPath)
......
......@@ -303,7 +303,7 @@ BOOL ShellView_InitList(LPSHELLVIEW this)
lvColumn.cx = nColumn1;
strcpy(szString,"File");
/*LoadString32A(shell32_hInstance, IDS_COLUMN1, szString, sizeof(szString));*/
/*LoadStringA(shell32_hInstance, IDS_COLUMN1, szString, sizeof(szString));*/
ListView_InsertColumnA(this->hWndList, 0, &lvColumn);
lvColumn.cx = nColumn2;
......@@ -992,7 +992,7 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
break;
case HDN_ENDTRACKA:
TRACE(shell,"-- HDN_ENDTRACK32A %p\n",this);
TRACE(shell,"-- HDN_ENDTRACKA %p\n",this);
/*nColumn1 = ListView_GetColumnWidth(this->hWndList, 0);
nColumn2 = ListView_GetColumnWidth(this->hWndList, 1);*/
break;
......@@ -1015,7 +1015,7 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
break;
case LVN_GETDISPINFOA:
TRACE(shell,"-- LVN_GETDISPINFO32A %p\n",this);
TRACE(shell,"-- LVN_GETDISPINFOA %p\n",this);
pidl = (LPITEMIDLIST)lpdi->item.lParam;
......
......@@ -196,6 +196,15 @@ typedef struct _AppBarData {
LPARAM lParam;
} APPBARDATA, *PAPPBARDATA;
#define SHGFI_LARGEICON 0x000000000 /* get large icon */
#define SHGFI_SMALLICON 0x000000001 /* get small icon */
#define SHGFI_OPENICON 0x000000002 /* get open icon */
#define SHGFI_SHELLICONSIZE 0x000000004 /* get shell size icon */
#define SHGFI_PIDL 0x000000008 /* pszPath is a pidl */
#define SHGFI_USEFILEATTRIBUTES 0x000000010 /* use passed dwFileAttribute */
#define SHGFI_UNKNOWN1 0x000000020
#define SHGFI_UNKNOWN2 0x000000040
#define SHGFI_UNKNOWN3 0x000000080
#define SHGFI_ICON 0x000000100 /* get icon */
#define SHGFI_DISPLAYNAME 0x000000200 /* get display name */
#define SHGFI_TYPENAME 0x000000400 /* get type name */
......@@ -205,12 +214,7 @@ typedef struct _AppBarData {
#define SHGFI_SYSICONINDEX 0x000004000 /* get system icon index */
#define SHGFI_LINKOVERLAY 0x000008000 /* put a link overlay on icon */
#define SHGFI_SELECTED 0x000010000 /* show icon in selected state */
#define SHGFI_LARGEICON 0x000000000 /* get large icon */
#define SHGFI_SMALLICON 0x000000001 /* get small icon */
#define SHGFI_OPENICON 0x000000002 /* get open icon */
#define SHGFI_SHELLICONSIZE 0x000000004 /* get shell size icon */
#define SHGFI_PIDL 0x000000008 /* pszPath is a pidl */
#define SHGFI_USEFILEATTRIBUTES 0x000000010 /* use passed dwFileAttribute */
#define SHGFI_ATTR_SPECIFIED 0x000020000 /* get only specified attributes */
/****************************************************************************
* SHChangeNotifyRegister API
......
......@@ -33,7 +33,7 @@ init Shell32LibMain
25 stdcall ILCombine(ptr ptr) ILCombine
26 stub ILLoadFromStream@8
27 stub ILSaveToStream@8
28 stub SHILCreateFromPath@12
28 stdcall SHILCreateFromPath (long long long) SHILCreateFromPathAW
29 stdcall PathIsRoot(ptr) PathIsRootAW
30 stdcall PathBuildRoot(ptr long) PathBuildRootA
31 stdcall PathFindExtension(ptr) PathFindExtensionAW
......@@ -162,7 +162,7 @@ init Shell32LibMain
154 stdcall ILAppend (long long long) ILAppend
155 stdcall ILFree (ptr) ILFree
156 stdcall ILGlobalFree (ptr) ILGlobalFree
157 stdcall ILCreateFromPath (ptr) ILCreateFromPath
157 stdcall ILCreateFromPath (ptr) ILCreateFromPathAW
158 stdcall PathGetExtension(str long long) PathGetExtensionAW
159 stub PathIsDirectory
160 stub SHNetConnectionDialog
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment