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

More use of rc files for strings and menus, fixes. First internal

icons.
parent 9bffcfc5
...@@ -199,7 +199,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation( ...@@ -199,7 +199,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation(
else /* object is file */ else /* object is file */
{ {
if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH) if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH)
&& HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH) && HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH, TRUE)
&& HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr)) && HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr))
{ {
if (!strcmp("%1",sTemp)) /* icon is in the file */ if (!strcmp("%1",sTemp)) /* icon is in the file */
......
...@@ -276,38 +276,38 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl) ...@@ -276,38 +276,38 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl)
* NOTES * NOTES
* wraper for IShellFolder::ParseDisplayName() * wraper for IShellFolder::ParseDisplayName()
*/ */
HRESULT WINAPI SHILCreateFromPathA (LPSTR path, LPITEMIDLIST * ppidl, DWORD attributes) HRESULT WINAPI SHILCreateFromPathA (LPCSTR path, LPITEMIDLIST * ppidl, DWORD * attributes)
{ LPSHELLFOLDER sf; { LPSHELLFOLDER sf;
WCHAR lpszDisplayName[MAX_PATH]; WCHAR lpszDisplayName[MAX_PATH];
DWORD pchEaten; DWORD pchEaten;
HRESULT ret = E_FAIL; HRESULT ret = E_FAIL;
TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes); TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes?*attributes:0);
LocalToWideChar(lpszDisplayName, path, MAX_PATH); LocalToWideChar(lpszDisplayName, path, MAX_PATH);
if (SUCCEEDED (SHGetDesktopFolder(&sf))) if (SUCCEEDED (SHGetDesktopFolder(&sf)))
{ {
ret = sf->lpvtbl->fnParseDisplayName(sf,0, NULL,lpszDisplayName,&pchEaten,ppidl,&attributes); ret = IShellFolder_ParseDisplayName(sf,0, NULL,lpszDisplayName,&pchEaten,ppidl,attributes);
sf->lpvtbl->fnRelease(sf); IShellFolder_Release(sf);
} }
return ret; return ret;
} }
HRESULT WINAPI SHILCreateFromPathW (LPWSTR path, LPITEMIDLIST * ppidl, DWORD attributes) HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * attributes)
{ LPSHELLFOLDER sf; { LPSHELLFOLDER sf;
DWORD pchEaten; DWORD pchEaten;
HRESULT ret = E_FAIL; HRESULT ret = E_FAIL;
TRACE_(shell)("%s %p 0x%08lx\n",debugstr_w(path),ppidl,attributes); TRACE_(shell)("%s %p 0x%08lx\n",debugstr_w(path),ppidl,attributes?*attributes:0);
if (SUCCEEDED (SHGetDesktopFolder(&sf))) if (SUCCEEDED (SHGetDesktopFolder(&sf)))
{ {
ret = sf->lpvtbl->fnParseDisplayName(sf,0, NULL, path, &pchEaten, ppidl, &attributes); ret = IShellFolder_ParseDisplayName(sf,0, NULL, path, &pchEaten, ppidl, attributes);
sf->lpvtbl->fnRelease(sf); IShellFolder_Release(sf);
} }
return ret; return ret;
} }
HRESULT WINAPI SHILCreateFromPathAW (LPVOID path, LPITEMIDLIST * ppidl, DWORD attributes) HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD * attributes)
{ {
if ( VERSION_OsIsUnicode()) if ( VERSION_OsIsUnicode())
return SHILCreateFromPathW (path, ppidl, attributes); return SHILCreateFromPathW (path, ppidl, attributes);
...@@ -698,27 +698,29 @@ DWORD WINAPI ILGlobalFree( LPITEMIDLIST pidl) ...@@ -698,27 +698,29 @@ DWORD WINAPI ILGlobalFree( LPITEMIDLIST pidl)
* ILCreateFromPath [SHELL32.157] * ILCreateFromPath [SHELL32.157]
* *
*/ */
LPITEMIDLIST WINAPI ILCreateFromPathA (LPSTR path) LPITEMIDLIST WINAPI ILCreateFromPathA (LPCSTR path)
{ {
LPITEMIDLIST pidlnew; LPITEMIDLIST pidlnew;
DWORD attributes = 0;
TRACE_(shell)("%s\n",path); TRACE_(shell)("%s\n",path);
if (SUCCEEDED (SHILCreateFromPathA (path, &pidlnew, 0))) if (SUCCEEDED (SHILCreateFromPathA (path, &pidlnew, &attributes)))
return pidlnew; return pidlnew;
return FALSE; return FALSE;
} }
LPITEMIDLIST WINAPI ILCreateFromPathW (LPWSTR path) LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path)
{ {
LPITEMIDLIST pidlnew; LPITEMIDLIST pidlnew;
DWORD attributes = 0;
TRACE_(shell)("%s\n",debugstr_w(path)); TRACE_(shell)("%s\n",debugstr_w(path));
if (SUCCEEDED (SHILCreateFromPathW (path, &pidlnew, 0))) if (SUCCEEDED (SHILCreateFromPathW (path, &pidlnew, &attributes)))
return pidlnew; return pidlnew;
return FALSE; return FALSE;
} }
LPITEMIDLIST WINAPI ILCreateFromPathAW (LPVOID path) LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
{ {
if ( VERSION_OsIsUnicode()) if ( VERSION_OsIsUnicode())
return ILCreateFromPathW (path); return ILCreateFromPathW (path);
...@@ -813,7 +815,7 @@ HRESULT WINAPI SHGetSpecialFolderLocation( ...@@ -813,7 +815,7 @@ HRESULT WINAPI SHGetSpecialFolderLocation(
{ {
DWORD attributes=0; DWORD attributes=0;
TRACE_(shell)("Value=%s\n",szPath); TRACE_(shell)("Value=%s\n",szPath);
hr = SHILCreateFromPathA(szPath, ppidl, attributes); hr = SHILCreateFromPathA(szPath, ppidl, &attributes);
} }
} }
} }
...@@ -891,7 +893,7 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int n ...@@ -891,7 +893,7 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int n
* fnGetDisplayNameOf can return different types of OLEString * fnGetDisplayNameOf can return different types of OLEString
*/ */
BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath) BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath)
{ STRRET lpName; { STRRET str;
LPSHELLFOLDER shellfolder; LPSHELLFOLDER shellfolder;
TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath); TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath);
...@@ -908,10 +910,10 @@ BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath) ...@@ -908,10 +910,10 @@ BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath)
{ {
if (SHGetDesktopFolder(&shellfolder)==S_OK) if (SHGetDesktopFolder(&shellfolder)==S_OK)
{ {
IShellFolder_GetDisplayNameOf(shellfolder,pidl,SHGDN_FORPARSING,&lpName); IShellFolder_GetDisplayNameOf(shellfolder,pidl,SHGDN_FORPARSING,&str);
StrRetToStrNA (pszPath, MAX_PATH, &str, pidl);
IShellFolder_Release(shellfolder); IShellFolder_Release(shellfolder);
} }
strcpy(pszPath,lpName.u.cStr);
} }
TRACE_(shell)("-- (%s)\n",pszPath); TRACE_(shell)("-- (%s)\n",pszPath);
...@@ -945,27 +947,37 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI ...@@ -945,27 +947,37 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI
TRACE_(shell)("pidl=%p\n", pidl); TRACE_(shell)("pidl=%p\n", pidl);
pdump(pidl); pdump(pidl);
if (_ILIsPidlSimple(pidl)) return E_INVALIDARG;
*ppv = NULL; *ppv = NULL;
if (ppidlLast) *ppidlLast = NULL;
if (_ILIsPidlSimple(pidl))
{
/* we are on desktop level */
if (ppidlLast)
*ppidlLast = ILClone(pidl);
hr = SHGetDesktopFolder((IShellFolder**)ppv);
}
else
{
pidlChild = ILClone(ILFindLastID(pidl)); pidlChild = ILClone(ILFindLastID(pidl));
pidlParent = ILClone(pidl); pidlParent = ILClone(pidl);
ILRemoveLastID(pidlParent); ILRemoveLastID(pidlParent);
if (SUCCEEDED(SHGetDesktopFolder(&psf))) hr = SHGetDesktopFolder(&psf);
{
if (SUCCEEDED(IShellFolder_BindToObject(psf, pidlParent, NULL, riid, ppv))) if (SUCCEEDED(hr))
{ hr = IShellFolder_BindToObject(psf, pidlParent, NULL, riid, ppv);
if(ppidlLast)
if (SUCCEEDED(hr) && ppidlLast)
*ppidlLast = pidlChild; *ppidlLast = pidlChild;
else else
ILFree (pidlChild); ILFree (pidlChild);
hr = S_OK;
}
}
SHFree (pidlParent); SHFree (pidlParent);
}
TRACE_(shell)("-- psf=%p pidl=%p\n", *ppv, (ppidlLast)?*ppidlLast:NULL); TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08lx\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
return hr; return hr;
} }
......
...@@ -176,7 +176,7 @@ init Shell32LibMain ...@@ -176,7 +176,7 @@ init Shell32LibMain
168 stub SHCreatePropSheetExtArray 168 stub SHCreatePropSheetExtArray
169 stub SHDestroyPropSheetExtArray 169 stub SHDestroyPropSheetExtArray
170 stub SHReplaceFromPropSheetExtArray 170 stub SHReplaceFromPropSheetExtArray
171 stdcall PathCleanupSpec(ptr ptr) PathCleanupSpec 171 stdcall PathCleanupSpec(ptr ptr) PathCleanupSpecAW
172 stub SHCreateLinks 172 stub SHCreateLinks
173 stdcall SHValidateUNC(long long long)SHValidateUNC 173 stdcall SHValidateUNC(long long long)SHValidateUNC
174 stdcall SHCreateShellFolderViewEx (ptr ptr) SHCreateShellFolderViewEx 174 stdcall SHCreateShellFolderViewEx (ptr ptr) SHCreateShellFolderViewEx
......
...@@ -53,6 +53,13 @@ extern LPVOID (WINAPI* pDPA_DeletePtr) (const HDPA hdpa, INT i); ...@@ -53,6 +53,13 @@ extern LPVOID (WINAPI* pDPA_DeletePtr) (const HDPA hdpa, INT i);
extern HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag); extern HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
extern HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag); extern HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
/* ole2 */
extern HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
extern void (WINAPI* pOleUninitialize)(void);
extern HRESULT (WINAPI* pDoDragDrop)(IDataObject* pDataObject, IDropSource * pDropSource, DWORD dwOKEffect, DWORD * pdwEffect);
extern HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
extern HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList); BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl); HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
...@@ -63,7 +70,7 @@ void SIC_Destroy(void); ...@@ -63,7 +70,7 @@ void SIC_Destroy(void);
BOOL PidlToSicIndex (IShellFolder * sh, LPITEMIDLIST pidl, BOOL bBigIcon, UINT * pIndex); BOOL PidlToSicIndex (IShellFolder * sh, LPITEMIDLIST pidl, BOOL bBigIcon, UINT * pIndex);
/* Classes Root */ /* Classes Root */
BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len); BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL bPrependDot);
BOOL HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len ); BOOL HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len );
BOOL HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr); BOOL HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr);
BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len); BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len);
...@@ -90,7 +97,7 @@ LPSHELLLINK IShellLink_Constructor(BOOL); ...@@ -90,7 +97,7 @@ LPSHELLLINK IShellLink_Constructor(BOOL);
IShellFolder * ISF_Desktop_Constructor(void); IShellFolder * ISF_Desktop_Constructor(void);
/* 3th parameter */ /* kind of enumidlist */
#define EIDL_DESK 0 #define EIDL_DESK 0
#define EIDL_MYCOMP 1 #define EIDL_MYCOMP 1
#define EIDL_FILE 2 #define EIDL_FILE 2
...@@ -113,4 +120,19 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR,REFCLSID,LPUNKNOWN,REFIID,LPVOID *); ...@@ -113,4 +120,19 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR,REFCLSID,LPUNKNOWN,REFIID,LPVOID *);
#define MM_SUBMENUSHAVEIDS 0x00000002L #define MM_SUBMENUSHAVEIDS 0x00000002L
HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags); HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
/* initialisation for FORMATETC */
#define InitFormatEtc(fe, cf, med) \
{\
(fe).cfFormat=cf;\
(fe).dwAspect=DVASPECT_CONTENT;\
(fe).ptd=NULL;\
(fe).tymed=med;\
(fe).lindex=-1;\
};
#define KeyStateToDropEffect(kst)\
(((kst) & MK_CONTROL) ?\
(((kst) & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY):\
DROPEFFECT_MOVE)
#endif #endif
...@@ -26,12 +26,13 @@ DEFAULT_DEBUG_CHANNEL(shell) ...@@ -26,12 +26,13 @@ DEFAULT_DEBUG_CHANNEL(shell)
#include "pshpack1.h" #include "pshpack1.h"
/* lnk elements: simple link has 0x0B */ /* flag1: lnk elements: simple link has 0x0B */
#define WORKDIR 0x10 #define WORKDIR 0x10
#define ARGUMENT 0x20 #define ARGUMENT 0x20
#define ICON 0x40 #define ICON 0x40
#define UNC 0x80
/* startup type */ /* fStartup */
#define NORMAL 0x01 #define NORMAL 0x01
#define MAXIMIZED 0x03 #define MAXIMIZED 0x03
#define MINIMIZED 0x07 #define MINIMIZED 0x07
...@@ -46,7 +47,7 @@ typedef struct _LINK_HEADER ...@@ -46,7 +47,7 @@ typedef struct _LINK_HEADER
FILETIME Time3; /* 0x2c */ FILETIME Time3; /* 0x2c */
DWORD Unknown1; /* 0x34 */ DWORD Unknown1; /* 0x34 */
DWORD Unknown2; /* 0x38 icon number */ DWORD Unknown2; /* 0x38 icon number */
DWORD Flag3; /* 0x3c startup type */ DWORD fStartup; /* 0x3c startup type */
DWORD wHotKey; /* 0x40 hotkey */ DWORD wHotKey; /* 0x40 hotkey */
DWORD Unknown5; /* 0x44 */ DWORD Unknown5; /* 0x44 */
DWORD Unknown6; /* 0x48 */ DWORD Unknown6; /* 0x48 */
...@@ -81,6 +82,9 @@ typedef struct ...@@ -81,6 +82,9 @@ typedef struct
LPSTR sPath; LPSTR sPath;
LPITEMIDLIST pPidl; LPITEMIDLIST pPidl;
WORD wHotKey; WORD wHotKey;
SYSTEMTIME time1;
SYSTEMTIME time2;
SYSTEMTIME time3;
} IShellLinkImpl; } IShellLinkImpl;
...@@ -315,27 +319,31 @@ static HRESULT WINAPI IPersistStream_fnLoad( ...@@ -315,27 +319,31 @@ static HRESULT WINAPI IPersistStream_fnLoad(
SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp); SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp);
This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp); This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp);
}
This->wHotKey = lpLinkHeader->wHotKey; This->wHotKey = lpLinkHeader->wHotKey;
FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1);
FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2);
FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3);
#if 1
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
TRACE("-- time1: %s\n", sTemp);
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256);
TRACE("-- time1: %s\n", sTemp);
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256);
TRACE("-- time1: %s\n", sTemp);
pdump (This->pPidl);
#endif
ret = S_OK; ret = S_OK;
} }
} }
} }
}
else else
{ WARN("stream contains no link!\n"); {
WARN("stream contains no link!\n");
} }
} }
} }
/* old code for debugging */
/* SYSTEMTIME time;
FileTimeToSystemTime (&pImage->Time1, &time);
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&time, NULL, sTemp, 256);
TRACE("-- time1: %s\n", sTemp);
pdump (&pImage->Pidl);
*/
IStream_Release (pLoadStream); IStream_Release (pLoadStream);
pdump(This->pPidl); pdump(This->pPidl);
......
...@@ -38,11 +38,11 @@ DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id); ...@@ -38,11 +38,11 @@ DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id);
LRESULT WINAPI SHCoCreateInstance( LRESULT WINAPI SHCoCreateInstance(
LPSTR aclsid, LPSTR aclsid,
REFCLSID clsid, REFCLSID clsid,
LPUNKNOWN unknownouter, IUnknown * unknownouter,
REFIID refiid, REFIID refiid,
LPVOID *ppv) LPVOID *ppv)
{ {
char xclsid[48], xiid[48]; char xclsid[48], xiid[48], xuout[48];
DWORD hres; DWORD hres;
IID iid; IID iid;
CLSID * myclsid = (CLSID*)clsid; CLSID * myclsid = (CLSID*)clsid;
...@@ -58,7 +58,11 @@ LRESULT WINAPI SHCoCreateInstance( ...@@ -58,7 +58,11 @@ LRESULT WINAPI SHCoCreateInstance(
WINE_StringFromCLSID(myclsid,xclsid); WINE_StringFromCLSID(myclsid,xclsid);
WINE_StringFromCLSID(refiid,xiid); WINE_StringFromCLSID(refiid,xiid);
TRACE("(%p,\n\tCLSID:\t%s,%p,\n\tIID:\t%s,%p)\n",aclsid,xclsid,unknownouter,xiid,ppv); if (unknownouter)
WINE_StringFromCLSID(unknownouter,xuout);
TRACE("(%p,\n\tCLSID:\t%s\n\tUOUT:\t%s\n\tIID:\t%s,%p)\n",
aclsid,xclsid,unknownouter?xuout:"nil",xiid,ppv);
hres = CoCreateInstance(myclsid, NULL, CLSCTX_INPROC_SERVER, refiid, ppv); hres = CoCreateInstance(myclsid, NULL, CLSCTX_INPROC_SERVER, refiid, ppv);
...@@ -156,15 +160,13 @@ LPSHELLFOLDER pdesktopfolder=NULL; ...@@ -156,15 +160,13 @@ LPSHELLFOLDER pdesktopfolder=NULL;
DWORD WINAPI SHGetDesktopFolder(IShellFolder **psf) DWORD WINAPI SHGetDesktopFolder(IShellFolder **psf)
{ {
HRESULT hres = E_OUTOFMEMORY; HRESULT hres = S_OK;
LPCLASSFACTORY lpclf; LPCLASSFACTORY lpclf;
TRACE_(shell)("%p->(%p)\n",psf,*psf); TRACE_(shell)("%p->(%p)\n",psf,*psf);
if (pdesktopfolder) *psf=NULL;
{
hres = NOERROR; if (!pdesktopfolder)
}
else
{ {
lpclf = IClassFactory_Constructor(&CLSID_ShellDesktop); lpclf = IClassFactory_Constructor(&CLSID_ShellDesktop);
if(lpclf) if(lpclf)
...@@ -176,12 +178,9 @@ DWORD WINAPI SHGetDesktopFolder(IShellFolder **psf) ...@@ -176,12 +178,9 @@ DWORD WINAPI SHGetDesktopFolder(IShellFolder **psf)
if (pdesktopfolder) if (pdesktopfolder)
{ {
*psf = pdesktopfolder; /* even if we create the folder, add a ref so the application cant destroy the folder*/
IShellFolder_AddRef(pdesktopfolder); IShellFolder_AddRef(pdesktopfolder);
} *psf = pdesktopfolder;
else
{
*psf=NULL;
} }
TRACE_(shell)("-- %p->(%p)\n",psf, *psf); TRACE_(shell)("-- %p->(%p)\n",psf, *psf);
......
...@@ -389,19 +389,25 @@ DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) { ...@@ -389,19 +389,25 @@ DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
* free_ptr() - frees memory using IMalloc * free_ptr() - frees memory using IMalloc
* exported by ordinal * exported by ordinal
*/ */
/*#define MEM_DEBUG 1*/
DWORD WINAPI SHFree(LPVOID x) DWORD WINAPI SHFree(LPVOID x)
{ {
TRACE("%p\n",x); #ifdef MEM_DEBUG
#if 0 WORD len = *(LPWORD)(x-2);
WORD len;
x -= 4;
if ( (*(LPWORD)x) != 0x8271) if ( *(LPWORD)(x+len) != 0x7384)
ERR("MAGIC2!\n");
if ( (*(LPWORD)(x-4)) != 0x8271)
ERR("MAGIC1!\n"); ERR("MAGIC1!\n");
else
memset(x-4, 0xde, len+6);
len = *(LPWORD)(x+2); TRACE("%p len=%u\n",x, len);
if ( *(LPWORD)( x + 4 + len) != 0x7384)
ERR("MAGIC2!\n"); x -= 4;
#else
TRACE("%p\n",x);
#endif #endif
return HeapFree(GetProcessHeap(), 0, x); return HeapFree(GetProcessHeap(), 0, x);
} }
...@@ -415,16 +421,21 @@ DWORD WINAPI SHFree(LPVOID x) ...@@ -415,16 +421,21 @@ DWORD WINAPI SHFree(LPVOID x)
*/ */
LPVOID WINAPI SHAlloc(DWORD len) LPVOID WINAPI SHAlloc(DWORD len)
{ {
LPBYTE ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len); LPBYTE ret;
#if 0
LPBYTE ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len + 6);
*(LPWORD)(ret) = 0x8271;
*(LPWORD)(ret+2) = len;
*(LPWORD)(ret+len+4) = 0x7384;
ret += 4; #ifdef MEM_DEBUG
ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len+6);
#else
ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
#endif #endif
#ifdef MEM_DEBUG
*(LPWORD)(ret) = 0x8271;
*(LPWORD)(ret+2) = (WORD)len;
*(LPWORD)(ret+4+len) = 0x7384;
ret += 4;
memset(ret, 0xdf, len);
#endif
TRACE("%lu bytes at %p\n",len, ret); TRACE("%lu bytes at %p\n",len, ret);
return (LPVOID)ret; return (LPVOID)ret;
} }
...@@ -1298,11 +1309,3 @@ HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y) ...@@ -1298,11 +1309,3 @@ HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
return DoEnvironmentSubstA(x, y); return DoEnvironmentSubstA(x, y);
} }
/*************************************************************************
* PathCleanupSpec [SHELL32.171]
*
*/
BOOL WINAPI PathCleanupSpec(LPSTR x, LPSTR y)
{ FIXME("%p(%s) %p(%s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
return TRUE;
}
...@@ -718,6 +718,29 @@ LPCVOID WINAPI PathGetExtensionAW(LPCVOID path,DWORD y,DWORD z) ...@@ -718,6 +718,29 @@ LPCVOID WINAPI PathGetExtensionAW(LPCVOID path,DWORD y,DWORD z)
} }
/************************************************************************* /*************************************************************************
* PathCleanupSpec [SHELL32.171]
*
*/
DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y)
{
FIXME("%p(%s) %p(%s) stub\n",x,x,y,y);
return TRUE;
}
DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y)
{
FIXME("%p(%s) %p(%s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
return TRUE;
}
DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
{
if (VERSION_OsIsUnicode())
return PathCleanupSpecW(x,y);
return PathCleanupSpecA(x,y);
}
/*************************************************************************
* SheGetDirW [SHELL32.281] * SheGetDirW [SHELL32.281]
* *
*/ */
......
#ifndef __WINE_SHELL_RES_H #ifndef __WINE_SHELL_RES_H
#define __WINE_SHELL_RES_H #define __WINE_SHELL_RES_H
#define IDS_FILE_TITLE 1 /*
#define IDS_MI_FILE 2 columntitles for the shellview
#define IDS_MI_VIEW_FILES 3 */
#define IDS_TB_VIEW_FILES 4 #define IDS_SHV_COLUMN1 7
#define IDS_MI_VIEW_IDW 5 #define IDS_SHV_COLUMN2 8
#define IDS_TB_VIEW_IDW 6 #define IDS_SHV_COLUMN3 9
#define IDS_SHV_COLUMN4 10
#define IDS_SHV_COLUMN5 11
#define IDS_SHV_COLUMN6 12
#define IDS_COLUMN1 7 #define IDS_DESKTOP 20
#define IDS_COLUMN2 8 #define IDS_MYCOMPUTER 21
#define IDS_COLUMN3 9
#define IDS_COLUMN4 10
#define IDS_MI_FILEITEM 12 #define IDS_SELECT 22
#define IDS_OPEN 23
#define IDI_FOLDER 101 #define IDS_VIEW_LARGE 24
#define IDI_FOLDEROPEN 102 #define IDS_VIEW_SMALL 25
#define IDS_VIEW_LIST 26
#define IDS_VIEW_DETAILS 27
#endif #endif
...@@ -168,15 +168,15 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand( ...@@ -168,15 +168,15 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand(
{ {
TRACE("%s\n",lpcmi->lpVerb); TRACE("%s\n",lpcmi->lpVerb);
if (! strcmp(lpcmi->lpVerb,CMDSTR_NEWFOLDER)) if (! strcmp(lpcmi->lpVerb,CMDSTR_NEWFOLDERA))
{ {
FIXME("%s not implemented\n",lpcmi->lpVerb); FIXME("%s not implemented\n",lpcmi->lpVerb);
} }
else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLIST)) else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLISTA))
{ {
SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_LISTVIEW,0),0 ); SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_LISTVIEW,0),0 );
} }
else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILS)) else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILSA))
{ {
SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 ); SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 );
} }
...@@ -213,9 +213,6 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand( ...@@ -213,9 +213,6 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand(
/************************************************************************** /**************************************************************************
* ISVBgCm_fnGetCommandString() * ISVBgCm_fnGetCommandString()
* *
* NOTES
* the values given by the common dialogs are not documented. so we put some magic
* words in it and will see, where we get these verbs back...
*/ */
static HRESULT WINAPI ISVBgCm_fnGetCommandString( static HRESULT WINAPI ISVBgCm_fnGetCommandString(
IContextMenu *iface, IContextMenu *iface,
...@@ -233,14 +230,16 @@ static HRESULT WINAPI ISVBgCm_fnGetCommandString( ...@@ -233,14 +230,16 @@ static HRESULT WINAPI ISVBgCm_fnGetCommandString(
the buttons according to this */ the buttons according to this */
if (uFlags == GCS_VALIDATEA) if (uFlags == GCS_VALIDATEA)
{ {
/* idCommmand's are 7febd910, 7febd920, 7febd930 */ if(HIWORD(idCommand))
if ((idCommand==0x7febd910) || {
(idCommand==0x7febd920) || if (!strcmp((LPSTR)idCommand, CMDSTR_VIEWLISTA) ||
(idCommand==0x7febd930)) !strcmp((LPSTR)idCommand, CMDSTR_VIEWDETAILSA) ||
!strcmp((LPSTR)idCommand, CMDSTR_NEWFOLDERA))
{ {
return NOERROR; return NOERROR;
} }
} }
}
FIXME("unknown command string\n"); FIXME("unknown command string\n");
return E_FAIL; return E_FAIL;
......
...@@ -174,6 +174,10 @@ LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf ); ...@@ -174,6 +174,10 @@ LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf );
LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf ); LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf );
#define StrFormatByteSize WINELIB_NAME_AW(StrFormatByteSize) #define StrFormatByteSize WINELIB_NAME_AW(StrFormatByteSize)
DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y);
DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y);
#define PathCleanupSpec WINELIB_NAME_AW(PathCleanupSpec)
/**************************************************************************** /****************************************************************************
* other functions * other functions
*/ */
......
...@@ -33,13 +33,13 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPSTR lpszPath); ...@@ -33,13 +33,13 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPSTR lpszPath);
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPWSTR lpszPath); LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPWSTR lpszPath);
LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPVOID lpszPath); LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPVOID lpszPath);
HRESULT WINAPI SHILCreateFromPathA (LPSTR path, LPITEMIDLIST * ppidl, DWORD attributes); HRESULT WINAPI SHILCreateFromPathA (LPCSTR path, LPITEMIDLIST * ppidl, DWORD *attributes);
HRESULT WINAPI SHILCreateFromPathW (LPWSTR path, LPITEMIDLIST * ppidl, DWORD attributes); HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST * ppidl, DWORD *attributes);
HRESULT WINAPI SHILCreateFromPathAW (LPVOID path, LPITEMIDLIST * ppidl, DWORD attributes); HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD *attributes);
LPITEMIDLIST WINAPI ILCreateFromPathA(LPSTR path); LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path);
LPITEMIDLIST WINAPI ILCreateFromPathW(LPWSTR path); LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path);
LPITEMIDLIST WINAPI ILCreateFromPathAW(LPVOID path); LPITEMIDLIST WINAPI ILCreateFromPathAW(LPCVOID path);
/* /*
string functions string functions
......
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