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

- made IShellFolder a aggregable object

- SHCoCreateInstance can create CSIDL_FSFolder now - browsing into folders on the desktop implemented - corrected returnvalue of Ico_ExtractIconEx - fixed SHGetDataFromIDList to return data of simple pidls
parent e0a3ba54
......@@ -136,7 +136,7 @@ BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len)
LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen);
ret = TRUE;
}
else if (IsEqualIID(riid, &IID_MyComputer))
else if (IsEqualIID(riid, &CLSID_MyComputer))
{
LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen);
ret = TRUE;
......@@ -152,6 +152,9 @@ BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len)
* HCR_GetFolderAttributes [internal]
*
* gets the folder attributes of a class
*
* FIXME
* verify the defaultvalue for *szDest
*/
BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest)
{ HKEY hkey;
......@@ -163,6 +166,9 @@ BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest)
WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]);
TRACE("%s\n",xriid );
if (!szDest) return FALSE;
*szDest = SFGAO_FOLDER|SFGAO_FILESYSTEM;
strcat (xriid, "\\ShellFolder");
if (RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey))
......
......@@ -203,18 +203,12 @@ static BYTE * ICO_GetIconDirectory( HFILE hFile, LPicoICONDIR* lplpiID, ULONG *u
}
/*************************************************************************
* InternalExtractIcon [SHELL.39]
*
* This abortion is called directly by Progman
* fixme: the icon section is broken (don't have a handle for
* ICO_GetIconDirectory....)
*
* returns
* failure:0; success: icon handle or nr of icons (nIconIndex-1)
*/
#define ICO_INVALID_FILE 1
#define ICO_NO_ICONS 0
HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nIconIndex, UINT n, UINT cxDesired, UINT cyDesired )
{ HGLOBAL hRet = ICO_NO_ICONS;
HICON WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nIconIndex, UINT n, UINT cxDesired, UINT cyDesired )
{ HGLOBAL hRet = 0;
LPBYTE pData;
OFSTRUCT ofs;
DWORD sig;
......@@ -227,7 +221,7 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
TRACE("(file %s,start %d,extract %d\n", lpszExeFileName, nIconIndex, n);
if( hFile == HFILE_ERROR || !n )
return ICO_INVALID_FILE;
return hRet;
sig = SHELL_GetResourceTable(hFile,&pData);
......@@ -321,13 +315,11 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
if ( !(fmapping = CreateFileMappingA(hFile,NULL,PAGE_READONLY|SEC_COMMIT,0,0,NULL)))
{ WARN("failed to create filemap.\n"); /* FIXME, INVALID_HANDLE_VALUE? */
hRet = ICO_INVALID_FILE;
goto end_2; /* failure */
}
if ( !(peimage = MapViewOfFile(fmapping,FILE_MAP_READ,0,0,0)))
{ WARN("failed to mmap filemap.\n");
hRet = ICO_INVALID_FILE;
goto end_2; /* failure */
}
......@@ -348,12 +340,12 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
if (!rootresdir)
{ WARN("haven't found section for resource directory.\n");
goto end_4; /* failure */
goto end_3; /* failure */
}
/* search the group icon dir*/
if (!(icongroupresdir = GetResDirEntryW(rootresdir,RT_GROUP_ICONW, (DWORD)rootresdir,FALSE)))
{ WARN("No Icongroupresourcedirectory!\n");
goto end_4; /* failure */
goto end_3; /* failure */
}
iconDirCount = icongroupresdir->NumberOfNamedEntries+icongroupresdir->NumberOfIdEntries;
......@@ -365,7 +357,7 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
if (nIconIndex >= iconDirCount)
{ WARN("nIconIndex %d is larger than iconDirCount %d\n",nIconIndex,iconDirCount);
goto end_4; /* failure */
goto end_3; /* failure */
}
xresent = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1); /* caller just wanted the number of entries */
......@@ -399,14 +391,14 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
if (!igdata)
{ WARN("no matching real address for icongroup!\n");
goto end_4; /* failure */
goto end_3; /* failure */
}
RetPtr[i] = (HICON)pLookupIconIdFromDirectoryEx(igdata, TRUE, cxDesired, cyDesired, LR_DEFAULTCOLOR);
}
if (!(iconresdir=GetResDirEntryW(rootresdir,RT_ICONW,(DWORD)rootresdir,FALSE)))
{ WARN("No Iconresourcedirectory!\n");
goto end_4; /* failure */
goto end_3; /* failure */
}
for (i=0;i<n;i++)
......@@ -434,11 +426,9 @@ HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nI
hRet = RetPtr[0]; /* return first icon */
goto end_3; /* sucess */
}
hRet = ICO_INVALID_FILE;
goto end_1; /* unknown filetype */
/* cleaning up (try & catch would be nicer:-) ) */
end_4: hRet = 0; /* failure */
end_3: UnmapViewOfFile(peimage); /* success */
end_2: CloseHandle(fmapping);
end_1: _lclose( hFile);
......
......@@ -121,7 +121,7 @@ BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
BOOL _ILGetAttributeStr (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft);
DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT16);
......@@ -158,8 +158,8 @@ LPITEMIDLIST _ILCreateSpecial (LPCSTR szGUID);
* helper functions (getting struct-pointer)
*/
LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST);
LPSTR _ILGetTextPointer (PIDLTYPE type, LPPIDLDATA pidldata);
LPSTR _ILGetSTextPointer (PIDLTYPE type, LPPIDLDATA pidldata);
LPSTR _ILGetTextPointer (LPCITEMIDLIST);
LPSTR _ILGetSTextPointer (LPCITEMIDLIST);
REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl);
/*
......
......@@ -28,6 +28,13 @@
DEFAULT_DEBUG_CHANNEL(shell)
DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id);
extern IShellFolder * IShellFolder_Constructor(
IShellFolder * psf,
LPITEMIDLIST pidl);
extern HRESULT IFSFolder_Constructor(
IUnknown * pUnkOuter,
REFIID riid,
LPVOID * ppv);
/*************************************************************************
* SHCoCreateInstance [SHELL32.102]
......@@ -62,14 +69,22 @@ LRESULT WINAPI SHCoCreateInstance(
TRACE("(%p,\n\tCLSID:\t%s, unk:%p\n\tIID:\t%s,%p)\n",
aclsid,xclsid,unknownouter,xiid,ppv);
hres = CoCreateInstance(myclsid, unknownouter, CLSCTX_INPROC_SERVER, refiid, ppv);
if IsEqualCLSID(myclsid, &CLSID_ShellFSFolder)
{
hres = IFSFolder_Constructor(unknownouter, refiid, ppv);
}
else
{
hres = CoCreateInstance(myclsid, unknownouter, CLSCTX_INPROC_SERVER, refiid, ppv);
}
if(hres!=S_OK)
{
ERR("failed (0x%08lx) to create \n\tCLSID:\t%s\n\tIID:\t%s\n", hres, xclsid, xiid);
ERR("you might need to import the winedefault.reg\n");
ERR("class not found in registry\n");
}
TRACE("-- instance: %p\n",*ppv);
return hres;
}
......@@ -87,11 +102,6 @@ HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv
*ppv = NULL;
if(IsEqualCLSID(rclsid, &CLSID_PaperBin))
{
ERR("paper bin not implemented\n");
return CLASS_E_CLASSNOTAVAILABLE;
}
if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)||
IsEqualCLSID(rclsid, &CLSID_ShellLink))
{
......
......@@ -469,10 +469,10 @@ DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
* free_ptr() - frees memory using IMalloc
* exported by ordinal
*/
/*#define MEM_DEBUG 1*/
#define MEM_DEBUG 0
DWORD WINAPI SHFree(LPVOID x)
{
#ifdef MEM_DEBUG
#if MEM_DEBUG
WORD len = *(LPWORD)(x-2);
if ( *(LPWORD)(x+len) != 0x7384)
......@@ -503,13 +503,13 @@ LPVOID WINAPI SHAlloc(DWORD len)
{
LPBYTE ret;
#ifdef MEM_DEBUG
#if MEM_DEBUG
ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len+6);
#else
ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
#endif
#ifdef MEM_DEBUG
#if MEM_DEBUG
*(LPWORD)(ret) = 0x8271;
*(LPWORD)(ret+2) = (WORD)len;
*(LPWORD)(ret+4+len) = 0x7384;
......
......@@ -777,6 +777,7 @@ HRESULT WINAPI PathProcessCommandA (LPSTR lpCommand, LPSTR v, DWORD w, DWORD x)
{
FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n",
lpCommand, lpCommand, v, w,x );
lstrcpyA(v, lpCommand);
return 0;
}
......
......@@ -417,8 +417,8 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
/* Sort by Attribute: Folder or Files can be sorted */
else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_ATTRIB)
{
_ILGetAttributeStr(pItemIdList1, strName1, MAX_PATH);
_ILGetAttributeStr(pItemIdList2, strName2, MAX_PATH);
_ILGetFileAttributes(pItemIdList1, strName1, MAX_PATH);
_ILGetFileAttributes(pItemIdList2, strName2, MAX_PATH);
nDiff = strcasecmp(strName1, strName2);
}
/* Sort by FileName: Folder or Files can be sorted */
......
......@@ -31,15 +31,17 @@ DEFINE_GUID (IID_IDockingWindow, 0x012dd920L, 0x7B26, 0x11D0, 0x8C, 0xA9, 0x00,
DEFINE_GUID (IID_IDockingWindowSite, 0x2A342FC2L, 0x7B26, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8);
/****************************************************************************
* undocumented stuff
*/
/* the next IID's are the namespace elements of the pidls */
DEFINE_GUID (IID_MyComputer, 0x20D04FE0L, 0x3AEA, 0x1069, 0xA2, 0xD8, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID (IID_IExplore, 0x871C5380L, 0x42A0, 0x1069, 0xA2, 0xEA, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID (IID_Control, 0x23EC2020L, 0x3AEA, 0x1069, 0xA2, 0xDD, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID (IID_Printer, 0x2227A280L, 0x3AEA, 0x1069, 0xA2, 0xDE, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID (IID_Network, 0x208D2C60L, 0x3AEA, 0x1069, 0xA2, 0xD7, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID (IID_BitBucket, 0x645FF040L, 0x5081, 0x101B, 0x9F, 0x08, 0x00, 0xAA, 0x00, 0x2F, 0x95, 0x4E);
DEFINE_GUID (CLSID_PaperBin, 0x645FF040L, 0x5081, 0x101B, 0x9F, 0x08, 0x00, 0xAA, 0x00, 0x2F, 0x95, 0x4E);
* the next IID's are the namespace elements of the pidls
*/
DEFINE_GUID(CLSID_NetworkPlaces, 0x208D2C60, 0x3AEA, 0x1069, 0xA2, 0xD7, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID(CLSID_NetworkDomain, 0x46e06680, 0x4bf0, 0x11d1, 0x83, 0xee, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0x49);
DEFINE_GUID(CLSID_NetworkServer, 0xc0542a90, 0x4bf0, 0x11d1, 0x83, 0xee, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0x49);
DEFINE_GUID(CLSID_NetworkShare, 0x54a754c0, 0x4bf0, 0x11d1, 0x83, 0xee, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0x49);
DEFINE_GUID(CLSID_MyComputer, 0x20D04FE0, 0x3AEA, 0x1069, 0xA2, 0xD8, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID(CLSID_Internet, 0x871C5380, 0x42A0, 0x1069, 0xA2, 0xEA, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID(CLSID_ShellFSFolder, 0xF3364BA0, 0x65B9, 0x11CE, 0xA9, 0xBA, 0x00, 0xAA, 0x00, 0x4A, 0xE8, 0x37);
DEFINE_GUID(CLSID_RecycleBin, 0x645FF040, 0x5081, 0x101B, 0x9F, 0x08, 0x00, 0xAA, 0x00, 0x2F, 0x95, 0x4E);
DEFINE_GUID(CLSID_ControlPanel, 0x21EC2020, 0x3AEA, 0x1069, 0xA2, 0xDD, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID(CLSID_Printers, 0x2227A280, 0x3AEA, 0x1069, 0xA2, 0xDE, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID(CLSID_MyDocuments, 0x450d8fba, 0xad25, 0x11d0, 0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03);
#endif /* __WINE_SHLGUID_H */
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