Revert revision 14118 changes

svn path=/trunk/; revision=14134
This commit is contained in:
Hervé Poussineau 2005-03-16 12:33:26 +00:00
parent 9189284a9d
commit 534636f9ce
27 changed files with 3202 additions and 4416 deletions

View file

@ -37,7 +37,6 @@ C_SRCS = \
shfldr_desktop.c \ shfldr_desktop.c \
shfldr_fs.c \ shfldr_fs.c \
shfldr_mycomp.c \ shfldr_mycomp.c \
shfldr_unixfs.c \
shlexec.c \ shlexec.c \
shlfileop.c \ shlfileop.c \
shlfolder.c \ shlfolder.c \
@ -78,7 +77,7 @@ version16.res: version16.rc
$(LDPATH) $(RC16) $(RC16FLAGS) -fo$@ $(SRCDIR)/version16.rc $(LDPATH) $(RC16) $(RC16FLAGS) -fo$@ $(SRCDIR)/version16.rc
shell.spec.c: shell.spec version16.res shell.spec.c: shell.spec version16.res
$(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --main-module $(MODULE) --res version16.res --export $(SRCDIR)/shell.spec $(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --main-module $(MODULE) --res version16.res --dll $(SRCDIR)/shell.spec
authors.c: $(TOPSRCDIR)/AUTHORS authors.c: $(TOPSRCDIR)/AUTHORS
(LC_ALL=C; export LC_ALL; echo 'const char * const SHELL_Authors[] = {' && \ (LC_ALL=C; export LC_ALL; echo 'const char * const SHELL_Authors[] = {' && \

View file

@ -55,95 +55,68 @@ static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0); return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0);
} }
/******************************************************************************
* InitializeTreeView [Internal]
*
* Called from WM_INITDIALOG handler.
*
* PARAMS
* hwndParent [I] The BrowseForFolder dialog
* root [I] ITEMIDLIST of the root shell folder
*/
static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root) static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root)
{ {
LPITEMIDLIST pidlParent, pidlChild;
HIMAGELIST hImageList; HIMAGELIST hImageList;
IShellFolder * lpsf;
HRESULT hr; HRESULT hr;
IShellFolder *lpsfParent, *lpsfRoot; IEnumIDList * pEnumIL = NULL;
IEnumIDList * pEnumChildren = NULL; LPITEMIDLIST parentofroot;
parentofroot = ILClone(root);
ILRemoveLastID(parentofroot);
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW);
Shell_GetImageList(NULL, &hImageList);
TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView ); TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView );
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW); if (hImageList && hwndTreeView)
if (!hwndTreeView) {
FIXME("Could not get handle to treeview control! Error: %08lx\n", GetLastError());
return;
}
Shell_GetImageList(NULL, &hImageList);
if (hImageList)
TreeView_SetImageList(hwndTreeView, hImageList, 0); TreeView_SetImageList(hwndTreeView, hImageList, 0);
/* We want to call InsertTreeViewItem down the code, in order to insert if (_ILIsDesktop (root)) {
* the root item of the treeview. Due to InsertTreeViewItem's signature, hr = SHGetDesktopFolder(&lpsf);
* we need the following to do this:
*
* + An ITEMIDLIST corresponding to _the parent_ of root.
* + An ITEMIDLIST, which is a relative path from root's parent to root
* (containing a single SHITEMID).
* + An IShellFolder interface pointer of root's parent folder.
*
* If root is 'Desktop', then root's parent is also 'Desktop'.
*/
pidlParent = ILClone(root);
ILRemoveLastID(pidlParent);
pidlChild = ILClone(ILFindLastID(root));
if (_ILIsDesktop(pidlParent)) {
hr = SHGetDesktopFolder(&lpsfParent);
} else { } else {
IShellFolder *lpsfDesktop; IShellFolder * lpsfdesktop;
hr = SHGetDesktopFolder(&lpsfDesktop);
if (!SUCCEEDED(hr)) { hr = SHGetDesktopFolder(&lpsfdesktop);
WARN("SHGetDesktopFolder failed! hr = %08lx\n", hr); if (SUCCEEDED(hr)) {
return; hr = IShellFolder_BindToObject(lpsfdesktop, parentofroot, 0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf);
IShellFolder_Release(lpsfdesktop);
}
}
if (SUCCEEDED(hr))
{
IShellFolder * pSFRoot;
if (_ILIsPidlSimple(root))
{
pSFRoot = lpsf;
IShellFolder_AddRef(pSFRoot);
}
else
hr = IShellFolder_BindToObject(lpsf,ILFindLastID(root),0,&IID_IShellFolder,(LPVOID *)&pSFRoot);
if (SUCCEEDED(hr))
{
hr = IShellFolder_EnumObjects(
pSFRoot,
hwndParent,
BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags),
&pEnumIL);
IShellFolder_Release(pSFRoot);
} }
hr = IShellFolder_BindToObject(lpsfDesktop, pidlParent, 0, &IID_IShellFolder, (LPVOID*)&lpsfParent);
IShellFolder_Release(lpsfDesktop);
}
if (!SUCCEEDED(hr)) {
WARN("Could not bind to parent shell folder! hr = %08lx\n", hr);
return;
}
if (pidlChild && pidlChild->mkid.cb) {
hr = IShellFolder_BindToObject(lpsfParent, pidlChild, 0, &IID_IShellFolder, (LPVOID*)&lpsfRoot);
} else {
lpsfRoot = lpsfParent;
hr = IShellFolder_AddRef(lpsfParent);
}
if (!SUCCEEDED(hr)) {
WARN("Could not bind to root shell folder! hr = %08lx\n", hr);
IShellFolder_Release(lpsfParent);
return;
}
hr = IShellFolder_EnumObjects(lpsfRoot, hwndParent, BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags), &pEnumChildren);
if (!SUCCEEDED(hr)) {
WARN("Could not get child iterator! hr = %08lx\n", hr);
IShellFolder_Release(lpsfParent);
IShellFolder_Release(lpsfRoot);
return;
} }
if (SUCCEEDED(hr) && hwndTreeView)
{
TreeView_DeleteAllItems(hwndTreeView); TreeView_DeleteAllItems(hwndTreeView);
TreeView_Expand(hwndTreeView, InsertTreeViewItem(lpsfParent, pidlChild, pidlParent, pEnumChildren, TVI_ROOT), TVE_EXPAND); TreeView_Expand(hwndTreeView,
InsertTreeViewItem(lpsf, _ILIsPidlSimple(root) ? root : ILFindLastID(root), parentofroot, pEnumIL, TVI_ROOT),
TVE_EXPAND);
}
IShellFolder_Release(lpsfRoot); if (SUCCEEDED(hr))
IShellFolder_Release(lpsfParent); IShellFolder_Release(lpsf);
TRACE("done\n");
} }
static int GetIcon(LPITEMIDLIST lpi, UINT uFlags) static int GetIcon(LPITEMIDLIST lpi, UINT uFlags)
@ -176,27 +149,12 @@ static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
typedef struct tagID typedef struct tagID
{ {
LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */ LPSHELLFOLDER lpsfParent;
LPITEMIDLIST lpi; /* PIDL relativ to parent */ LPITEMIDLIST lpi;
LPITEMIDLIST lpifq; /* Fully qualified PIDL */ LPITEMIDLIST lpifq;
IEnumIDList* pEnumIL; /* Children iterator */ IEnumIDList* pEnumIL;
} TV_ITEMDATA, *LPTV_ITEMDATA; } TV_ITEMDATA, *LPTV_ITEMDATA;
/******************************************************************************
* GetName [Internal]
*
* Query a shell folder for the display name of one of it's children
*
* PARAMS
* lpsf [I] IShellFolder interface of the folder to be queried.
* lpi [I] ITEMIDLIST of the child, relative to parent
* dwFlags [I] as in IShellFolder::GetDisplayNameOf
* lpFriendlyName [O] The desired display name in unicode
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName) static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
{ {
BOOL bSuccess=TRUE; BOOL bSuccess=TRUE;
@ -217,22 +175,7 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR
return bSuccess; return bSuccess;
} }
/****************************************************************************** static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent)
* InsertTreeViewItem [Internal]
*
* PARAMS
* lpsf [I] IShellFolder interface of the item's parent shell folder
* pidl [I] ITEMIDLIST of the child to insert, relativ to parent
* pidlParent [I] ITEMIDLIST of the parent shell folder
* pEnumIL [I] Iterator for the children of the item to be inserted
* hParent [I] The treeview-item that represents the parent shell folder
*
* RETURNS
* Success: Handle to the created and inserted treeview-item
* Failure: NULL
*/
static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl,
LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent)
{ {
TVITEMW tvi; TVITEMW tvi;
TVINSERTSTRUCTW tvins; TVINSERTSTRUCTW tvins;
@ -268,18 +211,6 @@ static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl,
return (HTREEITEM)TreeView_InsertItemW(hwndTreeView, &tvins); return (HTREEITEM)TreeView_InsertItemW(hwndTreeView, &tvins);
} }
/******************************************************************************
* FillTreeView [Internal]
*
* For each child (given by lpe) of the parent shell folder, which is given by
* lpsf and whose PIDL is pidl, insert a treeview-item right under hParent
*
* PARAMS
* lpsf [I] IShellFolder interface of the parent shell folder
* pidl [I] ITEMIDLIST of the parent shell folder
* hParent [I] The treeview item that represents the parent shell folder
* lpe [I] An iterator for the children of the parent shell folder
*/
static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent, IEnumIDList* lpe) static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent, IEnumIDList* lpe)
{ {
HTREEITEM hPrev = 0; HTREEITEM hPrev = 0;
@ -288,11 +219,7 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar
HRESULT hr; HRESULT hr;
HWND hwnd=GetParent(hwndTreeView); HWND hwnd=GetParent(hwndTreeView);
TRACE("%p %p %x %p\n",lpsf, pidl, (INT)hParent, lpe); TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
/* No IEnumIDList -> No children */
if (!lpe) return;
SetCapture(GetParent(hwndTreeView)); SetCapture(GetParent(hwndTreeView));
SetCursor(LoadCursorA(0, (LPSTR)IDC_WAIT)); SetCursor(LoadCursorA(0, (LPSTR)IDC_WAIT));

View file

@ -116,7 +116,7 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL b
BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
{ {
static const WCHAR swShell[] = {'s','h','e','l','l','\\',0}; static const WCHAR swShell[] = {'\\','s','h','e','l','l','\\',0};
static const WCHAR swCommand[] = {'\\','c','o','m','m','a','n','d',0}; static const WCHAR swCommand[] = {'\\','c','o','m','m','a','n','d',0};
BOOL ret = FALSE; BOOL ret = FALSE;

View file

@ -26,7 +26,7 @@
* - a right mousebutton-copy sets the following formats: * - a right mousebutton-copy sets the following formats:
* classic: * classic:
* Shell IDList Array * Shell IDList Array
* Preferred Drop Effect * Prefered Drop Effect
* Shell Object Offsets * Shell Object Offsets
* HDROP * HDROP
* FileName * FileName

View file

@ -127,9 +127,9 @@ INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
case WM_INITDIALOG : case WM_INITDIALOG :
prfdp = (RUNFILEDLGPARAMS *)lParam ; prfdp = (RUNFILEDLGPARAMS *)lParam ;
SetWindowTextA (hwnd, prfdp->lpstrTitle) ; SetWindowTextA (hwnd, prfdp->lpstrTitle) ;
SetClassLongPtrW (hwnd, GCLP_HICON, (LPARAM)prfdp->hIcon) ; SetClassLongA (hwnd, GCL_HICON, (LPARAM)prfdp->hIcon) ;
SendMessageW (GetDlgItem (hwnd, 12297), STM_SETICON, SendMessageA (GetDlgItem (hwnd, 12297), STM_SETICON,
(WPARAM)LoadIconW (NULL, (LPCWSTR)IDI_WINLOGO), 0); (WPARAM)LoadIconA (NULL, (LPSTR)IDI_WINLOGO), 0);
FillList (GetDlgItem (hwnd, 12298), NULL) ; FillList (GetDlgItem (hwnd, 12298), NULL) ;
SetFocus (GetDlgItem (hwnd, 12298)) ; SetFocus (GetDlgItem (hwnd, 12298)) ;
return TRUE ; return TRUE ;
@ -283,7 +283,7 @@ void FillList (HWND hCb, char *pszLatest)
if (NULL != pszLatest) if (NULL != pszLatest)
{ {
if (!lstrcmpiA(pszCmd, pszLatest)) if (!strcasecmp (pszCmd, pszLatest))
{ {
/* /*
sprintf (szDbgMsg, "Found existing (%d).\n", Nix) ; sprintf (szDbgMsg, "Found existing (%d).\n", Nix) ;

View file

@ -25,7 +25,6 @@
#define COBJMACROS #define COBJMACROS
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winreg.h" #include "winreg.h"
@ -104,27 +103,24 @@ BOOL AddToEnumList(
*/ */
BOOL CreateFolderEnumList( BOOL CreateFolderEnumList(
IEnumIDList *list, IEnumIDList *list,
LPCWSTR lpszPath, LPCSTR lpszPath,
DWORD dwFlags) DWORD dwFlags)
{ {
LPITEMIDLIST pidl=NULL; LPITEMIDLIST pidl=NULL;
WIN32_FIND_DATAW stffile; WIN32_FIND_DATAA stffile;
HANDLE hFile; HANDLE hFile;
WCHAR szPath[MAX_PATH]; CHAR szPath[MAX_PATH];
BOOL succeeded = TRUE; BOOL succeeded = TRUE;
const static WCHAR stars[] = { '*','.','*',0 };
const static WCHAR dot[] = { '.',0 };
const static WCHAR dotdot[] = { '.','.',0 };
TRACE("(%p)->(path=%s flags=0x%08lx) \n",list,debugstr_w(lpszPath),dwFlags); TRACE("(%p)->(path=%s flags=0x%08lx) \n",list,debugstr_a(lpszPath),dwFlags);
if(!lpszPath || !lpszPath[0]) return FALSE; if(!lpszPath || !lpszPath[0]) return FALSE;
strcpyW(szPath, lpszPath); strcpy(szPath, lpszPath);
PathAddBackslashW(szPath); PathAddBackslashA(szPath);
strcatW(szPath,stars); strcat(szPath,"*.*");
hFile = FindFirstFileW(szPath,&stffile); hFile = FindFirstFileA(szPath,&stffile);
if ( hFile != INVALID_HANDLE_VALUE ) if ( hFile != INVALID_HANDLE_VALUE )
{ {
BOOL findFinished = FALSE; BOOL findFinished = FALSE;
@ -136,21 +132,21 @@ BOOL CreateFolderEnumList(
{ {
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
dwFlags & SHCONTF_FOLDERS && dwFlags & SHCONTF_FOLDERS &&
strcmpW(stffile.cFileName, dot) && strcmpW(stffile.cFileName, dotdot)) strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, ".."))
{ {
pidl = _ILCreateFromFindDataW(&stffile); pidl = _ILCreateFromFindDataA(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl); succeeded = succeeded && AddToEnumList(list, pidl);
} }
else if (!(stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) else if (!(stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
&& dwFlags & SHCONTF_NONFOLDERS) && dwFlags & SHCONTF_NONFOLDERS)
{ {
pidl = _ILCreateFromFindDataW(&stffile); pidl = _ILCreateFromFindDataA(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl); succeeded = succeeded && AddToEnumList(list, pidl);
} }
} }
if (succeeded) if (succeeded)
{ {
if (!FindNextFileW(hFile, &stffile)) if (!FindNextFileA(hFile, &stffile))
{ {
if (GetLastError() == ERROR_NO_MORE_FILES) if (GetLastError() == ERROR_NO_MORE_FILES)
findFinished = TRUE; findFinished = TRUE;

View file

@ -25,6 +25,6 @@ BOOL AddToEnumList(IEnumIDList *list, LPITEMIDLIST pidl);
/* Enumerates the folders and/or files (depending on dwFlags) in lpszPath and /* Enumerates the folders and/or files (depending on dwFlags) in lpszPath and
* adds them to the already-created list. * adds them to the already-created list.
*/ */
BOOL CreateFolderEnumList(IEnumIDList *list, LPCWSTR lpszPath, DWORD dwFlags); BOOL CreateFolderEnumList(IEnumIDList *list, LPCSTR lpszPath, DWORD dwFlags);
#endif /* ndef __ENUMIDLIST_H__ */ #endif /* ndef __ENUMIDLIST_H__ */

View file

@ -328,7 +328,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
found = TRUE; found = TRUE;
} }
else if (!lstrcmpiA(sTemp, "lnkfile")) else if (!strcasecmp(sTemp, "lnkfile"))
{ {
/* extract icon from shell shortcut */ /* extract icon from shell shortcut */
IShellFolder* dsf; IShellFolder* dsf;

File diff suppressed because it is too large Load diff

View file

@ -208,14 +208,11 @@ LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid);
/* Like _ILCreateGuid, but using the string szGUID. */ /* Like _ILCreateGuid, but using the string szGUID. */
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID); LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID);
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID);
/* Commonly used PIDLs representing file system objects. */ /* Commonly used PIDLs representing file system objects. */
LPITEMIDLIST _ILCreateDesktop (void); LPITEMIDLIST _ILCreateDesktop (void);
LPITEMIDLIST _ILCreateFromFindDataA(WIN32_FIND_DATAA *stffile); LPITEMIDLIST _ILCreateFromFindDataA(WIN32_FIND_DATAA *stffile);
LPITEMIDLIST _ILCreateFromFindDataW(WIN32_FIND_DATAW *stffile);
HRESULT _ILCreateFromPathA (LPCSTR szPath, LPITEMIDLIST* ppidl); HRESULT _ILCreateFromPathA (LPCSTR szPath, LPITEMIDLIST* ppidl);
HRESULT _ILCreateFromPathW (LPCWSTR szPath, LPITEMIDLIST* ppidl);
/* Other helpers */ /* Other helpers */
LPITEMIDLIST _ILCreateMyComputer (void); LPITEMIDLIST _ILCreateMyComputer (void);

View file

@ -3,186 +3,193 @@
# win95 and winNT dlls import shell32.dll by ordinal) # win95 and winNT dlls import shell32.dll by ordinal)
# This list was updated to dll version 4.72 # This list was updated to dll version 4.72
2 stdcall -noname SHChangeNotifyRegister(long long long long long ptr) 2 stdcall SHChangeNotifyRegister(long long long long long ptr)
4 stdcall -noname SHChangeNotifyDeregister(long) 4 stdcall SHChangeNotifyDeregister (long)
5 stdcall -noname SHChangeNotifyUpdateEntryList(long long long long) 5 stdcall SHChangeNotifyUpdateEntryList (long long long long)
9 stub -noname PifMgr_OpenProperties 9 stub PifMgr_OpenProperties
10 stub -noname PifMgr_GetProperties 10 stub PifMgr_GetProperties
11 stub -noname PifMgr_SetProperties 11 stub PifMgr_SetProperties
13 stub -noname PifMgr_CloseProperties 13 stub PifMgr_CloseProperties
15 stdcall -noname ILGetDisplayName(ptr ptr) 15 stdcall ILGetDisplayName(ptr ptr)
16 stdcall -noname ILFindLastID(ptr) 16 stdcall ILFindLastID(ptr)
17 stdcall -noname ILRemoveLastID(ptr) 17 stdcall ILRemoveLastID(ptr)
18 stdcall -noname ILClone(ptr) 18 stdcall ILClone(ptr)
19 stdcall -noname ILCloneFirst(ptr) 19 stdcall ILCloneFirst (ptr)
20 stdcall -noname ILGlobalClone(ptr) 20 stdcall ILGlobalClone (ptr)
21 stdcall -noname ILIsEqual(ptr ptr) 21 stdcall ILIsEqual (ptr ptr)
23 stdcall -noname ILIsParent(ptr ptr long) 23 stdcall ILIsParent (ptr ptr long)
24 stdcall -noname ILFindChild(ptr ptr) 24 stdcall ILFindChild (ptr ptr)
25 stdcall -noname ILCombine(ptr ptr) 25 stdcall ILCombine(ptr ptr)
26 stdcall -noname ILLoadFromStream(ptr ptr) 26 stdcall ILLoadFromStream (ptr ptr)
27 stdcall -noname ILSaveToStream(ptr ptr) 27 stdcall ILSaveToStream(ptr ptr)
28 stdcall -noname SHILCreateFromPath(ptr ptr ptr) SHILCreateFromPathAW 28 stdcall SHILCreateFromPath(ptr ptr ptr) SHILCreateFromPathAW
29 stdcall -noname PathIsRoot(ptr) PathIsRootAW 29 stdcall PathIsRoot(ptr) PathIsRootAW
30 stdcall -noname PathBuildRoot(ptr long) PathBuildRootAW 30 stdcall PathBuildRoot(ptr long) PathBuildRootAW
31 stdcall -noname PathFindExtension(ptr) PathFindExtensionAW 31 stdcall PathFindExtension(ptr) PathFindExtensionAW
32 stdcall -noname PathAddBackslash(ptr) PathAddBackslashAW 32 stdcall PathAddBackslash(ptr) PathAddBackslashAW
33 stdcall -noname PathRemoveBlanks(ptr) PathRemoveBlanksAW 33 stdcall PathRemoveBlanks(ptr) PathRemoveBlanksAW
34 stdcall -noname PathFindFileName(ptr) PathFindFileNameAW 34 stdcall PathFindFileName(ptr) PathFindFileNameAW
35 stdcall -noname PathRemoveFileSpec(ptr) PathRemoveFileSpecAW 35 stdcall PathRemoveFileSpec(ptr) PathRemoveFileSpecAW
36 stdcall -noname PathAppend(ptr ptr) PathAppendAW 36 stdcall PathAppend(ptr ptr) PathAppendAW
37 stdcall -noname PathCombine(ptr ptr ptr) PathCombineAW 37 stdcall PathCombine(ptr ptr ptr) PathCombineAW
38 stdcall -noname PathStripPath(ptr)PathStripPathAW 38 stdcall PathStripPath(ptr)PathStripPathAW
39 stdcall -noname PathIsUNC(ptr) PathIsUNCAW 39 stdcall PathIsUNC (ptr) PathIsUNCAW
40 stdcall -noname PathIsRelative(ptr) PathIsRelativeAW 40 stdcall PathIsRelative (ptr) PathIsRelativeAW
41 stdcall -noname IsLFNDriveA(str) 41 stdcall IsLFNDriveA(str)
42 stdcall -noname IsLFNDriveW(wstr) 42 stdcall IsLFNDriveW(wstr)
43 stdcall -noname PathIsExe(ptr) PathIsExeAW 43 stdcall PathIsExe (ptr) PathIsExeAW
45 stdcall -noname PathFileExists(ptr) PathFileExistsAW 45 stdcall PathFileExists(ptr) PathFileExistsAW
46 stdcall -noname PathMatchSpec(ptr ptr) PathMatchSpecAW 46 stdcall PathMatchSpec (ptr ptr) PathMatchSpecAW
47 stdcall -noname PathMakeUniqueName(ptr long ptr ptr ptr)PathMakeUniqueNameAW 47 stdcall PathMakeUniqueName (ptr long ptr ptr ptr)PathMakeUniqueNameAW
48 stdcall -noname PathSetDlgItemPath(long long ptr) PathSetDlgItemPathAW 48 stdcall PathSetDlgItemPath (long long ptr) PathSetDlgItemPathAW
49 stdcall -noname PathQualify(ptr) PathQualifyAW 49 stdcall PathQualify (ptr) PathQualifyAW
50 stdcall -noname PathStripToRoot(ptr) PathStripToRootAW 50 stdcall PathStripToRoot (ptr) PathStripToRootAW
51 stdcall -noname PathResolve(str long long) PathResolveAW 51 stdcall PathResolve(str long long) PathResolveAW
52 stdcall -noname PathGetArgs(str) PathGetArgsAW 52 stdcall PathGetArgs(str) PathGetArgsAW
53 stdcall DoEnvironmentSubst (long long) DoEnvironmentSubstAW 53 stdcall DoEnvironmentSubst (long long) DoEnvironmentSubstAW
55 stdcall -noname PathQuoteSpaces(ptr) PathQuoteSpacesAW 54 stdcall DragAcceptFiles(long long)
56 stdcall -noname PathUnquoteSpaces(str) PathUnquoteSpacesAW 55 stdcall PathQuoteSpaces (ptr) PathQuoteSpacesAW
57 stdcall -noname PathGetDriveNumber(str) PathGetDriveNumberAW 56 stdcall PathUnquoteSpaces(str) PathUnquoteSpacesAW
58 stdcall -noname ParseField(str long ptr long) ParseFieldAW 57 stdcall PathGetDriveNumber (str) PathGetDriveNumberAW
59 stdcall -noname RestartDialog(long wstr long) 58 stdcall ParseField(str long ptr long) ParseFieldAW
60 stdcall -noname ExitWindowsDialog(long) 59 stdcall RestartDialog(long wstr long)
61 stdcall -noname RunFileDlg(long long long str str long) 60 stdcall ExitWindowsDialog(long)
62 stdcall -noname PickIconDlg(long long long long) 61 stdcall RunFileDlg(long long long str str long)
63 stdcall -noname GetFileNameFromBrowse(long long long long str str str) 62 stdcall PickIconDlg(long long long long)
64 stdcall -noname DriveType(long) 63 stdcall GetFileNameFromBrowse(long long long long str str str)
65 stub -noname InvalidateDriveType 64 stdcall DriveType (long)
66 stdcall -noname IsNetDrive(long) 65 stub InvalidateDriveType
67 stdcall -noname Shell_MergeMenus(long long long long long long) 66 stdcall IsNetDrive(long)
68 stdcall -noname SHGetSetSettings(ptr long long) 67 stdcall Shell_MergeMenus (long long long long long long)
69 stub -noname SHGetNetResource 68 stdcall SHGetSetSettings(ptr long long)
70 stdcall -noname SHCreateDefClassObject(long long long long long) 69 stub SHGetNetResource
71 stdcall -noname Shell_GetImageList(ptr ptr) 70 stdcall SHCreateDefClassObject(long long long long long)
72 stdcall -noname Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW 71 stdcall Shell_GetImageList(ptr ptr)
73 stdcall -noname SHShellFolderView_Message(long long long) 72 stdcall Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW
74 stdcall -noname SHCreateStdEnumFmtEtc(long ptr ptr) 73 stdcall SHShellFolderView_Message(long long long)
75 stdcall -noname PathYetAnotherMakeUniqueName(ptr wstr wstr wstr) 74 stdcall SHCreateStdEnumFmtEtc(long ptr ptr)
75 stdcall PathYetAnotherMakeUniqueName(ptr wstr wstr wstr)
76 stub DragQueryInfo 76 stub DragQueryInfo
77 stdcall -noname SHMapPIDLToSystemImageListIndex(ptr ptr ptr) 77 stdcall SHMapPIDLToSystemImageListIndex(ptr ptr ptr)
78 stdcall -noname OleStrToStrN(str long wstr long) OleStrToStrNAW 78 stdcall OleStrToStrN(str long wstr long) OleStrToStrNAW
79 stdcall -noname StrToOleStrN(wstr long str long) StrToOleStrNAW 79 stdcall StrToOleStrN(wstr long str long) StrToOleStrNAW
83 stdcall -noname CIDLData_CreateFromIDArray(ptr long ptr ptr) 80 stdcall DragFinish(long)
81 stdcall DragQueryFile(long long ptr long) DragQueryFileA
82 stdcall DragQueryFileA(long long ptr long)
83 stdcall CIDLData_CreateFromIDArray(ptr long ptr ptr)
84 stub SHIsBadInterfacePtr 84 stub SHIsBadInterfacePtr
85 stdcall -noname OpenRegStream(long str str long) shlwapi.SHOpenRegStreamA 85 stdcall OpenRegStream(long str str long) shlwapi.SHOpenRegStreamA
86 stdcall -noname SHRegisterDragDrop(long ptr) 86 stdcall SHRegisterDragDrop(long ptr)
87 stdcall -noname SHRevokeDragDrop(long) 87 stdcall SHRevokeDragDrop(long)
88 stdcall -noname SHDoDragDrop(long ptr ptr long ptr) 88 stdcall SHDoDragDrop(long ptr ptr long ptr)
89 stdcall -noname SHCloneSpecialIDList(long long long) 89 stdcall SHCloneSpecialIDList(long long long)
90 stdcall -noname SHFindFiles(ptr ptr) 90 stdcall SHFindFiles(ptr ptr)
91 stub SHFindComputer 91 stub SHFindComputer
92 stdcall -noname PathGetShortPath(ptr) PathGetShortPathAW 92 stdcall PathGetShortPath (ptr) PathGetShortPathAW
93 stdcall -noname Win32CreateDirectory(wstr ptr) Win32CreateDirectoryAW 93 stdcall Win32CreateDirectory(wstr ptr) Win32CreateDirectoryAW
94 stdcall -noname Win32RemoveDirectory(wstr) Win32RemoveDirectoryAW 94 stdcall Win32RemoveDirectory(wstr) Win32RemoveDirectoryAW
95 stdcall -noname SHLogILFromFSIL(ptr) 95 stdcall SHLogILFromFSIL (ptr)
96 stdcall -noname StrRetToStrN(ptr long ptr ptr) StrRetToStrNAW 96 stdcall StrRetToStrN (ptr long ptr ptr) StrRetToStrNAW
97 stdcall -noname SHWaitForFileToOpen (long long long) 97 stdcall SHWaitForFileToOpen (long long long)
98 stdcall -noname SHGetRealIDL(ptr ptr ptr) 98 stdcall SHGetRealIDL (ptr ptr ptr)
99 stdcall -noname SetAppStartingCursor(long long) 99 stdcall SetAppStartingCursor (long long)
100 stdcall -noname SHRestricted(long) 100 stdcall SHRestricted(long)
102 stdcall -noname SHCoCreateInstance(wstr ptr long ptr ptr) 102 stdcall SHCoCreateInstance(wstr ptr long ptr ptr)
103 stdcall -noname SignalFileOpen(long) 103 stdcall SignalFileOpen(long)
104 stdcall -noname FileMenu_DeleteAllItems(long) 104 stdcall FileMenu_DeleteAllItems(long)
105 stdcall -noname FileMenu_DrawItem(long ptr) 105 stdcall FileMenu_DrawItem(long ptr)
106 stdcall -noname FileMenu_FindSubMenuByPidl(long ptr) 106 stdcall FileMenu_FindSubMenuByPidl(long ptr)
107 stdcall -noname FileMenu_GetLastSelectedItemPidls(long ptr ptr) 107 stdcall FileMenu_GetLastSelectedItemPidls(long ptr ptr)
108 stdcall -noname FileMenu_HandleMenuChar(long long) 108 stdcall FileMenu_HandleMenuChar(long long)
109 stdcall -noname FileMenu_InitMenuPopup(long) 109 stdcall FileMenu_InitMenuPopup (long)
110 stdcall -noname FileMenu_InsertUsingPidl (long long ptr long long ptr) 110 stdcall FileMenu_InsertUsingPidl (long long ptr long long ptr)
111 stdcall -noname FileMenu_Invalidate(long) 111 stdcall FileMenu_Invalidate (long)
112 stdcall -noname FileMenu_MeasureItem(long ptr) 112 stdcall FileMenu_MeasureItem(long ptr)
113 stdcall -noname FileMenu_ReplaceUsingPidl(long long ptr long ptr) 113 stdcall FileMenu_ReplaceUsingPidl (long long ptr long ptr)
114 stdcall -noname FileMenu_Create(long long long long long) 114 stdcall FileMenu_Create (long long long long long)
115 stdcall -noname FileMenu_AppendItem(long ptr long long long long) FileMenu_AppendItemAW 115 stdcall FileMenu_AppendItem (long ptr long long long long) FileMenu_AppendItemAW
116 stdcall -noname FileMenu_TrackPopupMenuEx(long long long long long long) 116 stdcall FileMenu_TrackPopupMenuEx (long long long long long long)
117 stdcall -noname FileMenu_DeleteItemByCmd(long long) 117 stdcall FileMenu_DeleteItemByCmd(long long)
118 stdcall -noname FileMenu_Destroy(long) 118 stdcall FileMenu_Destroy (long)
119 stdcall -noname IsLFNDrive(ptr) IsLFNDriveAW 119 stdcall IsLFNDrive(ptr) IsLFNDriveAW
120 stdcall -noname FileMenu_AbortInitMenu() 120 stdcall FileMenu_AbortInitMenu ()
121 stdcall -noname SHFlushClipboard() 121 stdcall SHFlushClipboard ()
122 stdcall -noname RunDLL_CallEntry16(long long long str long) #name wrong? 122 stdcall -noname RunDLL_CallEntry16(long long long str long) #name wrong?
123 stdcall -noname SHFreeUnusedLibraries() 123 stdcall SHFreeUnusedLibraries ()
124 stdcall -noname FileMenu_AppendFilesForPidl(long ptr long) 124 stdcall FileMenu_AppendFilesForPidl(long ptr long)
125 stdcall -noname FileMenu_AddFilesForPidl(long long long ptr long long ptr) 125 stdcall FileMenu_AddFilesForPidl(long long long ptr long long ptr)
126 stdcall -noname SHOutOfMemoryMessageBox(long long long) 126 stdcall SHOutOfMemoryMessageBox (long long long)
127 stdcall -noname SHWinHelp(long long long long) 127 stdcall SHWinHelp (long long long long)
129 stdcall -noname DAD_AutoScroll(long ptr ptr) 128 stdcall -private DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
130 stdcall -noname DAD_DragEnter(long) 129 stdcall DAD_AutoScroll(long ptr ptr)
131 stdcall -noname DAD_DragEnterEx(long long long) 130 stdcall DAD_DragEnter(long)
132 stdcall -noname DAD_DragLeave() 131 stdcall DAD_DragEnterEx(long long long)
134 stdcall -noname DAD_DragMove(long long) 132 stdcall DAD_DragLeave()
136 stdcall -noname DAD_SetDragImage(long long) 133 stdcall DragQueryFileW(long long ptr long)
137 stdcall -noname DAD_ShowDragImage(long) 134 stdcall DAD_DragMove(long long)
135 stdcall DragQueryPoint(long ptr)
136 stdcall DAD_SetDragImage(long long)
137 stdcall DAD_ShowDragImage (long)
139 stub Desktop_UpdateBriefcaseOnEvent 139 stub Desktop_UpdateBriefcaseOnEvent
140 stdcall -noname FileMenu_DeleteItemByIndex(long long) 140 stdcall FileMenu_DeleteItemByIndex(long long)
141 stdcall -noname FileMenu_DeleteItemByFirstID(long long) 141 stdcall FileMenu_DeleteItemByFirstID(long long)
142 stdcall -noname FileMenu_DeleteSeparator(long) 142 stdcall FileMenu_DeleteSeparator(long)
143 stdcall -noname FileMenu_EnableItemByCmd(long long long) 143 stdcall FileMenu_EnableItemByCmd(long long long)
144 stdcall -noname FileMenu_GetItemExtent(long long) 144 stdcall FileMenu_GetItemExtent (long long)
145 stdcall -noname PathFindOnPath(ptr ptr) PathFindOnPathAW 145 stdcall PathFindOnPath (ptr ptr) PathFindOnPathAW
146 stdcall -noname RLBuildListOfPaths() 146 stdcall RLBuildListOfPaths()
147 stdcall -noname SHCLSIDFromString(long long) SHCLSIDFromStringAW 147 stdcall SHCLSIDFromString(long long) SHCLSIDFromStringAW
149 stdcall -noname SHFind_InitMenuPopup(long long long long) 149 stdcall SHFind_InitMenuPopup(long long long long)
151 stdcall -noname SHLoadOLE(long) 151 stdcall SHLoadOLE (long)
152 stdcall -noname ILGetSize(ptr) 152 stdcall ILGetSize(ptr)
153 stdcall -noname ILGetNext(ptr) 153 stdcall ILGetNext(ptr)
154 stdcall -noname ILAppend(long long long) 154 stdcall ILAppend (long long long)
155 stdcall -noname ILFree(ptr) 155 stdcall ILFree (ptr)
156 stdcall -noname ILGlobalFree(ptr) 156 stdcall ILGlobalFree (ptr)
157 stdcall -noname ILCreateFromPath(ptr) ILCreateFromPathAW 157 stdcall ILCreateFromPath (ptr) ILCreateFromPathAW
158 stdcall -noname PathGetExtension(str long long) PathGetExtensionAW 158 stdcall PathGetExtension(str long long) PathGetExtensionAW
159 stdcall -noname PathIsDirectory(ptr) PathIsDirectoryAW 159 stdcall PathIsDirectory(ptr)PathIsDirectoryAW
160 stub SHNetConnectionDialog 160 stub SHNetConnectionDialog
161 stdcall -noname SHRunControlPanel(long long) 161 stdcall SHRunControlPanel (long long)
162 stdcall -noname SHSimpleIDListFromPath(ptr) SHSimpleIDListFromPathAW 162 stdcall SHSimpleIDListFromPath (ptr) SHSimpleIDListFromPathAW
163 stdcall -noname StrToOleStr(wstr str) StrToOleStrAW 163 stdcall StrToOleStr (wstr str) StrToOleStrAW
164 stdcall -noname Win32DeleteFile(str) Win32DeleteFileAW 164 stdcall Win32DeleteFile(str) Win32DeleteFileAW
165 stdcall -noname SHCreateDirectory(long ptr) 165 stdcall SHCreateDirectory(long ptr)
166 stdcall -noname CallCPLEntry16(long long long long long long) 166 stdcall CallCPLEntry16(long long long long long long)
167 stdcall -noname SHAddFromPropSheetExtArray(long long long) 167 stdcall SHAddFromPropSheetExtArray(long long long)
168 stdcall -noname SHCreatePropSheetExtArray(long str long) 168 stdcall SHCreatePropSheetExtArray(long str long)
169 stdcall -noname SHDestroyPropSheetExtArray(long) 169 stdcall SHDestroyPropSheetExtArray(long)
170 stdcall -noname SHReplaceFromPropSheetExtArray(long long long long) 170 stdcall SHReplaceFromPropSheetExtArray(long long long long)
171 stdcall -noname PathCleanupSpec(ptr ptr) 171 stdcall PathCleanupSpec(ptr ptr)
172 stdcall -noname SHCreateLinks(long str ptr long ptr) 172 stdcall SHCreateLinks(long str ptr long ptr)
173 stdcall -noname SHValidateUNC(long long long) 173 stdcall SHValidateUNC(long long long)
174 stdcall -noname SHCreateShellFolderViewEx(ptr ptr) 174 stdcall SHCreateShellFolderViewEx (ptr ptr)
175 stdcall -noname SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW 175 stdcall SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW
176 stdcall -noname SHSetInstanceExplorer(long) 176 stdcall SHSetInstanceExplorer (long)
177 stub DAD_SetDragImageFromListView 177 stub DAD_SetDragImageFromListView
178 stdcall -noname SHObjectProperties(long long wstr wstr) 178 stdcall SHObjectProperties(long long wstr wstr)
179 stdcall -noname SHGetNewLinkInfoA(str str ptr long long) 179 stdcall SHGetNewLinkInfoA(str str ptr long long)
180 stdcall -noname SHGetNewLinkInfoW(wstr wstr ptr long long) 180 stdcall SHGetNewLinkInfoW(wstr wstr ptr long long)
181 stdcall -noname RegisterShellHook(long long) 181 stdcall RegisterShellHook(long long)
182 varargs -noname ShellMessageBoxW(long long long str long) 182 varargs ShellMessageBoxW(long long long str long)
183 varargs -noname ShellMessageBoxA(long long long str long) 183 varargs ShellMessageBoxA(long long long str long)
184 stdcall -noname ArrangeWindows(long long long long long) 184 stdcall ArrangeWindows(long long long long long)
185 stub SHHandleDiskFull 185 stub SHHandleDiskFull
186 stdcall -noname ILGetDisplayNameEx(ptr ptr ptr long) 186 stdcall ILGetDisplayNameEx(ptr ptr ptr long)
187 stub ILGetPseudoNameW 187 stub ILGetPseudoNameW
188 stdcall -noname ShellDDEInit(long) 188 stdcall ShellDDEInit(long)
189 stdcall -noname ILCreateFromPathA(str) 189 stdcall ILCreateFromPathA(str)
190 stdcall -noname ILCreateFromPathW(wstr) 190 stdcall ILCreateFromPathW(wstr)
191 stdcall -noname SHUpdateImageA(str long long long) 191 stdcall SHUpdateImageA(str long long long)
192 stdcall -noname SHUpdateImageW(wstr long long long) 192 stdcall SHUpdateImageW(wstr long long long)
193 stdcall -noname SHHandleUpdateImage(ptr) 193 stdcall SHHandleUpdateImage(ptr)
194 stub SHCreatePropSheetExtArrayEx 194 stub SHCreatePropSheetExtArrayEx
195 stdcall -noname SHFree(ptr) 195 stdcall SHFree(ptr)
196 stdcall -noname SHAlloc(long) 196 stdcall SHAlloc(long)
197 stub SHGlobalDefect 197 stub SHGlobalDefect
198 stdcall -noname SHAbortInvokeCommand() 198 stdcall SHAbortInvokeCommand ()
199 stub SHGetFileIcon 199 stub SHGetFileIcon
200 stub SHLocalAlloc 200 stub SHLocalAlloc
201 stub SHLocalFree 201 stub SHLocalFree
@ -199,15 +206,72 @@
212 stub Printers_AddPrinterPropPages 212 stub Printers_AddPrinterPropPages
213 stub Printers_RegisterWindowW 213 stub Printers_RegisterWindowW
214 stub Printers_UnregisterWindow 214 stub Printers_UnregisterWindow
215 stdcall -noname SHStartNetConnectionDialog(long str long) 215 stdcall SHStartNetConnectionDialog(long str long)
243 stdcall @(long long) shell32_243 243 stdcall @(long long) shell32_243
244 stdcall -noname SHInitRestricted(ptr ptr) 244 stdcall SHInitRestricted(ptr ptr)
249 stdcall -noname PathParseIconLocation(ptr) PathParseIconLocationAW 247 stdcall SHGetDataFromIDListA (ptr ptr long ptr long)
250 stdcall -noname PathRemoveExtension(ptr) PathRemoveExtensionAW 248 stdcall SHGetDataFromIDListW (ptr ptr long ptr long)
251 stdcall -noname PathRemoveArgs(ptr) PathRemoveArgsAW 249 stdcall PathParseIconLocation (ptr) PathParseIconLocationAW
250 stdcall PathRemoveExtension (ptr) PathRemoveExtensionAW
251 stdcall PathRemoveArgs (ptr) PathRemoveArgsAW
256 stdcall @(ptr ptr) SHELL32_256 256 stdcall @(ptr ptr) SHELL32_256
271 stub SheChangeDirA
272 stub SheChangeDirExA
273 stub SheChangeDirExW
274 stdcall SheChangeDirW(wstr)
275 stub SheConvertPathW
276 stub SheFullPathA
277 stub SheFullPathW
278 stub SheGetCurDrive
279 stub SheGetDirA
280 stub SheGetDirExW
281 stdcall SheGetDirW (long long)
282 stub SheGetPathOffsetW
283 stub SheRemoveQuotesA
284 stub SheRemoveQuotesW
285 stub SheSetCurDrive
286 stub SheShortenPathA
287 stub SheShortenPathW
288 stdcall ShellAboutA(long str str long)
289 stdcall ShellAboutW(long wstr wstr long)
290 stdcall ShellExecuteA(long str str str str long)
291 stdcall ShellExecuteEx (long) ShellExecuteExA
292 stdcall ShellExecuteExA (long)
293 stdcall ShellExecuteExW (long)
294 stdcall ShellExecuteW (long wstr wstr wstr wstr long)
296 stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA
297 stdcall Shell_NotifyIconA(long ptr)
298 stdcall Shell_NotifyIconW(long ptr)
#299 stub Shl1632_ThunkData32 #299 stub Shl1632_ThunkData32
#300 stub Shl3216_ThunkData32 #300 stub Shl3216_ThunkData32
301 stdcall StrChrA(str long) shlwapi.StrChrA
302 stdcall StrChrIA(str long) shlwapi.StrChrIA
303 stdcall StrChrIW(wstr long) shlwapi.StrChrIW
304 stdcall StrChrW(wstr long) shlwapi.StrChrW
305 stdcall StrCmpNA(str str long) shlwapi.StrCmpNA
306 stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA
307 stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW
308 stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW
309 stdcall StrCpyNA (ptr str long) lstrcpynA
310 stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW
311 stdcall StrNCmpA(str str long) shlwapi.StrCmpNA
312 stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA
313 stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW
314 stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW
315 stdcall StrNCpyA (ptr str long) lstrcpynA
316 stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW
317 stdcall StrRChrA(str str long) shlwapi.StrRChrA
318 stdcall StrRChrIA(str str long) shlwapi.StrRChrIA
319 stdcall StrRChrIW(str str long) shlwapi.StrRChrIW
320 stdcall StrRChrW(wstr wstr long) shlwapi.StrRChrW
321 stub StrRStrA
322 stdcall StrRStrIA(str str str) shlwapi.StrRStrIA
323 stdcall StrRStrIW(wstr wstr wstr) shlwapi.StrRStrIW
324 stub StrRStrW
325 stdcall StrStrA(str str) shlwapi.StrStrA
326 stdcall StrStrIA(str str) shlwapi.StrStrIA
327 stdcall StrStrIW(wstr wstr) shlwapi.StrStrIW
328 stdcall StrStrW(wstr wstr) shlwapi.StrStrW
505 stdcall SHRegCloseKey (long) 505 stdcall SHRegCloseKey (long)
506 stdcall SHRegOpenKeyA (long str long) 506 stdcall SHRegOpenKeyA (long str long)
@ -222,34 +286,34 @@
521 stdcall -noname SHLockShared (long long) 521 stdcall -noname SHLockShared (long long)
522 stdcall -noname SHUnlockShared (ptr) 522 stdcall -noname SHUnlockShared (ptr)
523 stdcall -noname SHFreeShared (long long) 523 stdcall -noname SHFreeShared (long long)
524 stdcall -noname RealDriveType(long long) 524 stdcall RealDriveType (long long)
525 stub RealDriveTypeFlags 525 stub RealDriveTypeFlags
640 stdcall -noname NTSHChangeNotifyRegister(long long long long long long) 640 stdcall NTSHChangeNotifyRegister (long long long long long long)
641 stdcall -noname NTSHChangeNotifyDeregister(long) 641 stdcall NTSHChangeNotifyDeregister (long)
643 stub SHChangeNotifyReceive 643 stub SHChangeNotifyReceive
644 stdcall -noname SHChangeNotification_Lock(long long ptr ptr) 644 stdcall SHChangeNotification_Lock(long long ptr ptr)
645 stdcall -noname SHChangeNotification_Unlock(long) 645 stdcall SHChangeNotification_Unlock(long)
646 stub SHChangeRegistrationReceive 646 stub SHChangeRegistrationReceive
647 stub ReceiveAddToRecentDocs 647 stub ReceiveAddToRecentDocs
648 stub SHWaitOp_Operate 648 stub SHWaitOp_Operate
650 stdcall -noname PathIsSameRoot(ptr ptr) PathIsSameRootAW 650 stdcall PathIsSameRoot(ptr ptr)PathIsSameRootAW
# nt40/win98 # nt40/win98
651 stdcall -noname ReadCabinetState(long long) # OldReadCabinetState 651 stdcall ReadCabinetState (long long) # OldReadCabinetState
652 stdcall -noname WriteCabinetState(long) 652 stdcall WriteCabinetState (long)
653 stdcall -noname PathProcessCommand(long long long long) PathProcessCommandAW 653 stdcall PathProcessCommand (long long long long) PathProcessCommandAW
# win98 # win98
654 stdcall @(long long)shell32_654 # ReadCabinetState@8 654 stdcall @(long long)shell32_654 # ReadCabinetState@8
660 stdcall -noname FileIconInit(long) 660 stdcall FileIconInit(long)
680 stdcall -noname IsUserAdmin() 680 stdcall IsUserAdmin()
# >= NT5 # >= NT5
714 stdcall @(ptr)SHELL32_714 # PathIsTemporaryW 714 stdcall @(ptr)SHELL32_714 # PathIsTemporaryW
730 stdcall -noname RestartDialogEx(long wstr long long) 730 stdcall RestartDialogEx(long wstr long long)
1217 stub FOOBAR1217 # no joke! This is the real name!! 1217 stub FOOBAR1217 # no joke! This is the real name!!
@ -265,22 +329,14 @@
@ stdcall Control_FillCache_RunDLLW(long long long long) @ stdcall Control_FillCache_RunDLLW(long long long long)
@ stdcall Control_RunDLL(ptr ptr str long) Control_RunDLLA @ stdcall Control_RunDLL(ptr ptr str long) Control_RunDLLA
@ stdcall Control_RunDLLA(ptr ptr str long) @ stdcall Control_RunDLLA(ptr ptr str long)
@ stub Control_RunDLLAsUserW
@ stdcall Control_RunDLLW(ptr ptr wstr long) @ stdcall Control_RunDLLW(ptr ptr wstr long)
@ stdcall -private DllCanUnloadNow() SHELL32_DllCanUnloadNow @ stdcall -private DllCanUnloadNow() SHELL32_DllCanUnloadNow
@ stdcall -private DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
@ stdcall DllInstall(long wstr)SHELL32_DllInstall @ stdcall DllInstall(long wstr)SHELL32_DllInstall
@ stdcall -private DllRegisterServer() SHELL32_DllRegisterServer @ stdcall -private DllRegisterServer() SHELL32_DllRegisterServer
@ stdcall -private DllUnregisterServer() SHELL32_DllUnregisterServer @ stdcall -private DllUnregisterServer() SHELL32_DllUnregisterServer
@ stdcall DoEnvironmentSubstA(str str) @ stdcall DoEnvironmentSubstA(str str)
@ stdcall DoEnvironmentSubstW(wstr wstr) @ stdcall DoEnvironmentSubstW(wstr wstr)
@ stdcall DragAcceptFiles(long long)
@ stdcall DragFinish(long)
@ stdcall DragQueryFile(long long ptr long) DragQueryFileA
@ stdcall DragQueryFileA(long long ptr long)
@ stub DragQueryFileAorW @ stub DragQueryFileAorW
@ stdcall DragQueryFileW(long long ptr long)
@ stdcall DragQueryPoint(long ptr)
@ stdcall DuplicateIcon(long long) @ stdcall DuplicateIcon(long long)
@ stdcall ExtractAssociatedIconA(long str ptr) @ stdcall ExtractAssociatedIconA(long str ptr)
@ stdcall ExtractAssociatedIconExA(long str long long) @ stdcall ExtractAssociatedIconExA(long str long long)
@ -297,11 +353,9 @@
@ stub FindExeDlgProc @ stub FindExeDlgProc
@ stdcall FindExecutableA(ptr ptr ptr) @ stdcall FindExecutableA(ptr ptr ptr)
@ stdcall FindExecutableW(wstr wstr wstr) @ stdcall FindExecutableW(wstr wstr wstr)
@ stub FixupOptionalComponents
@ stdcall FreeIconList(long) @ stdcall FreeIconList(long)
@ stub InternalExtractIconListA @ stub InternalExtractIconListA
@ stub InternalExtractIconListW @ stub InternalExtractIconListW
@ stub OCInstall
@ stub OpenAs_RunDLL @ stub OpenAs_RunDLL
@ stub OpenAs_RunDLLA @ stub OpenAs_RunDLLA
@ stub OpenAs_RunDLLW @ stub OpenAs_RunDLLW
@ -319,48 +373,16 @@
@ stdcall SHBrowseForFolderA(ptr) @ stdcall SHBrowseForFolderA(ptr)
@ stdcall SHBrowseForFolderW(ptr) @ stdcall SHBrowseForFolderW(ptr)
@ stdcall SHChangeNotify (long long ptr ptr) @ stdcall SHChangeNotify (long long ptr ptr)
@ stub SHChangeNotifySuspendResume
@ stdcall SHCreateDirectoryExA(long str ptr) @ stdcall SHCreateDirectoryExA(long str ptr)
@ stdcall SHCreateDirectoryExW(long wstr ptr) @ stdcall SHCreateDirectoryExW(long wstr ptr)
@ stub SHCreateProcessAsUserW
@ stdcall SheChangeDirA(str)
@ stub SheChangeDirExA
@ stub SheChangeDirExW
@ stdcall SheChangeDirW(wstr)
@ stub SheConvertPathW
@ stub SheFullPathA
@ stub SheFullPathW
@ stub SheGetCurDrive
@ stdcall SheGetDirA(long long)
@ stub SheGetDirExW
@ stdcall SheGetDirW (long long)
@ stub SheGetPathOffsetW
@ stdcall ShellAboutA(long str str long)
@ stdcall ShellAboutW(long wstr wstr long)
@ stdcall ShellExecuteA(long str str str str long)
@ stdcall ShellExecuteEx (long) ShellExecuteExA
@ stdcall ShellExecuteExA (long)
@ stdcall ShellExecuteExW (long)
@ stdcall ShellExecuteW (long wstr wstr wstr wstr long)
@ stub ShellHookProc @ stub ShellHookProc
@ stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA
@ stdcall Shell_NotifyIconA(long ptr)
@ stdcall Shell_NotifyIconW(long ptr)
@ stdcall SHEmptyRecycleBinA(long str long) @ stdcall SHEmptyRecycleBinA(long str long)
@ stdcall SHEmptyRecycleBinW(long wstr long) @ stdcall SHEmptyRecycleBinW(long wstr long)
@ stub SheRemoveQuotesA
@ stub SheRemoveQuotesW
@ stub SheSetCurDrive
@ stub SheShortenPathA
@ stub SheShortenPathW
@ stub SHExtractIconsW
@ stdcall SHFileOperation(ptr) SHFileOperationA @ stdcall SHFileOperation(ptr) SHFileOperationA
@ stdcall SHFileOperationA(ptr) @ stdcall SHFileOperationA(ptr)
@ stdcall SHFileOperationW(ptr) @ stdcall SHFileOperationW(ptr)
@ stdcall SHFormatDrive(long long long long) @ stdcall SHFormatDrive(long long long long)
@ stdcall SHFreeNameMappings(ptr) @ stdcall SHFreeNameMappings(ptr)
@ stdcall SHGetDataFromIDListA(ptr ptr long ptr long)
@ stdcall SHGetDataFromIDListW(ptr ptr long ptr long)
@ stdcall SHGetDesktopFolder(ptr) @ stdcall SHGetDesktopFolder(ptr)
@ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoA @ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoA
@ stdcall SHGetFileInfoA(ptr long ptr long long) @ stdcall SHGetFileInfoA(ptr long ptr long long)
@ -373,47 +395,13 @@
@ stdcall SHGetPathFromIDListW(ptr ptr) @ stdcall SHGetPathFromIDListW(ptr ptr)
@ stdcall SHGetSettings(ptr long) @ stdcall SHGetSettings(ptr long)
@ stdcall SHGetSpecialFolderLocation(long long ptr) @ stdcall SHGetSpecialFolderLocation(long long ptr)
@ stdcall SHHelpShortcuts_RunDLL(long long long long) SHHelpShortcuts_RunDLLA @ stdcall SHHelpShortcuts_RunDLL(long long long long)
@ stdcall SHHelpShortcuts_RunDLLA(long long long long) @ stub SHHelpShortcuts_RunDLLA
@ stdcall SHHelpShortcuts_RunDLLW(long long long long) @ stub SHHelpShortcuts_RunDLLW
@ stub SHInvokePrinterCommandA
@ stub SHInvokePrinterCommandW
@ stub SHIsFileAvailableOffline
@ stdcall SHLoadInProc(long) @ stdcall SHLoadInProc(long)
@ stub SHLoadNonloadedIconOverlayIdentifiers
@ stub SHPathPrepareForWriteA
@ stub SHPathPrepareForWriteW
@ stdcall SHQueryRecycleBinA(str ptr) @ stdcall SHQueryRecycleBinA(str ptr)
@ stdcall SHQueryRecycleBinW(wstr ptr) @ stdcall SHQueryRecycleBinW(wstr ptr)
@ stub SHUpdateRecycleBinIcon @ stub SHUpdateRecycleBinIcon
@ stdcall StrChrA(str long) shlwapi.StrChrA
@ stdcall StrChrIA(str long) shlwapi.StrChrIA
@ stdcall StrChrIW(wstr long) shlwapi.StrChrIW
@ stdcall StrChrW(wstr long) shlwapi.StrChrW
@ stdcall StrCmpNA(str str long) shlwapi.StrCmpNA
@ stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA
@ stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW
@ stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW
@ stdcall StrCpyNA (ptr str long) kernel32.lstrcpynA
@ stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW
@ stdcall StrNCmpA(str str long) shlwapi.StrCmpNA
@ stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA
@ stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW
@ stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW
@ stdcall StrNCpyA (ptr str long) kernel32.lstrcpynA
@ stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW
@ stdcall StrRChrA(str str long) shlwapi.StrRChrA
@ stdcall StrRChrIA(str str long) shlwapi.StrRChrIA
@ stdcall StrRChrIW(str str long) shlwapi.StrRChrIW
@ stdcall StrRChrW(wstr wstr long) shlwapi.StrRChrW
@ stub StrRStrA
@ stdcall StrRStrIA(str str str) shlwapi.StrRStrIA
@ stdcall StrRStrIW(wstr wstr wstr) shlwapi.StrRStrIW
@ stub StrRStrW
@ stdcall StrStrA(str str) shlwapi.StrStrA
@ stdcall StrStrIA(str str) shlwapi.StrStrIA
@ stdcall StrStrIW(wstr wstr) shlwapi.StrStrIW
@ stdcall StrStrW(wstr wstr) shlwapi.StrStrW
@ stub WOWShellExecute @ stub WOWShellExecute
# #
@ -439,9 +427,6 @@
# version 5.00 (Win2K) # version 5.00 (Win2K)
# _WIN32_IE >= 0x0500 # _WIN32_IE >= 0x0500
# #
@ stub ShellExec_RunDLL
@ stub ShellExec_RunDLLA
@ stub ShellExec_RunDLLW
@ stdcall SHBindToParent(ptr ptr ptr ptr) @ stdcall SHBindToParent(ptr ptr ptr ptr)
@ stdcall SHGetDiskFreeSpaceA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA @ stdcall SHGetDiskFreeSpaceA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
@ stdcall SHGetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA @ stdcall SHGetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
@ -449,8 +434,6 @@
@ stdcall SHGetFolderPathA(long long long long ptr) @ stdcall SHGetFolderPathA(long long long long ptr)
@ stdcall SHGetFolderPathW(long long long long ptr) @ stdcall SHGetFolderPathW(long long long long ptr)
@ stdcall SHGetFolderLocation(long long long long ptr) @ stdcall SHGetFolderLocation(long long long long ptr)
@ stub SHGetIconOverlayIndexA
@ stub SHGetIconOverlayIndexW
# version 6.0 (WinXP) # version 6.0 (WinXP)
# _WIN32_IE >= 0x600 # _WIN32_IE >= 0x600

View file

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE MENU_001 MENU DISCARDABLE
BEGIN BEGIN

View file

@ -188,35 +188,3 @@ STRINGTABLE DISCARDABLE
IDS_SHUTDOWN_TITLE "Desligar" IDS_SHUTDOWN_TITLE "Desligar"
IDS_SHUTDOWN_PROMPT "Você quer finalizar a sessão no ReactOS?" IDS_SHUTDOWN_PROMPT "Você quer finalizar a sessão no ReactOS?"
} }
/* shell folder path default values - */
STRINGTABLE DISCARDABLE
{
IDS_PROGRAMS "Menu Iniciar\\Programas"
IDS_PERSONAL "Meus Documentos"
IDS_FAVORITES "Favoritos"
IDS_STARTUP "Menu Iniciar\\Programas\\Iniciar"
IDS_RECENT "Recent"
IDS_SENDTO "SendTo"
IDS_STARTMENU "Menu Iniciar"
IDS_MYMUSIC "Meus Documentos\\Minhas Músicas"
IDS_MYVIDEO "Meus Documentos\\Meus Vídeos"
IDS_DESKTOPDIRECTORY "Desktop"
IDS_NETHOOD "NetHood"
IDS_TEMPLATES "Templates"
IDS_APPDATA "Application Data"
IDS_PRINTHOOD "PrintHood"
IDS_LOCAL_APPDATA "Configurações locais\\Dados de aplicativos"
IDS_INTERNET_CACHE "Temporary Internet Files"
IDS_COOKIES "Cookies"
IDS_HISTORY "Histórico"
IDS_PROGRAM_FILES "Arquivos de programas"
IDS_MYPICTURES "Meus Documentos\\Minhas Imagens"
IDS_PROGRAM_FILES_COMMON "Arquivos de programas\\Arquivos comuns"
IDS_COMMON_DOCUMENTS "Documentos"
IDS_ADMINTOOLS "Menu Iniciar\\Programas\\Ferramentas Administrativas"
IDS_COMMON_MUSIC "Documentos\\Minhas Músicas"
IDS_COMMON_PICTURES "Documentos\\Minhas Imagens"
IDS_COMMON_VIDEO "Documentos\\Meus Vídeos"
IDS_CDBURN_AREA "Configurações locais\\Dados de aplicativos\\Microsoft\\CD Burning"
}

View file

@ -92,18 +92,15 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
LPWSTR cmdline; LPWSTR cmdline;
int in_quotes,bcount; int in_quotes,bcount;
if (*lpCmdline==0) if (*lpCmdline==0) {
{
/* Return the path to the executable */ /* Return the path to the executable */
DWORD len, size=16; DWORD len, size=16;
hargv=GlobalAlloc(size, 0); hargv=GlobalAlloc(size, 0);
argv=GlobalLock(hargv); argv=GlobalLock(hargv);
for (;;) for (;;) {
{
len = GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR)); len = GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR));
if (!len) if (!len) {
{
GlobalFree(hargv); GlobalFree(hargv);
return NULL; return NULL;
} }
@ -124,10 +121,8 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
bcount=0; bcount=0;
in_quotes=0; in_quotes=0;
cs=lpCmdline; cs=lpCmdline;
while (1) while (1) {
{ if (*cs==0 || ((*cs==0x0009 || *cs==0x0020) && !in_quotes)) {
if (*cs==0 || ((*cs==0x0009 || *cs==0x0020) && !in_quotes))
{
/* space */ /* space */
argc++; argc++;
/* skip the remaining spaces */ /* skip the remaining spaces */
@ -138,20 +133,14 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
break; break;
bcount=0; bcount=0;
continue; continue;
} } else if (*cs==0x005c) {
else if (*cs==0x005c)
{
/* '\', count them */ /* '\', count them */
bcount++; bcount++;
} } else if ((*cs==0x0022) && ((bcount & 1)==0)) {
else if ((*cs==0x0022) && ((bcount & 1)==0))
{
/* unescaped '"' */ /* unescaped '"' */
in_quotes=!in_quotes; in_quotes=!in_quotes;
bcount=0; bcount=0;
} } else {
else
{
/* a regular character */ /* a regular character */
bcount=0; bcount=0;
} }
@ -171,10 +160,8 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
bcount=0; bcount=0;
in_quotes=0; in_quotes=0;
arg=d=s=cmdline; arg=d=s=cmdline;
while (*s) while (*s) {
{ if ((*s==0x0009 || *s==0x0020) && !in_quotes) {
if ((*s==0x0009 || *s==0x0020) && !in_quotes)
{
/* Close the argument and copy it */ /* Close the argument and copy it */
*d=0; *d=0;
argv[argc++]=arg; argv[argc++]=arg;
@ -187,28 +174,21 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
/* Start with a new argument */ /* Start with a new argument */
arg=d=s; arg=d=s;
bcount=0; bcount=0;
} } else if (*s==0x005c) {
else if (*s==0x005c)
{
/* '\\' */ /* '\\' */
*d++=*s++; *d++=*s++;
bcount++; bcount++;
} } else if (*s==0x0022) {
else if (*s==0x0022)
{
/* '"' */ /* '"' */
if ((bcount & 1)==0) if ((bcount & 1)==0) {
{ /* Preceeded by an even number of '\', this is half that
/* Preceded by an even number of '\', this is half that
* number of '\', plus a quote which we erase. * number of '\', plus a quote which we erase.
*/ */
d-=bcount/2; d-=bcount/2;
in_quotes=!in_quotes; in_quotes=!in_quotes;
s++; s++;
} } else {
else /* Preceeded by an odd number of '\', this is half that
{
/* Preceded by an odd number of '\', this is half that
* number of '\' followed by a '"' * number of '\' followed by a '"'
*/ */
d=d-bcount/2-1; d=d-bcount/2-1;
@ -216,16 +196,13 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
s++; s++;
} }
bcount=0; bcount=0;
} } else {
else
{
/* a regular character */ /* a regular character */
*d++=*s++; *d++=*s++;
bcount=0; bcount=0;
} }
} }
if (*arg) if (*arg) {
{
*d='\0'; *d='\0';
argv[argc++]=arg; argv[argc++]=arg;
} }
@ -235,19 +212,14 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
return argv; return argv;
} }
#define SHGFI_KNOWN_FLAGS \
(SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \
SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \
SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \
SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \
SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED)
/************************************************************************* /*************************************************************************
* SHGetFileInfoW [SHELL32.@] * SHGetFileInfoA [SHELL32.@]
* *
*/ */
DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags ) SHFILEINFOW *psfi, UINT sizeofpsfi,
UINT flags )
{ {
WCHAR szLocation[MAX_PATH], szFullPath[MAX_PATH]; WCHAR szLocation[MAX_PATH], szFullPath[MAX_PATH];
int iIndex; int iIndex;
@ -258,38 +230,30 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
HRESULT hr = S_OK; HRESULT hr = S_OK;
BOOL IconNotYetLoaded=TRUE; BOOL IconNotYetLoaded=TRUE;
TRACE("%s fattr=0x%lx sfi=%p(attr=0x%08lx) size=0x%x flags=0x%x\n", TRACE("(%s fattr=0x%lx sfi=%p(attr=0x%08lx) size=0x%x flags=0x%x)\n",
(flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, psfi, psfi->dwAttributes, sizeofpsfi, flags);
psfi, psfi->dwAttributes, sizeofpsfi, flags);
if ( (flags & SHGFI_USEFILEATTRIBUTES) && if ((flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
(flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
return FALSE; return FALSE;
/* windows initializes this values regardless of the flags */ /* windows initializes this values regardless of the flags */
if (psfi != NULL) if (psfi != NULL) {
{
psfi->szDisplayName[0] = '\0'; psfi->szDisplayName[0] = '\0';
psfi->szTypeName[0] = '\0'; psfi->szTypeName[0] = '\0';
psfi->iIcon = 0; psfi->iIcon = 0;
} }
if (!(flags & SHGFI_PIDL)) if (!(flags & SHGFI_PIDL)){
{
/* SHGitFileInfo should work with absolute and relative paths */ /* SHGitFileInfo should work with absolute and relative paths */
if (PathIsRelativeW(path)) if (PathIsRelativeW(path)){
{
GetCurrentDirectoryW(MAX_PATH, szLocation); GetCurrentDirectoryW(MAX_PATH, szLocation);
PathCombineW(szFullPath, szLocation, path); PathCombineW(szFullPath, szLocation, path);
} } else {
else
{
lstrcpynW(szFullPath, path, MAX_PATH); lstrcpynW(szFullPath, path, MAX_PATH);
} }
} }
if (flags & SHGFI_EXETYPE) if (flags & SHGFI_EXETYPE) {
{
BOOL status = FALSE; BOOL status = FALSE;
HANDLE hfile; HANDLE hfile;
DWORD BinaryType; DWORD BinaryType;
@ -298,22 +262,18 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
DWORD len; DWORD len;
char magic[4]; char magic[4];
if (flags != SHGFI_EXETYPE) if (flags != SHGFI_EXETYPE) return 0;
return 0;
status = GetBinaryTypeW (szFullPath, &BinaryType); status = GetBinaryTypeW (szFullPath, &BinaryType);
if (!status) if (!status) return 0;
return 0; if ((BinaryType == SCS_DOS_BINARY)
if ((BinaryType == SCS_DOS_BINARY) || (BinaryType == SCS_PIF_BINARY)) || (BinaryType == SCS_PIF_BINARY)) return 0x4d5a;
return 0x4d5a;
hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ, hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, 0, 0 ); NULL, OPEN_EXISTING, 0, 0 );
if ( hfile == INVALID_HANDLE_VALUE ) if ( hfile == INVALID_HANDLE_VALUE ) return 0;
return 0;
/* /* The next section is adapted from MODULE_GetBinaryType, as we need
* The next section is adapted from MODULE_GetBinaryType, as we need
* to examine the image header to get OS and version information. We * to examine the image header to get OS and version information. We
* know from calling GetBinaryTypeA that the image is valid and either * know from calling GetBinaryTypeA that the image is valid and either
* an NE or PE, so much error handling can be omitted. * an NE or PE, so much error handling can be omitted.
@ -330,11 +290,10 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
CloseHandle( hfile ); CloseHandle( hfile );
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) {
{ return IMAGE_NT_SIGNATURE
return IMAGE_NT_SIGNATURE | | (nt.OptionalHeader.MajorSubsystemVersion << 24)
(nt.OptionalHeader.MajorSubsystemVersion << 24) | | (nt.OptionalHeader.MinorSubsystemVersion << 16);
(nt.OptionalHeader.MinorSubsystemVersion << 16);
} }
return IMAGE_NT_SIGNATURE; return IMAGE_NT_SIGNATURE;
} }
@ -344,47 +303,35 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
ReadFile( hfile, &ne, sizeof(ne), &len, NULL ); ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
CloseHandle( hfile ); CloseHandle( hfile );
if (ne.ne_exetyp == 2) if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE
return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16); | (ne.ne_expver << 16);
return 0; return 0;
} }
CloseHandle( hfile ); CloseHandle( hfile );
return 0; return 0;
} }
/* /* psfi is NULL normally to query EXE type. If it is NULL, none of the
* psfi is NULL normally to query EXE type. If it is NULL, none of the * below makes sense anyway. Windows allows this and just returns FALSE */
* below makes sense anyway. Windows allows this and just returns FALSE if (psfi == NULL) return FALSE;
*/
if (psfi == NULL)
return FALSE;
/* /* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
* is not specified. * is not specified.
* The pidl functions fail on not existing file names The pidl functions fail on not existing file names */
*/
if (flags & SHGFI_PIDL) if (flags & SHGFI_PIDL) {
{
pidl = ILClone((LPCITEMIDLIST)path); pidl = ILClone((LPCITEMIDLIST)path);
} } else if (!(flags & SHGFI_USEFILEATTRIBUTES)) {
else if (!(flags & SHGFI_USEFILEATTRIBUTES))
{
hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes); hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes);
} }
if ((flags & SHGFI_PIDL) || !(flags & SHGFI_USEFILEATTRIBUTES)) if ((flags & SHGFI_PIDL) || !(flags & SHGFI_USEFILEATTRIBUTES))
{ {
/* get the parent shellfolder */ /* get the parent shellfolder */
if (pidl) if (pidl) {
{ hr = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&pidlLast);
hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
(LPCITEMIDLIST*)&pidlLast );
ILFree(pidl); ILFree(pidl);
} } else {
else
{
ERR("pidl is null!\n"); ERR("pidl is null!\n");
return FALSE; return FALSE;
} }
@ -397,8 +344,7 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{ {
psfi->dwAttributes = 0xffffffff; psfi->dwAttributes = 0xffffffff;
} }
IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast, IShellFolder_GetAttributesOf(psfParent, 1, (LPCITEMIDLIST*)&pidlLast, &(psfi->dwAttributes));
&(psfi->dwAttributes) );
} }
/* get the displayname */ /* get the displayname */
@ -411,8 +357,7 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
else else
{ {
STRRET str; STRRET str;
hr = IShellFolder_GetDisplayNameOf( psfParent, pidlLast, hr = IShellFolder_GetDisplayNameOf(psfParent, pidlLast, SHGDN_INFOLDER, &str);
SHGDN_INFOLDER, &str);
StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast); StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast);
} }
} }
@ -422,11 +367,9 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{ {
static const WCHAR szFile[] = { 'F','i','l','e',0 }; static const WCHAR szFile[] = { 'F','i','l','e',0 };
static const WCHAR szDashFile[] = { '-','f','i','l','e',0 }; static const WCHAR szDashFile[] = { '-','f','i','l','e',0 };
if (!(flags & SHGFI_USEFILEATTRIBUTES)) if (!(flags & SHGFI_USEFILEATTRIBUTES))
{ {
char ftype[80]; char ftype[80];
_ILGetFileType(pidlLast, ftype, 80); _ILGetFileType(pidlLast, ftype, 80);
MultiByteToWideChar(CP_ACP, 0, ftype, -1, psfi->szTypeName, 80 ); MultiByteToWideChar(CP_ACP, 0, ftype, -1, psfi->szTypeName, 80 );
} }
@ -437,10 +380,9 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
else else
{ {
WCHAR sTemp[64]; WCHAR sTemp[64];
lstrcpyW(sTemp,PathFindExtensionW(szFullPath)); lstrcpyW(sTemp,PathFindExtensionW(szFullPath));
if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE)
HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) && HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
{ {
lstrcpynW (psfi->szTypeName, sTemp, 64); lstrcpynW (psfi->szTypeName, sTemp, 64);
strcatW (psfi->szTypeName, szDashFile); strcatW (psfi->szTypeName, szDashFile);
@ -450,12 +392,6 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
} }
/* ### icons ###*/ /* ### icons ###*/
if (flags & SHGFI_ADDOVERLAYS)
FIXME("SHGFI_ADDOVERLAYS unhandled\n");
if (flags & SHGFI_OVERLAYINDEX)
FIXME("SHGFI_OVERLAYINDEX unhandled\n");
if (flags & SHGFI_LINKOVERLAY) if (flags & SHGFI_LINKOVERLAY)
FIXME("set icon to link, stub\n"); FIXME("set icon to link, stub\n");
@ -469,15 +405,11 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION )) if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
{ {
UINT uDummy,uFlags; UINT uDummy,uFlags;
hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, &uDummy, (LPVOID*)&pei);
hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
(LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA,
&uDummy, (LPVOID*)&pei);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = IExtractIconW_GetIconLocation(pei, hr = IExtractIconW_GetIconLocation(pei, (flags & SHGFI_OPENICON)? GIL_OPENICON : 0,szLocation, MAX_PATH, &iIndex, &uFlags);
(flags & SHGFI_OPENICON)? GIL_OPENICON : 0,
szLocation, MAX_PATH, &iIndex, &uFlags);
psfi->iIcon = iIndex; psfi->iIcon = iIndex;
if(uFlags != GIL_NOTFILENAME) if(uFlags != GIL_NOTFILENAME)
@ -492,6 +424,7 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
/* get icon index (or load icon)*/ /* get icon index (or load icon)*/
if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX))) if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX)))
{ {
if (flags & SHGFI_USEFILEATTRIBUTES) if (flags & SHGFI_USEFILEATTRIBUTES)
{ {
WCHAR sTemp [MAX_PATH]; WCHAR sTemp [MAX_PATH];
@ -505,12 +438,10 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
else else
{ {
static const WCHAR p1W[] = {'%','1',0}; static const WCHAR p1W[] = {'%','1',0};
psfi->iIcon = 0; psfi->iIcon = 0;
szExt = (LPWSTR) PathFindExtensionW(sTemp); szExt = (LPWSTR) PathFindExtensionW(sTemp);
if ( szExt && if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE)
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && && HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
{ {
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
strcpyW(sTemp, szFullPath); strcpyW(sTemp, szFullPath);
@ -518,22 +449,15 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (flags & SHGFI_SYSICONINDEX) if (flags & SHGFI_SYSICONINDEX)
{ {
psfi->iIcon = SIC_GetIconIndex(sTemp,dwNr); psfi->iIcon = SIC_GetIconIndex(sTemp,dwNr);
if (psfi->iIcon == -1) if (psfi->iIcon == -1) psfi->iIcon = 0;
psfi->iIcon = 0;
} }
else else
{ {
IconNotYetLoaded=FALSE; IconNotYetLoaded=FALSE;
if (flags & SHGFI_SMALLICON) PrivateExtractIconsW(sTemp,dwNr,(flags & SHGFI_SMALLICON) ?
PrivateExtractIconsW( sTemp,dwNr, GetSystemMetrics(SM_CXSMICON) : GetSystemMetrics(SM_CXICON),
GetSystemMetrics( SM_CXSMICON ), (flags & SHGFI_SMALLICON) ? GetSystemMetrics(SM_CYSMICON) :
GetSystemMetrics( SM_CYSMICON ), GetSystemMetrics(SM_CYICON), &psfi->hIcon,0,1,0);
&psfi->hIcon, 0, 1, 0);
else
PrivateExtractIconsW( sTemp, dwNr,
GetSystemMetrics( SM_CXICON),
GetSystemMetrics( SM_CYICON),
&psfi->hIcon, 0, 1, 0);
psfi->iIcon = dwNr; psfi->iIcon = dwNr;
} }
} }
@ -549,24 +473,16 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
} }
if (ret) if (ret)
{ {
if (flags & SHGFI_SMALLICON) ret = (DWORD) ((flags & SHGFI_SMALLICON) ? ShellSmallIconList : ShellBigIconList);
ret = (DWORD) ShellSmallIconList;
else
ret = (DWORD) ShellBigIconList;
} }
} }
/* icon handle */ /* icon handle */
if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded) if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
{ psfi->hIcon = ImageList_GetIcon((flags & SHGFI_SMALLICON) ? ShellSmallIconList:ShellBigIconList, psfi->iIcon, ILD_NORMAL);
if (flags & SHGFI_SMALLICON)
psfi->hIcon = ImageList_GetIcon( ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
else
psfi->hIcon = ImageList_GetIcon( ShellBigIconList, psfi->iIcon, ILD_NORMAL);
}
if (flags & ~SHGFI_KNOWN_FLAGS) if (flags & (SHGFI_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3))
FIXME("unknown flags %08x\n", flags & ~SHGFI_KNOWN_FLAGS); FIXME("unknown attribute!\n");
if (psfParent) if (psfParent)
IShellFolder_Release(psfParent); IShellFolder_Release(psfParent);
@ -574,21 +490,18 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (hr != S_OK) if (hr != S_OK)
ret = FALSE; ret = FALSE;
if (pidlLast) if(pidlLast) SHFree(pidlLast);
SHFree(pidlLast);
#ifdef MORE_DEBUG #ifdef MORE_DEBUG
TRACE ("icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n", TRACE ("icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n",
psfi->hIcon, psfi->iIcon, psfi->dwAttributes, psfi->hIcon, psfi->iIcon, psfi->dwAttributes, debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
#endif #endif
return ret; return ret;
} }
/************************************************************************* /*************************************************************************
* SHGetFileInfoA [SHELL32.@] * SHGetFileInfoW [SHELL32.@]
*/ */
DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
SHFILEINFOA *psfi, UINT sizeofpsfi, SHFILEINFOA *psfi, UINT sizeofpsfi,
UINT flags ) UINT flags )
@ -598,13 +511,10 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
DWORD ret; DWORD ret;
SHFILEINFOW temppsfi; SHFILEINFOW temppsfi;
if (flags & SHGFI_PIDL) if (flags & SHGFI_PIDL) {
{
/* path contains a pidl */ /* path contains a pidl */
temppath = (LPWSTR) path; temppath = (LPWSTR) path;
} } else {
else
{
len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len); MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
@ -613,10 +523,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if(psfi && (flags & SHGFI_ATTR_SPECIFIED)) if(psfi && (flags & SHGFI_ATTR_SPECIFIED))
temppsfi.dwAttributes=psfi->dwAttributes; temppsfi.dwAttributes=psfi->dwAttributes;
if (psfi == NULL) ret = SHGetFileInfoW(temppath, dwFileAttributes, (psfi == NULL)? NULL : &temppsfi, sizeof(temppsfi), flags);
ret = SHGetFileInfoW(temppath, dwFileAttributes, NULL, sizeof(temppsfi), flags);
else
ret = SHGetFileInfoW(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
if (psfi) if (psfi)
{ {
@ -627,20 +534,11 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if(flags & SHGFI_ATTRIBUTES) if(flags & SHGFI_ATTRIBUTES)
psfi->dwAttributes=temppsfi.dwAttributes; psfi->dwAttributes=temppsfi.dwAttributes;
if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION)) if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION))
{ WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1, psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1,
psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
}
if(flags & SHGFI_TYPENAME) if(flags & SHGFI_TYPENAME)
{ WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1,
psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
} }
} if(!(flags & SHGFI_PIDL)) HeapFree(GetProcessHeap(), 0, temppath);
if (!(flags & SHGFI_PIDL))
HeapFree(GetProcessHeap(), 0, temppath);
return ret; return ret;
} }
@ -652,7 +550,7 @@ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon)
ICONINFO IconInfo; ICONINFO IconInfo;
HICON hDupIcon = 0; HICON hDupIcon = 0;
TRACE("%p %p\n", hInstance, hIcon); TRACE("(%p, %p)\n", hInstance, hIcon);
if(GetIconInfo(hIcon, &IconInfo)) if(GetIconInfo(hIcon, &IconInfo))
{ {
@ -680,7 +578,6 @@ HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex)
MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len); MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex); ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex);
HeapFree(GetProcessHeap(), 0, lpwstrFile); HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret; return ret;
} }
@ -695,8 +592,7 @@ HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex
TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex); TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex);
if (nIconIndex == 0xFFFFFFFF) if (nIconIndex == 0xFFFFFFFF) {
{
ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR); ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR);
if (ret != 0xFFFFFFFF && ret) if (ret != 0xFFFFFFFF && ret)
return (HICON)ret; return (HICON)ret;
@ -709,7 +605,6 @@ HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex
return (HICON)1; return (HICON)1;
else if (ret > 0 && hIcon) else if (ret > 0 && hIcon)
return hIcon; return hIcon;
return NULL; return NULL;
} }
@ -730,12 +625,9 @@ typedef struct
#define DROP_FIELD_HEIGHT 15 #define DROP_FIELD_HEIGHT 15
static BOOL __get_dropline( HWND hWnd, LPRECT lprect ) static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
{ { HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
if( hWndCtl ) if( hWndCtl )
{ { GetWindowRect( hWndCtl, lprect );
GetWindowRect( hWndCtl, lprect );
MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 ); MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 );
lprect->bottom = (lprect->top += DROP_FIELD_TOP); lprect->bottom = (lprect->top += DROP_FIELD_TOP);
return TRUE; return TRUE;
@ -751,10 +643,8 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
int width=data->rc.right - data->rc.left; int width=data->rc.right - data->rc.left;
int height=data->rc.bottom - data->rc.top; int height=data->rc.bottom - data->rc.top;
RECT rec=data->rc; RECT rec=data->rc;
switch (msg) switch (msg)
{ { case ABM_GETSTATE:
case ABM_GETSTATE:
return ABS_ALWAYSONTOP | ABS_AUTOHIDE; return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
case ABM_GETTASKBARPOS: case ABM_GETTASKBARPOS:
GetWindowRect(data->hWnd, &rec); GetWindowRect(data->hWnd, &rec);
@ -794,22 +684,13 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
} }
/************************************************************************* /*************************************************************************
* SHHelpShortcuts_RunDLLA [SHELL32.@] * SHHelpShortcuts_RunDLL [SHELL32.@]
* *
*/ */
DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
{ { FIXME("(%lx, %lx, %lx, %lx) empty stub!\n",
FIXME("(%lx, %lx, %lx, %lx) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); dwArg1, dwArg2, dwArg3, dwArg4);
return 0;
}
/*************************************************************************
* SHHelpShortcuts_RunDLLA [SHELL32.@]
*
*/
DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
{
FIXME("(%lx, %lx, %lx, %lx) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
return 0; return 0;
} }
@ -818,6 +699,7 @@ DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, D
* Create an instance of specified object class from within * Create an instance of specified object class from within
* the shell process and release it immediately * the shell process and release it immediately
*/ */
HRESULT WINAPI SHLoadInProc (REFCLSID rclsid) HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
{ {
void *ptr = NULL; void *ptr = NULL;
@ -877,13 +759,11 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
return 1; return 1;
case WM_PAINT: case WM_PAINT:
{ { RECT rect;
RECT rect;
PAINTSTRUCT ps; PAINTSTRUCT ps;
HDC hDC = BeginPaint( hWnd, &ps ); HDC hDC = BeginPaint( hWnd, &ps );
if (__get_dropline( hWnd, &rect )) if( __get_dropline( hWnd, &rect ) ) {
{
SelectObject( hDC, GetStockObject( BLACK_PEN ) ); SelectObject( hDC, GetStockObject( BLACK_PEN ) );
MoveToEx( hDC, rect.left, rect.top, NULL ); MoveToEx( hDC, rect.left, rect.top, NULL );
LineTo( hDC, rect.right, rect.bottom ); LineTo( hDC, rect.right, rect.bottom );
@ -975,8 +855,7 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
* FreeIconList (SHELL32.@) * FreeIconList (SHELL32.@)
*/ */
void WINAPI FreeIconList( DWORD dw ) void WINAPI FreeIconList( DWORD dw )
{ { FIXME("(%lx): stub\n",dw);
FIXME("%lx: stub\n",dw);
} }
@ -1035,7 +914,6 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
return E_INVALIDARG; return E_INVALIDARG;
} }
} }
/************************************************************************* /*************************************************************************
* global variables of the shell32.dll * global variables of the shell32.dll
* all are once per process * all are once per process
@ -1052,6 +930,7 @@ HIMAGELIST ShellBigIconList = 0;
* NOTES * NOTES
* calling oleinitialize here breaks sone apps. * calling oleinitialize here breaks sone apps.
*/ */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
{ {
TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad); TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
@ -1092,7 +971,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline) HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
{ {
FIXME("%s %s: stub\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline)); FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
return S_OK; /* indicate success */ return S_OK; /* indicate success */
} }
@ -1101,6 +981,7 @@ HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
*/ */
HRESULT WINAPI SHELL32_DllCanUnloadNow(void) HRESULT WINAPI SHELL32_DllCanUnloadNow(void)
{ {
FIXME("stub\n"); FIXME("(void): stub\n");
return S_FALSE; return S_FALSE;
} }

View file

@ -92,7 +92,6 @@ HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPV
HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV); HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV);
HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI UnixFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex); HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex);
HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UINT cchMax, int* piIndex); HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UINT cchMax, int* piIndex);
HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
@ -221,8 +220,6 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
extern WCHAR swShell32Name[MAX_PATH]; extern WCHAR swShell32Name[MAX_PATH];
extern const GUID CLSID_UnixFolder;
/* Default shell folder value registration */ /* Default shell folder value registration */
HRESULT SHELL_RegisterShellFolders(void); HRESULT SHELL_RegisterShellFolders(void);

View file

@ -2,7 +2,6 @@
* *
* Copyright 1997 Marcus Meissner * Copyright 1997 Marcus Meissner
* Copyright 1998 Juergen Schmied * Copyright 1998 Juergen Schmied
* Copyright 2005 Mike McCormack
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -22,14 +21,6 @@
* Nearly complete informations about the binary formats * Nearly complete informations about the binary formats
* of .lnk files available at http://www.wotsit.org * of .lnk files available at http://www.wotsit.org
* *
* You can use winedump to examine the contents of a link file:
* winedump lnk sc.lnk
*
* MSI advertised shortcuts are totally undocumented. They provide an
* icon for a program that is not yet installed, and invoke MSI to
* install the program when the shortcut is clicked on. They are
* created by passing a special string to SetPath, and the information
* in that string is parsed an stored.
*/ */
#include "config.h" #include "config.h"
@ -67,28 +58,19 @@
#include "shlguid.h" #include "shlguid.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "initguid.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell); WINE_DEFAULT_DEBUG_CHANNEL(shell);
DEFINE_GUID( SHELL32_AdvtShortcutProduct,
0x9db1186f,0x40df,0x11d1,0xaa,0x8c,0x00,0xc0,0x4f,0xb6,0x78,0x63);
DEFINE_GUID( SHELL32_AdvtShortcutComponent,
0x9db1186e,0x40df,0x11d1,0xaa,0x8c,0x00,0xc0,0x4f,0xb6,0x78,0x63);
/* link file formats */ /* link file formats */
/* flag1: lnk elements: simple link has 0x0B */ /* flag1: lnk elements: simple link has 0x0B */
#define SCF_PIDL 1 #define SCF_PIDL 1
#define SCF_LOCATION 2 #define SCF_NORMAL 2
#define SCF_DESCRIPTION 4 #define SCF_DESCRIPTION 4
#define SCF_RELATIVE 8 #define SCF_RELATIVE 8
#define SCF_WORKDIR 0x10 #define SCF_WORKDIR 0x10
#define SCF_ARGS 0x20 #define SCF_ARGS 0x20
#define SCF_CUSTOMICON 0x40 #define SCF_CUSTOMICON 0x40
#define SCF_UNICODE 0x80 #define SCF_UNICODE 0x80
#define SCF_PRODUCT 0x800
#define SCF_COMPONENT 0x1000
#include "pshpack1.h" #include "pshpack1.h"
@ -131,21 +113,6 @@ typedef struct _LOCAL_VOLUME_INFO
DWORD dwVolLabelOfs; DWORD dwVolLabelOfs;
} LOCAL_VOLUME_INFO; } LOCAL_VOLUME_INFO;
typedef struct tagLINK_ADVERTISEINFO
{
DWORD size;
DWORD magic;
CHAR bufA[MAX_PATH];
WCHAR bufW[MAX_PATH];
} LINK_ADVERTISEINFO;
typedef struct volume_info_t
{
DWORD type;
DWORD serial;
WCHAR label[12]; /* assume 8.3 */
} volume_info;
#include "poppack.h" #include "poppack.h"
static IShellLinkAVtbl slvt; static IShellLinkAVtbl slvt;
@ -179,9 +146,6 @@ typedef struct
LPWSTR sWorkDir; LPWSTR sWorkDir;
LPWSTR sDescription; LPWSTR sDescription;
LPWSTR sPathRel; LPWSTR sPathRel;
LPWSTR sProduct;
LPWSTR sComponent;
volume_info volume;
BOOL bDirty; BOOL bDirty;
} IShellLinkImpl; } IShellLinkImpl;
@ -208,6 +172,7 @@ inline static LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str)
return p; return p;
} }
/************************************************************************** /**************************************************************************
* IPersistFile_QueryInterface * IPersistFile_QueryInterface
*/ */
@ -286,8 +251,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
static BOOL StartLinkProcessor( LPCOLESTR szLink ) static BOOL StartLinkProcessor( LPCOLESTR szLink )
{ {
static const WCHAR szFormat[] = { static const WCHAR szFormat[] = {'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
' ','-','r',' ','"','%','s','"',0 }; ' ','-','r',' ','"','%','s','"',0 };
LONG len; LONG len;
LPWSTR buffer; LPWSTR buffer;
@ -326,7 +290,7 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile
TRACE("(%p)->(%s)\n",This,debugstr_w(pszFileName)); TRACE("(%p)->(%s)\n",This,debugstr_w(pszFileName));
if (!pszFileName) if (!pszFileName || !This->sPath)
return E_FAIL; return E_FAIL;
r = CreateStreamOnFile(pszFileName, STGM_READWRITE | STGM_CREATE, &stm); r = CreateStreamOnFile(pszFileName, STGM_READWRITE | STGM_CREATE, &stm);
@ -505,175 +469,44 @@ static HRESULT Stream_LoadString( IStream* stm, BOOL unicode, LPWSTR *pstr )
return S_OK; return S_OK;
} }
static HRESULT Stream_ReadChunk( IStream* stm, LPVOID *data ) static HRESULT Stream_LoadLocation( IStream* stm )
{ {
DWORD size; DWORD size;
ULONG count; ULONG count;
HRESULT r; HRESULT r;
struct sized_chunk { LOCATION_INFO *loc;
DWORD size;
unsigned char data[1];
} *chunk;
TRACE("%p\n",stm); TRACE("%p\n",stm);
r = IStream_Read( stm, &size, sizeof(size), &count ); r = IStream_Read( stm, &size, sizeof(size), &count );
if( FAILED( r ) || count != sizeof(size) ) if( FAILED( r ) )
return r;
if( count != sizeof(loc->dwTotalSize) )
return E_FAIL; return E_FAIL;
chunk = HeapAlloc( GetProcessHeap(), 0, size ); loc = HeapAlloc( GetProcessHeap(), 0, size );
if( !chunk ) if( ! loc )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
chunk->size = size; r = IStream_Read( stm, &loc->dwHeaderSize, size-sizeof(size), &count );
r = IStream_Read( stm, chunk->data, size - sizeof(size), &count ); if( FAILED( r ) )
if( FAILED( r ) || count != (size - sizeof(size)) ) goto end;
if( count != (size - sizeof(size)) )
{ {
HeapFree( GetProcessHeap(), 0, chunk ); r = E_FAIL;
return E_FAIL; goto end;
} }
loc->dwTotalSize = size;
TRACE("Read %ld bytes\n",chunk->size); TRACE("Read %ld bytes\n",count);
*data = (LPVOID) chunk; /* FIXME: do something useful with it */
HeapFree( GetProcessHeap(), 0, loc );
return S_OK; return S_OK;
} end:
HeapFree( GetProcessHeap(), 0, loc );
static BOOL Stream_LoadVolume( LOCAL_VOLUME_INFO *vol, volume_info *volume )
{
const int label_sz = sizeof volume->label/sizeof volume->label[0];
LPSTR label;
int len;
volume->serial = vol->dwVolSerial;
volume->type = vol->dwType;
if( !vol->dwVolLabelOfs )
return FALSE;
if( vol->dwSize <= vol->dwVolLabelOfs )
return FALSE;
len = vol->dwSize - vol->dwVolLabelOfs;
label = (LPSTR) vol;
label += vol->dwVolLabelOfs;
MultiByteToWideChar( CP_ACP, 0, label, len, volume->label, label_sz-1);
return TRUE;
}
static LPWSTR Stream_LoadPath( LPSTR p, DWORD maxlen )
{
int len = 0, wlen;
LPWSTR path;
while( p[len] && (len < maxlen) )
len++;
wlen = MultiByteToWideChar(CP_ACP, 0, p, len, NULL, 0);
path = HeapAlloc(GetProcessHeap(), 0, (wlen+1)*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, p, len, path, wlen);
path[wlen] = 0;
return path;
}
static HRESULT Stream_LoadLocation( IStream *stm,
volume_info *volume, LPWSTR *path )
{
unsigned char *p = NULL;
LOCATION_INFO *loc;
HRESULT r;
int n;
r = Stream_ReadChunk( stm, (LPVOID*) &p );
if( FAILED(r) )
return r; return r;
loc = (LOCATION_INFO*) p;
if (loc->dwTotalSize < sizeof(LOCATION_INFO) - sizeof(DWORD))
{
HeapFree( GetProcessHeap(), 0, p );
return E_FAIL;
}
/* if there's valid local volume information, load it */
if( loc->dwVolTableOfs &&
((loc->dwVolTableOfs + sizeof(LOCAL_VOLUME_INFO)) <= loc->dwTotalSize) )
{
LOCAL_VOLUME_INFO *volume_info;
volume_info = (LOCAL_VOLUME_INFO*) &p[loc->dwVolTableOfs];
Stream_LoadVolume( volume_info, volume );
}
/* if there's a local path, load it */
n = loc->dwLocalPathOfs;
if( n && (n < loc->dwTotalSize) )
*path = Stream_LoadPath( &p[n], loc->dwTotalSize - n );
TRACE("type %ld serial %08lx name %s path %s\n", volume->type,
volume->serial, debugstr_w(volume->label), debugstr_w(*path));
HeapFree( GetProcessHeap(), 0, p );
return S_OK;
}
/*
* The format of the advertised shortcut info seems to be:
*
* Offset Description
* ------ -----------
*
* 0 Length of the block (4 bytes, usually 0x314)
* 4 tag (dword)
* 8 string data in ASCII
* 8+0x104 string data in UNICODE
*
* In the original Win32 implementation the buffers are not initialized
* to zero, so data trailing the string is random garbage.
*/
static HRESULT Stream_LoadAdvertiseInfo( IStream* stm, LPWSTR *str )
{
DWORD size;
ULONG count;
HRESULT r;
LINK_ADVERTISEINFO buffer;
TRACE("%p\n",stm);
r = IStream_Read( stm, &buffer.size, sizeof (DWORD), &count );
if( FAILED( r ) )
return r;
/* make sure that we read the size of the structure even on error */
size = sizeof buffer - sizeof (DWORD);
if( buffer.size != sizeof buffer )
{
ERR("Ooops. This structure is not as expected...\n");
return E_FAIL;
}
r = IStream_Read( stm, &buffer.magic, size, &count );
if( FAILED( r ) )
return r;
if( count != size )
return E_FAIL;
TRACE("magic %08lx string = %s\n", buffer.magic, debugstr_w(buffer.bufW));
if( (buffer.magic&0xffff0000) != 0xa0000000 )
{
ERR("Unknown magic number %08lx in advertised shortcut\n", buffer.magic);
return E_FAIL;
}
*str = HeapAlloc( GetProcessHeap(), 0,
(strlenW(buffer.bufW)+1) * sizeof(WCHAR) );
strcpyW( *str, buffer.bufW );
return S_OK;
} }
/************************************************************************ /************************************************************************
@ -686,12 +519,12 @@ static HRESULT WINAPI IPersistStream_fnLoad(
LINK_HEADER hdr; LINK_HEADER hdr;
ULONG dwBytesRead; ULONG dwBytesRead;
BOOL unicode; BOOL unicode;
WCHAR sTemp[MAX_PATH];
HRESULT r; HRESULT r;
DWORD zero;
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
TRACE("%p %p\n", This, stm); TRACE("(%p)(%p)\n", This, stm);
if( !stm ) if( !stm )
return STG_E_INVALIDPOINTER; return STG_E_INVALIDPOINTER;
@ -708,61 +541,30 @@ static HRESULT WINAPI IPersistStream_fnLoad(
if( !IsEqualIID(&hdr.MagicGuid, &CLSID_ShellLink) ) if( !IsEqualIID(&hdr.MagicGuid, &CLSID_ShellLink) )
return E_FAIL; return E_FAIL;
/* free all the old stuff */ /* if( hdr.dwFlags & SCF_PIDL ) */ /* FIXME: seems to always have a PIDL */
ILFree(This->pPidl);
This->pPidl = NULL;
memset( &This->volume, 0, sizeof This->volume );
HeapFree(GetProcessHeap(), 0, This->sPath);
This->sPath = NULL;
HeapFree(GetProcessHeap(), 0, This->sDescription);
This->sDescription = NULL;
HeapFree(GetProcessHeap(), 0, This->sPathRel);
This->sPathRel = NULL;
HeapFree(GetProcessHeap(), 0, This->sWorkDir);
This->sWorkDir = NULL;
HeapFree(GetProcessHeap(), 0, This->sArgs);
This->sArgs = NULL;
HeapFree(GetProcessHeap(), 0, This->sIcoPath);
This->sIcoPath = NULL;
HeapFree(GetProcessHeap(), 0, This->sProduct);
This->sProduct = NULL;
HeapFree(GetProcessHeap(), 0, This->sComponent);
This->sComponent = NULL;
This->wHotKey = (WORD)hdr.wHotKey;
This->iIcoNdx = hdr.nIcon;
FileTimeToSystemTime (&hdr.Time1, &This->time1);
FileTimeToSystemTime (&hdr.Time2, &This->time2);
FileTimeToSystemTime (&hdr.Time3, &This->time3);
if (TRACE_ON(shell))
{
WCHAR sTemp[MAX_PATH];
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE, &This->time1,
NULL, sTemp, sizeof(sTemp)/sizeof(*sTemp));
TRACE("-- time1: %s\n", debugstr_w(sTemp) );
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE, &This->time2,
NULL, sTemp, sizeof(sTemp)/sizeof(*sTemp));
TRACE("-- time2: %s\n", debugstr_w(sTemp) );
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE, &This->time3,
NULL, sTemp, sizeof(sTemp)/sizeof(*sTemp));
TRACE("-- time3: %s\n", debugstr_w(sTemp) );
}
/* load all the new stuff */
if( hdr.dwFlags & SCF_PIDL )
{ {
r = ILLoadFromStream( stm, &This->pPidl ); r = ILLoadFromStream( stm, &This->pPidl );
if( FAILED( r ) ) if( FAILED( r ) )
return r; return r;
} }
This->wHotKey = (WORD)hdr.wHotKey;
This->iIcoNdx = hdr.nIcon;
FileTimeToSystemTime (&hdr.Time1, &This->time1);
FileTimeToSystemTime (&hdr.Time2, &This->time2);
FileTimeToSystemTime (&hdr.Time3, &This->time3);
#if 1
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
TRACE("-- time1: %s\n", debugstr_w(sTemp) );
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256);
TRACE("-- time1: %s\n", debugstr_w(sTemp) );
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256);
TRACE("-- time1: %s\n", debugstr_w(sTemp) );
pdump (This->pPidl); pdump (This->pPidl);
#endif
/* load the location information */ if( hdr.dwFlags & SCF_NORMAL )
if( hdr.dwFlags & SCF_LOCATION ) r = Stream_LoadLocation( stm );
r = Stream_LoadLocation( stm, &This->volume, &This->sPath );
if( FAILED( r ) ) if( FAILED( r ) )
goto end; goto end;
unicode = hdr.dwFlags & SCF_UNICODE; unicode = hdr.dwFlags & SCF_UNICODE;
if( hdr.dwFlags & SCF_DESCRIPTION ) if( hdr.dwFlags & SCF_DESCRIPTION )
{ {
@ -804,26 +606,6 @@ static HRESULT WINAPI IPersistStream_fnLoad(
if( FAILED( r ) ) if( FAILED( r ) )
goto end; goto end;
if( hdr.dwFlags & SCF_PRODUCT )
{
r = Stream_LoadAdvertiseInfo( stm, &This->sProduct );
TRACE("Product -> %s\n",debugstr_w(This->sProduct));
}
if( FAILED( r ) )
goto end;
if( hdr.dwFlags & SCF_COMPONENT )
{
r = Stream_LoadAdvertiseInfo( stm, &This->sComponent );
TRACE("Component -> %s\n",debugstr_w(This->sComponent));
}
if( FAILED( r ) )
goto end;
r = IStream_Read(stm, &zero, sizeof zero, &dwBytesRead);
if( FAILED( r ) || zero || dwBytesRead != sizeof zero )
ERR("Last word was not zero\n");
TRACE("OK\n"); TRACE("OK\n");
pdump (This->pPidl); pdump (This->pPidl);
@ -858,81 +640,19 @@ static HRESULT Stream_WriteString( IStream* stm, LPCWSTR str )
return S_OK; return S_OK;
} }
/************************************************************************ static HRESULT Stream_WriteLocationInfo( IStream* stm, LPCWSTR filename )
* Stream_WriteLocationInfo
*
* Writes the location info to a stream
*
* FIXME: One day we might want to write the network volume information
* and the final path.
* Figure out how Windows deals with unicode paths here.
*/
static HRESULT Stream_WriteLocationInfo( IStream* stm, LPCWSTR path,
volume_info *volume )
{
DWORD total_size, path_size, volume_info_size, label_size, final_path_size;
LOCAL_VOLUME_INFO *vol;
LOCATION_INFO *loc;
LPSTR szLabel, szPath, szFinalPath;
ULONG count = 0;
TRACE("%p %s %p\n", stm, debugstr_w(path), volume);
/* figure out the size of everything */
label_size = WideCharToMultiByte( CP_ACP, 0, volume->label, -1,
NULL, 0, NULL, NULL );
path_size = WideCharToMultiByte( CP_ACP, 0, path, -1,
NULL, 0, NULL, NULL );
volume_info_size = sizeof *vol + label_size;
final_path_size = 1;
total_size = sizeof *loc + volume_info_size + path_size + final_path_size;
/* create pointers to everything */
loc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, total_size);
vol = (LOCAL_VOLUME_INFO*) &loc[1];
szLabel = (LPSTR) &vol[1];
szPath = &szLabel[label_size];
szFinalPath = &szPath[path_size];
/* fill in the location information header */
loc->dwTotalSize = total_size;
loc->dwHeaderSize = sizeof (*loc);
loc->dwFlags = 1;
loc->dwVolTableOfs = sizeof (*loc);
loc->dwLocalPathOfs = sizeof (*loc) + volume_info_size;
loc->dwNetworkVolTableOfs = 0;
loc->dwFinalPathOfs = sizeof (*loc) + volume_info_size + path_size;
/* fill in the volume information */
vol->dwSize = volume_info_size;
vol->dwType = volume->type;
vol->dwVolSerial = volume->serial;
vol->dwVolLabelOfs = sizeof (*vol);
/* copy in the strings */
WideCharToMultiByte( CP_ACP, 0, volume->label, -1,
szLabel, label_size, NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, path, -1,
szPath, path_size, NULL, NULL );
szFinalPath[0] = 0;
return IStream_Write( stm, loc, total_size, &count );
}
static HRESULT Stream_WriteAdvertiseInfo( IStream* stm, LPCWSTR string, DWORD magic )
{ {
LOCATION_INFO loc;
ULONG count; ULONG count;
LINK_ADVERTISEINFO buffer;
TRACE("%p\n",stm); FIXME("writing empty location info\n");
memset( &buffer, 0, sizeof buffer ); memset( &loc, 0, sizeof(loc) );
buffer.size = sizeof buffer; loc.dwTotalSize = sizeof(loc) - sizeof(loc.dwTotalSize);
buffer.magic = magic;
strncpyW( buffer.bufW, string, MAX_PATH );
WideCharToMultiByte(CP_ACP, 0, string, -1, buffer.bufA, MAX_PATH, NULL, NULL );
return IStream_Write( stm, &buffer, buffer.size, &count ); /* FIXME: fill this in */
return IStream_Write( stm, &loc, loc.dwTotalSize, &count );
} }
/************************************************************************ /************************************************************************
@ -950,19 +670,17 @@ static HRESULT WINAPI IPersistStream_fnSave(
LINK_HEADER header; LINK_HEADER header;
WCHAR exePath[MAX_PATH]; WCHAR exePath[MAX_PATH];
ULONG count; ULONG count;
DWORD zero;
HRESULT r; HRESULT r;
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
TRACE("%p %p %x\n", This, stm, fClearDirty); TRACE("(%p) %p %x\n", This, stm, fClearDirty);
*exePath = '\0'; *exePath = '\0';
if (This->sPath) if (This->sPath)
{ {
SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH, SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH, NULL, NULL, NULL, NULL);
NULL, NULL, NULL, NULL);
/* /*
* windows can create lnk files to executables that do not exist yet * windows can create lnk files to executables that do not exist yet
* so if the executable does not exist the just trust the path they * so if the executable does not exist the just trust the path they
@ -971,18 +689,19 @@ static HRESULT WINAPI IPersistStream_fnSave(
if( !*exePath ) strcpyW(exePath,This->sPath); if( !*exePath ) strcpyW(exePath,This->sPath);
} }
/* if there's no PIDL, generate one */
if( ! This->pPidl ) This->pPidl = ILCreateFromPathW(exePath);
memset(&header, 0, sizeof(header)); memset(&header, 0, sizeof(header));
header.dwSize = sizeof(header); header.dwSize = sizeof(header);
header.fStartup = This->iShowCmd;
memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) ); memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) );
header.wHotKey = This->wHotKey; header.wHotKey = This->wHotKey;
header.nIcon = This->iIcoNdx; header.nIcon = This->iIcoNdx;
header.dwFlags = SCF_UNICODE; /* strings are in unicode */ header.dwFlags = SCF_UNICODE; /* strings are in unicode */
header.dwFlags |= SCF_NORMAL; /* how do we determine this ? */
if( This->pPidl ) if( This->pPidl )
header.dwFlags |= SCF_PIDL; header.dwFlags |= SCF_PIDL;
if( This->sPath )
header.dwFlags |= SCF_LOCATION;
if( This->sDescription ) if( This->sDescription )
header.dwFlags |= SCF_DESCRIPTION; header.dwFlags |= SCF_DESCRIPTION;
if( This->sWorkDir ) if( This->sWorkDir )
@ -991,10 +710,6 @@ static HRESULT WINAPI IPersistStream_fnSave(
header.dwFlags |= SCF_ARGS; header.dwFlags |= SCF_ARGS;
if( This->sIcoPath ) if( This->sIcoPath )
header.dwFlags |= SCF_CUSTOMICON; header.dwFlags |= SCF_CUSTOMICON;
if( This->sProduct )
header.dwFlags |= SCF_PRODUCT;
if( This->sComponent )
header.dwFlags |= SCF_COMPONENT;
SystemTimeToFileTime ( &This->time1, &header.Time1 ); SystemTimeToFileTime ( &This->time1, &header.Time1 );
SystemTimeToFileTime ( &This->time2, &header.Time2 ); SystemTimeToFileTime ( &This->time2, &header.Time2 );
@ -1021,9 +736,9 @@ static HRESULT WINAPI IPersistStream_fnSave(
} }
} }
if( This->sPath ) Stream_WriteLocationInfo( stm, exePath );
Stream_WriteLocationInfo( stm, exePath, &This->volume );
TRACE("Description = %s\n", debugstr_w(This->sDescription));
if( This->sDescription ) if( This->sDescription )
r = Stream_WriteString( stm, This->sDescription ); r = Stream_WriteString( stm, This->sDescription );
@ -1039,16 +754,6 @@ static HRESULT WINAPI IPersistStream_fnSave(
if( This->sIcoPath ) if( This->sIcoPath )
r = Stream_WriteString( stm, This->sIcoPath ); r = Stream_WriteString( stm, This->sIcoPath );
if( This->sProduct )
r = Stream_WriteAdvertiseInfo( stm, This->sProduct, 0xa0000007 );
if( This->sComponent )
r = Stream_WriteAdvertiseInfo( stm, This->sComponent, 0xa0000006 );
/* the last field is a single zero dword */
zero = 0;
r = IStream_Write( stm, &zero, sizeof zero, &count );
return S_OK; return S_OK;
} }
@ -1123,9 +828,13 @@ HRESULT WINAPI IShellLink_Constructor (
static BOOL SHELL_ExistsFileW(LPCWSTR path) static BOOL SHELL_ExistsFileW(LPCWSTR path)
{ {
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW(path)) HANDLE hfile = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
return FALSE;
if (hfile != INVALID_HANDLE_VALUE) {
CloseHandle(hfile);
return TRUE; return TRUE;
} else
return FALSE;
} }
/************************************************************************** /**************************************************************************
@ -1308,9 +1017,6 @@ static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,
TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n", TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",
This, pszFile, cchMaxPath, pfd, fFlags, debugstr_w(This->sPath)); This, pszFile, cchMaxPath, pfd, fFlags, debugstr_w(This->sPath));
if (This->sComponent || This->sProduct)
return S_FALSE;
if( cchMaxPath ) if( cchMaxPath )
pszFile[0] = 0; pszFile[0] = 0;
if (This->sPath) if (This->sPath)
@ -1319,7 +1025,7 @@ static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,
if (pfd) FIXME("(%p): WIN32_FIND_DATA is not yet filled.\n", This); if (pfd) FIXME("(%p): WIN32_FIND_DATA is not yet filled.\n", This);
return S_OK; return NOERROR;
} }
static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST * ppidl) static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST * ppidl)
@ -1328,7 +1034,9 @@ static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST
TRACE("(%p)->(ppidl=%p)\n",This, ppidl); TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
return IShellLinkW_GetIDList((IShellLinkW*)&(This->lpvtblw), ppidl); *ppidl = ILClone(This->pPidl);
return NOERROR;
} }
static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST pidl) static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST pidl)
@ -1510,23 +1218,21 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p
TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon);
if (cchIconPath)
pszIconPath[0] = 0; pszIconPath[0] = 0;
*piIcon = This->iIcoNdx;
if (This->sIcoPath) if (This->sIcoPath) {
{
WideCharToMultiByte(CP_ACP, 0, This->sIcoPath, -1, pszIconPath, cchIconPath, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, This->sIcoPath, -1, pszIconPath, cchIconPath, NULL, NULL);
*piIcon = This->iIcoNdx;
return S_OK; return S_OK;
} }
if (This->pPidl || This->sPath) if (This->pPidl || This->sPath) {
{
IShellFolder* pdsk; IShellFolder* pdsk;
HRESULT hr = SHGetDesktopFolder(&pdsk); HRESULT hr = SHGetDesktopFolder(&pdsk);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr)) {
{
/* first look for an icon using the PIDL (if present) */ /* first look for an icon using the PIDL (if present) */
if (This->pPidl) if (This->pPidl)
hr = SHELL_PidlGeticonLocationA(pdsk, This->pPidl, pszIconPath, cchIconPath, piIcon); hr = SHELL_PidlGeticonLocationA(pdsk, This->pPidl, pszIconPath, cchIconPath, piIcon);
@ -1534,8 +1240,7 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p
hr = E_FAIL; hr = E_FAIL;
/* if we couldn't find an icon yet, look for it using the file system path */ /* if we couldn't find an icon yet, look for it using the file system path */
if (FAILED(hr) && This->sPath) if (FAILED(hr) && This->sPath) {
{
LPITEMIDLIST pidl; LPITEMIDLIST pidl;
hr = IShellFolder_ParseDisplayName(pdsk, 0, NULL, This->sPath, NULL, &pidl, NULL); hr = IShellFolder_ParseDisplayName(pdsk, 0, NULL, This->sPath, NULL, &pidl, NULL);
@ -1551,8 +1256,8 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p
} }
return hr; return hr;
} } else
return S_OK; return E_FAIL;
} }
static HRESULT WINAPI IShellLinkA_fnSetIconLocation(IShellLinkA * iface, LPCSTR pszIconPath,INT iIcon) static HRESULT WINAPI IShellLinkA_fnSetIconLocation(IShellLinkA * iface, LPCSTR pszIconPath,INT iIcon)
@ -1576,7 +1281,7 @@ static HRESULT WINAPI IShellLinkA_fnSetRelativePath(IShellLinkA * iface, LPCSTR
{ {
IShellLinkImpl *This = (IShellLinkImpl *)iface; IShellLinkImpl *This = (IShellLinkImpl *)iface;
TRACE("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved); FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
HeapFree(GetProcessHeap(), 0, This->sPathRel); HeapFree(GetProcessHeap(), 0, This->sPathRel);
This->sPathRel = HEAP_strdupAtoW(GetProcessHeap(), 0, pszPathRel); This->sPathRel = HEAP_strdupAtoW(GetProcessHeap(), 0, pszPathRel);
@ -1591,7 +1296,7 @@ static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWOR
IShellLinkImpl *This = (IShellLinkImpl *)iface; IShellLinkImpl *This = (IShellLinkImpl *)iface;
TRACE("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags); FIXME("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
/*FIXME: use IResolveShellLink interface */ /*FIXME: use IResolveShellLink interface */
@ -1628,20 +1333,23 @@ static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWOR
static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile) static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
{ {
HRESULT r;
LPWSTR str;
IShellLinkImpl *This = (IShellLinkImpl *)iface; IShellLinkImpl *This = (IShellLinkImpl *)iface;
char buffer[MAX_PATH];
LPSTR fname;
TRACE("(%p)->(path=%s)\n",This, pszFile); TRACE("(%p)->(path=%s)\n",This, pszFile);
str = HEAP_strdupAtoW(GetProcessHeap(), 0, pszFile); if (!GetFullPathNameA(pszFile, MAX_PATH, buffer, &fname))
if( !str ) return E_FAIL;
HeapFree(GetProcessHeap(), 0, This->sPath);
This->sPath = HEAP_strdupAtoW(GetProcessHeap(), 0, buffer);
if( !This->sPath )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
r = IShellLinkW_SetPath((IShellLinkW*)&(This->lpvtblw), str); This->bDirty = TRUE;
HeapFree( GetProcessHeap(), 0, str );
return r; return S_OK;
} }
/************************************************************************** /**************************************************************************
@ -1713,11 +1421,8 @@ static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,
{ {
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n", TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",
This, pszFile, cchMaxPath, pfd, fFlags, debugstr_w(This->sPath)); This, pszFile, cchMaxPath, pfd, fFlags);
if (This->sComponent || This->sProduct)
return S_FALSE;
if( cchMaxPath ) if( cchMaxPath )
pszFile[0] = 0; pszFile[0] = 0;
@ -1726,7 +1431,7 @@ static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,
if (pfd) FIXME("(%p): WIN32_FIND_DATA is not yet filled.\n", This); if (pfd) FIXME("(%p): WIN32_FIND_DATA is not yet filled.\n", This);
return S_OK; return NOERROR;
} }
static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl) static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl)
@ -1735,9 +1440,11 @@ static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST
TRACE("(%p)->(ppidl=%p)\n",This, ppidl); TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
if (!This->pPidl) if( This->pPidl)
return S_FALSE;
*ppidl = ILClone( This->pPidl ); *ppidl = ILClone( This->pPidl );
else
*ppidl = NULL;
return S_OK; return S_OK;
} }
@ -1764,6 +1471,7 @@ static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR p
TRACE("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); TRACE("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
if( cchMaxName )
pszName[0] = 0; pszName[0] = 0;
if( This->sDescription ) if( This->sDescription )
lstrcpynW( pszName, This->sDescription, cchMaxName ); lstrcpynW( pszName, This->sDescription, cchMaxName );
@ -1924,23 +1632,21 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR
TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon);
if (cchIconPath)
pszIconPath[0] = 0; pszIconPath[0] = 0;
*piIcon = This->iIcoNdx;
if (This->sIcoPath) if (This->sIcoPath) {
{
lstrcpynW(pszIconPath, This->sIcoPath, cchIconPath); lstrcpynW(pszIconPath, This->sIcoPath, cchIconPath);
*piIcon = This->iIcoNdx;
return S_OK; return S_OK;
} }
if (This->pPidl || This->sPath) if (This->pPidl || This->sPath) {
{
IShellFolder* pdsk; IShellFolder* pdsk;
HRESULT hr = SHGetDesktopFolder(&pdsk); HRESULT hr = SHGetDesktopFolder(&pdsk);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr)) {
{
/* first look for an icon using the PIDL (if present) */ /* first look for an icon using the PIDL (if present) */
if (This->pPidl) if (This->pPidl)
hr = SHELL_PidlGeticonLocationW(pdsk, This->pPidl, pszIconPath, cchIconPath, piIcon); hr = SHELL_PidlGeticonLocationW(pdsk, This->pPidl, pszIconPath, cchIconPath, piIcon);
@ -1948,14 +1654,12 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR
hr = E_FAIL; hr = E_FAIL;
/* if we couldn't find an icon yet, look for it using the file system path */ /* if we couldn't find an icon yet, look for it using the file system path */
if (FAILED(hr) && This->sPath) if (FAILED(hr) && This->sPath) {
{
LPITEMIDLIST pidl; LPITEMIDLIST pidl;
hr = IShellFolder_ParseDisplayName(pdsk, 0, NULL, This->sPath, NULL, &pidl, NULL); hr = IShellFolder_ParseDisplayName(pdsk, 0, NULL, This->sPath, NULL, &pidl, NULL);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr)) {
{
hr = SHELL_PidlGeticonLocationW(pdsk, pidl, pszIconPath, cchIconPath, piIcon); hr = SHELL_PidlGeticonLocationW(pdsk, pidl, pszIconPath, cchIconPath, piIcon);
SHFree(pidl); SHFree(pidl);
@ -1964,9 +1668,10 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR
IShellFolder_Release(pdsk); IShellFolder_Release(pdsk);
} }
return hr; return hr;
} } else
return S_OK; return E_FAIL;
} }
static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon) static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon)
@ -2011,7 +1716,7 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
TRACE("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags); FIXME("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
/*FIXME: use IResolveShellLink interface */ /*FIXME: use IResolveShellLink interface */
@ -2046,141 +1751,27 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
return hr; return hr;
} }
static LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str)
{
LPWSTR ret;
LPCWSTR p;
DWORD len;
p = strchrW( str, ':' );
if( !p )
return NULL;
len = p - str;
ret = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR)*(len+1));
if( !ret )
return ret;
memcpy( ret, str, sizeof(WCHAR)*len );
ret[len] = 0;
return ret;
}
static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str)
{
LPCWSTR szComponent = NULL, szProduct = NULL, p;
WCHAR szGuid[39];
HRESULT r;
GUID guid;
int len;
while( str[0] )
{
/* each segment must start with two colons */
if( str[0] != ':' || str[1] != ':' )
return E_FAIL;
/* the last segment is just two colons */
if( !str[2] )
break;
str += 2;
/* there must be a colon straight after a guid */
p = strchrW( str, ':' );
if( !p )
return E_FAIL;
len = p - str;
if( len != 38 )
return E_FAIL;
/* get the guid, and check it's validly formatted */
memcpy( szGuid, str, sizeof(WCHAR)*len );
szGuid[len] = 0;
r = CLSIDFromString( szGuid, &guid );
if( r != S_OK )
return r;
str = p + 1;
/* match it up to a guid that we care about */
if( IsEqualGUID( &guid, &SHELL32_AdvtShortcutComponent ) && !szComponent )
szComponent = str;
else if( IsEqualGUID( &guid, &SHELL32_AdvtShortcutProduct ) && !szProduct )
szProduct = str;
else
return E_FAIL;
/* skip to the next field */
str = strchrW( str, ':' );
if( !str )
return E_FAIL;
}
/* we have to have at least one of these two for an advertised shortcut */
if( !szComponent && !szProduct )
return E_FAIL;
This->sComponent = ShellLink_GetAdvertisedArg( szComponent );
This->sProduct = ShellLink_GetAdvertisedArg( szProduct );
TRACE("Component = %s\n", debugstr_w(This->sComponent));
TRACE("Product = %s\n", debugstr_w(This->sProduct));
return S_OK;
}
static BOOL ShellLink_GetVolumeInfo(LPWSTR path, volume_info *volume)
{
const int label_sz = sizeof volume->label/sizeof volume->label[0];
WCHAR drive[4] = { path[0], ':', '\\', 0 };
BOOL r;
volume->type = GetDriveTypeW(drive);
r = GetVolumeInformationW(drive, volume->label, label_sz,
&volume->serial, NULL, NULL, NULL, 0);
TRACE("r = %d type %ld serial %08lx name %s\n", r,
volume->type, volume->serial, debugstr_w(volume->label));
return r;
}
static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile) static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile)
{ {
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
WCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
LPWSTR fname; LPWSTR fname;
HRESULT hr = S_OK;
TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile)); TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
HeapFree(GetProcessHeap(), 0, This->sPath); if (!GetFullPathNameW(pszFile, MAX_PATH, buffer, &fname))
This->sPath = NULL;
HeapFree(GetProcessHeap(), 0, This->sComponent);
This->sComponent = NULL;
if (This->pPidl)
ILFree(This->pPidl);
This->pPidl = NULL;
if (S_OK != ShellLink_SetAdvertiseInfo( This, pszFile ))
{
if (*pszFile == '\0')
*buffer = '\0';
else if (!GetFullPathNameW(pszFile, MAX_PATH, buffer, &fname))
return E_FAIL; return E_FAIL;
else if(!PathFileExistsW(buffer))
hr = S_FALSE;
This->pPidl = SHSimpleIDListFromPathW(pszFile);
ShellLink_GetVolumeInfo(buffer, &This->volume);
HeapFree(GetProcessHeap(), 0, This->sPath);
This->sPath = HeapAlloc( GetProcessHeap(), 0, This->sPath = HeapAlloc( GetProcessHeap(), 0,
(lstrlenW( buffer )+1) * sizeof (WCHAR) ); (lstrlenW( buffer )+1) * sizeof (WCHAR) );
if (!This->sPath) if (!This->sPath)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
lstrcpyW(This->sPath, buffer); lstrcpyW(This->sPath, buffer);
}
This->bDirty = TRUE; This->bDirty = TRUE;
return hr; return S_OK;
} }
/************************************************************************** /**************************************************************************

View file

@ -365,7 +365,7 @@ static BOOL PathIsExeA (LPCSTR lpszPath)
TRACE("path=%s\n",lpszPath); TRACE("path=%s\n",lpszPath);
for(i=0; lpszExtensions[i]; i++) for(i=0; lpszExtensions[i]; i++)
if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE; if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
return FALSE; return FALSE;
} }
@ -1267,7 +1267,7 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
} }
else else
{ {
FIXME("(%d,%s), LoadString failed, missing translation?\n", folder, debugstr_w(pszPath)); FIXME("LoadString failed, missing translation?\n");
hr = E_FAIL; hr = E_FAIL;
} }
} }

View file

@ -46,7 +46,6 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut); LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut);
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path);
static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str) static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
{ {
@ -56,17 +55,4 @@ static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
} }
static inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
{
static const WCHAR fmtW[] =
{ '{','%','0','8','l','x','-','%','0','4','x','-','%','0','4','x','-',
'%','0','2','x','%','0','2','x','-',
'%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x',
'%','0','2','x','%','0','2','x','}',0 };
return sprintfW(str, fmtW,
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
}
void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags); void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags);

View file

@ -93,8 +93,7 @@ static shvheader DesktopSFHeader[] = {
/************************************************************************** /**************************************************************************
* ISF_Desktop_Constructor * ISF_Desktop_Constructor
*/ */
HRESULT WINAPI ISF_Desktop_Constructor ( HRESULT WINAPI ISF_Desktop_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{ {
IGenericSFImpl *sf; IGenericSFImpl *sf;
char szMyPath[MAX_PATH]; char szMyPath[MAX_PATH];
@ -119,8 +118,7 @@ HRESULT WINAPI ISF_Desktop_Constructor (
sf->sPathTarget = SHAlloc (strlen (szMyPath) + 1); sf->sPathTarget = SHAlloc (strlen (szMyPath) + 1);
lstrcpyA (sf->sPathTarget, szMyPath); lstrcpyA (sf->sPathTarget, szMyPath);
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
{
IUnknown_Release (_IUnknown_ (sf)); IUnknown_Release (_IUnknown_ (sf));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
@ -134,8 +132,7 @@ HRESULT WINAPI ISF_Desktop_Constructor (
* *
* NOTES supports not IPersist/IPersistFolder * NOTES supports not IPersist/IPersistFolder
*/ */
static HRESULT WINAPI ISF_Desktop_fnQueryInterface( static HRESULT WINAPI ISF_Desktop_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
@ -143,15 +140,12 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
*ppvObj = NULL; *ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) || if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IShellFolder)
IsEqualIID (riid, &IID_IShellFolder) || || IsEqualIID (riid, &IID_IShellFolder2)) {
IsEqualIID (riid, &IID_IShellFolder2))
{
*ppvObj = This; *ppvObj = This;
} }
if (*ppvObj) if (*ppvObj) {
{
IUnknown_AddRef ((IUnknown *) (*ppvObj)); IUnknown_AddRef ((IUnknown *) (*ppvObj));
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK; return S_OK;
@ -177,8 +171,7 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
TRACE ("(%p)->(count=%lu)\n", This, refCount + 1); TRACE ("(%p)->(count=%lu)\n", This, refCount + 1);
if (!refCount) if (!refCount) {
{
TRACE ("-- destroying IShellFolder(%p)\n", This); TRACE ("-- destroying IShellFolder(%p)\n", This);
if (This->pidlRoot) if (This->pidlRoot)
SHFree (This->pidlRoot); SHFree (This->pidlRoot);
@ -198,19 +191,23 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
* to MyComputer * to MyComputer
*/ */
static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, HWND hwndOwner,
LPBC pbc,
LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
WCHAR szElement[MAX_PATH]; WCHAR szElement[MAX_PATH];
LPCWSTR szNext = NULL; LPCWSTR szNext = NULL;
LPITEMIDLIST pidlTemp = NULL; LPITEMIDLIST pidlTemp = NULL;
HRESULT hr = S_OK; HRESULT hr = S_OK;
char szPath[MAX_PATH];
DWORD len;
CLSID clsid; CLSID clsid;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
pchEaten, ppidl, pdwAttributes);
if (!lpszDisplayName || !ppidl) if (!lpszDisplayName || !ppidl)
return E_INVALIDARG; return E_INVALIDARG;
@ -220,72 +217,42 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
if (pchEaten) if (pchEaten)
*pchEaten = 0; /* strange but like the original */ *pchEaten = 0; /* strange but like the original */
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
{
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement)); TRACE ("-- element: %s\n", debugstr_w (szElement));
SHCLSIDFromStringW (szElement + 2, &clsid); SHCLSIDFromStringW (szElement + 2, &clsid);
pidlTemp = _ILCreateGuid (PT_GUID, &clsid); pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
} } else if (PathGetDriveNumberW (lpszDisplayName) >= 0) {
else if (PathGetDriveNumberW (lpszDisplayName) >= 0)
{
/* it's a filesystem path with a drive. Let MyComputer parse it */ /* it's a filesystem path with a drive. Let MyComputer parse it */
pidlTemp = _ILCreateMyComputer (); pidlTemp = _ILCreateMyComputer ();
szNext = lpszDisplayName; szNext = lpszDisplayName;
} } else if (PathIsUNCW(lpszDisplayName)) {
else if (PathIsUNCW(lpszDisplayName))
{
pidlTemp = _ILCreateNetwork(); pidlTemp = _ILCreateNetwork();
szNext = lpszDisplayName; szNext = lpszDisplayName;
} } else {
else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) )
{
*ppidl = pidlTemp;
return S_OK;
}
else
{
/* it's a filesystem path on the desktop. Let a FSFolder parse it */ /* it's a filesystem path on the desktop. Let a FSFolder parse it */
if (*lpszDisplayName) if (*lpszDisplayName) {
{
WCHAR szPath[MAX_PATH];
LPWSTR pathPtr;
/* build a complete path to create a simple pidl */ /* build a complete path to create a simple pidl */
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szPath, lstrcpyA(szPath, This->sPathTarget);
sizeof(szPath) / sizeof(szPath[0])); PathAddBackslashA(szPath);
pathPtr = PathAddBackslashW(szPath); len = lstrlenA(szPath);
if (pathPtr) WideCharToMultiByte(CP_ACP, 0, lpszDisplayName, -1, szPath + len, MAX_PATH - len, NULL, NULL);
{ hr = _ILCreateFromPathA(szPath, &pidlTemp);
lstrcpynW(pathPtr, lpszDisplayName, } else {
sizeof(szPath)/sizeof(szPath[0]) - (pathPtr - szPath));
hr = _ILCreateFromPathW(szPath, &pidlTemp);
}
else
{
/* should never reach here, but for completeness */
hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
}
}
else
pidlTemp = _ILCreateMyComputer(); pidlTemp = _ILCreateMyComputer();
}
szNext = NULL; szNext = NULL;
} }
if (SUCCEEDED(hr) && pidlTemp) if (SUCCEEDED(hr) && pidlTemp) {
{ if (szNext && *szNext) {
if (szNext && *szNext) hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
{ } else {
hr = SHELL32_ParseNextElement(iface, hwndOwner, pbc, if (pdwAttributes && *pdwAttributes) {
&pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); hr = SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
} }
else
{
if (pdwAttributes && *pdwAttributes)
hr = SHELL32_GetItemAttributes(_IShellFolder_ (This),
pidlTemp, pdwAttributes);
} }
} }
@ -299,16 +266,10 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
/************************************************************************** /**************************************************************************
* CreateDesktopEnumList() * CreateDesktopEnumList()
*/ */
static const WCHAR Desktop_NameSpaceW[] = { 'S','O','F','T','W','A','R','E',
'\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l',
'o','r','e','r','\\','D','e','s','k','t','o','p','\\','N','a','m','e','s','p',
'a','c','e','\0' };
static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
{ {
BOOL ret = TRUE; BOOL ret = TRUE;
WCHAR szPath[MAX_PATH]; char szPath[MAX_PATH];
TRACE("(%p)->(flags=0x%08lx) \n",list,dwFlags); TRACE("(%p)->(flags=0x%08lx) \n",list,dwFlags);
@ -316,31 +277,30 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
if(dwFlags & SHCONTF_FOLDERS) if(dwFlags & SHCONTF_FOLDERS)
{ {
HKEY hkey; HKEY hkey;
LONG r;
/*create the pidl for This item */ /*create the pidl for This item */
ret = AddToEnumList(list, _ILCreateMyComputer()); ret = AddToEnumList(list, _ILCreateMyComputer());
r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, Desktop_NameSpaceW, if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
0, KEY_READ, &hkey); "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\desktop\\NameSpace",
if (ret && ERROR_SUCCESS == r) 0, KEY_READ, &hkey))
{ {
WCHAR iid[50]; char iid[50];
int i=0; int i=0;
BOOL moreKeys = TRUE; BOOL moreKeys = TRUE;
while (ret && moreKeys) while (ret && moreKeys)
{ {
DWORD size; DWORD size = sizeof (iid);
LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
NULL);
size = sizeof (iid); if (ERROR_SUCCESS == apiRet)
r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
if (ERROR_SUCCESS == r)
{ {
ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid)); ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
i++; i++;
} }
else if (ERROR_NO_MORE_ITEMS == r) else if (ERROR_NO_MORE_ITEMS == apiRet)
moreKeys = FALSE; moreKeys = FALSE;
else else
ret = FALSE; ret = FALSE;
@ -350,7 +310,7 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
} }
/*enumerate the elements in %windir%\desktop */ /*enumerate the elements in %windir%\desktop */
SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE); SHGetSpecialFolderPathA(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ret = ret && CreateFolderEnumList(list, szPath, dwFlags); ret = ret && CreateFolderEnumList(list, szPath, dwFlags);
return ret; return ret;
@ -364,8 +324,7 @@ static HRESULT WINAPI ISF_Desktop_fnEnumObjects (IShellFolder2 * iface,
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
This, hwndOwner, dwFlags, ppEnumIDList);
*ppEnumIDList = IEnumIDList_Constructor(); *ppEnumIDList = IEnumIDList_Constructor();
if (*ppEnumIDList) if (*ppEnumIDList)
@ -384,8 +343,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut); return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
} }
@ -398,8 +356,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToStorage (IShellFolder2 * iface,
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
*ppvOut = NULL; *ppvOut = NULL;
return E_NOTIMPL; return E_NOTIMPL;
@ -408,10 +365,12 @@ static HRESULT WINAPI ISF_Desktop_fnBindToStorage (IShellFolder2 * iface,
/************************************************************************** /**************************************************************************
* ISF_Desktop_fnCompareIDs * ISF_Desktop_fnCompareIDs
*/ */
static HRESULT WINAPI ISF_Desktop_fnCompareIDs (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnCompareIDs (IShellFolder2 * iface,
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
int nReturn; int nReturn;
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
@ -427,36 +386,29 @@ static HRESULT WINAPI ISF_Desktop_fnCreateViewObject (IShellFolder2 * iface,
HWND hwndOwner, REFIID riid, LPVOID * ppvOut) HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPSHELLVIEW pShellView; LPSHELLVIEW pShellView;
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
This, hwndOwner, shdebugstr_guid (riid), ppvOut);
if (!ppvOut)
return hr;
if (ppvOut) {
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID (riid, &IID_IDropTarget)) if (IsEqualIID (riid, &IID_IDropTarget)) {
{
WARN ("IDropTarget not implemented\n"); WARN ("IDropTarget not implemented\n");
hr = E_NOTIMPL; hr = E_NOTIMPL;
} } else if (IsEqualIID (riid, &IID_IContextMenu)) {
else if (IsEqualIID (riid, &IID_IContextMenu))
{
WARN ("IContextMenu not implemented\n"); WARN ("IContextMenu not implemented\n");
hr = E_NOTIMPL; hr = E_NOTIMPL;
} } else if (IsEqualIID (riid, &IID_IShellView)) {
else if (IsEqualIID (riid, &IID_IShellView))
{
pShellView = IShellView_Constructor ((IShellFolder *) iface); pShellView = IShellView_Constructor ((IShellFolder *) iface);
if (pShellView) if (pShellView) {
{
hr = IShellView_QueryInterface (pShellView, riid, ppvOut); hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
IShellView_Release (pShellView); IShellView_Release (pShellView);
} }
} }
}
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut); TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
return hr; return hr;
} }
@ -468,19 +420,18 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK; HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
This, cidl, apidl, *rgfInOut);
if (!cidl || !apidl || !rgfInOut) if ((!cidl) || (!apidl) || (!rgfInOut))
return E_INVALIDARG; return E_INVALIDARG;
if (*rgfInOut == 0) if (*rgfInOut == 0)
*rgfInOut = ~0; *rgfInOut = ~0;
while (cidl > 0 && *apidl) while (cidl > 0 && *apidl) {
{
pdump (*apidl); pdump (*apidl);
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut); SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
apidl++; apidl++;
@ -505,7 +456,9 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
* *
*/ */
static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, HWND hwndOwner,
UINT cidl,
LPCITEMIDLIST * apidl,
REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
@ -517,8 +470,8 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut); This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
if (!ppvOut) if (ppvOut) {
return hr; *ppvOut = NULL;
if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
{ {
@ -567,6 +520,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
*ppvOut = pObj; *ppvOut = pObj;
}
TRACE ("(%p)->hr=0x%08lx\n", This, hr); TRACE ("(%p)->hr=0x%08lx\n", This, hr);
return hr; return hr;
} }
@ -581,6 +535,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
CHAR szPath[MAX_PATH]; CHAR szPath[MAX_PATH];
GUID const *clsid; GUID const *clsid;
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -593,99 +548,62 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
if (!strRet) if (!strRet)
return E_INVALIDARG; return E_INVALIDARG;
if (_ILIsDesktop (pidl)) if (_ILIsDesktop (pidl)) {
{ if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)) {
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
(GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING))
{
lstrcpyA (szPath, This->sPathTarget); lstrcpyA (szPath, This->sPathTarget);
} } else {
else
HCR_GetClassNameA(&CLSID_ShellDesktop, szPath, MAX_PATH); HCR_GetClassNameA(&CLSID_ShellDesktop, szPath, MAX_PATH);
} }
else if (_ILIsPidlSimple (pidl)) } else if (_ILIsPidlSimple (pidl)) {
{ if ((clsid = _ILGetGUIDPointer (pidl))) {
if ((clsid = _ILGetGUIDPointer (pidl))) if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
{
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)
{
int bWantsForParsing; int bWantsForParsing;
/* /*
* We can only get a filesystem path from a shellfolder if the * we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
* value WantsFORPARSING in CLSID\\{...}\\shellfolder exists. * CLSID\\{...}\\shellfolder exists
* * exception: the MyComputer folder has this keys not but like any filesystem backed
* Exception: The MyComputer folder doesn't have this key, * folder it needs these behaviour
* but any other filesystem backed folder it needs it.
*/ */
if (IsEqualIID (clsid, &CLSID_MyComputer)) if (IsEqualIID (clsid, &CLSID_MyComputer)) {
{
bWantsForParsing = 1; bWantsForParsing = 1;
} } else {
else
{
/* get the "WantsFORPARSING" flag from the registry */ /* get the "WantsFORPARSING" flag from the registry */
static const WCHAR clsidW[] = char szRegPath[100];
{ 'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] =
{ '\\','s','h','e','l','l','f','o','l','d','e','r',0 };
static const WCHAR wantsForParsingW[] =
{ 'W','a','n','t','s','F','o','r','P','a','r','s','i','n',
'g',0 };
WCHAR szRegPath[100];
LONG r;
lstrcpyW (szRegPath, clsidW); lstrcpyA (szRegPath, "CLSID\\");
SHELL32_GUIDToStringW (clsid, &szRegPath[6]); SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
lstrcatW (szRegPath, shellfolderW); lstrcatA (szRegPath, "\\shellfolder");
r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, bWantsForParsing =
wantsForParsingW, NULL, NULL, NULL); (ERROR_SUCCESS ==
if (r == ERROR_SUCCESS) SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
bWantsForParsing = TRUE;
else
bWantsForParsing = FALSE;
} }
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && bWantsForParsing) {
bWantsForParsing) /* we need the filesystem path to the destination folder. Only the folder itself can know it */
{ hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
/* } else {
* we need the filesystem path to the destination folder.
* Only the folder itself can know it
*/
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags,
szPath, MAX_PATH);
}
else
{
/* parsing name like ::{...} */ /* parsing name like ::{...} */
lstrcpyA (szPath, "::"); lstrcpyA (szPath, "::");
SHELL32_GUIDToStringA (clsid, &szPath[2]); SHELL32_GUIDToStringA (clsid, &szPath[2]);
} }
} } else {
else
{
/* user friendly name */ /* user friendly name */
HCR_GetClassNameA (clsid, szPath, MAX_PATH); HCR_GetClassNameA (clsid, szPath, MAX_PATH);
} }
} } else {
else
{
/* file system folder */ /* file system folder */
_ILSimpleGetText (pidl, szPath, MAX_PATH); _ILSimpleGetText (pidl, szPath, MAX_PATH);
if (!_ILIsFolder(pidl)) if (!_ILIsFolder(pidl))
SHELL_FS_ProcessDisplayFilename(szPath, dwFlags); SHELL_FS_ProcessDisplayFilename(szPath, dwFlags);
} }
} } else {
else
{
/* a complex pidl, let the subfolder do the work */ /* a complex pidl, let the subfolder do the work */
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH); hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
} }
if (SUCCEEDED (hr)) if (SUCCEEDED (hr)) {
{
strRet->uType = STRRET_CSTR; strRet->uType = STRRET_CSTR;
lstrcpynA (strRet->u.cStr, szPath, MAX_PATH); lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
} }
@ -706,35 +624,29 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
* DWORD dwFlags, //[in ] SHGNO formatting flags * DWORD dwFlags, //[in ] SHGNO formatting flags
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
*/ */
static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
HWND hwndOwner, LPCITEMIDLIST pidl, /* simple pidl */
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
debugstr_w (lpName), dwFlags, pPidlOut);
return E_FAIL; return E_FAIL;
} }
static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2 *iface, static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
GUID * pguid)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI ISF_Desktop_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
static HRESULT WINAPI ISF_Desktop_fnEnumSearches (IShellFolder2 *iface,
IEnumExtraSearch ** ppenum)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface,
DWORD dwRes, ULONG * pSort, ULONG * pDisplay) DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
{ {
@ -749,8 +661,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface,
return S_OK; return S_OK;
} }
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState ( static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
@ -763,7 +674,6 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (
return S_OK; return S_OK;
} }
static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface,
LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{ {
@ -772,7 +682,6 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface,
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
{ {
@ -785,22 +694,17 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS) if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
return E_INVALIDARG; return E_INVALIDARG;
if (!pidl) if (!pidl) {
{
psd->fmt = DesktopSFHeader[iColumn].fmt; psd->fmt = DesktopSFHeader[iColumn].fmt;
psd->cxChar = DesktopSFHeader[iColumn].cxChar; psd->cxChar = DesktopSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR; psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, DesktopSFHeader[iColumn].colnameid, LoadStringA (shell32_hInstance, DesktopSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
psd->str.u.cStr, MAX_PATH);
return S_OK; return S_OK;
} } else {
/* the data from the pidl */ /* the data from the pidl */
switch (iColumn) switch (iColumn) {
{
case 0: /* name */ case 0: /* name */
hr = IShellFolder_GetDisplayNameOf(iface, pidl, hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break; break;
case 1: /* size */ case 1: /* size */
_ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH); _ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
@ -817,12 +721,11 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
} }
hr = S_OK; hr = S_OK;
psd->str.uType = STRRET_CSTR; psd->str.uType = STRRET_CSTR;
}
return hr; return hr;
} }
static HRESULT WINAPI ISF_Desktop_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
static HRESULT WINAPI ISF_Desktop_fnMapColumnToSCID (
IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
@ -851,5 +754,4 @@ static IShellFolder2Vtbl vt_MCFldr_ShellFolder2 =
ISF_Desktop_fnGetDefaultColumnState, ISF_Desktop_fnGetDefaultColumnState,
ISF_Desktop_fnGetDetailsEx, ISF_Desktop_fnGetDetailsEx,
ISF_Desktop_fnGetDetailsOf, ISF_Desktop_fnGetDetailsOf,
ISF_Desktop_fnMapColumnToSCID ISF_Desktop_fnMapColumnToSCID};
};

View file

@ -224,8 +224,7 @@ static shvheader GenericSFHeader[] = {
* {F3364BA0-65B9-11CE-A9BA-00AA004AE837} * {F3364BA0-65B9-11CE-A9BA-00AA004AE837}
* *
*/ */
HRESULT WINAPI HRESULT WINAPI IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{ {
IGenericSFImpl *sf; IGenericSFImpl *sf;
@ -262,9 +261,7 @@ IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
* REFIID riid [in ] Requested InterfaceID * REFIID riid [in ] Requested InterfaceID
* LPVOID* ppvObject [out] Interface* to hold the result * LPVOID* ppvObject [out] Interface* to hold the result
*/ */
static HRESULT WINAPI static HRESULT WINAPI IShellFolder_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
IShellFolder_fnQueryInterface (IShellFolder2 * iface, REFIID riid,
LPVOID * ppvObj)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
@ -298,50 +295,6 @@ static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface)
return IUnknown_Release (This->pUnkOuter); return IUnknown_Release (This->pUnkOuter);
} }
/**************************************************************************
* SHELL32_CreatePidlFromBindCtx [internal]
*
* If the caller bound File System Bind Data, assume it is the
* find data for the path.
* This allows binding of paths that don't exist.
*/
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
{
static const WCHAR szfsbc[] = {
'F','i','l','e',' ','S','y','s','t','e','m',' ',
'B','i','n','d',' ','D','a','t','a',0 };
IFileSystemBindData *fsbd = NULL;
LPITEMIDLIST pidl = NULL;
IUnknown *param = NULL;
WIN32_FIND_DATAW wfd;
HRESULT r;
TRACE("%p %s\n", pbc, debugstr_w(path));
if (!pbc)
return NULL;
/* see if the caller bound File System Bind Data */
r = IBindCtx_GetObjectParam( pbc, (LPOLESTR) szfsbc, &param );
if (FAILED(r))
return NULL;
r = IUnknown_QueryInterface( param, &IID_IFileSystemBindData,
(LPVOID*) &fsbd );
if (SUCCEEDED(r))
{
r = IFileSystemBindData_GetFindData( fsbd, &wfd );
if (SUCCEEDED(r))
{
lstrcpynW( &wfd.cFileName[0], path, MAX_PATH );
pidl = _ILCreateFromFindDataW( &wfd );
}
IFileSystemBindData_Release( fsbd );
}
return pidl;
}
/************************************************************************** /**************************************************************************
* IShellFolder_ParseDisplayName {SHELL32} * IShellFolder_ParseDisplayName {SHELL32}
* *
@ -372,21 +325,19 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, HWND hwndOwner,
LPBC pbc, LPBC pbc,
LPOLESTR lpszDisplayName, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
DWORD * pdwAttributes)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL; LPCWSTR szNext = NULL;
WCHAR szElement[MAX_PATH]; WCHAR szElement[MAX_PATH];
WCHAR szPath[MAX_PATH]; CHAR szPath[MAX_PATH];
LPITEMIDLIST pidlTemp = NULL; LPITEMIDLIST pidlTemp = NULL;
DWORD len; DWORD len;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
pchEaten, ppidl, pdwAttributes);
if (!lpszDisplayName || !ppidl) if (!lpszDisplayName || !ppidl)
return E_INVALIDARG; return E_INVALIDARG;
@ -394,32 +345,27 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
if (pchEaten) if (pchEaten)
*pchEaten = 0; /* strange but like the original */ *pchEaten = 0; /* strange but like the original */
pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName); if (*lpszDisplayName) {
if (!pidlTemp && *lpszDisplayName)
{
/* get the next element */ /* get the next element */
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
/* build the full pathname to the element */ /* build the full pathname to the element */
/* lstrcpyW(szPath, This->sPathTarget); */ lstrcpyA(szPath, This->sPathTarget);
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szPath, MAX_PATH); PathAddBackslashA(szPath);
PathAddBackslashW(szPath); len = lstrlenA(szPath);
len = lstrlenW(szPath); WideCharToMultiByte(CP_ACP, 0, szElement, -1, szPath + len, MAX_PATH - len, NULL, NULL);
lstrcpynW(szPath + len, szElement, MAX_PATH - len);
/* get the pidl */ /* get the pidl */
hr = _ILCreateFromPathW(szPath, &pidlTemp); hr = _ILCreateFromPathA(szPath, &pidlTemp);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
if (szNext && *szNext) { if (szNext && *szNext) {
/* try to analyse the next element */ /* try to analyse the next element */
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
&pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
} else { } else {
/* it's the last element */ /* it's the last element */
if (pdwAttributes && *pdwAttributes) { if (pdwAttributes && *pdwAttributes) {
hr = SHELL32_GetItemAttributes (_IShellFolder_ (This), hr = SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
pidlTemp, pdwAttributes);
} }
} }
} }
@ -443,21 +389,15 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
* LPENUMIDLIST* ppenumIDList //[out] IEnumIDList interface * LPENUMIDLIST* ppenumIDList //[out] IEnumIDList interface
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
dwFlags, ppEnumIDList);
*ppEnumIDList = IEnumIDList_Constructor(); *ppEnumIDList = IEnumIDList_Constructor();
if (*ppEnumIDList) if (*ppEnumIDList)
{ CreateFolderEnumList(*ppEnumIDList, This->sPathTarget, dwFlags);
WCHAR path[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, path, MAX_PATH);
CreateFolderEnumList(*ppEnumIDList, path, dwFlags);
}
TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList); TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
@ -473,16 +413,13 @@ IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner,
* LPVOID* ppvObject //[out] Interface* * LPVOID* ppvObject //[out] Interface*
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl, IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, LPVOID * ppvOut)
LPBC pbc, REFIID riid, LPVOID * ppvOut)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc, TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc, shdebugstr_guid (riid), ppvOut);
shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
ppvOut);
} }
/************************************************************************** /**************************************************************************
@ -494,13 +431,11 @@ IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
* LPVOID* ppvObject //[out] Interface* returned * LPVOID* ppvObject //[out] Interface* returned
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl, IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
shdebugstr_guid (riid), ppvOut);
*ppvOut = NULL; *ppvOut = NULL;
return E_NOTIMPL; return E_NOTIMPL;
@ -511,8 +446,7 @@ IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl,
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
@ -528,16 +462,14 @@ IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam,
* IShellFolder_fnCreateViewObject * IShellFolder_fnCreateViewObject
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
REFIID riid, LPVOID * ppvOut)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
LPSHELLVIEW pShellView; LPSHELLVIEW pShellView;
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
ppvOut);
if (ppvOut) { if (ppvOut) {
*ppvOut = NULL; *ppvOut = NULL;
@ -569,15 +501,13 @@ IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner,
* *
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
HRESULT hr = S_OK; HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
*rgfInOut);
if ((!cidl) || (!apidl) || (!rgfInOut)) if ((!cidl) || (!apidl) || (!rgfInOut))
return E_INVALIDARG; return E_INVALIDARG;
@ -609,22 +539,19 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl,
* LPVOID* ppvObject) //[out] Resulting Interface * LPVOID* ppvObject) //[out] Resulting Interface
* *
* NOTES * NOTES
* This function gets asked to return "view objects" for one or more (multiple * This function gets asked to return "view objects" for one or more (multiple select)
* select) items: * items:
* The viewobject typically is an COM object with one of the following * The viewobject typically is an COM object with one of the following interfaces:
* interfaces:
* IExtractIcon,IDataObject,IContextMenu * IExtractIcon,IDataObject,IContextMenu
* In order to support icon positions in the default Listview your DataObject * In order to support icon positions in the default Listview your DataObject
* must implement the SetData method (in addition to GetData :) - the shell * must implement the SetData method (in addition to GetData :) - the shell passes
* passes a barely documented "Icon positions" structure to SetData when the * a barely documented "Icon positions" structure to SetData when the drag starts,
* drag starts, and GetData's it if the drop is in another explorer window that * and GetData's it if the drop is in another explorer window that needs the positions.
* needs the positions.
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface, IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
HWND hwndOwner, HWND hwndOwner,
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
UINT * prgfInOut, LPVOID * ppvOut)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
@ -639,12 +566,10 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) { } else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]); pidl = ILCombine (This->pidlRoot, apidl[0]);
@ -657,10 +582,9 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
SHFree (pidl); SHFree (pidl);
hr = S_OK; hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) { } else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) {
hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
(LPVOID *) & pObj); } else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
} else if ((IsEqualIID(riid,&IID_IShellLinkW) || && (cidl == 1)) {
IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]); pidl = ILCombine (This->pidlRoot, apidl[0]);
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj); hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
SHFree (pidl); SHFree (pidl);
@ -677,15 +601,6 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
return hr; return hr;
} }
static const WCHAR AdvancedW[] = { 'S','O','F','T','W','A','R','E',
'\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l',
'o','r','e','r','\\','A','d','v','a','n','c','e','d',0 };
static const WCHAR HideFileExtW[] = { 'H','i','d','e','F','i','l','e','E','x',
't',0 };
static const WCHAR NeverShowExtW[] = { 'N','e','v','e','r','S','h','o','w','E',
'x','t',0 };
void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags) void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
{ {
/*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */ /*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */
@ -696,10 +611,10 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
DWORD dwDataSize = sizeof (DWORD); DWORD dwDataSize = sizeof (DWORD);
BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */ BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */
if (!RegCreateKeyExW (HKEY_CURRENT_USER, AdvancedW, if (!RegCreateKeyExA (HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) { 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
if (!RegQueryValueExW (hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData, if (!RegQueryValueExA (hKey, "HideFileExt", 0, 0, (LPBYTE) & dwData, &dwDataSize))
&dwDataSize))
doHide = dwData; doHide = dwData;
RegCloseKey (hKey); RegCloseKey (hKey);
@ -709,17 +624,16 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
LPSTR ext = PathFindExtensionA(szPath); LPSTR ext = PathFindExtensionA(szPath);
if (ext) { if (ext) {
HKEY hkey;
char classname[MAX_PATH]; char classname[MAX_PATH];
LONG classlen = MAX_PATH; LONG classlen = MAX_PATH;
if (!RegQueryValueA(HKEY_CLASSES_ROOT, ext, classname, if (!RegQueryValueA(HKEY_CLASSES_ROOT, ext, classname, &classlen))
&classlen)) if (!RegOpenKeyA(HKEY_CLASSES_ROOT, classname, &hkey)) {
if (!RegOpenKeyA(HKEY_CLASSES_ROOT, classname, &hKey)) { if (!RegQueryValueExA(hkey, "NeverShowExt", 0, NULL, NULL, NULL))
if (!RegQueryValueExW(hKey, NeverShowExtW, 0, NULL,
NULL, NULL))
doHide = TRUE; doHide = TRUE;
RegCloseKey(hKey); RegCloseKey(hkey);
} }
} }
} }
@ -743,8 +657,7 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
DWORD dwFlags, LPSTRRET strRet)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
@ -770,27 +683,23 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
FIXME ("special pidl\n"); FIXME ("special pidl\n");
} }
} else { } else {
if (!(dwFlags & SHGDN_INFOLDER) && (dwFlags & SHGDN_FORPARSING) && if (!(dwFlags & SHGDN_INFOLDER) && (dwFlags & SHGDN_FORPARSING) && This->sPathTarget) {
This->sPathTarget) { lstrcpyA (szPath, This->sPathTarget); /* get path to root */
/* get path to root */
lstrcpyA (szPath, This->sPathTarget);
PathAddBackslashA (szPath); PathAddBackslashA (szPath);
len = lstrlenA (szPath); len = lstrlenA (szPath);
} }
/* append my own path */ _ILSimpleGetText (pidl, szPath + len, MAX_PATH - len); /* append my own path */
_ILSimpleGetText (pidl, szPath + len, MAX_PATH - len);
if (!_ILIsFolder(pidl)) if (!_ILIsFolder(pidl))
SHELL_FS_ProcessDisplayFilename(szPath, dwFlags); SHELL_FS_ProcessDisplayFilename(szPath, dwFlags);
} }
/* go deeper if needed */ if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) { /* go deeper if needed */
if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) {
PathAddBackslashA (szPath); PathAddBackslashA (szPath);
len = lstrlenA (szPath); len = lstrlenA (szPath);
if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild (iface, pidl, if (!SUCCEEDED
dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len))) (SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
strRet->uType = STRRET_CSTR; strRet->uType = STRRET_CSTR;
@ -812,46 +721,42 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
* DWORD dwFlags, //[in ] SHGNO formatting flags * DWORD dwFlags, //[in ] SHGNO formatting flags
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
*/ */
static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
HWND hwndOwner, LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
LPCITEMIDLIST pidl,
LPCOLESTR lpName,
DWORD dwFlags,
LPITEMIDLIST * pPidlOut)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
WCHAR szSrc[MAX_PATH], szDest[MAX_PATH]; char szSrc[MAX_PATH],
LPWSTR ptr; szDest[MAX_PATH];
int len;
BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl)); BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl));
TRACE ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, TRACE ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
debugstr_w (lpName), dwFlags, pPidlOut);
/* build source path */ /* build source path */
if (dwFlags & SHGDN_INFOLDER) { if (dwFlags & SHGDN_INFOLDER) {
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szSrc, MAX_PATH); strcpy (szSrc, This->sPathTarget);
ptr = PathAddBackslashW (szSrc); PathAddBackslashA (szSrc);
if (ptr) len = strlen (szSrc);
_ILSimpleGetTextW (pidl, ptr, MAX_PATH - (ptr - szSrc)); _ILSimpleGetText (pidl, szSrc + len, MAX_PATH - len);
} else { } else {
/* FIXME: Can this work with a simple PIDL? */ /* FIXME: Can this work with a simple PIDL? */
SHGetPathFromIDListW (pidl, szSrc); SHGetPathFromIDListA (pidl, szSrc);
} }
/* build destination path */ /* build destination path */
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szDest, MAX_PATH); strcpy (szDest, This->sPathTarget);
ptr = PathAddBackslashW (szDest); PathAddBackslashA (szDest);
if (ptr) len = strlen (szDest);
lstrcpynW(ptr, lpName, MAX_PATH - (ptr - szDest)); WideCharToMultiByte (CP_ACP, 0, lpName, -1, szDest + len, MAX_PATH - len, NULL, NULL);
TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest)); szDest[MAX_PATH - 1] = 0;
if (MoveFileW (szSrc, szDest)) { TRACE ("src=%s dest=%s\n", szSrc, szDest);
if (MoveFileA (szSrc, szDest)) {
HRESULT hr = S_OK; HRESULT hr = S_OK;
if (pPidlOut) if (pPidlOut)
hr = _ILCreateFromPathW(szDest, pPidlOut); hr = _ILCreateFromPathA(szDest, pPidlOut);
SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHCNF_PATHA, szSrc, szDest);
SHCNF_PATHW, szSrc, szDest);
return hr; return hr;
} }
@ -859,24 +764,20 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
return E_FAIL; return E_FAIL;
} }
static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID (IShellFolder2 *iface, static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
GUID * pguid)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI IShellFolder_fnEnumSearches (IShellFolder2 * iface, static HRESULT WINAPI IShellFolder_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
IEnumExtraSearch ** ppenum)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
ULONG * pSort, ULONG * pDisplay)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
@ -889,10 +790,7 @@ IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes,
return S_OK; return S_OK;
} }
static HRESULT WINAPI IShellFolder_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
static HRESULT WINAPI
IShellFolder_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn,
DWORD * pcsFlags)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
@ -905,20 +803,16 @@ IShellFolder_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn,
return S_OK; return S_OK;
} }
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, IShellFolder_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
const SHCOLUMNID * pscid, VARIANT * pv)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
UINT iColumn, SHELLDETAILS * psd)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
@ -933,15 +827,13 @@ IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
psd->fmt = GenericSFHeader[iColumn].fmt; psd->fmt = GenericSFHeader[iColumn].fmt;
psd->cxChar = GenericSFHeader[iColumn].cxChar; psd->cxChar = GenericSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR; psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, GenericSFHeader[iColumn].colnameid, LoadStringA (shell32_hInstance, GenericSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
psd->str.u.cStr, MAX_PATH);
return S_OK; return S_OK;
} else { } else {
/* the data from the pidl */ /* the data from the pidl */
switch (iColumn) { switch (iColumn) {
case 0: /* name */ case 0: /* name */
hr = IShellFolder_GetDisplayNameOf (iface, pidl, hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break; break;
case 1: /* size */ case 1: /* size */
_ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH); _ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
@ -962,10 +854,7 @@ IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
return hr; return hr;
} }
static HRESULT WINAPI IShellFolder_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
static HRESULT WINAPI
IShellFolder_fnMapColumnToSCID (IShellFolder2 * iface, UINT column,
SHCOLUMNID * pscid)
{ {
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface) _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
@ -1001,8 +890,7 @@ static IShellFolder2Vtbl sfvt =
* ISFHelper for IShellFolder implementation * ISFHelper for IShellFolder implementation
*/ */
static HRESULT WINAPI static HRESULT WINAPI ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj)
ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj)
{ {
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface); _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface);
@ -1035,8 +923,7 @@ static ULONG WINAPI ISFHelper_fnRelease (ISFHelper * iface)
* creates a unique folder name * creates a unique folder name
*/ */
static HRESULT WINAPI static HRESULT WINAPI ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName, UINT uLen)
ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName, UINT uLen)
{ {
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface) _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
IEnumIDList *penum; IEnumIDList *penum;
@ -1058,10 +945,8 @@ ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName, UINT uLen)
DWORD dwFetched; DWORD dwFetched;
int i = 1; int i = 1;
next: next:IEnumIDList_Reset (penum);
IEnumIDList_Reset (penum); while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) && dwFetched) {
while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) &&
dwFetched) {
_ILSimpleGetText (pidl, szText, MAX_PATH); _ILSimpleGetText (pidl, szText, MAX_PATH);
if (0 == strcasecmp (szText, lpName)) { if (0 == strcasecmp (szText, lpName)) {
sprintf (lpName, "%s %d", szNewFolder, i++); sprintf (lpName, "%s %d", szNewFolder, i++);
@ -1084,9 +969,7 @@ next:
* adds a new folder. * adds a new folder.
*/ */
static HRESULT WINAPI static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName, LPITEMIDLIST * ppidlOut)
ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName,
LPITEMIDLIST * ppidlOut)
{ {
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface) _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
char lpstrNewDir[MAX_PATH]; char lpstrNewDir[MAX_PATH];
@ -1112,10 +995,8 @@ ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName,
char lpstrCaption[256]; char lpstrCaption[256];
/* Cannot Create folder because of permissions */ /* Cannot Create folder because of permissions */
LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_DENIED, lpstrTempText, LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_DENIED, lpstrTempText, sizeof (lpstrTempText));
sizeof (lpstrTempText)); LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, lpstrCaption, sizeof (lpstrCaption));
LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, lpstrCaption,
sizeof (lpstrCaption));
sprintf (lpstrText, lpstrTempText, lpstrNewDir); sprintf (lpstrText, lpstrTempText, lpstrNewDir);
MessageBoxA (hwnd, lpstrText, lpstrCaption, MB_OK | MB_ICONEXCLAMATION); MessageBoxA (hwnd, lpstrText, lpstrCaption, MB_OK | MB_ICONEXCLAMATION);
} }
@ -1128,8 +1009,7 @@ ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName,
* *
* deletes items in folder * deletes items in folder
*/ */
static HRESULT WINAPI static HRESULT WINAPI ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
{ {
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface) _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
UINT i; UINT i;
@ -1187,8 +1067,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
* copies items to this folder * copies items to this folder
*/ */
static HRESULT WINAPI static HRESULT WINAPI
ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl)
LPCITEMIDLIST * apidl)
{ {
UINT i; UINT i;
IPersistFolder2 *ppf2 = NULL; IPersistFolder2 *ppf2 = NULL;
@ -1199,8 +1078,7 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl,
TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl); TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl);
IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, (LPVOID *) & ppf2);
(LPVOID *) & ppf2);
if (ppf2) { if (ppf2) {
LPITEMIDLIST pidl; LPITEMIDLIST pidl;
@ -1208,13 +1086,11 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl,
for (i = 0; i < cidl; i++) { for (i = 0; i < cidl; i++) {
SHGetPathFromIDListA (pidl, szSrcPath); SHGetPathFromIDListA (pidl, szSrcPath);
PathAddBackslashA (szSrcPath); PathAddBackslashA (szSrcPath);
_ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath), _ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath), MAX_PATH);
MAX_PATH);
strcpy (szDstPath, This->sPathTarget); strcpy (szDstPath, This->sPathTarget);
PathAddBackslashA (szDstPath); PathAddBackslashA (szDstPath);
_ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), _ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), MAX_PATH);
MAX_PATH);
MESSAGE ("would copy %s to %s\n", szSrcPath, szDstPath); MESSAGE ("would copy %s to %s\n", szSrcPath, szDstPath);
} }
SHFree (pidl); SHFree (pidl);
@ -1239,9 +1115,7 @@ static ISFHelperVtbl shvt =
* IFSFldr_PersistFolder3_QueryInterface * IFSFldr_PersistFolder3_QueryInterface
* *
*/ */
static HRESULT WINAPI static HRESULT WINAPI IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * iface, REFIID iid, LPVOID * ppvObj)
IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * iface, REFIID iid,
LPVOID * ppvObj)
{ {
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
@ -1254,8 +1128,7 @@ IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * iface, REFIID iid,
* IFSFldr_PersistFolder3_AddRef * IFSFldr_PersistFolder3_AddRef
* *
*/ */
static ULONG WINAPI static ULONG WINAPI IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
{ {
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
@ -1268,8 +1141,7 @@ IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
* IFSFldr_PersistFolder3_Release * IFSFldr_PersistFolder3_Release
* *
*/ */
static ULONG WINAPI static ULONG WINAPI IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
{ {
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
@ -1281,8 +1153,7 @@ IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
/************************************************************************ /************************************************************************
* IFSFldr_PersistFolder3_GetClassID * IFSFldr_PersistFolder3_GetClassID
*/ */
static HRESULT WINAPI static HRESULT WINAPI IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface, CLSID * lpClassId)
IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface, CLSID * lpClassId)
{ {
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
@ -1301,8 +1172,7 @@ IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface, CLSID * lpClassId)
* NOTES * NOTES
* sPathTarget is not set. Don't know how to handle in a non rooted environment. * sPathTarget is not set. Don't know how to handle in a non rooted environment.
*/ */
static HRESULT WINAPI static HRESULT WINAPI IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
{ {
char sTemp[MAX_PATH]; char sTemp[MAX_PATH];
@ -1330,9 +1200,7 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
/************************************************************************** /**************************************************************************
* IFSFldr_PersistFolder3_GetCurFolder * IFSFldr_PersistFolder3_GetCurFolder
*/ */
static HRESULT WINAPI static HRESULT WINAPI IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * iface, LPITEMIDLIST * pidl)
IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * iface,
LPITEMIDLIST * pidl)
{ {
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
@ -1350,8 +1218,7 @@ IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * iface,
*/ */
static HRESULT WINAPI static HRESULT WINAPI
IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface, IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
IBindCtx * pbc, LPCITEMIDLIST pidlRoot, IBindCtx * pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO * ppfti)
const PERSIST_FOLDER_TARGET_INFO * ppfti)
{ {
char sTemp[MAX_PATH]; char sTemp[MAX_PATH];
@ -1361,8 +1228,7 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
if (ppfti) if (ppfti)
TRACE ("--%p %s %s 0x%08lx 0x%08x\n", TRACE ("--%p %s %s 0x%08lx 0x%08x\n",
ppfti->pidlTargetFolder, debugstr_w (ppfti->szTargetParsingName), ppfti->pidlTargetFolder, debugstr_w (ppfti->szTargetParsingName),
debugstr_w (ppfti->szNetworkProvider), ppfti->dwAttributes, debugstr_w (ppfti->szNetworkProvider), ppfti->dwAttributes, ppfti->csidl);
ppfti->csidl);
pdump (pidlRoot); pdump (pidlRoot);
if (ppfti && ppfti->pidlTargetFolder) if (ppfti && ppfti->pidlTargetFolder)
@ -1379,13 +1245,11 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
This->pidlRoot = ILClone (pidlRoot); This->pidlRoot = ILClone (pidlRoot);
/* /*
* the target folder is spezified in csidl OR pidlTargetFolder OR * the target folder is spezified in csidl OR pidlTargetFolder OR szTargetParsingName
* szTargetParsingName
*/ */
if (ppfti) { if (ppfti) {
if (ppfti->csidl != -1) { if (ppfti->csidl != -1) {
if (SHGetSpecialFolderPathA (0, sTemp, ppfti->csidl, if (SHGetSpecialFolderPathA (0, sTemp, ppfti->csidl, ppfti->csidl & CSIDL_FLAG_CREATE)) {
ppfti->csidl & CSIDL_FLAG_CREATE)) {
__SHCloneStrA (&This->sPathTarget, sTemp); __SHCloneStrA (&This->sPathTarget, sTemp);
} }
} else if (ppfti->szTargetParsingName[0]) { } else if (ppfti->szTargetParsingName[0]) {
@ -1403,8 +1267,7 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
} }
static HRESULT WINAPI static HRESULT WINAPI
IFSFldr_PersistFolder3_GetFolderTargetInfo (IPersistFolder3 * iface, IFSFldr_PersistFolder3_GetFolderTargetInfo (IPersistFolder3 * iface, PERSIST_FOLDER_TARGET_INFO * ppfti)
PERSIST_FOLDER_TARGET_INFO * ppfti)
{ {
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
FIXME ("(%p)->(%p)\n", This, ppfti); FIXME ("(%p)->(%p)\n", This, ppfti);
@ -1427,9 +1290,7 @@ static IPersistFolder3Vtbl vt_FSFldr_PersistFolder3 =
/**************************************************************************** /****************************************************************************
* ISFDropTarget implementation * ISFDropTarget implementation
*/ */
static BOOL static BOOL ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState, LPDWORD pdwEffect)
ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState,
LPDWORD pdwEffect)
{ {
DWORD dwEffect = *pdwEffect; DWORD dwEffect = *pdwEffect;
@ -1448,8 +1309,7 @@ ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState,
return FALSE; return FALSE;
} }
static HRESULT WINAPI static HRESULT WINAPI ISFDropTarget_QueryInterface (IDropTarget * iface, REFIID riid, LPVOID * ppvObj)
ISFDropTarget_QueryInterface (IDropTarget * iface, REFIID riid, LPVOID * ppvObj)
{ {
_ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface); _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
@ -1477,8 +1337,7 @@ static ULONG WINAPI ISFDropTarget_Release (IDropTarget * iface)
} }
static HRESULT WINAPI static HRESULT WINAPI
ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject, ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
{ {
FORMATETC fmt; FORMATETC fmt;
@ -1488,17 +1347,14 @@ ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject,
InitFormatEtc (fmt, This->cfShellIDList, TYMED_HGLOBAL); InitFormatEtc (fmt, This->cfShellIDList, TYMED_HGLOBAL);
This->fAcceptFmt = (S_OK == IDataObject_QueryGetData (pDataObject, &fmt)) ? This->fAcceptFmt = (S_OK == IDataObject_QueryGetData (pDataObject, &fmt)) ? TRUE : FALSE;
TRUE : FALSE;
ISFDropTarget_QueryDrop (iface, dwKeyState, pdwEffect); ISFDropTarget_QueryDrop (iface, dwKeyState, pdwEffect);
return S_OK; return S_OK;
} }
static HRESULT WINAPI static HRESULT WINAPI ISFDropTarget_DragOver (IDropTarget * iface, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
ISFDropTarget_DragOver (IDropTarget * iface, DWORD dwKeyState, POINTL pt,
DWORD * pdwEffect)
{ {
_ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface); _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
@ -1524,8 +1380,7 @@ static HRESULT WINAPI ISFDropTarget_DragLeave (IDropTarget * iface)
} }
static HRESULT WINAPI static HRESULT WINAPI
ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject, ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
{ {
_ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface); _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);

View file

@ -1,3 +1,4 @@
/* /*
* Virtual Workplace folder * Virtual Workplace folder
* *
@ -108,7 +109,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
if (pUnkOuter) if (pUnkOuter)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
sf = LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl)); sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf) if (!sf)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
@ -117,8 +118,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
sf->lpVtblPersistFolder2 = &vt_PersistFolder2; sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
sf->pidlRoot = _ILCreateMyComputer (); /* my qualified pidl */ sf->pidlRoot = _ILCreateMyComputer (); /* my qualified pidl */
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
{
IUnknown_Release (_IUnknown_ (sf)); IUnknown_Release (_IUnknown_ (sf));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
@ -132,8 +132,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
* *
* NOTES supports not IPersist/IPersistFolder * NOTES supports not IPersist/IPersistFolder
*/ */
static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 *iface, static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
REFIID riid, LPVOID *ppvObj)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
@ -142,20 +141,14 @@ static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 *iface,
*ppvObj = NULL; *ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) || if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IShellFolder) || IsEqualIID (riid, &IID_IShellFolder) || IsEqualIID (riid, &IID_IShellFolder2)) {
IsEqualIID (riid, &IID_IShellFolder2))
{
*ppvObj = This; *ppvObj = This;
} } else if (IsEqualIID (riid, &IID_IPersist) ||
else if (IsEqualIID (riid, &IID_IPersist) || IsEqualIID (riid, &IID_IPersistFolder) || IsEqualIID (riid, &IID_IPersistFolder2)) {
IsEqualIID (riid, &IID_IPersistFolder) ||
IsEqualIID (riid, &IID_IPersistFolder2))
{
*ppvObj = _IPersistFolder2_ (This); *ppvObj = _IPersistFolder2_ (This);
} }
if (*ppvObj) if (*ppvObj) {
{
IUnknown_AddRef ((IUnknown *) (*ppvObj)); IUnknown_AddRef ((IUnknown *) (*ppvObj));
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK; return S_OK;
@ -181,8 +174,7 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
TRACE ("(%p)->(count=%lu)\n", This, refCount + 1); TRACE ("(%p)->(count=%lu)\n", This, refCount + 1);
if (!refCount) if (!refCount) {
{
TRACE ("-- destroying IShellFolder(%p)\n", This); TRACE ("-- destroying IShellFolder(%p)\n", This);
if (This->pidlRoot) if (This->pidlRoot)
SHFree (This->pidlRoot); SHFree (This->pidlRoot);
@ -194,53 +186,48 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnParseDisplayName * ISF_MyComputer_fnParseDisplayName
*/ */
static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface, static HRESULT WINAPI
HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner,
LPBC pbc,
LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL; LPCWSTR szNext = NULL;
WCHAR szElement[MAX_PATH]; WCHAR szElement[MAX_PATH];
LPITEMIDLIST pidlTemp = NULL; LPITEMIDLIST pidlTemp = NULL;
CLSID clsid; CLSID clsid;
TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This, TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
pchEaten, ppidl, pdwAttributes);
*ppidl = 0; *ppidl = 0;
if (pchEaten) if (pchEaten)
*pchEaten = 0; /* strange but like the original */ *pchEaten = 0; /* strange but like the original */
/* handle CLSID paths */ /* handle CLSID paths */
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
{
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement)); TRACE ("-- element: %s\n", debugstr_w (szElement));
SHCLSIDFromStringW (szElement + 2, &clsid); SHCLSIDFromStringW (szElement + 2, &clsid);
pidlTemp = _ILCreateGuid (PT_GUID, &clsid); pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
} }
/* do we have an absolute path name ? */ /* do we have an absolute path name ? */
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && lpszDisplayName[2] == (WCHAR) '\\') {
lpszDisplayName[2] == (WCHAR) '\\')
{
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
/* make drive letter uppercase to enable PIDL comparison */ szElement[0] = toupper(szElement[0]); /* make drive letter uppercase to enable PIDL comparison */
szElement[0] = toupper(szElement[0]);
pidlTemp = _ILCreateDrive (szElement); pidlTemp = _ILCreateDrive (szElement);
} }
if (szNext && *szNext) if (szNext && *szNext) {
{ hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, } else {
(LPOLESTR) szNext, pchEaten, pdwAttributes); if (pdwAttributes && *pdwAttributes) {
SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
} }
else
{
if (pdwAttributes && *pdwAttributes)
SHELL32_GetItemAttributes (_IShellFolder_ (This),
pidlTemp, pdwAttributes);
hr = S_OK; hr = S_OK;
} }
@ -254,12 +241,6 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
/************************************************************************** /**************************************************************************
* CreateMyCompEnumList() * CreateMyCompEnumList()
*/ */
static const WCHAR MyComputer_NameSpaceW[] = { 'S','O','F','T','W','A','R','E',
'\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l',
'o','r','e','r','\\','M','y','C','o','m','p','u','t','e','r','\\','N','a','m',
'e','s','p','a','c','e','\0' };
static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags) static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
{ {
BOOL ret = TRUE; BOOL ret = TRUE;
@ -282,27 +263,27 @@ static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
} }
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list); TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list);
if (ret && !RegOpenKeyExW(HKEY_LOCAL_MACHINE, MyComputer_NameSpaceW, if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\mycomputer\\NameSpace",
0, KEY_READ, &hkey)) 0, KEY_READ, &hkey))
{ {
WCHAR iid[50]; char iid[50];
int i=0; int i=0;
while (ret) while (ret)
{ {
DWORD size; DWORD size = sizeof (iid);
LONG r; LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
NULL);
size = sizeof(iid) / sizeof(iid[0]); if (ERROR_SUCCESS == apiRet)
r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
if (ERROR_SUCCESS == r)
{ {
/* FIXME: shell extensions, shouldn't the type be /* FIXME: shell extensions, shouldn't the type be
* PT_SHELLEXT? */ * PT_SHELLEXT? */
ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid)); ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
i++; i++;
} }
else if (ERROR_NO_MORE_ITEMS == r) else if (ERROR_NO_MORE_ITEMS == apiRet)
break; break;
else else
ret = FALSE; ret = FALSE;
@ -316,13 +297,12 @@ static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnEnumObjects * ISF_MyComputer_fnEnumObjects
*/ */
static HRESULT WINAPI ISF_MyComputer_fnEnumObjects (IShellFolder2 *iface, static HRESULT WINAPI
HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) ISF_MyComputer_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
hwndOwner, dwFlags, ppEnumIDList);
*ppEnumIDList = IEnumIDList_Constructor(); *ppEnumIDList = IEnumIDList_Constructor();
if (*ppEnumIDList) if (*ppEnumIDList)
@ -336,13 +316,13 @@ static HRESULT WINAPI ISF_MyComputer_fnEnumObjects (IShellFolder2 *iface,
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnBindToObject * ISF_MyComputer_fnBindToObject
*/ */
static HRESULT WINAPI ISF_MyComputer_fnBindToObject (IShellFolder2 *iface, static HRESULT WINAPI
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) ISF_MyComputer_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut); return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
} }
@ -350,13 +330,13 @@ static HRESULT WINAPI ISF_MyComputer_fnBindToObject (IShellFolder2 *iface,
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnBindToStorage * ISF_MyComputer_fnBindToStorage
*/ */
static HRESULT WINAPI ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface, static HRESULT WINAPI
ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
*ppvOut = NULL; *ppvOut = NULL;
return E_NOTIMPL; return E_NOTIMPL;
@ -366,10 +346,11 @@ static HRESULT WINAPI ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
* ISF_MyComputer_fnCompareIDs * ISF_MyComputer_fnCompareIDs
*/ */
static HRESULT WINAPI ISF_MyComputer_fnCompareIDs (IShellFolder2 *iface, static HRESULT WINAPI
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) ISF_MyComputer_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
int nReturn; int nReturn;
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
@ -381,40 +362,33 @@ static HRESULT WINAPI ISF_MyComputer_fnCompareIDs (IShellFolder2 *iface,
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnCreateViewObject * ISF_MyComputer_fnCreateViewObject
*/ */
static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject (IShellFolder2 *iface, static HRESULT WINAPI
HWND hwndOwner, REFIID riid, LPVOID * ppvOut) ISF_MyComputer_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPSHELLVIEW pShellView; LPSHELLVIEW pShellView;
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(hwnd=%p,%s,%p)\n", This, TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
hwndOwner, shdebugstr_guid (riid), ppvOut);
if (!ppvOut)
return hr;
if (ppvOut) {
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID (riid, &IID_IDropTarget)) if (IsEqualIID (riid, &IID_IDropTarget)) {
{
WARN ("IDropTarget not implemented\n"); WARN ("IDropTarget not implemented\n");
hr = E_NOTIMPL; hr = E_NOTIMPL;
} } else if (IsEqualIID (riid, &IID_IContextMenu)) {
else if (IsEqualIID (riid, &IID_IContextMenu))
{
WARN ("IContextMenu not implemented\n"); WARN ("IContextMenu not implemented\n");
hr = E_NOTIMPL; hr = E_NOTIMPL;
} } else if (IsEqualIID (riid, &IID_IShellView)) {
else if (IsEqualIID (riid, &IID_IShellView))
{
pShellView = IShellView_Constructor ((IShellFolder *) iface); pShellView = IShellView_Constructor ((IShellFolder *) iface);
if (pShellView) if (pShellView) {
{
hr = IShellView_QueryInterface (pShellView, riid, ppvOut); hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
IShellView_Release (pShellView); IShellView_Release (pShellView);
} }
} }
}
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut); TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
return hr; return hr;
} }
@ -422,22 +396,22 @@ static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject (IShellFolder2 *iface,
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnGetAttributesOf * ISF_MyComputer_fnGetAttributesOf
*/ */
static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, static HRESULT WINAPI
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK; HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut); TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
if (!cidl || !apidl || !rgfInOut) if ((!cidl) || (!apidl) || (!rgfInOut))
return E_INVALIDARG; return E_INVALIDARG;
if (*rgfInOut == 0) if (*rgfInOut == 0)
*rgfInOut = ~0; *rgfInOut = ~0;
while (cidl > 0 && *apidl) while (cidl > 0 && *apidl) {
{
pdump (*apidl); pdump (*apidl);
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut); SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
apidl++; apidl++;
@ -452,17 +426,18 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
* ISF_MyComputer_fnGetUIObjectOf * ISF_MyComputer_fnGetUIObjectOf
* *
* PARAMETERS * PARAMETERS
* hwndOwner [in] Parent window for any output * HWND hwndOwner, //[in ] Parent window for any output
* cidl [in] array size * UINT cidl, //[in ] array size
* apidl [in] simple pidl array * LPCITEMIDLIST* apidl, //[in ] simple pidl array
* riid [in] Requested Interface * REFIID riid, //[in ] Requested Interface
* prgfInOut [ ] reserved * UINT* prgfInOut, //[ ] reserved
* ppvObject [out] Resulting Interface * LPVOID* ppvObject) //[out] Resulting Interface
* *
*/ */
static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface, static HRESULT WINAPI
HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
UINT * prgfInOut, LPVOID * ppvOut) HWND hwndOwner,
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
@ -470,59 +445,44 @@ static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
IUnknown *pObj = NULL; IUnknown *pObj = NULL;
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This, TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut); This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
if (!ppvOut)
return hr;
if (ppvOut) {
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
{ pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface,
This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
{
pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner,
This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} } else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]); pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
SHFree (pidl); SHFree (pidl);
hr = S_OK; hr = S_OK;
} } else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) {
else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]); pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl); pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
SHFree (pidl); SHFree (pidl);
hr = S_OK; hr = S_OK;
} } else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) {
else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
{ } else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, && (cidl == 1)) {
(LPVOID *) &pObj);
}
else if ((IsEqualIID(riid,&IID_IShellLinkW) ||
IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]); pidl = ILCombine (This->pidlRoot, apidl[0]);
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj); hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
SHFree (pidl); SHFree (pidl);
} } else {
else
hr = E_NOINTERFACE; hr = E_NOINTERFACE;
}
if (SUCCEEDED(hr) && !pObj) if (SUCCEEDED(hr) && !pObj)
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
*ppvOut = pObj; *ppvOut = pObj;
}
TRACE ("(%p)->hr=0x%08lx\n", This, hr); TRACE ("(%p)->hr=0x%08lx\n", This, hr);
return hr; return hr;
} }
@ -530,12 +490,12 @@ static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
/************************************************************************** /**************************************************************************
* ISF_MyComputer_fnGetDisplayNameOf * ISF_MyComputer_fnGetDisplayNameOf
*/ */
static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
char szPath[MAX_PATH], szDrive[18]; char szPath[MAX_PATH],
szDrive[18];
int len = 0; int len = 0;
BOOL bSimplePidl; BOOL bSimplePidl;
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -551,66 +511,39 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
bSimplePidl = _ILIsPidlSimple (pidl); bSimplePidl = _ILIsPidlSimple (pidl);
if (!pidl->mkid.cb) if (!pidl->mkid.cb) {
{
/* parsing name like ::{...} */ /* parsing name like ::{...} */
lstrcpyA (szPath, "::"); lstrcpyA (szPath, "::");
SHELL32_GUIDToStringA(&CLSID_MyComputer, &szPath[2]); SHELL32_GUIDToStringA(&CLSID_MyComputer, &szPath[2]);
} } else if (_ILIsSpecialFolder (pidl)) {
else if (_ILIsSpecialFolder (pidl))
{
/* take names of special folders only if its only this folder */ /* take names of special folders only if its only this folder */
if (bSimplePidl) if (bSimplePidl) {
{
GUID const *clsid; GUID const *clsid;
clsid = _ILGetGUIDPointer (pidl); if ((clsid = _ILGetGUIDPointer (pidl))) {
if (clsid) if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
{ int bWantsForParsing;
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)
{
static const WCHAR clsidW[] =
{ 'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] =
{ '\\','s','h','e','l','l','f','o','l','d','e','r',0 };
static const WCHAR wantsForParsingW[] =
{ 'W','a','n','t','s','F','o','r','P','a','r','s','i','n',
'g',0 };
int bWantsForParsing = FALSE;
WCHAR szRegPath[100];
LONG r;
/* /*
* We can only get a filesystem path from a shellfolder * we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
* if the value WantsFORPARSING exists in * CLSID\\{...}\\shellfolder exists
* CLSID\\{...}\\shellfolder * exception: the MyComputer folder has this keys not but like any filesystem backed
* exception: the MyComputer folder has this keys not
* but like any filesystem backed
* folder it needs these behaviour * folder it needs these behaviour
*
* Get the "WantsFORPARSING" flag from the registry
*/ */
/* get the "WantsFORPARSING" flag from the registry */
char szRegPath[100];
lstrcpyW (szRegPath, clsidW); lstrcpyA (szRegPath, "CLSID\\");
SHELL32_GUIDToStringW (clsid, &szRegPath[6]); SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
lstrcatW (szRegPath, shellfolderW); lstrcatA (szRegPath, "\\shellfolder");
r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath, bWantsForParsing =
wantsForParsingW, NULL, NULL, NULL); (ERROR_SUCCESS ==
if (r == ERROR_SUCCESS) SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
bWantsForParsing = TRUE;
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && bWantsForParsing) {
bWantsForParsing) /* we need the filesystem path to the destination folder. Only the folder itself can know it */
{ hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
/* } else {
* We need the filesystem path to the destination folder
* Only the folder itself can know it
*/
hr = SHELL32_GetDisplayNameOfChild (iface, pidl,
dwFlags, szPath, MAX_PATH);
}
else
{
LPSTR p; LPSTR p;
/* parsing name like ::{...} */ /* parsing name like ::{...} */
@ -621,26 +554,17 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
p += 3; p += 3;
SHELL32_GUIDToStringA(clsid, p); SHELL32_GUIDToStringA(clsid, p);
} }
} } else {
else
{
/* user friendly name */ /* user friendly name */
HCR_GetClassNameA (clsid, szPath, MAX_PATH); HCR_GetClassNameA (clsid, szPath, MAX_PATH);
} }
} } else
else _ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
{ } else {
/* append my own path */
_ILSimpleGetText (pidl, szPath, MAX_PATH);
}
}
else
FIXME ("special folder\n"); FIXME ("special folder\n");
} }
else } else {
{ if (!_ILIsDrive (pidl)) {
if (!_ILIsDrive (pidl))
{
ERR ("Wrong pidl type\n"); ERR ("Wrong pidl type\n");
return E_INVALIDARG; return E_INVALIDARG;
} }
@ -648,12 +572,12 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
_ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */ _ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
/* long view "lw_name (C:)" */ /* long view "lw_name (C:)" */
if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING)) if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING)) {
{ DWORD dwVolumeSerialNumber,
DWORD dwVolumeSerialNumber, dwMaximumComponetLength, dwFileSystemFlags; dwMaximumComponetLength,
dwFileSystemFlags;
GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6, GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6, &dwVolumeSerialNumber,
&dwVolumeSerialNumber,
&dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0); &dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0);
strcat (szDrive, " ("); strcat (szDrive, " (");
strncat (szDrive, szPath, 2); strncat (szDrive, szPath, 2);
@ -662,18 +586,14 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
} }
} }
if (!bSimplePidl) if (!bSimplePidl) { /* go deeper if needed */
{
/* go deeper if needed */
PathAddBackslashA (szPath); PathAddBackslashA (szPath);
len = strlen (szPath); len = strlen (szPath);
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
} }
if (SUCCEEDED (hr)) if (SUCCEEDED (hr)) {
{
strRet->uType = STRRET_CSTR; strRet->uType = STRRET_CSTR;
lstrcpynA (strRet->u.cStr, szPath, MAX_PATH); lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
} }
@ -688,64 +608,53 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
* identifier in the process. * identifier in the process.
* *
* PARAMETERS * PARAMETERS
* hwndOwner [in] Owner window for output * HWND hwndOwner, //[in ] Owner window for output
* pidl [in] simple pidl of item to change * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
* lpszName [in] the items new display name * LPCOLESTR lpszName, //[in ] the items new display name
* dwFlags [in] SHGNO formatting flags * DWORD dwFlags, //[in ] SHGNO formatting flags
* ppidlOut [out] simple pidl returned * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
*/ */
static HRESULT WINAPI ISF_MyComputer_fnSetNameOf ( static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl,
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
return E_FAIL; return E_FAIL;
} }
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID ( static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
IShellFolder2 * iface, GUID * pguid)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI ISF_MyComputer_fnEnumSearches ( static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn ( static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
IShellFolder2 *iface, DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This); TRACE ("(%p)\n", This);
if (pSort) if (pSort) *pSort = 0;
*pSort = 0; if (pDisplay) *pDisplay = 0;
if (pDisplay)
*pDisplay = 0;
return S_OK; return S_OK;
} }
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState ( static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This); TRACE ("(%p)\n", This);
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) return E_INVALIDARG;
return E_INVALIDARG;
*pcsFlags = MyComputerSFHeader[iColumn].pcsFlags; *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
return S_OK; return S_OK;
} }
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface,
LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
@ -753,8 +662,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface,
} }
/* FIXME: drive size >4GB is rolling over */ /* FIXME: drive size >4GB is rolling over */
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr; HRESULT hr;
@ -764,42 +672,34 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface,
if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG; return E_INVALIDARG;
if (!pidl) if (!pidl) {
{
psd->fmt = MyComputerSFHeader[iColumn].fmt; psd->fmt = MyComputerSFHeader[iColumn].fmt;
psd->cxChar = MyComputerSFHeader[iColumn].cxChar; psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR; psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid, LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
psd->str.u.cStr, MAX_PATH);
return S_OK; return S_OK;
} } else {
else
{
char szPath[MAX_PATH]; char szPath[MAX_PATH];
ULARGE_INTEGER ulBytes; ULARGE_INTEGER ulBytes;
psd->str.u.cStr[0] = 0x00; psd->str.u.cStr[0] = 0x00;
psd->str.uType = STRRET_CSTR; psd->str.uType = STRRET_CSTR;
switch (iColumn) switch (iColumn) {
{
case 0: /* name */ case 0: /* name */
hr = IShellFolder_GetDisplayNameOf (iface, pidl, hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break; break;
case 1: /* type */ case 1: /* type */
_ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH); _ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
break; break;
case 2: /* total size */ case 2: /* total size */
if (_ILIsDrive (pidl)) if (_ILIsDrive (pidl)) {
{
_ILSimpleGetText (pidl, szPath, MAX_PATH); _ILSimpleGetText (pidl, szPath, MAX_PATH);
GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL); GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL);
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH); StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
} }
break; break;
case 3: /* free size */ case 3: /* free size */
if (_ILIsDrive (pidl)) if (_ILIsDrive (pidl)) {
{
_ILSimpleGetText (pidl, szPath, MAX_PATH); _ILSimpleGetText (pidl, szPath, MAX_PATH);
GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL); GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL);
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH); StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
@ -811,9 +711,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface,
return hr; return hr;
} }
static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (
IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
{ {
IGenericSFImpl *This = (IGenericSFImpl *)iface; IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This); FIXME ("(%p)\n", This);
@ -848,8 +746,7 @@ static IShellFolder2Vtbl vt_ShellFolder2 =
/************************************************************************ /************************************************************************
* IMCFldr_PersistFolder2_QueryInterface * IMCFldr_PersistFolder2_QueryInterface
*/ */
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface ( static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
{ {
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
@ -885,8 +782,7 @@ static ULONG WINAPI IMCFldr_PersistFolder2_Release (IPersistFolder2 * iface)
/************************************************************************ /************************************************************************
* IMCFldr_PersistFolder2_GetClassID * IMCFldr_PersistFolder2_GetClassID
*/ */
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID ( static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (IPersistFolder2 * iface, CLSID * lpClassId)
IPersistFolder2 * iface, CLSID * lpClassId)
{ {
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
@ -904,8 +800,7 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (
* *
* NOTES: it makes no sense to change the pidl * NOTES: it makes no sense to change the pidl
*/ */
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize ( static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (IPersistFolder2 * iface, LPCITEMIDLIST pidl)
IPersistFolder2 * iface, LPCITEMIDLIST pidl)
{ {
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)->(%p)\n", This, pidl); TRACE ("(%p)->(%p)\n", This, pidl);
@ -915,8 +810,7 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (
/************************************************************************** /**************************************************************************
* IPersistFolder2_fnGetCurFolder * IPersistFolder2_fnGetCurFolder
*/ */
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder ( static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (IPersistFolder2 * iface, LPITEMIDLIST * pidl)
IPersistFolder2 * iface, LPITEMIDLIST * pidl)
{ {
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);

View file

@ -1,21 +0,0 @@
/*
* UNIXFS - Shell namespace extension for the unix filesystem
*
* Copyright (C) 2005 Michael Jung
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Placeholder in ReactOS, we don't need this */

View file

@ -365,7 +365,7 @@ static UINT SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
} }
else if ((retval = GetLastError()) >= 32) else if ((retval = GetLastError()) >= 32)
{ {
TRACE("CreateProcess returned error %d\n", retval); FIXME("Strange error set by CreateProcess: %d\n", retval);
retval = ERROR_BAD_FORMAT; retval = ERROR_BAD_FORMAT;
} }

View file

@ -861,8 +861,7 @@ static const char * debug_shfileops_action( DWORD op )
#define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026 #define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026
#define HIGH_ADR (LPWSTR)0xffffffff #define HIGH_ADR (LPWSTR)0xffffffff
/* handle the complete deletion of `pTempFrom` */ static int file_operation_delete( WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW nFileOp, LPWSTR pFromFile,LPWSTR pTempFrom,HANDLE *hFind)
static int shfileops_delete(WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW nFileOp, LPWSTR pFromFile,LPWSTR pTempFrom,HANDLE *hFind)
{ {
LPWSTR lpFileName; LPWSTR lpFileName;
@ -915,7 +914,7 @@ static int shfileops_delete(WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW nFileOp, LPWST
* FOF_ALLOWUNDO, FOF_WANTMAPPINGHANDLE * FOF_ALLOWUNDO, FOF_WANTMAPPINGHANDLE
*/ */
static int shfileops_check_flags(SHFILEOPSTRUCTW nFileOp) static int file_operation_checkFlags(SHFILEOPSTRUCTW nFileOp)
{ {
FILEOP_FLAGS OFl = ((FILEOP_FLAGS)nFileOp.fFlags & 0xfff); FILEOP_FLAGS OFl = ((FILEOP_FLAGS)nFileOp.fFlags & 0xfff);
long FuncSwitch = (nFileOp.wFunc & FO_MASK); long FuncSwitch = (nFileOp.wFunc & FO_MASK);
@ -946,53 +945,6 @@ static int shfileops_check_flags(SHFILEOPSTRUCTW nFileOp)
return 0; return 0;
} }
static int shfileops_do_operation(WIN32_FIND_DATAW wfd,SHFILEOPSTRUCTW *nFileOp, LPWSTR pToFile, LPWSTR pFromFile)
{
LPWSTR lpFileName = wfd.cAlternateFileName;
if (!lpFileName[0])
lpFileName = wfd.cFileName;
if (IsDotDir(lpFileName) ||
(IsAttribDir(wfd.dwFileAttributes) && (nFileOp->fFlags & FOF_FILESONLY)))
return 0; /* next name in pTempFrom(dir) */
SHFileStrCpyCatW(&pToFile[1], lpFileName, NULL);
SHFileStrCpyCatW(&pFromFile[1], lpFileName, NULL);
return SHFileOperationW (nFileOp);
}
/* get attributes of the parent dir of pTemp and create the directory if it does not exists */
static DWORD shfileops_get_parent_attr2(LPWSTR pFile,LPWSTR pTemp,int flag,int *retCode)
{
DWORD PathAttr;
pFile[0] = '\0';
PathAttr = GetFileAttributesW(pTemp);
if ((PathAttr == INVALID_FILE_ATTRIBUTES) && flag)
{
/* create dir must be here, sample target D:\y\ *.* create with RC=10003 */
if (SHNotifyCreateDirectoryW(pTemp, NULL))
{
*retCode = 0x73;/* value unknown */
/*goto shfileop_end;*/
return PathAttr;
}
PathAttr = GetFileAttributesW(pTemp);
}
pFile[0] = '\\';
return PathAttr;
}
/* get attributes of the parent dir of pTemp without creating the directory if it does not exists */
static DWORD shfileops_get_parent_attr(LPWSTR pFile,LPWSTR pTemp)
{
/* less efficient:
return shfileops_get_parent_attr2(pFile,pTemp,0,NULL);
*/
DWORD PathAttr;
pFile[0] = '\0';
PathAttr = GetFileAttributesW(pTemp);
pFile[0] = '\\';
return PathAttr;
}
/************************************************************************* /*************************************************************************
* SHFileOperationW [SHELL32.@] * SHFileOperationW [SHELL32.@]
* *
@ -1012,6 +964,7 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
LPWSTR pTempTo = NULL; LPWSTR pTempTo = NULL;
LPWSTR pFromFile; LPWSTR pFromFile;
LPWSTR pToFile = NULL; LPWSTR pToFile = NULL;
LPWSTR lpFileName;
int retCode = 0; int retCode = 0;
DWORD ToAttr; DWORD ToAttr;
DWORD ToPathAttr; DWORD ToPathAttr;
@ -1033,6 +986,8 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
long FuncSwitch = (nFileOp.wFunc & FO_MASK); long FuncSwitch = (nFileOp.wFunc & FO_MASK);
long level= nFileOp.wFunc>>4; long level= nFileOp.wFunc>>4;
int ret;
/* default no error */ /* default no error */
nFileOp.fAnyOperationsAborted = FALSE; nFileOp.fAnyOperationsAborted = FALSE;
@ -1061,9 +1016,12 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
* create dir 0 0 0 0 0 0 1 0 * create dir 0 0 0 0 0 0 1 0
*/ */
retCode = shfileops_check_flags(nFileOp); ret = file_operation_checkFlags(nFileOp);
if (retCode) if (ret != 0)
{
retCode = ret;
goto shfileop_end; goto shfileop_end;
}
if ((pNextFrom) && (!(b_MultiTo) || (pNextTo))) if ((pNextFrom) && (!(b_MultiTo) || (pNextTo)))
{ {
@ -1150,11 +1108,18 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
hFind = FindFirstFileW(pFrom, &wfd); hFind = FindFirstFileW(pFrom, &wfd);
if (INVALID_HANDLE_VALUE == hFind) if (INVALID_HANDLE_VALUE == hFind)
{ {
if ((FO_DELETE == FuncSwitch) && (b_Mask) && IsAttribDir(shfileops_get_parent_attr(pFromFile,pTempFrom))) if ((FO_DELETE == FuncSwitch) && (b_Mask))
{
DWORD FromPathAttr;
pFromFile[0] = '\0';
FromPathAttr = GetFileAttributesW(pTempFrom);
pFromFile[0] = '\\';
if (IsAttribDir(FromPathAttr))
{ {
/* FO_DELETE with mask and without found is valid */ /* FO_DELETE with mask and without found is valid */
goto shfileop_end; goto shfileop_end;
} }
}
/* root (without mask) is also not allowed as source, tested in W98 */ /* root (without mask) is also not allowed as source, tested in W98 */
retCode = ERROR_SHELL_INTERNAL_FILE_NOT_FOUND; retCode = ERROR_SHELL_INTERNAL_FILE_NOT_FOUND;
goto shfileop_end; goto shfileop_end;
@ -1165,8 +1130,13 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
/* ??? b_Mask = (!SHFileStrICmpA(&pFromFile[1], &wfd.cFileName[0], HIGH_ADR, HIGH_ADR)); */ /* ??? b_Mask = (!SHFileStrICmpA(&pFromFile[1], &wfd.cFileName[0], HIGH_ADR, HIGH_ADR)); */
if (!pTo) /* FO_DELETE */ if (!pTo) /* FO_DELETE */
{ {
retCode = shfileops_delete(&wfd,nFileOp,pFromFile,pTempFrom,&hFind); ret = file_operation_delete(&wfd,nFileOp,pFromFile,pTempFrom,&hFind);
/* if ret is not 0, nFileOp.fAnyOperationsAborted is TRUE and the loop will end */ /* if ret is not 0, nFileOp.fAnyOperationsAborted is TRUE */
if (ret != 0)
{
retCode = ret;
goto shfileop_end;
}
continue; continue;
} /* FO_DELETE ends, pTo must be always valid from here */ } /* FO_DELETE ends, pTo must be always valid from here */
@ -1176,7 +1146,9 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
ToPathAttr = ToAttr = GetFileAttributesW(pTempTo); ToPathAttr = ToAttr = GetFileAttributesW(pTempTo);
if (!b_Mask && (ToAttr == INVALID_FILE_ATTRIBUTES) && (pToFile)) if (!b_Mask && (ToAttr == INVALID_FILE_ATTRIBUTES) && (pToFile))
{ {
ToPathAttr = shfileops_get_parent_attr(pToFile,pTempTo); pToFile[0] = '\0';
ToPathAttr = GetFileAttributesW(pTempTo);
pToFile[0] = '\\';
} }
if (FO_RENAME == FuncSwitch) if (FO_RENAME == FuncSwitch)
@ -1230,7 +1202,15 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
nFileOp.fFlags = (nFileOp.fFlags | FOF_MULTIDESTFILES); nFileOp.fFlags = (nFileOp.fFlags | FOF_MULTIDESTFILES);
do do
{ {
retCode = shfileops_do_operation(wfd,&nFileOp,pToFile,pFromFile); lpFileName = wfd.cAlternateFileName;
if (!lpFileName[0])
lpFileName = wfd.cFileName;
if (IsDotDir(lpFileName) ||
(IsAttribDir(wfd.dwFileAttributes) && (nFileOp.fFlags & FOF_FILESONLY)))
continue; /* next name in pTempFrom(dir) */
SHFileStrCpyCatW(&pToFile[1], lpFileName, NULL);
SHFileStrCpyCatW(&pFromFile[1], lpFileName, NULL);
retCode = SHFileOperationW (&nFileOp);
} while(!nFileOp.fAnyOperationsAborted && FindNextFileW(hFind, &wfd)); } while(!nFileOp.fAnyOperationsAborted && FindNextFileW(hFind, &wfd));
} }
FindClose(hFind); FindClose(hFind);
@ -1244,9 +1224,19 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
{ {
if (pToFile) if (pToFile)
{ {
ToPathAttr = shfileops_get_parent_attr2(pToFile,pTempTo,b_ToValid,&retCode); pToFile[0] = '\0';
if (retCode) ToPathAttr = GetFileAttributesW(pTempTo);
if ((ToPathAttr == INVALID_FILE_ATTRIBUTES) && b_ToValid)
{
/* create dir must be here, sample target D:\y\ *.* create with RC=10003 */
if (SHNotifyCreateDirectoryW(pTempTo, NULL))
{
retCode = 0x73;/* value unknown */
goto shfileop_end; goto shfileop_end;
}
ToPathAttr = GetFileAttributesW(pTempTo);
}
pToFile[0] = '\\';
if (b_ToInvalidTail) if (b_ToInvalidTail)
{ {
retCode = 0x10003; retCode = 0x10003;
@ -1280,7 +1270,9 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
} }
else else
{ {
ToPathAttr = shfileops_get_parent_attr(pToFile,pTempTo); pToFile[0] = '\0';
ToPathAttr = GetFileAttributesW(pTempTo);
pToFile[0] = '\\';
if (IsAttribFile(ToPathAttr)) if (IsAttribFile(ToPathAttr))
{ {
/* error, is this tested ? */ /* error, is this tested ? */
@ -1411,16 +1403,7 @@ void WINAPI SHFreeNameMappings(HANDLE hNameMapping)
} }
/************************************************************************* /*************************************************************************
* SheGetDirA [SHELL32.@] * SheGetDirW [SHELL32.281]
*
*/
HRESULT WINAPI SheGetDirA(LPSTR u, LPSTR v)
{ FIXME("%p %p stub\n",u,v);
return 0;
}
/*************************************************************************
* SheGetDirW [SHELL32.@]
* *
*/ */
HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v) HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v)
@ -1429,16 +1412,7 @@ HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v)
} }
/************************************************************************* /*************************************************************************
* SheChangeDirA [SHELL32.@] * SheChangeDirW [SHELL32.274]
*
*/
HRESULT WINAPI SheChangeDirA(LPSTR u)
{ FIXME("(%s),stub\n",debugstr_a(u));
return 0;
}
/*************************************************************************
* SheChangeDirW [SHELL32.@]
* *
*/ */
HRESULT WINAPI SheChangeDirW(LPWSTR u) HRESULT WINAPI SheChangeDirW(LPWSTR u)

View file

@ -422,7 +422,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
if (SFGAO_LINK & *pdwAttributes) { if (SFGAO_LINK & *pdwAttributes) {
char ext[MAX_PATH]; char ext[MAX_PATH];
if (!_ILGetExtension(pidl, ext, MAX_PATH) || lstrcmpiA(ext, "lnk")) if (!_ILGetExtension(pidl, ext, MAX_PATH) || strcasecmp(ext, "lnk"))
*pdwAttributes &= ~SFGAO_LINK; *pdwAttributes &= ~SFGAO_LINK;
} }
} else { } else {
@ -469,7 +469,7 @@ HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST p
/* test for name of pidl */ /* test for name of pidl */
_ILSimpleGetText (pidl1, szTemp1, MAX_PATH); _ILSimpleGetText (pidl1, szTemp1, MAX_PATH);
_ILSimpleGetText (pidl2, szTemp2, MAX_PATH); _ILSimpleGetText (pidl2, szTemp2, MAX_PATH);
nReturn = lstrcmpiA (szTemp1, szTemp2); nReturn = strcasecmp (szTemp1, szTemp2);
if (nReturn < 0) if (nReturn < 0)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 ); return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
else if (nReturn > 0) else if (nReturn > 0)

View file

@ -47,11 +47,11 @@ typedef struct
WIN32_FIND_DATAW findFile; WIN32_FIND_DATAW findFile;
} IFileSystemBindDataImpl; } IFileSystemBindDataImpl;
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *, REFIID, LPVOID*); static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *iface, REFIID riid, LPVOID* ppvObj);
static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *); static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *iface);
static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *); static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface);
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *, WIN32_FIND_DATAW *); static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd);
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *, const WIN32_FIND_DATAW *); static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd);
static struct IFileSystemBindDataVtbl sbvt = static struct IFileSystemBindDataVtbl sbvt =
{ {
@ -62,8 +62,7 @@ static struct IFileSystemBindDataVtbl sbvt =
IFileSystemBindData_fnGetFindData, IFileSystemBindData_fnGetFindData,
}; };
static const WCHAR wFileSystemBindData[] = { static const WCHAR wFileSystemBindData[] = {'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV) HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
{ {
@ -77,7 +76,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
*ppV = NULL; *ppV = NULL;
sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileSystemBindDataImpl)); sb = (IFileSystemBindDataImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileSystemBindDataImpl));
if (!sb) if (!sb)
return ret; return ret;
@ -89,7 +88,6 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
if (SUCCEEDED(ret)) if (SUCCEEDED(ret))
{ {
BIND_OPTS bindOpts; BIND_OPTS bindOpts;
bindOpts.cbStruct = sizeof(BIND_OPTS); bindOpts.cbStruct = sizeof(BIND_OPTS);
bindOpts.grfFlags = 0; bindOpts.grfFlags = 0;
bindOpts.grfMode = STGM_CREATE; bindOpts.grfMode = STGM_CREATE;
@ -148,11 +146,11 @@ HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *
} }
IUnknown_Release(pUnk); IUnknown_Release(pUnk);
} }
return ret; return ret;}
}
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(
IFileSystemBindData *iface, REFIID riid, LPVOID *ppV)
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *iface, REFIID riid, LPVOID *ppV)
{ {
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface; IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s, %p)\n", This, debugstr_guid(riid), ppV); TRACE("(%p)->(\n\tIID:\t%s, %p)\n", This, debugstr_guid(riid), ppV);
@ -160,9 +158,13 @@ static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(
*ppV = NULL; *ppV = NULL;
if (IsEqualIID(riid, &IID_IUnknown)) if (IsEqualIID(riid, &IID_IUnknown))
{
*ppV = This; *ppV = This;
}
else if (IsEqualIID(riid, &IID_IFileSystemBindData)) else if (IsEqualIID(riid, &IID_IFileSystemBindData))
{
*ppV = (IFileSystemBindData*)This; *ppV = (IFileSystemBindData*)This;
}
if (*ppV) if (*ppV)
{ {
@ -199,8 +201,7 @@ static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface)
return refCount; return refCount;
} }
static HRESULT WINAPI IFileSystemBindData_fnGetFindData( static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd)
IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd)
{ {
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface; IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p), %p\n", This, pfd); TRACE("(%p), %p\n", This, pfd);
@ -212,8 +213,7 @@ static HRESULT WINAPI IFileSystemBindData_fnGetFindData(
return NOERROR; return NOERROR;
} }
static HRESULT WINAPI IFileSystemBindData_fnSetFindData( static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd)
IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd)
{ {
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface; IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p), %p\n", This, pfd); TRACE("(%p), %p\n", This, pfd);

View file

@ -454,7 +454,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
{ {
_ILGetFileAttributes(pItemIdList1, strName1, MAX_PATH); _ILGetFileAttributes(pItemIdList1, strName1, MAX_PATH);
_ILGetFileAttributes(pItemIdList2, strName2, MAX_PATH); _ILGetFileAttributes(pItemIdList2, strName2, MAX_PATH);
nDiff = lstrcmpiA(strName1, strName2); nDiff = strcasecmp(strName1, strName2);
} }
/* Sort by FileName: Folder or Files can be sorted */ /* Sort by FileName: Folder or Files can be sorted */
else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_NAME || bIsBothFolder) else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_NAME || bIsBothFolder)
@ -462,7 +462,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
/* Sort by Text */ /* Sort by Text */
_ILSimpleGetText(pItemIdList1, strName1, MAX_PATH); _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
_ILSimpleGetText(pItemIdList2, strName2, MAX_PATH); _ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
nDiff = lstrcmpiA(strName1, strName2); nDiff = strcasecmp(strName1, strName2);
} }
/* Sort by File Size, Only valid for Files */ /* Sort by File Size, Only valid for Files */
else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_SIZE) else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_SIZE)
@ -475,7 +475,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
/* Sort by Type */ /* Sort by Type */
_ILGetFileType(pItemIdList1, strName1, MAX_PATH); _ILGetFileType(pItemIdList1, strName1, MAX_PATH);
_ILGetFileType(pItemIdList2, strName2, MAX_PATH); _ILGetFileType(pItemIdList2, strName2, MAX_PATH);
nDiff = lstrcmpiA(strName1, strName2); nDiff = strcasecmp(strName1, strName2);
} }
} }
/* If the Date, FileSize, FileType, Attrib was the same, sort by FileName */ /* If the Date, FileSize, FileType, Attrib was the same, sort by FileName */
@ -484,7 +484,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
{ {
_ILSimpleGetText(pItemIdList1, strName1, MAX_PATH); _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
_ILSimpleGetText(pItemIdList2, strName2, MAX_PATH); _ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
nDiff = lstrcmpiA(strName1, strName2); nDiff = strcasecmp(strName1, strName2);
} }
if(!pSortInfo->bIsAscending) if(!pSortInfo->bIsAscending)