mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
Sync to Wine-20050310:
Michael Jung <mjung@iss.tu-darmstadt.de> - Beginning of a shell namespace extension to browse the unix filesystem. - Fixed parsing of ITEMIDLIST in InitializeTreeView. - Added some documentation. - Fixed a crash occuring when the user double-clicks a leaf item. Dimitrie O. Paun <dpaun@rogers.com> - Add support for .exe's with exported functions. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. - Add the -noname flag to match the Platform SDK. - Don't hardcode ordinals if which are not hardcoded on Windows. Juan Lang <juan_lang@yahoo.com> - Convert more API calls to Unicode. - Convert tabs to space, wrap long lines, make indenting consistent. - Convert a few calls to Unicode. Mike McCormack <mike@codeweavers.com> - handle IFileSystemBindData in ISF_Desktop_fnParseDisplayName - more Unicode conversion - handle IFileSystemBindData in IShellFolder::ParseDisplayName - convert IShellFolder::ParseDisplayName to use Unicode - Remove tabs and make formatting consistent. - Reindent some code to improve readability. - Define some extra SHFGI values. - Remove tabs and reformat. - Use lstrcmpiA in preference to strcasecmp. - Make lstr* functions inline inside Wine. - implement loading and saving of MSI advertised shortcut info - make more test cases pass - read and write the location block - improve the binary compatibility of lnk files - Cleanup, create unicode versions of _ILCreateFromPath, _ILCreateGuidFromStr, and _ILCreateFromFindData. Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Hans Leidekker <hans@it.vu.nl> - Revert wrong -noname markup for Drag*, DoEnvironmentSubst and SHGetNewLinkInfo{A,W}. - Also mark stub exports -noname when they are exported by ordinal only on win98/2k. - Implementation level stubs for SheChangeDirA, SheGetDirA, SHHelpShortcuts_RunDLL{A,W}. - New spec file stubs for Control_RunDLLAsUserW, FixupOptionalComponents, OCInstall, SHChangeNotifySuspendResume, SHCreateProcessAsUserW, SHExtractIconsW, SHInvokePrinterCommand{A,W}, SHIsFileAvailableOffline, SHLoadNonloadedIconOverlayIdentifiers, SHPathPrepareForWrite{A,W}, ShellExec_RunDLL{,A,W}, SHGetIconOverlayIndex{A,W}. - Mark exports -noname when they are exported by ordinal only on win98/2k. Marcelo Duarte <wine-devel@bol.com.br> - Update the resources for Portuguese. Filip Navara <xnavara@volny.cz> - Don't crash if ShellFolder doesn't implement the IID_ISFHelper interface. Dmitry Timoshkov <dmitry@codeweavers.com> - Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and SetClassLongA/W according to SDK definitions. - Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_ constants from using in Wine or in _WIN64 mode. - Fix all places in Wine affected by the above changes. - Convert winemenubuilder to unicode. Alex Villacis Lasso <a_villacis@palosanto.com> - Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all resources, so that Spanish locales other than Spain also use Spanish resources. Marcus Meissner <marcus@jet.franken.de> - Output some more informations. - Mark one global variable static. Huw Davies <huw@codeweavers.com> - SetPath("") should return S_OK. SetPath("nonexistent_path") should return S_FALSE. - Don't prepend '\\' to the subkey name. Joris Huizer <jorishuizer@planet.nl> - renamed file_operation_delete and to shfileops_delete - renamed file_operation_checkFlags to shfileops_check_flags - added helper function shfileops_do_operation() - added helper function shfileops_get_parent_attr() - added helper function shfileops_get_parent_attr2() - various cleanups in SHFileOperationW using these functions Ge van Geldorp <gvg@reactos.com> - Error numbers >= 32 are to be expected. svn path=/trunk/; revision=14118
This commit is contained in:
parent
4bf67aaf0f
commit
23265de0b9
27 changed files with 4422 additions and 3208 deletions
|
@ -37,6 +37,7 @@ C_SRCS = \
|
|||
shfldr_desktop.c \
|
||||
shfldr_fs.c \
|
||||
shfldr_mycomp.c \
|
||||
shfldr_unixfs.c \
|
||||
shlexec.c \
|
||||
shlfileop.c \
|
||||
shlfolder.c \
|
||||
|
@ -77,7 +78,7 @@ version16.res: version16.rc
|
|||
$(LDPATH) $(RC16) $(RC16FLAGS) -fo$@ $(SRCDIR)/version16.rc
|
||||
|
||||
shell.spec.c: shell.spec version16.res
|
||||
$(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --main-module $(MODULE) --res version16.res --dll $(SRCDIR)/shell.spec
|
||||
$(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --main-module $(MODULE) --res version16.res --export $(SRCDIR)/shell.spec
|
||||
|
||||
authors.c: $(TOPSRCDIR)/AUTHORS
|
||||
(LC_ALL=C; export LC_ALL; echo 'const char * const SHELL_Authors[] = {' && \
|
||||
|
|
|
@ -55,68 +55,95 @@ static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
|
|||
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)
|
||||
{
|
||||
LPITEMIDLIST pidlParent, pidlChild;
|
||||
HIMAGELIST hImageList;
|
||||
IShellFolder * lpsf;
|
||||
HRESULT hr;
|
||||
IEnumIDList * pEnumIL = NULL;
|
||||
LPITEMIDLIST parentofroot;
|
||||
parentofroot = ILClone(root);
|
||||
ILRemoveLastID(parentofroot);
|
||||
|
||||
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW);
|
||||
Shell_GetImageList(NULL, &hImageList);
|
||||
IShellFolder *lpsfParent, *lpsfRoot;
|
||||
IEnumIDList * pEnumChildren = NULL;
|
||||
|
||||
TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView );
|
||||
|
||||
if (hImageList && hwndTreeView)
|
||||
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW);
|
||||
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);
|
||||
|
||||
if (_ILIsDesktop (root)) {
|
||||
hr = SHGetDesktopFolder(&lpsf);
|
||||
/* We want to call InsertTreeViewItem down the code, in order to insert
|
||||
* the root item of the treeview. Due to InsertTreeViewItem's signature,
|
||||
* 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 {
|
||||
IShellFolder * lpsfdesktop;
|
||||
|
||||
hr = SHGetDesktopFolder(&lpsfdesktop);
|
||||
if (SUCCEEDED(hr)) {
|
||||
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);
|
||||
IShellFolder *lpsfDesktop;
|
||||
hr = SHGetDesktopFolder(&lpsfDesktop);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
WARN("SHGetDesktopFolder failed! hr = %08lx\n", hr);
|
||||
return;
|
||||
}
|
||||
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_Expand(hwndTreeView,
|
||||
InsertTreeViewItem(lpsf, _ILIsPidlSimple(root) ? root : ILFindLastID(root), parentofroot, pEnumIL, TVI_ROOT),
|
||||
TVE_EXPAND);
|
||||
}
|
||||
TreeView_Expand(hwndTreeView, InsertTreeViewItem(lpsfParent, pidlChild, pidlParent, pEnumChildren, TVI_ROOT), TVE_EXPAND);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
IShellFolder_Release(lpsf);
|
||||
|
||||
TRACE("done\n");
|
||||
IShellFolder_Release(lpsfRoot);
|
||||
IShellFolder_Release(lpsfParent);
|
||||
}
|
||||
|
||||
static int GetIcon(LPITEMIDLIST lpi, UINT uFlags)
|
||||
|
@ -149,12 +176,27 @@ static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
|
|||
|
||||
typedef struct tagID
|
||||
{
|
||||
LPSHELLFOLDER lpsfParent;
|
||||
LPITEMIDLIST lpi;
|
||||
LPITEMIDLIST lpifq;
|
||||
IEnumIDList* pEnumIL;
|
||||
LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */
|
||||
LPITEMIDLIST lpi; /* PIDL relativ to parent */
|
||||
LPITEMIDLIST lpifq; /* Fully qualified PIDL */
|
||||
IEnumIDList* pEnumIL; /* Children iterator */
|
||||
} 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)
|
||||
{
|
||||
BOOL bSuccess=TRUE;
|
||||
|
@ -175,7 +217,22 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR
|
|||
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;
|
||||
TVINSERTSTRUCTW tvins;
|
||||
|
@ -211,6 +268,18 @@ static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl, LPC
|
|||
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)
|
||||
{
|
||||
HTREEITEM hPrev = 0;
|
||||
|
@ -219,7 +288,11 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar
|
|||
HRESULT hr;
|
||||
HWND hwnd=GetParent(hwndTreeView);
|
||||
|
||||
TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
|
||||
TRACE("%p %p %x %p\n",lpsf, pidl, (INT)hParent, lpe);
|
||||
|
||||
/* No IEnumIDList -> No children */
|
||||
if (!lpe) return;
|
||||
|
||||
SetCapture(GetParent(hwndTreeView));
|
||||
SetCursor(LoadCursorA(0, (LPSTR)IDC_WAIT));
|
||||
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
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};
|
||||
BOOL ret = FALSE;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* - a right mousebutton-copy sets the following formats:
|
||||
* classic:
|
||||
* Shell IDList Array
|
||||
* Prefered Drop Effect
|
||||
* Preferred Drop Effect
|
||||
* Shell Object Offsets
|
||||
* HDROP
|
||||
* FileName
|
||||
|
|
|
@ -127,9 +127,9 @@ INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
|
|||
case WM_INITDIALOG :
|
||||
prfdp = (RUNFILEDLGPARAMS *)lParam ;
|
||||
SetWindowTextA (hwnd, prfdp->lpstrTitle) ;
|
||||
SetClassLongA (hwnd, GCL_HICON, (LPARAM)prfdp->hIcon) ;
|
||||
SendMessageA (GetDlgItem (hwnd, 12297), STM_SETICON,
|
||||
(WPARAM)LoadIconA (NULL, (LPSTR)IDI_WINLOGO), 0);
|
||||
SetClassLongPtrW (hwnd, GCLP_HICON, (LPARAM)prfdp->hIcon) ;
|
||||
SendMessageW (GetDlgItem (hwnd, 12297), STM_SETICON,
|
||||
(WPARAM)LoadIconW (NULL, (LPCWSTR)IDI_WINLOGO), 0);
|
||||
FillList (GetDlgItem (hwnd, 12298), NULL) ;
|
||||
SetFocus (GetDlgItem (hwnd, 12298)) ;
|
||||
return TRUE ;
|
||||
|
@ -283,7 +283,7 @@ void FillList (HWND hCb, char *pszLatest)
|
|||
|
||||
if (NULL != pszLatest)
|
||||
{
|
||||
if (!strcasecmp (pszCmd, pszLatest))
|
||||
if (!lstrcmpiA(pszCmd, pszLatest))
|
||||
{
|
||||
/*
|
||||
sprintf (szDbgMsg, "Found existing (%d).\n", Nix) ;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#define COBJMACROS
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
|
@ -103,24 +104,27 @@ BOOL AddToEnumList(
|
|||
*/
|
||||
BOOL CreateFolderEnumList(
|
||||
IEnumIDList *list,
|
||||
LPCSTR lpszPath,
|
||||
LPCWSTR lpszPath,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
LPITEMIDLIST pidl=NULL;
|
||||
WIN32_FIND_DATAA stffile;
|
||||
WIN32_FIND_DATAW stffile;
|
||||
HANDLE hFile;
|
||||
CHAR szPath[MAX_PATH];
|
||||
WCHAR szPath[MAX_PATH];
|
||||
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_a(lpszPath),dwFlags);
|
||||
TRACE("(%p)->(path=%s flags=0x%08lx) \n",list,debugstr_w(lpszPath),dwFlags);
|
||||
|
||||
if(!lpszPath || !lpszPath[0]) return FALSE;
|
||||
|
||||
strcpy(szPath, lpszPath);
|
||||
PathAddBackslashA(szPath);
|
||||
strcat(szPath,"*.*");
|
||||
strcpyW(szPath, lpszPath);
|
||||
PathAddBackslashW(szPath);
|
||||
strcatW(szPath,stars);
|
||||
|
||||
hFile = FindFirstFileA(szPath,&stffile);
|
||||
hFile = FindFirstFileW(szPath,&stffile);
|
||||
if ( hFile != INVALID_HANDLE_VALUE )
|
||||
{
|
||||
BOOL findFinished = FALSE;
|
||||
|
@ -132,21 +136,21 @@ BOOL CreateFolderEnumList(
|
|||
{
|
||||
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||
dwFlags & SHCONTF_FOLDERS &&
|
||||
strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, ".."))
|
||||
strcmpW(stffile.cFileName, dot) && strcmpW(stffile.cFileName, dotdot))
|
||||
{
|
||||
pidl = _ILCreateFromFindDataA(&stffile);
|
||||
pidl = _ILCreateFromFindDataW(&stffile);
|
||||
succeeded = succeeded && AddToEnumList(list, pidl);
|
||||
}
|
||||
else if (!(stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
&& dwFlags & SHCONTF_NONFOLDERS)
|
||||
{
|
||||
pidl = _ILCreateFromFindDataA(&stffile);
|
||||
pidl = _ILCreateFromFindDataW(&stffile);
|
||||
succeeded = succeeded && AddToEnumList(list, pidl);
|
||||
}
|
||||
}
|
||||
if (succeeded)
|
||||
{
|
||||
if (!FindNextFileA(hFile, &stffile))
|
||||
if (!FindNextFileW(hFile, &stffile))
|
||||
{
|
||||
if (GetLastError() == ERROR_NO_MORE_FILES)
|
||||
findFinished = TRUE;
|
||||
|
|
|
@ -25,6 +25,6 @@ BOOL AddToEnumList(IEnumIDList *list, LPITEMIDLIST pidl);
|
|||
/* Enumerates the folders and/or files (depending on dwFlags) in lpszPath and
|
||||
* adds them to the already-created list.
|
||||
*/
|
||||
BOOL CreateFolderEnumList(IEnumIDList *list, LPCSTR lpszPath, DWORD dwFlags);
|
||||
BOOL CreateFolderEnumList(IEnumIDList *list, LPCWSTR lpszPath, DWORD dwFlags);
|
||||
|
||||
#endif /* ndef __ENUMIDLIST_H__ */
|
||||
|
|
|
@ -328,7 +328,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
|
|||
|
||||
found = TRUE;
|
||||
}
|
||||
else if (!strcasecmp(sTemp, "lnkfile"))
|
||||
else if (!lstrcmpiA(sTemp, "lnkfile"))
|
||||
{
|
||||
/* extract icon from shell shortcut */
|
||||
IShellFolder* dsf;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -208,11 +208,14 @@ LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid);
|
|||
|
||||
/* Like _ILCreateGuid, but using the string szGUID. */
|
||||
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID);
|
||||
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID);
|
||||
|
||||
/* Commonly used PIDLs representing file system objects. */
|
||||
LPITEMIDLIST _ILCreateDesktop (void);
|
||||
LPITEMIDLIST _ILCreateFromFindDataA(WIN32_FIND_DATAA *stffile);
|
||||
LPITEMIDLIST _ILCreateFromFindDataW(WIN32_FIND_DATAW *stffile);
|
||||
HRESULT _ILCreateFromPathA (LPCSTR szPath, LPITEMIDLIST* ppidl);
|
||||
HRESULT _ILCreateFromPathW (LPCWSTR szPath, LPITEMIDLIST* ppidl);
|
||||
|
||||
/* Other helpers */
|
||||
LPITEMIDLIST _ILCreateMyComputer (void);
|
||||
|
|
|
@ -3,193 +3,186 @@
|
|||
# win95 and winNT dlls import shell32.dll by ordinal)
|
||||
# This list was updated to dll version 4.72
|
||||
|
||||
2 stdcall SHChangeNotifyRegister(long long long long long ptr)
|
||||
4 stdcall SHChangeNotifyDeregister (long)
|
||||
5 stdcall SHChangeNotifyUpdateEntryList (long long long long)
|
||||
9 stub PifMgr_OpenProperties
|
||||
10 stub PifMgr_GetProperties
|
||||
11 stub PifMgr_SetProperties
|
||||
13 stub PifMgr_CloseProperties
|
||||
15 stdcall ILGetDisplayName(ptr ptr)
|
||||
16 stdcall ILFindLastID(ptr)
|
||||
17 stdcall ILRemoveLastID(ptr)
|
||||
18 stdcall ILClone(ptr)
|
||||
19 stdcall ILCloneFirst (ptr)
|
||||
20 stdcall ILGlobalClone (ptr)
|
||||
21 stdcall ILIsEqual (ptr ptr)
|
||||
23 stdcall ILIsParent (ptr ptr long)
|
||||
24 stdcall ILFindChild (ptr ptr)
|
||||
25 stdcall ILCombine(ptr ptr)
|
||||
26 stdcall ILLoadFromStream (ptr ptr)
|
||||
27 stdcall ILSaveToStream(ptr ptr)
|
||||
28 stdcall SHILCreateFromPath(ptr ptr ptr) SHILCreateFromPathAW
|
||||
29 stdcall PathIsRoot(ptr) PathIsRootAW
|
||||
30 stdcall PathBuildRoot(ptr long) PathBuildRootAW
|
||||
31 stdcall PathFindExtension(ptr) PathFindExtensionAW
|
||||
32 stdcall PathAddBackslash(ptr) PathAddBackslashAW
|
||||
33 stdcall PathRemoveBlanks(ptr) PathRemoveBlanksAW
|
||||
34 stdcall PathFindFileName(ptr) PathFindFileNameAW
|
||||
35 stdcall PathRemoveFileSpec(ptr) PathRemoveFileSpecAW
|
||||
36 stdcall PathAppend(ptr ptr) PathAppendAW
|
||||
37 stdcall PathCombine(ptr ptr ptr) PathCombineAW
|
||||
38 stdcall PathStripPath(ptr)PathStripPathAW
|
||||
39 stdcall PathIsUNC (ptr) PathIsUNCAW
|
||||
40 stdcall PathIsRelative (ptr) PathIsRelativeAW
|
||||
41 stdcall IsLFNDriveA(str)
|
||||
42 stdcall IsLFNDriveW(wstr)
|
||||
43 stdcall PathIsExe (ptr) PathIsExeAW
|
||||
45 stdcall PathFileExists(ptr) PathFileExistsAW
|
||||
46 stdcall PathMatchSpec (ptr ptr) PathMatchSpecAW
|
||||
47 stdcall PathMakeUniqueName (ptr long ptr ptr ptr)PathMakeUniqueNameAW
|
||||
48 stdcall PathSetDlgItemPath (long long ptr) PathSetDlgItemPathAW
|
||||
49 stdcall PathQualify (ptr) PathQualifyAW
|
||||
50 stdcall PathStripToRoot (ptr) PathStripToRootAW
|
||||
51 stdcall PathResolve(str long long) PathResolveAW
|
||||
52 stdcall PathGetArgs(str) PathGetArgsAW
|
||||
53 stdcall DoEnvironmentSubst (long long) DoEnvironmentSubstAW
|
||||
54 stdcall DragAcceptFiles(long long)
|
||||
55 stdcall PathQuoteSpaces (ptr) PathQuoteSpacesAW
|
||||
56 stdcall PathUnquoteSpaces(str) PathUnquoteSpacesAW
|
||||
57 stdcall PathGetDriveNumber (str) PathGetDriveNumberAW
|
||||
58 stdcall ParseField(str long ptr long) ParseFieldAW
|
||||
59 stdcall RestartDialog(long wstr long)
|
||||
60 stdcall ExitWindowsDialog(long)
|
||||
61 stdcall RunFileDlg(long long long str str long)
|
||||
62 stdcall PickIconDlg(long long long long)
|
||||
63 stdcall GetFileNameFromBrowse(long long long long str str str)
|
||||
64 stdcall DriveType (long)
|
||||
65 stub InvalidateDriveType
|
||||
66 stdcall IsNetDrive(long)
|
||||
67 stdcall Shell_MergeMenus (long long long long long long)
|
||||
68 stdcall SHGetSetSettings(ptr long long)
|
||||
69 stub SHGetNetResource
|
||||
70 stdcall SHCreateDefClassObject(long long long long long)
|
||||
71 stdcall Shell_GetImageList(ptr ptr)
|
||||
72 stdcall Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW
|
||||
73 stdcall SHShellFolderView_Message(long long long)
|
||||
74 stdcall SHCreateStdEnumFmtEtc(long ptr ptr)
|
||||
75 stdcall PathYetAnotherMakeUniqueName(ptr wstr wstr wstr)
|
||||
2 stdcall -noname SHChangeNotifyRegister(long long long long long ptr)
|
||||
4 stdcall -noname SHChangeNotifyDeregister(long)
|
||||
5 stdcall -noname SHChangeNotifyUpdateEntryList(long long long long)
|
||||
9 stub -noname PifMgr_OpenProperties
|
||||
10 stub -noname PifMgr_GetProperties
|
||||
11 stub -noname PifMgr_SetProperties
|
||||
13 stub -noname PifMgr_CloseProperties
|
||||
15 stdcall -noname ILGetDisplayName(ptr ptr)
|
||||
16 stdcall -noname ILFindLastID(ptr)
|
||||
17 stdcall -noname ILRemoveLastID(ptr)
|
||||
18 stdcall -noname ILClone(ptr)
|
||||
19 stdcall -noname ILCloneFirst(ptr)
|
||||
20 stdcall -noname ILGlobalClone(ptr)
|
||||
21 stdcall -noname ILIsEqual(ptr ptr)
|
||||
23 stdcall -noname ILIsParent(ptr ptr long)
|
||||
24 stdcall -noname ILFindChild(ptr ptr)
|
||||
25 stdcall -noname ILCombine(ptr ptr)
|
||||
26 stdcall -noname ILLoadFromStream(ptr ptr)
|
||||
27 stdcall -noname ILSaveToStream(ptr ptr)
|
||||
28 stdcall -noname SHILCreateFromPath(ptr ptr ptr) SHILCreateFromPathAW
|
||||
29 stdcall -noname PathIsRoot(ptr) PathIsRootAW
|
||||
30 stdcall -noname PathBuildRoot(ptr long) PathBuildRootAW
|
||||
31 stdcall -noname PathFindExtension(ptr) PathFindExtensionAW
|
||||
32 stdcall -noname PathAddBackslash(ptr) PathAddBackslashAW
|
||||
33 stdcall -noname PathRemoveBlanks(ptr) PathRemoveBlanksAW
|
||||
34 stdcall -noname PathFindFileName(ptr) PathFindFileNameAW
|
||||
35 stdcall -noname PathRemoveFileSpec(ptr) PathRemoveFileSpecAW
|
||||
36 stdcall -noname PathAppend(ptr ptr) PathAppendAW
|
||||
37 stdcall -noname PathCombine(ptr ptr ptr) PathCombineAW
|
||||
38 stdcall -noname PathStripPath(ptr)PathStripPathAW
|
||||
39 stdcall -noname PathIsUNC(ptr) PathIsUNCAW
|
||||
40 stdcall -noname PathIsRelative(ptr) PathIsRelativeAW
|
||||
41 stdcall -noname IsLFNDriveA(str)
|
||||
42 stdcall -noname IsLFNDriveW(wstr)
|
||||
43 stdcall -noname PathIsExe(ptr) PathIsExeAW
|
||||
45 stdcall -noname PathFileExists(ptr) PathFileExistsAW
|
||||
46 stdcall -noname PathMatchSpec(ptr ptr) PathMatchSpecAW
|
||||
47 stdcall -noname PathMakeUniqueName(ptr long ptr ptr ptr)PathMakeUniqueNameAW
|
||||
48 stdcall -noname PathSetDlgItemPath(long long ptr) PathSetDlgItemPathAW
|
||||
49 stdcall -noname PathQualify(ptr) PathQualifyAW
|
||||
50 stdcall -noname PathStripToRoot(ptr) PathStripToRootAW
|
||||
51 stdcall -noname PathResolve(str long long) PathResolveAW
|
||||
52 stdcall -noname PathGetArgs(str) PathGetArgsAW
|
||||
53 stdcall DoEnvironmentSubst(long long) DoEnvironmentSubstAW
|
||||
55 stdcall -noname PathQuoteSpaces(ptr) PathQuoteSpacesAW
|
||||
56 stdcall -noname PathUnquoteSpaces(str) PathUnquoteSpacesAW
|
||||
57 stdcall -noname PathGetDriveNumber(str) PathGetDriveNumberAW
|
||||
58 stdcall -noname ParseField(str long ptr long) ParseFieldAW
|
||||
59 stdcall -noname RestartDialog(long wstr long)
|
||||
60 stdcall -noname ExitWindowsDialog(long)
|
||||
61 stdcall -noname RunFileDlg(long long long str str long)
|
||||
62 stdcall -noname PickIconDlg(long long long long)
|
||||
63 stdcall -noname GetFileNameFromBrowse(long long long long str str str)
|
||||
64 stdcall -noname DriveType(long)
|
||||
65 stub -noname InvalidateDriveType
|
||||
66 stdcall -noname IsNetDrive(long)
|
||||
67 stdcall -noname Shell_MergeMenus(long long long long long long)
|
||||
68 stdcall -noname SHGetSetSettings(ptr long long)
|
||||
69 stub -noname SHGetNetResource
|
||||
70 stdcall -noname SHCreateDefClassObject(long long long long long)
|
||||
71 stdcall -noname Shell_GetImageList(ptr ptr)
|
||||
72 stdcall -noname Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW
|
||||
73 stdcall -noname SHShellFolderView_Message(long long long)
|
||||
74 stdcall -noname SHCreateStdEnumFmtEtc(long ptr ptr)
|
||||
75 stdcall -noname PathYetAnotherMakeUniqueName(ptr wstr wstr wstr)
|
||||
76 stub DragQueryInfo
|
||||
77 stdcall SHMapPIDLToSystemImageListIndex(ptr ptr ptr)
|
||||
78 stdcall OleStrToStrN(str long wstr long) OleStrToStrNAW
|
||||
79 stdcall StrToOleStrN(wstr long str long) StrToOleStrNAW
|
||||
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)
|
||||
77 stdcall -noname SHMapPIDLToSystemImageListIndex(ptr ptr ptr)
|
||||
78 stdcall -noname OleStrToStrN(str long wstr long) OleStrToStrNAW
|
||||
79 stdcall -noname StrToOleStrN(wstr long str long) StrToOleStrNAW
|
||||
83 stdcall -noname CIDLData_CreateFromIDArray(ptr long ptr ptr)
|
||||
84 stub SHIsBadInterfacePtr
|
||||
85 stdcall OpenRegStream(long str str long) shlwapi.SHOpenRegStreamA
|
||||
86 stdcall SHRegisterDragDrop(long ptr)
|
||||
87 stdcall SHRevokeDragDrop(long)
|
||||
88 stdcall SHDoDragDrop(long ptr ptr long ptr)
|
||||
89 stdcall SHCloneSpecialIDList(long long long)
|
||||
90 stdcall SHFindFiles(ptr ptr)
|
||||
85 stdcall -noname OpenRegStream(long str str long) shlwapi.SHOpenRegStreamA
|
||||
86 stdcall -noname SHRegisterDragDrop(long ptr)
|
||||
87 stdcall -noname SHRevokeDragDrop(long)
|
||||
88 stdcall -noname SHDoDragDrop(long ptr ptr long ptr)
|
||||
89 stdcall -noname SHCloneSpecialIDList(long long long)
|
||||
90 stdcall -noname SHFindFiles(ptr ptr)
|
||||
91 stub SHFindComputer
|
||||
92 stdcall PathGetShortPath (ptr) PathGetShortPathAW
|
||||
93 stdcall Win32CreateDirectory(wstr ptr) Win32CreateDirectoryAW
|
||||
94 stdcall Win32RemoveDirectory(wstr) Win32RemoveDirectoryAW
|
||||
95 stdcall SHLogILFromFSIL (ptr)
|
||||
96 stdcall StrRetToStrN (ptr long ptr ptr) StrRetToStrNAW
|
||||
97 stdcall SHWaitForFileToOpen (long long long)
|
||||
98 stdcall SHGetRealIDL (ptr ptr ptr)
|
||||
99 stdcall SetAppStartingCursor (long long)
|
||||
100 stdcall SHRestricted(long)
|
||||
92 stdcall -noname PathGetShortPath(ptr) PathGetShortPathAW
|
||||
93 stdcall -noname Win32CreateDirectory(wstr ptr) Win32CreateDirectoryAW
|
||||
94 stdcall -noname Win32RemoveDirectory(wstr) Win32RemoveDirectoryAW
|
||||
95 stdcall -noname SHLogILFromFSIL(ptr)
|
||||
96 stdcall -noname StrRetToStrN(ptr long ptr ptr) StrRetToStrNAW
|
||||
97 stdcall -noname SHWaitForFileToOpen (long long long)
|
||||
98 stdcall -noname SHGetRealIDL(ptr ptr ptr)
|
||||
99 stdcall -noname SetAppStartingCursor(long long)
|
||||
100 stdcall -noname SHRestricted(long)
|
||||
|
||||
102 stdcall SHCoCreateInstance(wstr ptr long ptr ptr)
|
||||
103 stdcall SignalFileOpen(long)
|
||||
104 stdcall FileMenu_DeleteAllItems(long)
|
||||
105 stdcall FileMenu_DrawItem(long ptr)
|
||||
106 stdcall FileMenu_FindSubMenuByPidl(long ptr)
|
||||
107 stdcall FileMenu_GetLastSelectedItemPidls(long ptr ptr)
|
||||
108 stdcall FileMenu_HandleMenuChar(long long)
|
||||
109 stdcall FileMenu_InitMenuPopup (long)
|
||||
110 stdcall FileMenu_InsertUsingPidl (long long ptr long long ptr)
|
||||
111 stdcall FileMenu_Invalidate (long)
|
||||
112 stdcall FileMenu_MeasureItem(long ptr)
|
||||
113 stdcall FileMenu_ReplaceUsingPidl (long long ptr long ptr)
|
||||
114 stdcall FileMenu_Create (long long long long long)
|
||||
115 stdcall FileMenu_AppendItem (long ptr long long long long) FileMenu_AppendItemAW
|
||||
116 stdcall FileMenu_TrackPopupMenuEx (long long long long long long)
|
||||
117 stdcall FileMenu_DeleteItemByCmd(long long)
|
||||
118 stdcall FileMenu_Destroy (long)
|
||||
119 stdcall IsLFNDrive(ptr) IsLFNDriveAW
|
||||
120 stdcall FileMenu_AbortInitMenu ()
|
||||
121 stdcall SHFlushClipboard ()
|
||||
102 stdcall -noname SHCoCreateInstance(wstr ptr long ptr ptr)
|
||||
103 stdcall -noname SignalFileOpen(long)
|
||||
104 stdcall -noname FileMenu_DeleteAllItems(long)
|
||||
105 stdcall -noname FileMenu_DrawItem(long ptr)
|
||||
106 stdcall -noname FileMenu_FindSubMenuByPidl(long ptr)
|
||||
107 stdcall -noname FileMenu_GetLastSelectedItemPidls(long ptr ptr)
|
||||
108 stdcall -noname FileMenu_HandleMenuChar(long long)
|
||||
109 stdcall -noname FileMenu_InitMenuPopup(long)
|
||||
110 stdcall -noname FileMenu_InsertUsingPidl (long long ptr long long ptr)
|
||||
111 stdcall -noname FileMenu_Invalidate(long)
|
||||
112 stdcall -noname FileMenu_MeasureItem(long ptr)
|
||||
113 stdcall -noname FileMenu_ReplaceUsingPidl(long long ptr long ptr)
|
||||
114 stdcall -noname FileMenu_Create(long long long long long)
|
||||
115 stdcall -noname FileMenu_AppendItem(long ptr long long long long) FileMenu_AppendItemAW
|
||||
116 stdcall -noname FileMenu_TrackPopupMenuEx(long long long long long long)
|
||||
117 stdcall -noname FileMenu_DeleteItemByCmd(long long)
|
||||
118 stdcall -noname FileMenu_Destroy(long)
|
||||
119 stdcall -noname IsLFNDrive(ptr) IsLFNDriveAW
|
||||
120 stdcall -noname FileMenu_AbortInitMenu()
|
||||
121 stdcall -noname SHFlushClipboard()
|
||||
122 stdcall -noname RunDLL_CallEntry16(long long long str long) #name wrong?
|
||||
123 stdcall SHFreeUnusedLibraries ()
|
||||
124 stdcall FileMenu_AppendFilesForPidl(long ptr long)
|
||||
125 stdcall FileMenu_AddFilesForPidl(long long long ptr long long ptr)
|
||||
126 stdcall SHOutOfMemoryMessageBox (long long long)
|
||||
127 stdcall SHWinHelp (long long long long)
|
||||
128 stdcall -private DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
|
||||
129 stdcall DAD_AutoScroll(long ptr ptr)
|
||||
130 stdcall DAD_DragEnter(long)
|
||||
131 stdcall DAD_DragEnterEx(long long long)
|
||||
132 stdcall DAD_DragLeave()
|
||||
133 stdcall DragQueryFileW(long long ptr long)
|
||||
134 stdcall DAD_DragMove(long long)
|
||||
135 stdcall DragQueryPoint(long ptr)
|
||||
136 stdcall DAD_SetDragImage(long long)
|
||||
137 stdcall DAD_ShowDragImage (long)
|
||||
123 stdcall -noname SHFreeUnusedLibraries()
|
||||
124 stdcall -noname FileMenu_AppendFilesForPidl(long ptr long)
|
||||
125 stdcall -noname FileMenu_AddFilesForPidl(long long long ptr long long ptr)
|
||||
126 stdcall -noname SHOutOfMemoryMessageBox(long long long)
|
||||
127 stdcall -noname SHWinHelp(long long long long)
|
||||
129 stdcall -noname DAD_AutoScroll(long ptr ptr)
|
||||
130 stdcall -noname DAD_DragEnter(long)
|
||||
131 stdcall -noname DAD_DragEnterEx(long long long)
|
||||
132 stdcall -noname DAD_DragLeave()
|
||||
134 stdcall -noname DAD_DragMove(long long)
|
||||
136 stdcall -noname DAD_SetDragImage(long long)
|
||||
137 stdcall -noname DAD_ShowDragImage(long)
|
||||
139 stub Desktop_UpdateBriefcaseOnEvent
|
||||
140 stdcall FileMenu_DeleteItemByIndex(long long)
|
||||
141 stdcall FileMenu_DeleteItemByFirstID(long long)
|
||||
142 stdcall FileMenu_DeleteSeparator(long)
|
||||
143 stdcall FileMenu_EnableItemByCmd(long long long)
|
||||
144 stdcall FileMenu_GetItemExtent (long long)
|
||||
145 stdcall PathFindOnPath (ptr ptr) PathFindOnPathAW
|
||||
146 stdcall RLBuildListOfPaths()
|
||||
147 stdcall SHCLSIDFromString(long long) SHCLSIDFromStringAW
|
||||
149 stdcall SHFind_InitMenuPopup(long long long long)
|
||||
140 stdcall -noname FileMenu_DeleteItemByIndex(long long)
|
||||
141 stdcall -noname FileMenu_DeleteItemByFirstID(long long)
|
||||
142 stdcall -noname FileMenu_DeleteSeparator(long)
|
||||
143 stdcall -noname FileMenu_EnableItemByCmd(long long long)
|
||||
144 stdcall -noname FileMenu_GetItemExtent(long long)
|
||||
145 stdcall -noname PathFindOnPath(ptr ptr) PathFindOnPathAW
|
||||
146 stdcall -noname RLBuildListOfPaths()
|
||||
147 stdcall -noname SHCLSIDFromString(long long) SHCLSIDFromStringAW
|
||||
149 stdcall -noname SHFind_InitMenuPopup(long long long long)
|
||||
|
||||
151 stdcall SHLoadOLE (long)
|
||||
152 stdcall ILGetSize(ptr)
|
||||
153 stdcall ILGetNext(ptr)
|
||||
154 stdcall ILAppend (long long long)
|
||||
155 stdcall ILFree (ptr)
|
||||
156 stdcall ILGlobalFree (ptr)
|
||||
157 stdcall ILCreateFromPath (ptr) ILCreateFromPathAW
|
||||
158 stdcall PathGetExtension(str long long) PathGetExtensionAW
|
||||
159 stdcall PathIsDirectory(ptr)PathIsDirectoryAW
|
||||
151 stdcall -noname SHLoadOLE(long)
|
||||
152 stdcall -noname ILGetSize(ptr)
|
||||
153 stdcall -noname ILGetNext(ptr)
|
||||
154 stdcall -noname ILAppend(long long long)
|
||||
155 stdcall -noname ILFree(ptr)
|
||||
156 stdcall -noname ILGlobalFree(ptr)
|
||||
157 stdcall -noname ILCreateFromPath(ptr) ILCreateFromPathAW
|
||||
158 stdcall -noname PathGetExtension(str long long) PathGetExtensionAW
|
||||
159 stdcall -noname PathIsDirectory(ptr) PathIsDirectoryAW
|
||||
160 stub SHNetConnectionDialog
|
||||
161 stdcall SHRunControlPanel (long long)
|
||||
162 stdcall SHSimpleIDListFromPath (ptr) SHSimpleIDListFromPathAW
|
||||
163 stdcall StrToOleStr (wstr str) StrToOleStrAW
|
||||
164 stdcall Win32DeleteFile(str) Win32DeleteFileAW
|
||||
165 stdcall SHCreateDirectory(long ptr)
|
||||
166 stdcall CallCPLEntry16(long long long long long long)
|
||||
167 stdcall SHAddFromPropSheetExtArray(long long long)
|
||||
168 stdcall SHCreatePropSheetExtArray(long str long)
|
||||
169 stdcall SHDestroyPropSheetExtArray(long)
|
||||
170 stdcall SHReplaceFromPropSheetExtArray(long long long long)
|
||||
171 stdcall PathCleanupSpec(ptr ptr)
|
||||
172 stdcall SHCreateLinks(long str ptr long ptr)
|
||||
173 stdcall SHValidateUNC(long long long)
|
||||
174 stdcall SHCreateShellFolderViewEx (ptr ptr)
|
||||
175 stdcall SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW
|
||||
176 stdcall SHSetInstanceExplorer (long)
|
||||
161 stdcall -noname SHRunControlPanel(long long)
|
||||
162 stdcall -noname SHSimpleIDListFromPath(ptr) SHSimpleIDListFromPathAW
|
||||
163 stdcall -noname StrToOleStr(wstr str) StrToOleStrAW
|
||||
164 stdcall -noname Win32DeleteFile(str) Win32DeleteFileAW
|
||||
165 stdcall -noname SHCreateDirectory(long ptr)
|
||||
166 stdcall -noname CallCPLEntry16(long long long long long long)
|
||||
167 stdcall -noname SHAddFromPropSheetExtArray(long long long)
|
||||
168 stdcall -noname SHCreatePropSheetExtArray(long str long)
|
||||
169 stdcall -noname SHDestroyPropSheetExtArray(long)
|
||||
170 stdcall -noname SHReplaceFromPropSheetExtArray(long long long long)
|
||||
171 stdcall -noname PathCleanupSpec(ptr ptr)
|
||||
172 stdcall -noname SHCreateLinks(long str ptr long ptr)
|
||||
173 stdcall -noname SHValidateUNC(long long long)
|
||||
174 stdcall -noname SHCreateShellFolderViewEx(ptr ptr)
|
||||
175 stdcall -noname SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW
|
||||
176 stdcall -noname SHSetInstanceExplorer(long)
|
||||
177 stub DAD_SetDragImageFromListView
|
||||
178 stdcall SHObjectProperties(long long wstr wstr)
|
||||
179 stdcall SHGetNewLinkInfoA(str str ptr long long)
|
||||
180 stdcall SHGetNewLinkInfoW(wstr wstr ptr long long)
|
||||
181 stdcall RegisterShellHook(long long)
|
||||
182 varargs ShellMessageBoxW(long long long str long)
|
||||
183 varargs ShellMessageBoxA(long long long str long)
|
||||
184 stdcall ArrangeWindows(long long long long long)
|
||||
178 stdcall -noname SHObjectProperties(long long wstr wstr)
|
||||
179 stdcall -noname SHGetNewLinkInfoA(str str ptr long long)
|
||||
180 stdcall -noname SHGetNewLinkInfoW(wstr wstr ptr long long)
|
||||
181 stdcall -noname RegisterShellHook(long long)
|
||||
182 varargs -noname ShellMessageBoxW(long long long str long)
|
||||
183 varargs -noname ShellMessageBoxA(long long long str long)
|
||||
184 stdcall -noname ArrangeWindows(long long long long long)
|
||||
185 stub SHHandleDiskFull
|
||||
186 stdcall ILGetDisplayNameEx(ptr ptr ptr long)
|
||||
186 stdcall -noname ILGetDisplayNameEx(ptr ptr ptr long)
|
||||
187 stub ILGetPseudoNameW
|
||||
188 stdcall ShellDDEInit(long)
|
||||
189 stdcall ILCreateFromPathA(str)
|
||||
190 stdcall ILCreateFromPathW(wstr)
|
||||
191 stdcall SHUpdateImageA(str long long long)
|
||||
192 stdcall SHUpdateImageW(wstr long long long)
|
||||
193 stdcall SHHandleUpdateImage(ptr)
|
||||
188 stdcall -noname ShellDDEInit(long)
|
||||
189 stdcall -noname ILCreateFromPathA(str)
|
||||
190 stdcall -noname ILCreateFromPathW(wstr)
|
||||
191 stdcall -noname SHUpdateImageA(str long long long)
|
||||
192 stdcall -noname SHUpdateImageW(wstr long long long)
|
||||
193 stdcall -noname SHHandleUpdateImage(ptr)
|
||||
194 stub SHCreatePropSheetExtArrayEx
|
||||
195 stdcall SHFree(ptr)
|
||||
196 stdcall SHAlloc(long)
|
||||
195 stdcall -noname SHFree(ptr)
|
||||
196 stdcall -noname SHAlloc(long)
|
||||
197 stub SHGlobalDefect
|
||||
198 stdcall SHAbortInvokeCommand ()
|
||||
198 stdcall -noname SHAbortInvokeCommand()
|
||||
199 stub SHGetFileIcon
|
||||
200 stub SHLocalAlloc
|
||||
201 stub SHLocalFree
|
||||
|
@ -206,72 +199,15 @@
|
|||
212 stub Printers_AddPrinterPropPages
|
||||
213 stub Printers_RegisterWindowW
|
||||
214 stub Printers_UnregisterWindow
|
||||
215 stdcall SHStartNetConnectionDialog(long str long)
|
||||
215 stdcall -noname SHStartNetConnectionDialog(long str long)
|
||||
243 stdcall @(long long) shell32_243
|
||||
244 stdcall SHInitRestricted(ptr ptr)
|
||||
247 stdcall SHGetDataFromIDListA (ptr ptr long ptr long)
|
||||
248 stdcall SHGetDataFromIDListW (ptr ptr long ptr long)
|
||||
249 stdcall PathParseIconLocation (ptr) PathParseIconLocationAW
|
||||
250 stdcall PathRemoveExtension (ptr) PathRemoveExtensionAW
|
||||
251 stdcall PathRemoveArgs (ptr) PathRemoveArgsAW
|
||||
244 stdcall -noname SHInitRestricted(ptr ptr)
|
||||
249 stdcall -noname PathParseIconLocation(ptr) PathParseIconLocationAW
|
||||
250 stdcall -noname PathRemoveExtension(ptr) PathRemoveExtensionAW
|
||||
251 stdcall -noname PathRemoveArgs(ptr) PathRemoveArgsAW
|
||||
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
|
||||
#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)
|
||||
506 stdcall SHRegOpenKeyA (long str long)
|
||||
|
@ -282,38 +218,38 @@
|
|||
511 stdcall SHRegQueryValueExW (long wstr ptr ptr ptr ptr)
|
||||
512 stdcall SHRegDeleteKeyW (long wstr)
|
||||
|
||||
520 stdcall -noname SHAllocShared (ptr long long)
|
||||
521 stdcall -noname SHLockShared (long long)
|
||||
522 stdcall -noname SHUnlockShared (ptr)
|
||||
523 stdcall -noname SHFreeShared (long long)
|
||||
524 stdcall RealDriveType (long long)
|
||||
520 stdcall -noname SHAllocShared(ptr long long)
|
||||
521 stdcall -noname SHLockShared(long long)
|
||||
522 stdcall -noname SHUnlockShared(ptr)
|
||||
523 stdcall -noname SHFreeShared(long long)
|
||||
524 stdcall -noname RealDriveType(long long)
|
||||
525 stub RealDriveTypeFlags
|
||||
|
||||
640 stdcall NTSHChangeNotifyRegister (long long long long long long)
|
||||
641 stdcall NTSHChangeNotifyDeregister (long)
|
||||
640 stdcall -noname NTSHChangeNotifyRegister(long long long long long long)
|
||||
641 stdcall -noname NTSHChangeNotifyDeregister(long)
|
||||
|
||||
643 stub SHChangeNotifyReceive
|
||||
644 stdcall SHChangeNotification_Lock(long long ptr ptr)
|
||||
645 stdcall SHChangeNotification_Unlock(long)
|
||||
644 stdcall -noname SHChangeNotification_Lock(long long ptr ptr)
|
||||
645 stdcall -noname SHChangeNotification_Unlock(long)
|
||||
646 stub SHChangeRegistrationReceive
|
||||
647 stub ReceiveAddToRecentDocs
|
||||
648 stub SHWaitOp_Operate
|
||||
|
||||
650 stdcall PathIsSameRoot(ptr ptr)PathIsSameRootAW
|
||||
650 stdcall -noname PathIsSameRoot(ptr ptr) PathIsSameRootAW
|
||||
|
||||
# nt40/win98
|
||||
651 stdcall ReadCabinetState (long long) # OldReadCabinetState
|
||||
652 stdcall WriteCabinetState (long)
|
||||
653 stdcall PathProcessCommand (long long long long) PathProcessCommandAW
|
||||
651 stdcall -noname ReadCabinetState(long long) # OldReadCabinetState
|
||||
652 stdcall -noname WriteCabinetState(long)
|
||||
653 stdcall -noname PathProcessCommand(long long long long) PathProcessCommandAW
|
||||
|
||||
# win98
|
||||
654 stdcall @(long long)shell32_654 # ReadCabinetState@8
|
||||
660 stdcall FileIconInit(long)
|
||||
680 stdcall IsUserAdmin()
|
||||
654 stdcall @(long long) shell32_654 # ReadCabinetState@8
|
||||
660 stdcall -noname FileIconInit(long)
|
||||
680 stdcall -noname IsUserAdmin()
|
||||
|
||||
# >= NT5
|
||||
714 stdcall @(ptr)SHELL32_714 # PathIsTemporaryW
|
||||
730 stdcall RestartDialogEx(long wstr long long)
|
||||
714 stdcall @(ptr) SHELL32_714 # PathIsTemporaryW
|
||||
730 stdcall -noname RestartDialogEx(long wstr long long)
|
||||
|
||||
1217 stub FOOBAR1217 # no joke! This is the real name!!
|
||||
|
||||
|
@ -329,14 +265,22 @@
|
|||
@ stdcall Control_FillCache_RunDLLW(long long long long)
|
||||
@ stdcall Control_RunDLL(ptr ptr str long) Control_RunDLLA
|
||||
@ stdcall Control_RunDLLA(ptr ptr str long)
|
||||
@ stub Control_RunDLLAsUserW
|
||||
@ stdcall Control_RunDLLW(ptr ptr wstr long)
|
||||
@ stdcall -private DllCanUnloadNow() SHELL32_DllCanUnloadNow
|
||||
@ stdcall -private DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
|
||||
@ stdcall DllInstall(long wstr)SHELL32_DllInstall
|
||||
@ stdcall -private DllRegisterServer() SHELL32_DllRegisterServer
|
||||
@ stdcall -private DllUnregisterServer() SHELL32_DllUnregisterServer
|
||||
@ stdcall DoEnvironmentSubstA(str str)
|
||||
@ 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
|
||||
@ stdcall DragQueryFileW(long long ptr long)
|
||||
@ stdcall DragQueryPoint(long ptr)
|
||||
@ stdcall DuplicateIcon(long long)
|
||||
@ stdcall ExtractAssociatedIconA(long str ptr)
|
||||
@ stdcall ExtractAssociatedIconExA(long str long long)
|
||||
|
@ -353,9 +297,11 @@
|
|||
@ stub FindExeDlgProc
|
||||
@ stdcall FindExecutableA(ptr ptr ptr)
|
||||
@ stdcall FindExecutableW(wstr wstr wstr)
|
||||
@ stub FixupOptionalComponents
|
||||
@ stdcall FreeIconList(long)
|
||||
@ stub InternalExtractIconListA
|
||||
@ stub InternalExtractIconListW
|
||||
@ stub OCInstall
|
||||
@ stub OpenAs_RunDLL
|
||||
@ stub OpenAs_RunDLLA
|
||||
@ stub OpenAs_RunDLLW
|
||||
|
@ -373,16 +319,48 @@
|
|||
@ stdcall SHBrowseForFolderA(ptr)
|
||||
@ stdcall SHBrowseForFolderW(ptr)
|
||||
@ stdcall SHChangeNotify (long long ptr ptr)
|
||||
@ stub SHChangeNotifySuspendResume
|
||||
@ stdcall SHCreateDirectoryExA(long str 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
|
||||
@ stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA
|
||||
@ stdcall Shell_NotifyIconA(long ptr)
|
||||
@ stdcall Shell_NotifyIconW(long ptr)
|
||||
@ stdcall SHEmptyRecycleBinA(long str long)
|
||||
@ stdcall SHEmptyRecycleBinW(long wstr long)
|
||||
@ stub SheRemoveQuotesA
|
||||
@ stub SheRemoveQuotesW
|
||||
@ stub SheSetCurDrive
|
||||
@ stub SheShortenPathA
|
||||
@ stub SheShortenPathW
|
||||
@ stub SHExtractIconsW
|
||||
@ stdcall SHFileOperation(ptr) SHFileOperationA
|
||||
@ stdcall SHFileOperationA(ptr)
|
||||
@ stdcall SHFileOperationW(ptr)
|
||||
@ stdcall SHFormatDrive(long long long long)
|
||||
@ stdcall SHFreeNameMappings(ptr)
|
||||
@ stdcall SHGetDataFromIDListA(ptr ptr long ptr long)
|
||||
@ stdcall SHGetDataFromIDListW(ptr ptr long ptr long)
|
||||
@ stdcall SHGetDesktopFolder(ptr)
|
||||
@ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoA
|
||||
@ stdcall SHGetFileInfoA(ptr long ptr long long)
|
||||
|
@ -395,13 +373,47 @@
|
|||
@ stdcall SHGetPathFromIDListW(ptr ptr)
|
||||
@ stdcall SHGetSettings(ptr long)
|
||||
@ stdcall SHGetSpecialFolderLocation(long long ptr)
|
||||
@ stdcall SHHelpShortcuts_RunDLL(long long long long)
|
||||
@ stub SHHelpShortcuts_RunDLLA
|
||||
@ stub SHHelpShortcuts_RunDLLW
|
||||
@ stdcall SHHelpShortcuts_RunDLL(long long long long) SHHelpShortcuts_RunDLLA
|
||||
@ stdcall SHHelpShortcuts_RunDLLA(long long long long)
|
||||
@ stdcall SHHelpShortcuts_RunDLLW(long long long long)
|
||||
@ stub SHInvokePrinterCommandA
|
||||
@ stub SHInvokePrinterCommandW
|
||||
@ stub SHIsFileAvailableOffline
|
||||
@ stdcall SHLoadInProc(long)
|
||||
@ stub SHLoadNonloadedIconOverlayIdentifiers
|
||||
@ stub SHPathPrepareForWriteA
|
||||
@ stub SHPathPrepareForWriteW
|
||||
@ stdcall SHQueryRecycleBinA(str ptr)
|
||||
@ stdcall SHQueryRecycleBinW(wstr ptr)
|
||||
@ 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
|
||||
|
||||
#
|
||||
|
@ -427,6 +439,9 @@
|
|||
# version 5.00 (Win2K)
|
||||
# _WIN32_IE >= 0x0500
|
||||
#
|
||||
@ stub ShellExec_RunDLL
|
||||
@ stub ShellExec_RunDLLA
|
||||
@ stub ShellExec_RunDLLW
|
||||
@ stdcall SHBindToParent(ptr ptr ptr ptr)
|
||||
@ stdcall SHGetDiskFreeSpaceA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
|
||||
@ stdcall SHGetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
|
||||
|
@ -434,6 +449,8 @@
|
|||
@ stdcall SHGetFolderPathA(long long long long ptr)
|
||||
@ stdcall SHGetFolderPathW(long long long long ptr)
|
||||
@ stdcall SHGetFolderLocation(long long long long ptr)
|
||||
@ stub SHGetIconOverlayIndexA
|
||||
@ stub SHGetIconOverlayIndexW
|
||||
|
||||
# version 6.0 (WinXP)
|
||||
# _WIN32_IE >= 0x600
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
||||
MENU_001 MENU DISCARDABLE
|
||||
BEGIN
|
||||
|
|
|
@ -188,3 +188,35 @@ STRINGTABLE DISCARDABLE
|
|||
IDS_SHUTDOWN_TITLE "Desligar"
|
||||
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"
|
||||
}
|
||||
|
|
|
@ -92,15 +92,18 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
LPWSTR cmdline;
|
||||
int in_quotes,bcount;
|
||||
|
||||
if (*lpCmdline==0) {
|
||||
if (*lpCmdline==0)
|
||||
{
|
||||
/* Return the path to the executable */
|
||||
DWORD len, size=16;
|
||||
|
||||
hargv=GlobalAlloc(size, 0);
|
||||
argv=GlobalLock(hargv);
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
len = GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR));
|
||||
if (!len) {
|
||||
if (!len)
|
||||
{
|
||||
GlobalFree(hargv);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -121,8 +124,10 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
bcount=0;
|
||||
in_quotes=0;
|
||||
cs=lpCmdline;
|
||||
while (1) {
|
||||
if (*cs==0 || ((*cs==0x0009 || *cs==0x0020) && !in_quotes)) {
|
||||
while (1)
|
||||
{
|
||||
if (*cs==0 || ((*cs==0x0009 || *cs==0x0020) && !in_quotes))
|
||||
{
|
||||
/* space */
|
||||
argc++;
|
||||
/* skip the remaining spaces */
|
||||
|
@ -133,14 +138,20 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
break;
|
||||
bcount=0;
|
||||
continue;
|
||||
} else if (*cs==0x005c) {
|
||||
}
|
||||
else if (*cs==0x005c)
|
||||
{
|
||||
/* '\', count them */
|
||||
bcount++;
|
||||
} else if ((*cs==0x0022) && ((bcount & 1)==0)) {
|
||||
}
|
||||
else if ((*cs==0x0022) && ((bcount & 1)==0))
|
||||
{
|
||||
/* unescaped '"' */
|
||||
in_quotes=!in_quotes;
|
||||
bcount=0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* a regular character */
|
||||
bcount=0;
|
||||
}
|
||||
|
@ -160,8 +171,10 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
bcount=0;
|
||||
in_quotes=0;
|
||||
arg=d=s=cmdline;
|
||||
while (*s) {
|
||||
if ((*s==0x0009 || *s==0x0020) && !in_quotes) {
|
||||
while (*s)
|
||||
{
|
||||
if ((*s==0x0009 || *s==0x0020) && !in_quotes)
|
||||
{
|
||||
/* Close the argument and copy it */
|
||||
*d=0;
|
||||
argv[argc++]=arg;
|
||||
|
@ -174,21 +187,28 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
/* Start with a new argument */
|
||||
arg=d=s;
|
||||
bcount=0;
|
||||
} else if (*s==0x005c) {
|
||||
}
|
||||
else if (*s==0x005c)
|
||||
{
|
||||
/* '\\' */
|
||||
*d++=*s++;
|
||||
bcount++;
|
||||
} else if (*s==0x0022) {
|
||||
}
|
||||
else if (*s==0x0022)
|
||||
{
|
||||
/* '"' */
|
||||
if ((bcount & 1)==0) {
|
||||
/* Preceeded by an even number of '\', this is half that
|
||||
if ((bcount & 1)==0)
|
||||
{
|
||||
/* Preceded by an even number of '\', this is half that
|
||||
* number of '\', plus a quote which we erase.
|
||||
*/
|
||||
d-=bcount/2;
|
||||
in_quotes=!in_quotes;
|
||||
s++;
|
||||
} else {
|
||||
/* Preceeded by an odd number of '\', this is half that
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Preceded by an odd number of '\', this is half that
|
||||
* number of '\' followed by a '"'
|
||||
*/
|
||||
d=d-bcount/2-1;
|
||||
|
@ -196,13 +216,16 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
s++;
|
||||
}
|
||||
bcount=0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* a regular character */
|
||||
*d++=*s++;
|
||||
bcount=0;
|
||||
}
|
||||
}
|
||||
if (*arg) {
|
||||
if (*arg)
|
||||
{
|
||||
*d='\0';
|
||||
argv[argc++]=arg;
|
||||
}
|
||||
|
@ -212,14 +235,19 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
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)
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetFileInfoA [SHELL32.@]
|
||||
* SHGetFileInfoW [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
|
||||
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];
|
||||
int iIndex;
|
||||
|
@ -230,30 +258,38 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
HRESULT hr = S_OK;
|
||||
BOOL IconNotYetLoaded=TRUE;
|
||||
|
||||
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, psfi, psfi->dwAttributes, sizeofpsfi, flags);
|
||||
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,
|
||||
psfi, psfi->dwAttributes, sizeofpsfi, flags);
|
||||
|
||||
if ((flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
|
||||
if ( (flags & SHGFI_USEFILEATTRIBUTES) &&
|
||||
(flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
|
||||
return FALSE;
|
||||
|
||||
/* windows initializes this values regardless of the flags */
|
||||
if (psfi != NULL) {
|
||||
if (psfi != NULL)
|
||||
{
|
||||
psfi->szDisplayName[0] = '\0';
|
||||
psfi->szTypeName[0] = '\0';
|
||||
psfi->iIcon = 0;
|
||||
}
|
||||
|
||||
if (!(flags & SHGFI_PIDL)){
|
||||
if (!(flags & SHGFI_PIDL))
|
||||
{
|
||||
/* SHGitFileInfo should work with absolute and relative paths */
|
||||
if (PathIsRelativeW(path)){
|
||||
if (PathIsRelativeW(path))
|
||||
{
|
||||
GetCurrentDirectoryW(MAX_PATH, szLocation);
|
||||
PathCombineW(szFullPath, szLocation, path);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
lstrcpynW(szFullPath, path, MAX_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & SHGFI_EXETYPE) {
|
||||
if (flags & SHGFI_EXETYPE)
|
||||
{
|
||||
BOOL status = FALSE;
|
||||
HANDLE hfile;
|
||||
DWORD BinaryType;
|
||||
|
@ -262,18 +298,22 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
DWORD len;
|
||||
char magic[4];
|
||||
|
||||
if (flags != SHGFI_EXETYPE) return 0;
|
||||
if (flags != SHGFI_EXETYPE)
|
||||
return 0;
|
||||
|
||||
status = GetBinaryTypeW (szFullPath, &BinaryType);
|
||||
if (!status) return 0;
|
||||
if ((BinaryType == SCS_DOS_BINARY)
|
||||
|| (BinaryType == SCS_PIF_BINARY)) return 0x4d5a;
|
||||
if (!status)
|
||||
return 0;
|
||||
if ((BinaryType == SCS_DOS_BINARY) || (BinaryType == SCS_PIF_BINARY))
|
||||
return 0x4d5a;
|
||||
|
||||
hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ,
|
||||
NULL, OPEN_EXISTING, 0, 0 );
|
||||
if ( hfile == INVALID_HANDLE_VALUE ) return 0;
|
||||
if ( hfile == INVALID_HANDLE_VALUE )
|
||||
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
|
||||
* know from calling GetBinaryTypeA that the image is valid and either
|
||||
* an NE or PE, so much error handling can be omitted.
|
||||
|
@ -290,10 +330,11 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||
ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
|
||||
CloseHandle( hfile );
|
||||
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) {
|
||||
return IMAGE_NT_SIGNATURE
|
||||
| (nt.OptionalHeader.MajorSubsystemVersion << 24)
|
||||
| (nt.OptionalHeader.MinorSubsystemVersion << 16);
|
||||
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
|
||||
{
|
||||
return IMAGE_NT_SIGNATURE |
|
||||
(nt.OptionalHeader.MajorSubsystemVersion << 24) |
|
||||
(nt.OptionalHeader.MinorSubsystemVersion << 16);
|
||||
}
|
||||
return IMAGE_NT_SIGNATURE;
|
||||
}
|
||||
|
@ -303,35 +344,47 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||
ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
|
||||
CloseHandle( hfile );
|
||||
if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE
|
||||
| (ne.ne_expver << 16);
|
||||
if (ne.ne_exetyp == 2)
|
||||
return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16);
|
||||
return 0;
|
||||
}
|
||||
CloseHandle( hfile );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
if (psfi == NULL) return FALSE;
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
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.
|
||||
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);
|
||||
} else if (!(flags & SHGFI_USEFILEATTRIBUTES)) {
|
||||
}
|
||||
else if (!(flags & SHGFI_USEFILEATTRIBUTES))
|
||||
{
|
||||
hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes);
|
||||
}
|
||||
|
||||
if ((flags & SHGFI_PIDL) || !(flags & SHGFI_USEFILEATTRIBUTES))
|
||||
{
|
||||
/* get the parent shellfolder */
|
||||
if (pidl) {
|
||||
hr = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&pidlLast);
|
||||
if (pidl)
|
||||
{
|
||||
hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
|
||||
(LPCITEMIDLIST*)&pidlLast );
|
||||
ILFree(pidl);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("pidl is null!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -344,7 +397,8 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
{
|
||||
psfi->dwAttributes = 0xffffffff;
|
||||
}
|
||||
IShellFolder_GetAttributesOf(psfParent, 1, (LPCITEMIDLIST*)&pidlLast, &(psfi->dwAttributes));
|
||||
IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast,
|
||||
&(psfi->dwAttributes) );
|
||||
}
|
||||
|
||||
/* get the displayname */
|
||||
|
@ -357,7 +411,8 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
STRRET str;
|
||||
hr = IShellFolder_GetDisplayNameOf(psfParent, pidlLast, SHGDN_INFOLDER, &str);
|
||||
hr = IShellFolder_GetDisplayNameOf( psfParent, pidlLast,
|
||||
SHGDN_INFOLDER, &str);
|
||||
StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast);
|
||||
}
|
||||
}
|
||||
|
@ -367,9 +422,11 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
{
|
||||
static const WCHAR szFile[] = { 'F','i','l','e',0 };
|
||||
static const WCHAR szDashFile[] = { '-','f','i','l','e',0 };
|
||||
|
||||
if (!(flags & SHGFI_USEFILEATTRIBUTES))
|
||||
{
|
||||
char ftype[80];
|
||||
|
||||
_ILGetFileType(pidlLast, ftype, 80);
|
||||
MultiByteToWideChar(CP_ACP, 0, ftype, -1, psfi->szTypeName, 80 );
|
||||
}
|
||||
|
@ -380,9 +437,10 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
WCHAR sTemp[64];
|
||||
|
||||
lstrcpyW(sTemp,PathFindExtensionW(szFullPath));
|
||||
if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE)
|
||||
&& HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
|
||||
if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) &&
|
||||
HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
|
||||
{
|
||||
lstrcpynW (psfi->szTypeName, sTemp, 64);
|
||||
strcatW (psfi->szTypeName, szDashFile);
|
||||
|
@ -392,6 +450,12 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
}
|
||||
|
||||
/* ### icons ###*/
|
||||
if (flags & SHGFI_ADDOVERLAYS)
|
||||
FIXME("SHGFI_ADDOVERLAYS unhandled\n");
|
||||
|
||||
if (flags & SHGFI_OVERLAYINDEX)
|
||||
FIXME("SHGFI_OVERLAYINDEX unhandled\n");
|
||||
|
||||
if (flags & SHGFI_LINKOVERLAY)
|
||||
FIXME("set icon to link, stub\n");
|
||||
|
||||
|
@ -405,14 +469,18 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
|
||||
{
|
||||
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))
|
||||
{
|
||||
hr = IExtractIconW_GetIconLocation(pei, (flags & SHGFI_OPENICON)? GIL_OPENICON : 0,szLocation, MAX_PATH, &iIndex, &uFlags);
|
||||
hr = IExtractIconW_GetIconLocation(pei,
|
||||
(flags & SHGFI_OPENICON)? GIL_OPENICON : 0,
|
||||
szLocation, MAX_PATH, &iIndex, &uFlags);
|
||||
psfi->iIcon = iIndex;
|
||||
|
||||
if(uFlags != GIL_NOTFILENAME)
|
||||
if (uFlags != GIL_NOTFILENAME)
|
||||
lstrcpyW (psfi->szDisplayName, szLocation);
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -424,7 +492,6 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
/* get icon index (or load icon)*/
|
||||
if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX)))
|
||||
{
|
||||
|
||||
if (flags & SHGFI_USEFILEATTRIBUTES)
|
||||
{
|
||||
WCHAR sTemp [MAX_PATH];
|
||||
|
@ -438,10 +505,12 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
static const WCHAR p1W[] = {'%','1',0};
|
||||
|
||||
psfi->iIcon = 0;
|
||||
szExt = (LPWSTR) PathFindExtensionW(sTemp);
|
||||
if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE)
|
||||
&& HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
|
||||
if ( szExt &&
|
||||
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
|
||||
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
|
||||
{
|
||||
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
|
||||
strcpyW(sTemp, szFullPath);
|
||||
|
@ -449,15 +518,22 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
if (flags & SHGFI_SYSICONINDEX)
|
||||
{
|
||||
psfi->iIcon = SIC_GetIconIndex(sTemp,dwNr);
|
||||
if (psfi->iIcon == -1) psfi->iIcon = 0;
|
||||
if (psfi->iIcon == -1)
|
||||
psfi->iIcon = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
IconNotYetLoaded=FALSE;
|
||||
PrivateExtractIconsW(sTemp,dwNr,(flags & SHGFI_SMALLICON) ?
|
||||
GetSystemMetrics(SM_CXSMICON) : GetSystemMetrics(SM_CXICON),
|
||||
(flags & SHGFI_SMALLICON) ? GetSystemMetrics(SM_CYSMICON) :
|
||||
GetSystemMetrics(SM_CYICON), &psfi->hIcon,0,1,0);
|
||||
if (flags & SHGFI_SMALLICON)
|
||||
PrivateExtractIconsW( sTemp,dwNr,
|
||||
GetSystemMetrics( SM_CXSMICON ),
|
||||
GetSystemMetrics( SM_CYSMICON ),
|
||||
&psfi->hIcon, 0, 1, 0);
|
||||
else
|
||||
PrivateExtractIconsW( sTemp, dwNr,
|
||||
GetSystemMetrics( SM_CXICON),
|
||||
GetSystemMetrics( SM_CYICON),
|
||||
&psfi->hIcon, 0, 1, 0);
|
||||
psfi->iIcon = dwNr;
|
||||
}
|
||||
}
|
||||
|
@ -473,16 +549,24 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
}
|
||||
if (ret)
|
||||
{
|
||||
ret = (DWORD) ((flags & SHGFI_SMALLICON) ? ShellSmallIconList : ShellBigIconList);
|
||||
if (flags & SHGFI_SMALLICON)
|
||||
ret = (DWORD) ShellSmallIconList;
|
||||
else
|
||||
ret = (DWORD) ShellBigIconList;
|
||||
}
|
||||
}
|
||||
|
||||
/* icon handle */
|
||||
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_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3))
|
||||
FIXME("unknown attribute!\n");
|
||||
if (flags & ~SHGFI_KNOWN_FLAGS)
|
||||
FIXME("unknown flags %08x\n", flags & ~SHGFI_KNOWN_FLAGS);
|
||||
|
||||
if (psfParent)
|
||||
IShellFolder_Release(psfParent);
|
||||
|
@ -490,18 +574,21 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
if (hr != S_OK)
|
||||
ret = FALSE;
|
||||
|
||||
if(pidlLast) SHFree(pidlLast);
|
||||
if (pidlLast)
|
||||
SHFree(pidlLast);
|
||||
|
||||
#ifdef MORE_DEBUG
|
||||
TRACE ("icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n",
|
||||
psfi->hIcon, psfi->iIcon, psfi->dwAttributes, debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
|
||||
psfi->hIcon, psfi->iIcon, psfi->dwAttributes,
|
||||
debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetFileInfoW [SHELL32.@]
|
||||
* SHGetFileInfoA [SHELL32.@]
|
||||
*/
|
||||
|
||||
DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
||||
SHFILEINFOA *psfi, UINT sizeofpsfi,
|
||||
UINT flags )
|
||||
|
@ -511,19 +598,25 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
|||
DWORD ret;
|
||||
SHFILEINFOW temppsfi;
|
||||
|
||||
if (flags & SHGFI_PIDL) {
|
||||
if (flags & SHGFI_PIDL)
|
||||
{
|
||||
/* path contains a pidl */
|
||||
temppath = (LPWSTR) path;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
|
||||
temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
|
||||
}
|
||||
|
||||
if(psfi && (flags & SHGFI_ATTR_SPECIFIED))
|
||||
if (psfi && (flags & SHGFI_ATTR_SPECIFIED))
|
||||
temppsfi.dwAttributes=psfi->dwAttributes;
|
||||
|
||||
ret = SHGetFileInfoW(temppath, dwFileAttributes, (psfi == NULL)? NULL : &temppsfi, sizeof(temppsfi), flags);
|
||||
if (psfi == NULL)
|
||||
ret = SHGetFileInfoW(temppath, dwFileAttributes, NULL, sizeof(temppsfi), flags);
|
||||
else
|
||||
ret = SHGetFileInfoW(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
|
||||
|
||||
if (psfi)
|
||||
{
|
||||
|
@ -534,11 +627,20 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
|||
if(flags & SHGFI_ATTRIBUTES)
|
||||
psfi->dwAttributes=temppsfi.dwAttributes;
|
||||
if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION))
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1, psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
|
||||
if(flags & SHGFI_TYPENAME)
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1,
|
||||
psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
|
||||
}
|
||||
if(!(flags & SHGFI_PIDL)) HeapFree(GetProcessHeap(), 0, temppath);
|
||||
if(flags & SHGFI_TYPENAME)
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1,
|
||||
psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(flags & SHGFI_PIDL))
|
||||
HeapFree(GetProcessHeap(), 0, temppath);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -550,9 +652,9 @@ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon)
|
|||
ICONINFO IconInfo;
|
||||
HICON hDupIcon = 0;
|
||||
|
||||
TRACE("(%p, %p)\n", hInstance, hIcon);
|
||||
TRACE("%p %p\n", hInstance, hIcon);
|
||||
|
||||
if(GetIconInfo(hIcon, &IconInfo))
|
||||
if (GetIconInfo(hIcon, &IconInfo))
|
||||
{
|
||||
hDupIcon = CreateIconIndirect(&IconInfo);
|
||||
|
||||
|
@ -578,6 +680,7 @@ HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex)
|
|||
MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
|
||||
ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex);
|
||||
HeapFree(GetProcessHeap(), 0, lpwstrFile);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -592,7 +695,8 @@ HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT 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);
|
||||
if (ret != 0xFFFFFFFF && ret)
|
||||
return (HICON)ret;
|
||||
|
@ -605,6 +709,7 @@ HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex
|
|||
return (HICON)1;
|
||||
else if (ret > 0 && hIcon)
|
||||
return hIcon;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -625,9 +730,12 @@ typedef struct
|
|||
#define DROP_FIELD_HEIGHT 15
|
||||
|
||||
static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
|
||||
{ HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
|
||||
{
|
||||
HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
|
||||
|
||||
if( hWndCtl )
|
||||
{ GetWindowRect( hWndCtl, lprect );
|
||||
{
|
||||
GetWindowRect( hWndCtl, lprect );
|
||||
MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 );
|
||||
lprect->bottom = (lprect->top += DROP_FIELD_TOP);
|
||||
return TRUE;
|
||||
|
@ -643,8 +751,10 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
|
|||
int width=data->rc.right - data->rc.left;
|
||||
int height=data->rc.bottom - data->rc.top;
|
||||
RECT rec=data->rc;
|
||||
|
||||
switch (msg)
|
||||
{ case ABM_GETSTATE:
|
||||
{
|
||||
case ABM_GETSTATE:
|
||||
return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
|
||||
case ABM_GETTASKBARPOS:
|
||||
GetWindowRect(data->hWnd, &rec);
|
||||
|
@ -684,13 +794,22 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHHelpShortcuts_RunDLL [SHELL32.@]
|
||||
* SHHelpShortcuts_RunDLLA [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
|
||||
{ FIXME("(%lx, %lx, %lx, %lx) empty stub!\n",
|
||||
dwArg1, dwArg2, dwArg3, dwArg4);
|
||||
DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
|
||||
{
|
||||
FIXME("(%lx, %lx, %lx, %lx) stub!\n", 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;
|
||||
}
|
||||
|
||||
|
@ -699,7 +818,6 @@ DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, D
|
|||
* Create an instance of specified object class from within
|
||||
* the shell process and release it immediately
|
||||
*/
|
||||
|
||||
HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
@ -759,11 +877,13 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
|
|||
return 1;
|
||||
|
||||
case WM_PAINT:
|
||||
{ RECT rect;
|
||||
{
|
||||
RECT rect;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC = BeginPaint( hWnd, &ps );
|
||||
|
||||
if( __get_dropline( hWnd, &rect ) ) {
|
||||
if (__get_dropline( hWnd, &rect ))
|
||||
{
|
||||
SelectObject( hDC, GetStockObject( BLACK_PEN ) );
|
||||
MoveToEx( hDC, rect.left, rect.top, NULL );
|
||||
LineTo( hDC, rect.right, rect.bottom );
|
||||
|
@ -855,7 +975,8 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
|
|||
* FreeIconList (SHELL32.@)
|
||||
*/
|
||||
void WINAPI FreeIconList( DWORD dw )
|
||||
{ FIXME("(%lx): stub\n",dw);
|
||||
{
|
||||
FIXME("%lx: stub\n",dw);
|
||||
}
|
||||
|
||||
|
||||
|
@ -914,6 +1035,7 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
|||
return E_INVALIDARG;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* global variables of the shell32.dll
|
||||
* all are once per process
|
||||
|
@ -930,7 +1052,6 @@ HIMAGELIST ShellBigIconList = 0;
|
|||
* NOTES
|
||||
* calling oleinitialize here breaks sone apps.
|
||||
*/
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
||||
{
|
||||
TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
|
||||
|
@ -971,8 +1092,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
|||
|
||||
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 */
|
||||
}
|
||||
|
||||
|
@ -981,7 +1101,6 @@ HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
|||
*/
|
||||
HRESULT WINAPI SHELL32_DllCanUnloadNow(void)
|
||||
{
|
||||
FIXME("(void): stub\n");
|
||||
|
||||
FIXME("stub\n");
|
||||
return S_FALSE;
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPV
|
|||
HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
|
||||
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *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_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);
|
||||
|
@ -220,6 +221,8 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
|
|||
|
||||
extern WCHAR swShell32Name[MAX_PATH];
|
||||
|
||||
extern const GUID CLSID_UnixFolder;
|
||||
|
||||
/* Default shell folder value registration */
|
||||
HRESULT SHELL_RegisterShellFolders(void);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
*
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998 Juergen Schmied
|
||||
* Copyright 2005 Mike McCormack
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -21,6 +22,14 @@
|
|||
* Nearly complete informations about the binary formats
|
||||
* 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"
|
||||
|
@ -58,19 +67,28 @@
|
|||
#include "shlguid.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "initguid.h"
|
||||
|
||||
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 */
|
||||
|
||||
/* flag1: lnk elements: simple link has 0x0B */
|
||||
#define SCF_PIDL 1
|
||||
#define SCF_NORMAL 2
|
||||
#define SCF_LOCATION 2
|
||||
#define SCF_DESCRIPTION 4
|
||||
#define SCF_RELATIVE 8
|
||||
#define SCF_WORKDIR 0x10
|
||||
#define SCF_ARGS 0x20
|
||||
#define SCF_CUSTOMICON 0x40
|
||||
#define SCF_UNICODE 0x80
|
||||
#define SCF_PRODUCT 0x800
|
||||
#define SCF_COMPONENT 0x1000
|
||||
|
||||
#include "pshpack1.h"
|
||||
|
||||
|
@ -113,6 +131,21 @@ typedef struct _LOCAL_VOLUME_INFO
|
|||
DWORD dwVolLabelOfs;
|
||||
} 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"
|
||||
|
||||
static IShellLinkAVtbl slvt;
|
||||
|
@ -146,6 +179,9 @@ typedef struct
|
|||
LPWSTR sWorkDir;
|
||||
LPWSTR sDescription;
|
||||
LPWSTR sPathRel;
|
||||
LPWSTR sProduct;
|
||||
LPWSTR sComponent;
|
||||
volume_info volume;
|
||||
|
||||
BOOL bDirty;
|
||||
} IShellLinkImpl;
|
||||
|
@ -172,7 +208,6 @@ inline static LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str)
|
|||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* IPersistFile_QueryInterface
|
||||
*/
|
||||
|
@ -251,7 +286,8 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
|
|||
|
||||
static BOOL StartLinkProcessor( LPCOLESTR szLink )
|
||||
{
|
||||
static const WCHAR szFormat[] = {'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
|
||||
static const WCHAR szFormat[] = {
|
||||
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
|
||||
' ','-','r',' ','"','%','s','"',0 };
|
||||
LONG len;
|
||||
LPWSTR buffer;
|
||||
|
@ -290,7 +326,7 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile
|
|||
|
||||
TRACE("(%p)->(%s)\n",This,debugstr_w(pszFileName));
|
||||
|
||||
if (!pszFileName || !This->sPath)
|
||||
if (!pszFileName)
|
||||
return E_FAIL;
|
||||
|
||||
r = CreateStreamOnFile(pszFileName, STGM_READWRITE | STGM_CREATE, &stm);
|
||||
|
@ -469,44 +505,175 @@ static HRESULT Stream_LoadString( IStream* stm, BOOL unicode, LPWSTR *pstr )
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT Stream_LoadLocation( IStream* stm )
|
||||
static HRESULT Stream_ReadChunk( IStream* stm, LPVOID *data )
|
||||
{
|
||||
DWORD size;
|
||||
ULONG count;
|
||||
HRESULT r;
|
||||
LOCATION_INFO *loc;
|
||||
struct sized_chunk {
|
||||
DWORD size;
|
||||
unsigned char data[1];
|
||||
} *chunk;
|
||||
|
||||
TRACE("%p\n",stm);
|
||||
|
||||
r = IStream_Read( stm, &size, sizeof(size), &count );
|
||||
if( FAILED( r ) )
|
||||
return r;
|
||||
if( count != sizeof(loc->dwTotalSize) )
|
||||
if( FAILED( r ) || count != sizeof(size) )
|
||||
return E_FAIL;
|
||||
|
||||
loc = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
if( ! loc )
|
||||
chunk = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
if( !chunk )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
r = IStream_Read( stm, &loc->dwHeaderSize, size-sizeof(size), &count );
|
||||
if( FAILED( r ) )
|
||||
goto end;
|
||||
if( count != (size - sizeof(size)) )
|
||||
chunk->size = size;
|
||||
r = IStream_Read( stm, chunk->data, size - sizeof(size), &count );
|
||||
if( FAILED( r ) || count != (size - sizeof(size)) )
|
||||
{
|
||||
r = E_FAIL;
|
||||
goto end;
|
||||
HeapFree( GetProcessHeap(), 0, chunk );
|
||||
return E_FAIL;
|
||||
}
|
||||
loc->dwTotalSize = size;
|
||||
|
||||
TRACE("Read %ld bytes\n",count);
|
||||
TRACE("Read %ld bytes\n",chunk->size);
|
||||
|
||||
/* FIXME: do something useful with it */
|
||||
HeapFree( GetProcessHeap(), 0, loc );
|
||||
*data = (LPVOID) chunk;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -519,12 +686,12 @@ static HRESULT WINAPI IPersistStream_fnLoad(
|
|||
LINK_HEADER hdr;
|
||||
ULONG dwBytesRead;
|
||||
BOOL unicode;
|
||||
WCHAR sTemp[MAX_PATH];
|
||||
HRESULT r;
|
||||
DWORD zero;
|
||||
|
||||
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
||||
|
||||
TRACE("(%p)(%p)\n", This, stm);
|
||||
TRACE("%p %p\n", This, stm);
|
||||
|
||||
if( !stm )
|
||||
return STG_E_INVALIDPOINTER;
|
||||
|
@ -541,30 +708,61 @@ static HRESULT WINAPI IPersistStream_fnLoad(
|
|||
if( !IsEqualIID(&hdr.MagicGuid, &CLSID_ShellLink) )
|
||||
return E_FAIL;
|
||||
|
||||
/* if( hdr.dwFlags & SCF_PIDL ) */ /* FIXME: seems to always have a PIDL */
|
||||
{
|
||||
r = ILLoadFromStream( stm, &This->pPidl );
|
||||
if( FAILED( r ) )
|
||||
return r;
|
||||
}
|
||||
/* free all the old stuff */
|
||||
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 1
|
||||
GetDateFormatW(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
|
||||
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, 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);
|
||||
#endif
|
||||
if( hdr.dwFlags & SCF_NORMAL )
|
||||
r = Stream_LoadLocation( stm );
|
||||
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 );
|
||||
if( FAILED( r ) )
|
||||
return r;
|
||||
}
|
||||
pdump(This->pPidl);
|
||||
|
||||
/* load the location information */
|
||||
if( hdr.dwFlags & SCF_LOCATION )
|
||||
r = Stream_LoadLocation( stm, &This->volume, &This->sPath );
|
||||
if( FAILED( r ) )
|
||||
goto end;
|
||||
|
||||
unicode = hdr.dwFlags & SCF_UNICODE;
|
||||
if( hdr.dwFlags & SCF_DESCRIPTION )
|
||||
{
|
||||
|
@ -606,6 +804,26 @@ static HRESULT WINAPI IPersistStream_fnLoad(
|
|||
if( FAILED( r ) )
|
||||
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");
|
||||
|
||||
pdump (This->pPidl);
|
||||
|
@ -640,19 +858,81 @@ static HRESULT Stream_WriteString( IStream* stm, LPCWSTR str )
|
|||
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;
|
||||
LINK_ADVERTISEINFO buffer;
|
||||
|
||||
FIXME("writing empty location info\n");
|
||||
TRACE("%p\n",stm);
|
||||
|
||||
memset( &loc, 0, sizeof(loc) );
|
||||
loc.dwTotalSize = sizeof(loc) - sizeof(loc.dwTotalSize);
|
||||
memset( &buffer, 0, sizeof buffer );
|
||||
buffer.size = sizeof buffer;
|
||||
buffer.magic = magic;
|
||||
strncpyW( buffer.bufW, string, MAX_PATH );
|
||||
WideCharToMultiByte(CP_ACP, 0, string, -1, buffer.bufA, MAX_PATH, NULL, NULL );
|
||||
|
||||
/* FIXME: fill this in */
|
||||
|
||||
return IStream_Write( stm, &loc, loc.dwTotalSize, &count );
|
||||
return IStream_Write( stm, &buffer, buffer.size, &count );
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -670,38 +950,39 @@ static HRESULT WINAPI IPersistStream_fnSave(
|
|||
LINK_HEADER header;
|
||||
WCHAR exePath[MAX_PATH];
|
||||
ULONG count;
|
||||
DWORD zero;
|
||||
HRESULT r;
|
||||
|
||||
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
||||
|
||||
TRACE("(%p) %p %x\n", This, stm, fClearDirty);
|
||||
TRACE("%p %p %x\n", This, stm, fClearDirty);
|
||||
|
||||
*exePath = '\0';
|
||||
|
||||
if (This->sPath)
|
||||
{
|
||||
SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH, NULL, NULL, NULL, NULL);
|
||||
SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH,
|
||||
NULL, NULL, NULL, NULL);
|
||||
/*
|
||||
* 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
|
||||
* gave us
|
||||
*/
|
||||
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));
|
||||
header.dwSize = sizeof(header);
|
||||
header.fStartup = This->iShowCmd;
|
||||
memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) );
|
||||
|
||||
header.wHotKey = This->wHotKey;
|
||||
header.nIcon = This->iIcoNdx;
|
||||
header.dwFlags = SCF_UNICODE; /* strings are in unicode */
|
||||
header.dwFlags |= SCF_NORMAL; /* how do we determine this ? */
|
||||
if( This->pPidl )
|
||||
header.dwFlags |= SCF_PIDL;
|
||||
if( This->sPath )
|
||||
header.dwFlags |= SCF_LOCATION;
|
||||
if( This->sDescription )
|
||||
header.dwFlags |= SCF_DESCRIPTION;
|
||||
if( This->sWorkDir )
|
||||
|
@ -710,6 +991,10 @@ static HRESULT WINAPI IPersistStream_fnSave(
|
|||
header.dwFlags |= SCF_ARGS;
|
||||
if( This->sIcoPath )
|
||||
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->time2, &header.Time2 );
|
||||
|
@ -736,9 +1021,9 @@ static HRESULT WINAPI IPersistStream_fnSave(
|
|||
}
|
||||
}
|
||||
|
||||
Stream_WriteLocationInfo( stm, exePath );
|
||||
if( This->sPath )
|
||||
Stream_WriteLocationInfo( stm, exePath, &This->volume );
|
||||
|
||||
TRACE("Description = %s\n", debugstr_w(This->sDescription));
|
||||
if( This->sDescription )
|
||||
r = Stream_WriteString( stm, This->sDescription );
|
||||
|
||||
|
@ -754,6 +1039,16 @@ static HRESULT WINAPI IPersistStream_fnSave(
|
|||
if( 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;
|
||||
}
|
||||
|
||||
|
@ -828,13 +1123,9 @@ HRESULT WINAPI IShellLink_Constructor (
|
|||
|
||||
static BOOL SHELL_ExistsFileW(LPCWSTR path)
|
||||
{
|
||||
HANDLE hfile = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
||||
|
||||
if (hfile != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle(hfile);
|
||||
return TRUE;
|
||||
} else
|
||||
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW(path))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -1017,7 +1308,10 @@ static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,
|
|||
TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",
|
||||
This, pszFile, cchMaxPath, pfd, fFlags, debugstr_w(This->sPath));
|
||||
|
||||
if( cchMaxPath )
|
||||
if (This->sComponent || This->sProduct)
|
||||
return S_FALSE;
|
||||
|
||||
if (cchMaxPath)
|
||||
pszFile[0] = 0;
|
||||
if (This->sPath)
|
||||
WideCharToMultiByte( CP_ACP, 0, This->sPath, -1,
|
||||
|
@ -1025,7 +1319,7 @@ static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,
|
|||
|
||||
if (pfd) FIXME("(%p): WIN32_FIND_DATA is not yet filled.\n", This);
|
||||
|
||||
return NOERROR;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST * ppidl)
|
||||
|
@ -1034,9 +1328,7 @@ static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST
|
|||
|
||||
TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
|
||||
|
||||
*ppidl = ILClone(This->pPidl);
|
||||
|
||||
return NOERROR;
|
||||
return IShellLinkW_GetIDList((IShellLinkW*)&(This->lpvtblw), ppidl);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST pidl)
|
||||
|
@ -1218,21 +1510,23 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p
|
|||
|
||||
TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon);
|
||||
|
||||
if (cchIconPath)
|
||||
pszIconPath[0] = 0;
|
||||
|
||||
if (This->sIcoPath) {
|
||||
WideCharToMultiByte(CP_ACP, 0, This->sIcoPath, -1, pszIconPath, cchIconPath, NULL, NULL);
|
||||
*piIcon = This->iIcoNdx;
|
||||
|
||||
if (This->sIcoPath)
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, This->sIcoPath, -1, pszIconPath, cchIconPath, NULL, NULL);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (This->pPidl || This->sPath) {
|
||||
if (This->pPidl || This->sPath)
|
||||
{
|
||||
IShellFolder* pdsk;
|
||||
|
||||
HRESULT hr = SHGetDesktopFolder(&pdsk);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
/* first look for an icon using the PIDL (if present) */
|
||||
if (This->pPidl)
|
||||
hr = SHELL_PidlGeticonLocationA(pdsk, This->pPidl, pszIconPath, cchIconPath, piIcon);
|
||||
|
@ -1240,7 +1534,8 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p
|
|||
hr = E_FAIL;
|
||||
|
||||
/* 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;
|
||||
|
||||
hr = IShellFolder_ParseDisplayName(pdsk, 0, NULL, This->sPath, NULL, &pidl, NULL);
|
||||
|
@ -1256,8 +1551,8 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p
|
|||
}
|
||||
|
||||
return hr;
|
||||
} else
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IShellLinkA_fnSetIconLocation(IShellLinkA * iface, LPCSTR pszIconPath,INT iIcon)
|
||||
|
@ -1281,7 +1576,7 @@ static HRESULT WINAPI IShellLinkA_fnSetRelativePath(IShellLinkA * iface, LPCSTR
|
|||
{
|
||||
IShellLinkImpl *This = (IShellLinkImpl *)iface;
|
||||
|
||||
FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
|
||||
TRACE("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->sPathRel);
|
||||
This->sPathRel = HEAP_strdupAtoW(GetProcessHeap(), 0, pszPathRel);
|
||||
|
@ -1296,7 +1591,7 @@ static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWOR
|
|||
|
||||
IShellLinkImpl *This = (IShellLinkImpl *)iface;
|
||||
|
||||
FIXME("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
|
||||
TRACE("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
|
||||
|
||||
/*FIXME: use IResolveShellLink interface */
|
||||
|
||||
|
@ -1333,23 +1628,20 @@ static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWOR
|
|||
|
||||
static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
|
||||
{
|
||||
HRESULT r;
|
||||
LPWSTR str;
|
||||
IShellLinkImpl *This = (IShellLinkImpl *)iface;
|
||||
char buffer[MAX_PATH];
|
||||
LPSTR fname;
|
||||
|
||||
TRACE("(%p)->(path=%s)\n",This, pszFile);
|
||||
|
||||
if (!GetFullPathNameA(pszFile, MAX_PATH, buffer, &fname))
|
||||
return E_FAIL;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->sPath);
|
||||
This->sPath = HEAP_strdupAtoW(GetProcessHeap(), 0, buffer);
|
||||
if( !This->sPath )
|
||||
str = HEAP_strdupAtoW(GetProcessHeap(), 0, pszFile);
|
||||
if( !str )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
This->bDirty = TRUE;
|
||||
r = IShellLinkW_SetPath((IShellLinkW*)&(This->lpvtblw), str);
|
||||
HeapFree( GetProcessHeap(), 0, str );
|
||||
|
||||
return S_OK;
|
||||
return r;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -1421,17 +1713,20 @@ static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,
|
|||
{
|
||||
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
||||
|
||||
TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",
|
||||
This, pszFile, cchMaxPath, pfd, fFlags);
|
||||
TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",
|
||||
This, pszFile, cchMaxPath, pfd, fFlags, debugstr_w(This->sPath));
|
||||
|
||||
if( cchMaxPath )
|
||||
if (This->sComponent || This->sProduct)
|
||||
return S_FALSE;
|
||||
|
||||
if (cchMaxPath)
|
||||
pszFile[0] = 0;
|
||||
if( This->sPath )
|
||||
if (This->sPath)
|
||||
lstrcpynW( pszFile, This->sPath, cchMaxPath );
|
||||
|
||||
if (pfd) FIXME("(%p): WIN32_FIND_DATA is not yet filled.\n", This);
|
||||
|
||||
return NOERROR;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl)
|
||||
|
@ -1440,11 +1735,9 @@ static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST
|
|||
|
||||
TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
|
||||
|
||||
if( This->pPidl)
|
||||
*ppidl = ILClone( This->pPidl );
|
||||
else
|
||||
*ppidl = NULL;
|
||||
|
||||
if (!This->pPidl)
|
||||
return S_FALSE;
|
||||
*ppidl = ILClone(This->pPidl);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -1471,7 +1764,6 @@ static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR p
|
|||
|
||||
TRACE("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
|
||||
|
||||
if( cchMaxName )
|
||||
pszName[0] = 0;
|
||||
if( This->sDescription )
|
||||
lstrcpynW( pszName, This->sDescription, cchMaxName );
|
||||
|
@ -1632,21 +1924,23 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR
|
|||
|
||||
TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon);
|
||||
|
||||
if (cchIconPath)
|
||||
pszIconPath[0] = 0;
|
||||
|
||||
if (This->sIcoPath) {
|
||||
lstrcpynW(pszIconPath, This->sIcoPath, cchIconPath);
|
||||
*piIcon = This->iIcoNdx;
|
||||
|
||||
if (This->sIcoPath)
|
||||
{
|
||||
lstrcpynW(pszIconPath, This->sIcoPath, cchIconPath);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (This->pPidl || This->sPath) {
|
||||
if (This->pPidl || This->sPath)
|
||||
{
|
||||
IShellFolder* pdsk;
|
||||
|
||||
HRESULT hr = SHGetDesktopFolder(&pdsk);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
/* first look for an icon using the PIDL (if present) */
|
||||
if (This->pPidl)
|
||||
hr = SHELL_PidlGeticonLocationW(pdsk, This->pPidl, pszIconPath, cchIconPath, piIcon);
|
||||
|
@ -1654,12 +1948,14 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR
|
|||
hr = E_FAIL;
|
||||
|
||||
/* 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;
|
||||
|
||||
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);
|
||||
|
||||
SHFree(pidl);
|
||||
|
@ -1668,10 +1964,9 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR
|
|||
|
||||
IShellFolder_Release(pdsk);
|
||||
}
|
||||
|
||||
return hr;
|
||||
} else
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon)
|
||||
|
@ -1716,7 +2011,7 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
|
|||
|
||||
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
||||
|
||||
FIXME("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
|
||||
TRACE("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
|
||||
|
||||
/*FIXME: use IResolveShellLink interface */
|
||||
|
||||
|
@ -1751,27 +2046,141 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
|
|||
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)
|
||||
{
|
||||
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
||||
WCHAR buffer[MAX_PATH];
|
||||
LPWSTR fname;
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
|
||||
|
||||
if (!GetFullPathNameW(pszFile, MAX_PATH, buffer, &fname))
|
||||
return E_FAIL;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->sPath);
|
||||
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;
|
||||
else if(!PathFileExistsW(buffer))
|
||||
hr = S_FALSE;
|
||||
|
||||
This->pPidl = SHSimpleIDListFromPathW(pszFile);
|
||||
ShellLink_GetVolumeInfo(buffer, &This->volume);
|
||||
|
||||
This->sPath = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( buffer )+1) * sizeof (WCHAR) );
|
||||
if (!This->sPath)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
lstrcpyW(This->sPath, buffer);
|
||||
}
|
||||
This->bDirty = TRUE;
|
||||
|
||||
return S_OK;
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -365,7 +365,7 @@ static BOOL PathIsExeA (LPCSTR lpszPath)
|
|||
TRACE("path=%s\n",lpszPath);
|
||||
|
||||
for(i=0; lpszExtensions[i]; i++)
|
||||
if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
|
||||
if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1267,7 +1267,7 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
|
|||
}
|
||||
else
|
||||
{
|
||||
FIXME("LoadString failed, missing translation?\n");
|
||||
FIXME("(%d,%s), LoadString failed, missing translation?\n", folder, debugstr_w(pszPath));
|
||||
hr = E_FAIL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
|||
LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut);
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -55,4 +56,17 @@ static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
|
|||
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);
|
||||
|
|
|
@ -91,9 +91,10 @@ static shvheader DesktopSFHeader[] = {
|
|||
#define DESKTOPSHELLVIEWCOLUMNS 5
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_Constructor
|
||||
*/
|
||||
HRESULT WINAPI ISF_Desktop_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
|
||||
* ISF_Desktop_Constructor
|
||||
*/
|
||||
HRESULT WINAPI ISF_Desktop_Constructor (
|
||||
IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
|
||||
{
|
||||
IGenericSFImpl *sf;
|
||||
char szMyPath[MAX_PATH];
|
||||
|
@ -118,7 +119,8 @@ HRESULT WINAPI ISF_Desktop_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOI
|
|||
sf->sPathTarget = SHAlloc (strlen (szMyPath) + 1);
|
||||
lstrcpyA (sf->sPathTarget, szMyPath);
|
||||
|
||||
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
|
||||
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv)))
|
||||
{
|
||||
IUnknown_Release (_IUnknown_ (sf));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
@ -132,7 +134,8 @@ HRESULT WINAPI ISF_Desktop_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOI
|
|||
*
|
||||
* NOTES supports not IPersist/IPersistFolder
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
|
||||
IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
|
@ -140,12 +143,15 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface (IShellFolder2 * iface, REFII
|
|||
|
||||
*ppvObj = NULL;
|
||||
|
||||
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IShellFolder)
|
||||
|| IsEqualIID (riid, &IID_IShellFolder2)) {
|
||||
if (IsEqualIID (riid, &IID_IUnknown) ||
|
||||
IsEqualIID (riid, &IID_IShellFolder) ||
|
||||
IsEqualIID (riid, &IID_IShellFolder2))
|
||||
{
|
||||
*ppvObj = This;
|
||||
}
|
||||
|
||||
if (*ppvObj) {
|
||||
if (*ppvObj)
|
||||
{
|
||||
IUnknown_AddRef ((IUnknown *) (*ppvObj));
|
||||
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
|
||||
return S_OK;
|
||||
|
@ -171,7 +177,8 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
|
|||
|
||||
TRACE ("(%p)->(count=%lu)\n", This, refCount + 1);
|
||||
|
||||
if (!refCount) {
|
||||
if (!refCount)
|
||||
{
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", This);
|
||||
if (This->pidlRoot)
|
||||
SHFree (This->pidlRoot);
|
||||
|
@ -184,30 +191,26 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnParseDisplayName
|
||||
*
|
||||
* NOTES
|
||||
* "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
|
||||
* to MyComputer
|
||||
*/
|
||||
* ISF_Desktop_fnParseDisplayName
|
||||
*
|
||||
* NOTES
|
||||
* "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
|
||||
* to MyComputer
|
||||
*/
|
||||
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)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
WCHAR szElement[MAX_PATH];
|
||||
LPCWSTR szNext = NULL;
|
||||
LPITEMIDLIST pidlTemp = NULL;
|
||||
HRESULT hr = S_OK;
|
||||
char szPath[MAX_PATH];
|
||||
DWORD len;
|
||||
CLSID clsid;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
|
||||
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
|
||||
This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
|
||||
pchEaten, ppidl, pdwAttributes);
|
||||
|
||||
if (!lpszDisplayName || !ppidl)
|
||||
return E_INVALIDARG;
|
||||
|
@ -217,42 +220,72 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
|
|||
if (pchEaten)
|
||||
*pchEaten = 0; /* strange but like the original */
|
||||
|
||||
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
|
||||
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
|
||||
{
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
TRACE ("-- element: %s\n", debugstr_w (szElement));
|
||||
SHCLSIDFromStringW (szElement + 2, &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 */
|
||||
pidlTemp = _ILCreateMyComputer ();
|
||||
szNext = lpszDisplayName;
|
||||
} else if (PathIsUNCW(lpszDisplayName)) {
|
||||
}
|
||||
else if (PathIsUNCW(lpszDisplayName))
|
||||
{
|
||||
pidlTemp = _ILCreateNetwork();
|
||||
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 */
|
||||
|
||||
if (*lpszDisplayName) {
|
||||
if (*lpszDisplayName)
|
||||
{
|
||||
WCHAR szPath[MAX_PATH];
|
||||
LPWSTR pathPtr;
|
||||
|
||||
/* build a complete path to create a simple pidl */
|
||||
lstrcpyA(szPath, This->sPathTarget);
|
||||
PathAddBackslashA(szPath);
|
||||
len = lstrlenA(szPath);
|
||||
WideCharToMultiByte(CP_ACP, 0, lpszDisplayName, -1, szPath + len, MAX_PATH - len, NULL, NULL);
|
||||
hr = _ILCreateFromPathA(szPath, &pidlTemp);
|
||||
} else {
|
||||
pidlTemp = _ILCreateMyComputer();
|
||||
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szPath,
|
||||
sizeof(szPath) / sizeof(szPath[0]));
|
||||
pathPtr = PathAddBackslashW(szPath);
|
||||
if (pathPtr)
|
||||
{
|
||||
lstrcpynW(pathPtr, lpszDisplayName,
|
||||
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();
|
||||
|
||||
szNext = NULL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr) && pidlTemp) {
|
||||
if (szNext && *szNext) {
|
||||
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
|
||||
} else {
|
||||
if (pdwAttributes && *pdwAttributes) {
|
||||
hr = SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
|
||||
if (SUCCEEDED(hr) && pidlTemp)
|
||||
{
|
||||
if (szNext && *szNext)
|
||||
{
|
||||
hr = SHELL32_ParseNextElement(iface, hwndOwner, pbc,
|
||||
&pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pdwAttributes && *pdwAttributes)
|
||||
hr = SHELL32_GetItemAttributes(_IShellFolder_ (This),
|
||||
pidlTemp, pdwAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,41 +299,48 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
|
|||
/**************************************************************************
|
||||
* 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)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
char szPath[MAX_PATH];
|
||||
WCHAR szPath[MAX_PATH];
|
||||
|
||||
TRACE("(%p)->(flags=0x%08lx) \n",list,dwFlags);
|
||||
|
||||
/*enumerate the root folders */
|
||||
if(dwFlags & SHCONTF_FOLDERS)
|
||||
/* enumerate the root folders */
|
||||
if (dwFlags & SHCONTF_FOLDERS)
|
||||
{
|
||||
HKEY hkey;
|
||||
LONG r;
|
||||
|
||||
/*create the pidl for This item */
|
||||
/* create the pidl for This item */
|
||||
ret = AddToEnumList(list, _ILCreateMyComputer());
|
||||
|
||||
if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
||||
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\desktop\\NameSpace",
|
||||
0, KEY_READ, &hkey))
|
||||
r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, Desktop_NameSpaceW,
|
||||
0, KEY_READ, &hkey);
|
||||
if (ret && ERROR_SUCCESS == r)
|
||||
{
|
||||
char iid[50];
|
||||
WCHAR iid[50];
|
||||
int i=0;
|
||||
BOOL moreKeys = TRUE;
|
||||
|
||||
while (ret && moreKeys)
|
||||
{
|
||||
DWORD size = sizeof (iid);
|
||||
LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
|
||||
NULL);
|
||||
DWORD size;
|
||||
|
||||
if (ERROR_SUCCESS == apiRet)
|
||||
size = sizeof (iid);
|
||||
r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
|
||||
if (ERROR_SUCCESS == r)
|
||||
{
|
||||
ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
|
||||
ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid));
|
||||
i++;
|
||||
}
|
||||
else if (ERROR_NO_MORE_ITEMS == apiRet)
|
||||
else if (ERROR_NO_MORE_ITEMS == r)
|
||||
moreKeys = FALSE;
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -309,22 +349,23 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
|
|||
}
|
||||
}
|
||||
|
||||
/*enumerate the elements in %windir%\desktop */
|
||||
SHGetSpecialFolderPathA(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
|
||||
/* enumerate the elements in %windir%\desktop */
|
||||
SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
|
||||
ret = ret && CreateFolderEnumList(list, szPath, dwFlags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnEnumObjects
|
||||
*/
|
||||
* ISF_Desktop_fnEnumObjects
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnEnumObjects (IShellFolder2 * iface,
|
||||
HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n",
|
||||
This, hwndOwner, dwFlags, ppEnumIDList);
|
||||
|
||||
*ppEnumIDList = IEnumIDList_Constructor();
|
||||
if (*ppEnumIDList)
|
||||
|
@ -336,41 +377,41 @@ static HRESULT WINAPI ISF_Desktop_fnEnumObjects (IShellFolder2 * iface,
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnBindToObject
|
||||
*/
|
||||
* ISF_Desktop_fnBindToObject
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n",
|
||||
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnBindToStorage
|
||||
*/
|
||||
* ISF_Desktop_fnBindToStorage
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnBindToStorage (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
|
||||
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
*ppvOut = NULL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnCompareIDs
|
||||
*/
|
||||
|
||||
* ISF_Desktop_fnCompareIDs
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnCompareIDs (IShellFolder2 * iface,
|
||||
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
int nReturn;
|
||||
|
||||
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
|
||||
|
@ -380,58 +421,66 @@ static HRESULT WINAPI ISF_Desktop_fnCompareIDs (IShellFolder2 * iface,
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnCreateViewObject
|
||||
*/
|
||||
* ISF_Desktop_fnCreateViewObject
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnCreateViewObject (IShellFolder2 * iface,
|
||||
HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
LPSHELLVIEW pShellView;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
|
||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
|
||||
This, hwndOwner, shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
if (!ppvOut)
|
||||
return hr;
|
||||
|
||||
if (ppvOut) {
|
||||
*ppvOut = NULL;
|
||||
|
||||
if (IsEqualIID (riid, &IID_IDropTarget)) {
|
||||
if (IsEqualIID (riid, &IID_IDropTarget))
|
||||
{
|
||||
WARN ("IDropTarget not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
} else if (IsEqualIID (riid, &IID_IContextMenu)) {
|
||||
}
|
||||
else if (IsEqualIID (riid, &IID_IContextMenu))
|
||||
{
|
||||
WARN ("IContextMenu not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
} else if (IsEqualIID (riid, &IID_IShellView)) {
|
||||
}
|
||||
else if (IsEqualIID (riid, &IID_IShellView))
|
||||
{
|
||||
pShellView = IShellView_Constructor ((IShellFolder *) iface);
|
||||
if (pShellView) {
|
||||
if (pShellView)
|
||||
{
|
||||
hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
|
||||
IShellView_Release (pShellView);
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnGetAttributesOf
|
||||
*/
|
||||
* ISF_Desktop_fnGetAttributesOf
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
|
||||
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
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;
|
||||
|
||||
if (*rgfInOut == 0)
|
||||
*rgfInOut = ~0;
|
||||
|
||||
while (cidl > 0 && *apidl) {
|
||||
while (cidl > 0 && *apidl)
|
||||
{
|
||||
pdump (*apidl);
|
||||
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
|
||||
apidl++;
|
||||
|
@ -444,21 +493,19 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnGetUIObjectOf
|
||||
*
|
||||
* PARAMETERS
|
||||
* HWND hwndOwner, //[in ] Parent window for any output
|
||||
* UINT cidl, //[in ] array size
|
||||
* LPCITEMIDLIST* apidl, //[in ] simple pidl array
|
||||
* REFIID riid, //[in ] Requested Interface
|
||||
* UINT* prgfInOut, //[ ] reserved
|
||||
* LPVOID* ppvObject) //[out] Resulting Interface
|
||||
*
|
||||
*/
|
||||
* ISF_Desktop_fnGetUIObjectOf
|
||||
*
|
||||
* PARAMETERS
|
||||
* HWND hwndOwner, //[in ] Parent window for any output
|
||||
* UINT cidl, //[in ] array size
|
||||
* LPCITEMIDLIST* apidl, //[in ] simple pidl array
|
||||
* REFIID riid, //[in ] Requested Interface
|
||||
* UINT* prgfInOut, //[ ] reserved
|
||||
* LPVOID* ppvObject) //[out] Resulting Interface
|
||||
*
|
||||
*/
|
||||
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)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
@ -470,8 +517,8 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
|
||||
This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
|
||||
|
||||
if (ppvOut) {
|
||||
*ppvOut = NULL;
|
||||
if (!ppvOut)
|
||||
return hr;
|
||||
|
||||
if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
|
||||
{
|
||||
|
@ -520,22 +567,20 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
hr = E_OUTOFMEMORY;
|
||||
|
||||
*ppvOut = pObj;
|
||||
}
|
||||
TRACE ("(%p)->hr=0x%08lx\n", This, hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnGetDisplayNameOf
|
||||
*
|
||||
* NOTES
|
||||
* special case: pidl = null gives desktop-name back
|
||||
*/
|
||||
* ISF_Desktop_fnGetDisplayNameOf
|
||||
*
|
||||
* NOTES
|
||||
* special case: pidl = null gives desktop-name back
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
CHAR szPath[MAX_PATH];
|
||||
GUID const *clsid;
|
||||
HRESULT hr = S_OK;
|
||||
|
@ -548,62 +593,99 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
if (!strRet)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (_ILIsDesktop (pidl)) {
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)) {
|
||||
if (_ILIsDesktop (pidl))
|
||||
{
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
|
||||
(GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING))
|
||||
{
|
||||
lstrcpyA (szPath, This->sPathTarget);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
HCR_GetClassNameA(&CLSID_ShellDesktop, szPath, MAX_PATH);
|
||||
}
|
||||
} else if (_ILIsPidlSimple (pidl)) {
|
||||
if ((clsid = _ILGetGUIDPointer (pidl))) {
|
||||
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
|
||||
else if (_ILIsPidlSimple (pidl))
|
||||
{
|
||||
if ((clsid = _ILGetGUIDPointer (pidl)))
|
||||
{
|
||||
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)
|
||||
{
|
||||
int bWantsForParsing;
|
||||
|
||||
/*
|
||||
* we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
|
||||
* CLSID\\{...}\\shellfolder exists
|
||||
* exception: the MyComputer folder has this keys not but like any filesystem backed
|
||||
* folder it needs these behaviour
|
||||
* We can only get a filesystem path from a shellfolder if the
|
||||
* value WantsFORPARSING in CLSID\\{...}\\shellfolder exists.
|
||||
*
|
||||
* Exception: The MyComputer folder doesn't have this key,
|
||||
* but any other filesystem backed folder it needs it.
|
||||
*/
|
||||
if (IsEqualIID (clsid, &CLSID_MyComputer)) {
|
||||
if (IsEqualIID (clsid, &CLSID_MyComputer))
|
||||
{
|
||||
bWantsForParsing = 1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* get the "WantsFORPARSING" flag from the registry */
|
||||
char szRegPath[100];
|
||||
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 };
|
||||
WCHAR szRegPath[100];
|
||||
LONG r;
|
||||
|
||||
lstrcpyA (szRegPath, "CLSID\\");
|
||||
SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
|
||||
lstrcatA (szRegPath, "\\shellfolder");
|
||||
bWantsForParsing =
|
||||
(ERROR_SUCCESS ==
|
||||
SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
|
||||
lstrcpyW (szRegPath, clsidW);
|
||||
SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
|
||||
lstrcatW (szRegPath, shellfolderW);
|
||||
r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath,
|
||||
wantsForParsingW, NULL, NULL, NULL);
|
||||
if (r == ERROR_SUCCESS)
|
||||
bWantsForParsing = TRUE;
|
||||
else
|
||||
bWantsForParsing = FALSE;
|
||||
}
|
||||
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && 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 {
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
|
||||
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
|
||||
{
|
||||
/* parsing name like ::{...} */
|
||||
lstrcpyA (szPath, "::");
|
||||
SHELL32_GUIDToStringA (clsid, &szPath[2]);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* user friendly name */
|
||||
HCR_GetClassNameA (clsid, szPath, MAX_PATH);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* file system folder */
|
||||
_ILSimpleGetText (pidl, szPath, MAX_PATH);
|
||||
|
||||
if (!_ILIsFolder(pidl))
|
||||
SHELL_FS_ProcessDisplayFilename(szPath, dwFlags);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* a complex pidl, let the subfolder do the work */
|
||||
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
|
||||
}
|
||||
|
||||
if (SUCCEEDED (hr)) {
|
||||
if (SUCCEEDED (hr))
|
||||
{
|
||||
strRet->uType = STRRET_CSTR;
|
||||
lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
|
||||
}
|
||||
|
@ -613,40 +695,46 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Desktop_fnSetNameOf
|
||||
* Changes the name of a file object or subfolder, possibly changing its item
|
||||
* identifier in the process.
|
||||
*
|
||||
* PARAMETERS
|
||||
* HWND hwndOwner, //[in ] Owner window for output
|
||||
* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
|
||||
* LPCOLESTR lpszName, //[in ] the items new display name
|
||||
* DWORD dwFlags, //[in ] SHGNO formatting flags
|
||||
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
||||
* ISF_Desktop_fnSetNameOf
|
||||
* Changes the name of a file object or subfolder, possibly changing its item
|
||||
* identifier in the process.
|
||||
*
|
||||
* PARAMETERS
|
||||
* HWND hwndOwner, //[in ] Owner window for output
|
||||
* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
|
||||
* LPCOLESTR lpszName, //[in ] the items new display name
|
||||
* DWORD dwFlags, //[in ] SHGNO formatting flags
|
||||
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
|
||||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface,
|
||||
HWND hwndOwner, LPCITEMIDLIST pidl, /* simple pidl */
|
||||
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
|
||||
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl,
|
||||
debugstr_w (lpName), dwFlags, pPidlOut);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2 *iface,
|
||||
GUID * pguid)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
FIXME ("(%p)\n", This);
|
||||
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;
|
||||
FIXME ("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface,
|
||||
DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
|
||||
{
|
||||
|
@ -661,7 +749,8 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface,
|
|||
|
||||
return S_OK;
|
||||
}
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (
|
||||
IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
|
@ -674,6 +763,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (IShellFolder2 * iface
|
|||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
|
||||
{
|
||||
|
@ -682,6 +772,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface,
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
|
||||
{
|
||||
|
@ -694,17 +785,22 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
|
|||
if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!pidl) {
|
||||
if (!pidl)
|
||||
{
|
||||
psd->fmt = DesktopSFHeader[iColumn].fmt;
|
||||
psd->cxChar = DesktopSFHeader[iColumn].cxChar;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
LoadStringA (shell32_hInstance, DesktopSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
|
||||
LoadStringA (shell32_hInstance, DesktopSFHeader[iColumn].colnameid,
|
||||
psd->str.u.cStr, MAX_PATH);
|
||||
return S_OK;
|
||||
} else {
|
||||
}
|
||||
|
||||
/* the data from the pidl */
|
||||
switch (iColumn) {
|
||||
switch (iColumn)
|
||||
{
|
||||
case 0: /* name */
|
||||
hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
|
||||
hr = IShellFolder_GetDisplayNameOf(iface, pidl,
|
||||
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
|
||||
break;
|
||||
case 1: /* size */
|
||||
_ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
|
||||
|
@ -721,11 +817,12 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
|
|||
}
|
||||
hr = S_OK;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
}
|
||||
|
||||
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;
|
||||
FIXME ("(%p)\n", This);
|
||||
|
@ -754,4 +851,5 @@ static IShellFolder2Vtbl vt_MCFldr_ShellFolder2 =
|
|||
ISF_Desktop_fnGetDefaultColumnState,
|
||||
ISF_Desktop_fnGetDetailsEx,
|
||||
ISF_Desktop_fnGetDetailsOf,
|
||||
ISF_Desktop_fnMapColumnToSCID};
|
||||
ISF_Desktop_fnMapColumnToSCID
|
||||
};
|
||||
|
|
|
@ -224,7 +224,8 @@ static shvheader GenericSFHeader[] = {
|
|||
* {F3364BA0-65B9-11CE-A9BA-00AA004AE837}
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
|
||||
HRESULT WINAPI
|
||||
IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
|
||||
{
|
||||
IGenericSFImpl *sf;
|
||||
|
||||
|
@ -261,7 +262,9 @@ HRESULT WINAPI IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID
|
|||
* REFIID riid [in ] Requested InterfaceID
|
||||
* LPVOID* ppvObject [out] Interface* to hold the result
|
||||
*/
|
||||
static HRESULT WINAPI IShellFolder_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnQueryInterface (IShellFolder2 * iface, REFIID riid,
|
||||
LPVOID * ppvObj)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
|
@ -295,6 +298,50 @@ static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface)
|
|||
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, ¶m );
|
||||
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}
|
||||
*
|
||||
|
@ -325,19 +372,21 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
|||
HWND hwndOwner,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl,
|
||||
DWORD * pdwAttributes)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
LPCWSTR szNext = NULL;
|
||||
WCHAR szElement[MAX_PATH];
|
||||
CHAR szPath[MAX_PATH];
|
||||
WCHAR szPath[MAX_PATH];
|
||||
LPITEMIDLIST pidlTemp = NULL;
|
||||
DWORD len;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
|
||||
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
|
||||
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
|
||||
pchEaten, ppidl, pdwAttributes);
|
||||
|
||||
if (!lpszDisplayName || !ppidl)
|
||||
return E_INVALIDARG;
|
||||
|
@ -345,27 +394,32 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
|||
if (pchEaten)
|
||||
*pchEaten = 0; /* strange but like the original */
|
||||
|
||||
if (*lpszDisplayName) {
|
||||
pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName);
|
||||
if (!pidlTemp && *lpszDisplayName)
|
||||
{
|
||||
/* get the next element */
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
|
||||
/* build the full pathname to the element */
|
||||
lstrcpyA(szPath, This->sPathTarget);
|
||||
PathAddBackslashA(szPath);
|
||||
len = lstrlenA(szPath);
|
||||
WideCharToMultiByte(CP_ACP, 0, szElement, -1, szPath + len, MAX_PATH - len, NULL, NULL);
|
||||
/* lstrcpyW(szPath, This->sPathTarget); */
|
||||
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szPath, MAX_PATH);
|
||||
PathAddBackslashW(szPath);
|
||||
len = lstrlenW(szPath);
|
||||
lstrcpynW(szPath + len, szElement, MAX_PATH - len);
|
||||
|
||||
/* get the pidl */
|
||||
hr = _ILCreateFromPathA(szPath, &pidlTemp);
|
||||
hr = _ILCreateFromPathW(szPath, &pidlTemp);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (szNext && *szNext) {
|
||||
/* try to analyse the next element */
|
||||
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
|
||||
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc,
|
||||
&pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
|
||||
} else {
|
||||
/* it's the last element */
|
||||
if (pdwAttributes && *pdwAttributes) {
|
||||
hr = SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
|
||||
hr = SHELL32_GetItemAttributes (_IShellFolder_ (This),
|
||||
pidlTemp, pdwAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -389,15 +443,21 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
|||
* LPENUMIDLIST* ppenumIDList //[out] IEnumIDList interface
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
||||
IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner,
|
||||
DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner,
|
||||
dwFlags, ppEnumIDList);
|
||||
|
||||
*ppEnumIDList = IEnumIDList_Constructor();
|
||||
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);
|
||||
|
||||
|
@ -413,13 +473,16 @@ IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags
|
|||
* LPVOID* ppvObject //[out] Interface*
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, LPVOID * ppvOut)
|
||||
IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||
LPBC pbc, REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc, shdebugstr_guid (riid), ppvOut);
|
||||
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc,
|
||||
shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
|
||||
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid,
|
||||
ppvOut);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -431,11 +494,13 @@ IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbc
|
|||
* LPVOID* ppvObject //[out] Interface* returned
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||
IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved,
|
||||
shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
*ppvOut = NULL;
|
||||
return E_NOTIMPL;
|
||||
|
@ -446,7 +511,8 @@ IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pb
|
|||
*/
|
||||
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam,
|
||||
LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
|
@ -462,14 +528,16 @@ IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST p
|
|||
* IShellFolder_fnCreateViewObject
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||
IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner,
|
||||
REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
LPSHELLVIEW pShellView;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
|
||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid),
|
||||
ppvOut);
|
||||
|
||||
if (ppvOut) {
|
||||
*ppvOut = NULL;
|
||||
|
@ -501,13 +569,15 @@ IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID r
|
|||
*
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
||||
IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl,
|
||||
LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
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))
|
||||
return E_INVALIDARG;
|
||||
|
@ -539,19 +609,22 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST
|
|||
* LPVOID* ppvObject) //[out] Resulting Interface
|
||||
*
|
||||
* NOTES
|
||||
* This function gets asked to return "view objects" for one or more (multiple select)
|
||||
* items:
|
||||
* The viewobject typically is an COM object with one of the following interfaces:
|
||||
* This function gets asked to return "view objects" for one or more (multiple
|
||||
* select) items:
|
||||
* The viewobject typically is an COM object with one of the following
|
||||
* interfaces:
|
||||
* IExtractIcon,IDataObject,IContextMenu
|
||||
* In order to support icon positions in the default Listview your DataObject
|
||||
* must implement the SetData method (in addition to GetData :) - the shell passes
|
||||
* a barely documented "Icon positions" structure to SetData when the drag starts,
|
||||
* and GetData's it if the drop is in another explorer window that needs the positions.
|
||||
* must implement the SetData method (in addition to GetData :) - the shell
|
||||
* passes a barely documented "Icon positions" structure to SetData when the
|
||||
* drag starts, and GetData's it if the drop is in another explorer window that
|
||||
* needs the positions.
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
|
||||
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
|
||||
UINT * prgfInOut, LPVOID * ppvOut)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
|
@ -566,10 +639,12 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
*ppvOut = NULL;
|
||||
|
||||
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;
|
||||
} 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;
|
||||
} else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
|
||||
pidl = ILCombine (This->pidlRoot, apidl[0]);
|
||||
|
@ -582,9 +657,10 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
SHFree (pidl);
|
||||
hr = S_OK;
|
||||
} 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))
|
||||
&& (cidl == 1)) {
|
||||
hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget,
|
||||
(LPVOID *) & pObj);
|
||||
} else if ((IsEqualIID(riid,&IID_IShellLinkW) ||
|
||||
IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1)) {
|
||||
pidl = ILCombine (This->pidlRoot, apidl[0]);
|
||||
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
|
||||
SHFree (pidl);
|
||||
|
@ -601,6 +677,15 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
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)
|
||||
{
|
||||
/*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */
|
||||
|
@ -611,10 +696,10 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
|
|||
DWORD dwDataSize = sizeof (DWORD);
|
||||
BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */
|
||||
|
||||
if (!RegCreateKeyExA (HKEY_CURRENT_USER,
|
||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
if (!RegCreateKeyExW (HKEY_CURRENT_USER, AdvancedW,
|
||||
0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
|
||||
if (!RegQueryValueExA (hKey, "HideFileExt", 0, 0, (LPBYTE) & dwData, &dwDataSize))
|
||||
if (!RegQueryValueExW (hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData,
|
||||
&dwDataSize))
|
||||
doHide = dwData;
|
||||
|
||||
RegCloseKey (hKey);
|
||||
|
@ -624,16 +709,17 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
|
|||
LPSTR ext = PathFindExtensionA(szPath);
|
||||
|
||||
if (ext) {
|
||||
HKEY hkey;
|
||||
char classname[MAX_PATH];
|
||||
LONG classlen = MAX_PATH;
|
||||
|
||||
if (!RegQueryValueA(HKEY_CLASSES_ROOT, ext, classname, &classlen))
|
||||
if (!RegOpenKeyA(HKEY_CLASSES_ROOT, classname, &hkey)) {
|
||||
if (!RegQueryValueExA(hkey, "NeverShowExt", 0, NULL, NULL, NULL))
|
||||
if (!RegQueryValueA(HKEY_CLASSES_ROOT, ext, classname,
|
||||
&classlen))
|
||||
if (!RegOpenKeyA(HKEY_CLASSES_ROOT, classname, &hKey)) {
|
||||
if (!RegQueryValueExW(hKey, NeverShowExtW, 0, NULL,
|
||||
NULL, NULL))
|
||||
doHide = TRUE;
|
||||
|
||||
RegCloseKey(hkey);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -657,7 +743,8 @@ void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
|
|||
*/
|
||||
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||
IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||
DWORD dwFlags, LPSTRRET strRet)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
|
@ -683,23 +770,27 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWOR
|
|||
FIXME ("special pidl\n");
|
||||
}
|
||||
} else {
|
||||
if (!(dwFlags & SHGDN_INFOLDER) && (dwFlags & SHGDN_FORPARSING) && This->sPathTarget) {
|
||||
lstrcpyA (szPath, This->sPathTarget); /* get path to root */
|
||||
if (!(dwFlags & SHGDN_INFOLDER) && (dwFlags & SHGDN_FORPARSING) &&
|
||||
This->sPathTarget) {
|
||||
/* get path to root */
|
||||
lstrcpyA (szPath, This->sPathTarget);
|
||||
PathAddBackslashA (szPath);
|
||||
len = lstrlenA (szPath);
|
||||
}
|
||||
_ILSimpleGetText (pidl, szPath + len, MAX_PATH - len); /* append my own path */
|
||||
/* append my own path */
|
||||
_ILSimpleGetText (pidl, szPath + len, MAX_PATH - len);
|
||||
|
||||
if (!_ILIsFolder(pidl))
|
||||
SHELL_FS_ProcessDisplayFilename(szPath, dwFlags);
|
||||
}
|
||||
|
||||
if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) { /* go deeper if needed */
|
||||
/* go deeper if needed */
|
||||
if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) {
|
||||
PathAddBackslashA (szPath);
|
||||
len = lstrlenA (szPath);
|
||||
|
||||
if (!SUCCEEDED
|
||||
(SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len)))
|
||||
if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild (iface, pidl,
|
||||
dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len)))
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
strRet->uType = STRRET_CSTR;
|
||||
|
@ -721,42 +812,46 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWOR
|
|||
* DWORD dwFlags, //[in ] SHGNO formatting flags
|
||||
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
|
||||
*/
|
||||
static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
||||
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
|
||||
static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
LPCITEMIDLIST pidl,
|
||||
LPCOLESTR lpName,
|
||||
DWORD dwFlags,
|
||||
LPITEMIDLIST * pPidlOut)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
char szSrc[MAX_PATH],
|
||||
szDest[MAX_PATH];
|
||||
int len;
|
||||
WCHAR szSrc[MAX_PATH], szDest[MAX_PATH];
|
||||
LPWSTR ptr;
|
||||
BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl));
|
||||
|
||||
TRACE ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
|
||||
TRACE ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl,
|
||||
debugstr_w (lpName), dwFlags, pPidlOut);
|
||||
|
||||
/* build source path */
|
||||
if (dwFlags & SHGDN_INFOLDER) {
|
||||
strcpy (szSrc, This->sPathTarget);
|
||||
PathAddBackslashA (szSrc);
|
||||
len = strlen (szSrc);
|
||||
_ILSimpleGetText (pidl, szSrc + len, MAX_PATH - len);
|
||||
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szSrc, MAX_PATH);
|
||||
ptr = PathAddBackslashW (szSrc);
|
||||
if (ptr)
|
||||
_ILSimpleGetTextW (pidl, ptr, MAX_PATH - (ptr - szSrc));
|
||||
} else {
|
||||
/* FIXME: Can this work with a simple PIDL? */
|
||||
SHGetPathFromIDListA (pidl, szSrc);
|
||||
SHGetPathFromIDListW (pidl, szSrc);
|
||||
}
|
||||
|
||||
/* build destination path */
|
||||
strcpy (szDest, This->sPathTarget);
|
||||
PathAddBackslashA (szDest);
|
||||
len = strlen (szDest);
|
||||
WideCharToMultiByte (CP_ACP, 0, lpName, -1, szDest + len, MAX_PATH - len, NULL, NULL);
|
||||
szDest[MAX_PATH - 1] = 0;
|
||||
TRACE ("src=%s dest=%s\n", szSrc, szDest);
|
||||
if (MoveFileA (szSrc, szDest)) {
|
||||
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szDest, MAX_PATH);
|
||||
ptr = PathAddBackslashW (szDest);
|
||||
if (ptr)
|
||||
lstrcpynW(ptr, lpName, MAX_PATH - (ptr - szDest));
|
||||
TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest));
|
||||
if (MoveFileW (szSrc, szDest)) {
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (pPidlOut)
|
||||
hr = _ILCreateFromPathA(szDest, pPidlOut);
|
||||
hr = _ILCreateFromPathW(szDest, pPidlOut);
|
||||
|
||||
SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHCNF_PATHA, szSrc, szDest);
|
||||
SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM,
|
||||
SHCNF_PATHW, szSrc, szDest);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
@ -764,20 +859,24 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwnd
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
|
||||
static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID (IShellFolder2 *iface,
|
||||
GUID * pguid)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
FIXME ("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
static HRESULT WINAPI IShellFolder_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
|
||||
static HRESULT WINAPI IShellFolder_fnEnumSearches (IShellFolder2 * iface,
|
||||
IEnumExtraSearch ** ppenum)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
FIXME ("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
|
||||
IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes,
|
||||
ULONG * pSort, ULONG * pDisplay)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
|
||||
|
@ -790,7 +889,10 @@ IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSo
|
|||
|
||||
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)
|
||||
|
||||
|
@ -803,16 +905,20 @@ static HRESULT WINAPI IShellFolder_fnGetDefaultColumnState (IShellFolder2 * ifac
|
|||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
|
||||
IShellFolder_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||
const SHCOLUMNID * pscid, VARIANT * pv)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
FIXME ("(%p)\n", This);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
|
||||
IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||
UINT iColumn, SHELLDETAILS * psd)
|
||||
{
|
||||
_ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
|
||||
HRESULT hr = E_FAIL;
|
||||
|
@ -827,13 +933,15 @@ IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iCo
|
|||
psd->fmt = GenericSFHeader[iColumn].fmt;
|
||||
psd->cxChar = GenericSFHeader[iColumn].cxChar;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
LoadStringA (shell32_hInstance, GenericSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
|
||||
LoadStringA (shell32_hInstance, GenericSFHeader[iColumn].colnameid,
|
||||
psd->str.u.cStr, MAX_PATH);
|
||||
return S_OK;
|
||||
} else {
|
||||
/* the data from the pidl */
|
||||
switch (iColumn) {
|
||||
case 0: /* name */
|
||||
hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
|
||||
hr = IShellFolder_GetDisplayNameOf (iface, pidl,
|
||||
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
|
||||
break;
|
||||
case 1: /* size */
|
||||
_ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
|
||||
|
@ -854,7 +962,10 @@ IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iCo
|
|||
|
||||
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)
|
||||
FIXME ("(%p)\n", This);
|
||||
|
@ -890,7 +1001,8 @@ static IShellFolder2Vtbl sfvt =
|
|||
* ISFHelper for IShellFolder implementation
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI
|
||||
ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj)
|
||||
{
|
||||
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -923,7 +1035,8 @@ static ULONG WINAPI ISFHelper_fnRelease (ISFHelper * iface)
|
|||
* creates a unique folder name
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName, UINT uLen)
|
||||
static HRESULT WINAPI
|
||||
ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName, UINT uLen)
|
||||
{
|
||||
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
|
||||
IEnumIDList *penum;
|
||||
|
@ -945,8 +1058,10 @@ static HRESULT WINAPI ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName
|
|||
DWORD dwFetched;
|
||||
int i = 1;
|
||||
|
||||
next:IEnumIDList_Reset (penum);
|
||||
while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) && dwFetched) {
|
||||
next:
|
||||
IEnumIDList_Reset (penum);
|
||||
while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) &&
|
||||
dwFetched) {
|
||||
_ILSimpleGetText (pidl, szText, MAX_PATH);
|
||||
if (0 == strcasecmp (szText, lpName)) {
|
||||
sprintf (lpName, "%s %d", szNewFolder, i++);
|
||||
|
@ -969,7 +1084,9 @@ static HRESULT WINAPI ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName
|
|||
* adds a new folder.
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName, LPITEMIDLIST * ppidlOut)
|
||||
static HRESULT WINAPI
|
||||
ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName,
|
||||
LPITEMIDLIST * ppidlOut)
|
||||
{
|
||||
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
|
||||
char lpstrNewDir[MAX_PATH];
|
||||
|
@ -995,8 +1112,10 @@ static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCST
|
|||
char lpstrCaption[256];
|
||||
|
||||
/* Cannot Create folder because of permissions */
|
||||
LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_DENIED, lpstrTempText, sizeof (lpstrTempText));
|
||||
LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, lpstrCaption, sizeof (lpstrCaption));
|
||||
LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_DENIED, lpstrTempText,
|
||||
sizeof (lpstrTempText));
|
||||
LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, lpstrCaption,
|
||||
sizeof (lpstrCaption));
|
||||
sprintf (lpstrText, lpstrTempText, lpstrNewDir);
|
||||
MessageBoxA (hwnd, lpstrText, lpstrCaption, MB_OK | MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
@ -1009,7 +1128,8 @@ static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCST
|
|||
*
|
||||
* deletes items in folder
|
||||
*/
|
||||
static HRESULT WINAPI ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
|
||||
static HRESULT WINAPI
|
||||
ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
|
||||
{
|
||||
_ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
|
||||
UINT i;
|
||||
|
@ -1067,7 +1187,8 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPC
|
|||
* copies items to this folder
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl)
|
||||
ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl,
|
||||
LPCITEMIDLIST * apidl)
|
||||
{
|
||||
UINT i;
|
||||
IPersistFolder2 *ppf2 = NULL;
|
||||
|
@ -1078,7 +1199,8 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPC
|
|||
|
||||
TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl);
|
||||
|
||||
IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, (LPVOID *) & ppf2);
|
||||
IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2,
|
||||
(LPVOID *) & ppf2);
|
||||
if (ppf2) {
|
||||
LPITEMIDLIST pidl;
|
||||
|
||||
|
@ -1086,11 +1208,13 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPC
|
|||
for (i = 0; i < cidl; i++) {
|
||||
SHGetPathFromIDListA (pidl, szSrcPath);
|
||||
PathAddBackslashA (szSrcPath);
|
||||
_ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath), MAX_PATH);
|
||||
_ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath),
|
||||
MAX_PATH);
|
||||
|
||||
strcpy (szDstPath, This->sPathTarget);
|
||||
PathAddBackslashA (szDstPath);
|
||||
_ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), MAX_PATH);
|
||||
_ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath),
|
||||
MAX_PATH);
|
||||
MESSAGE ("would copy %s to %s\n", szSrcPath, szDstPath);
|
||||
}
|
||||
SHFree (pidl);
|
||||
|
@ -1115,7 +1239,9 @@ static ISFHelperVtbl shvt =
|
|||
* IFSFldr_PersistFolder3_QueryInterface
|
||||
*
|
||||
*/
|
||||
static HRESULT WINAPI IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * iface, REFIID iid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI
|
||||
IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * iface, REFIID iid,
|
||||
LPVOID * ppvObj)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1128,7 +1254,8 @@ static HRESULT WINAPI IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * i
|
|||
* IFSFldr_PersistFolder3_AddRef
|
||||
*
|
||||
*/
|
||||
static ULONG WINAPI IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
|
||||
static ULONG WINAPI
|
||||
IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1141,7 +1268,8 @@ static ULONG WINAPI IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
|
|||
* IFSFldr_PersistFolder3_Release
|
||||
*
|
||||
*/
|
||||
static ULONG WINAPI IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
|
||||
static ULONG WINAPI
|
||||
IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1153,7 +1281,8 @@ static ULONG WINAPI IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
|
|||
/************************************************************************
|
||||
* IFSFldr_PersistFolder3_GetClassID
|
||||
*/
|
||||
static HRESULT WINAPI IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface, CLSID * lpClassId)
|
||||
static HRESULT WINAPI
|
||||
IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface, CLSID * lpClassId)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1172,7 +1301,8 @@ static HRESULT WINAPI IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface
|
|||
* NOTES
|
||||
* sPathTarget is not set. Don't know how to handle in a non rooted environment.
|
||||
*/
|
||||
static HRESULT WINAPI IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
|
||||
static HRESULT WINAPI
|
||||
IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
|
||||
{
|
||||
char sTemp[MAX_PATH];
|
||||
|
||||
|
@ -1200,7 +1330,9 @@ static HRESULT WINAPI IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface
|
|||
/**************************************************************************
|
||||
* IFSFldr_PersistFolder3_GetCurFolder
|
||||
*/
|
||||
static HRESULT WINAPI IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * iface, LPITEMIDLIST * pidl)
|
||||
static HRESULT WINAPI
|
||||
IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * iface,
|
||||
LPITEMIDLIST * pidl)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1214,11 +1346,12 @@ static HRESULT WINAPI IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * i
|
|||
/**************************************************************************
|
||||
* IFSFldr_PersistFolder3_InitializeEx
|
||||
*
|
||||
* FIXME: errorhandling
|
||||
* FIXME: error handling
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
|
||||
IBindCtx * pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO * ppfti)
|
||||
IBindCtx * pbc, LPCITEMIDLIST pidlRoot,
|
||||
const PERSIST_FOLDER_TARGET_INFO * ppfti)
|
||||
{
|
||||
char sTemp[MAX_PATH];
|
||||
|
||||
|
@ -1228,7 +1361,8 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
|
|||
if (ppfti)
|
||||
TRACE ("--%p %s %s 0x%08lx 0x%08x\n",
|
||||
ppfti->pidlTargetFolder, debugstr_w (ppfti->szTargetParsingName),
|
||||
debugstr_w (ppfti->szNetworkProvider), ppfti->dwAttributes, ppfti->csidl);
|
||||
debugstr_w (ppfti->szNetworkProvider), ppfti->dwAttributes,
|
||||
ppfti->csidl);
|
||||
|
||||
pdump (pidlRoot);
|
||||
if (ppfti && ppfti->pidlTargetFolder)
|
||||
|
@ -1245,11 +1379,13 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
|
|||
This->pidlRoot = ILClone (pidlRoot);
|
||||
|
||||
/*
|
||||
* the target folder is spezified in csidl OR pidlTargetFolder OR szTargetParsingName
|
||||
* the target folder is spezified in csidl OR pidlTargetFolder OR
|
||||
* szTargetParsingName
|
||||
*/
|
||||
if (ppfti) {
|
||||
if (ppfti->csidl != -1) {
|
||||
if (SHGetSpecialFolderPathA (0, sTemp, ppfti->csidl, ppfti->csidl & CSIDL_FLAG_CREATE)) {
|
||||
if (SHGetSpecialFolderPathA (0, sTemp, ppfti->csidl,
|
||||
ppfti->csidl & CSIDL_FLAG_CREATE)) {
|
||||
__SHCloneStrA (&This->sPathTarget, sTemp);
|
||||
}
|
||||
} else if (ppfti->szTargetParsingName[0]) {
|
||||
|
@ -1267,7 +1403,8 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
|
|||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
IFSFldr_PersistFolder3_GetFolderTargetInfo (IPersistFolder3 * iface, PERSIST_FOLDER_TARGET_INFO * ppfti)
|
||||
IFSFldr_PersistFolder3_GetFolderTargetInfo (IPersistFolder3 * iface,
|
||||
PERSIST_FOLDER_TARGET_INFO * ppfti)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
|
||||
FIXME ("(%p)->(%p)\n", This, ppfti);
|
||||
|
@ -1290,7 +1427,9 @@ static IPersistFolder3Vtbl vt_FSFldr_PersistFolder3 =
|
|||
/****************************************************************************
|
||||
* ISFDropTarget implementation
|
||||
*/
|
||||
static BOOL ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState, LPDWORD pdwEffect)
|
||||
static BOOL
|
||||
ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState,
|
||||
LPDWORD pdwEffect)
|
||||
{
|
||||
DWORD dwEffect = *pdwEffect;
|
||||
|
||||
|
@ -1309,7 +1448,8 @@ static BOOL ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState, LPDW
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISFDropTarget_QueryInterface (IDropTarget * iface, REFIID riid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI
|
||||
ISFDropTarget_QueryInterface (IDropTarget * iface, REFIID riid, LPVOID * ppvObj)
|
||||
{
|
||||
_ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1337,7 +1477,8 @@ static ULONG WINAPI ISFDropTarget_Release (IDropTarget * iface)
|
|||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
|
||||
ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject,
|
||||
DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
|
||||
{
|
||||
FORMATETC fmt;
|
||||
|
||||
|
@ -1347,14 +1488,17 @@ ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject, DWORD d
|
|||
|
||||
InitFormatEtc (fmt, This->cfShellIDList, TYMED_HGLOBAL);
|
||||
|
||||
This->fAcceptFmt = (S_OK == IDataObject_QueryGetData (pDataObject, &fmt)) ? TRUE : FALSE;
|
||||
This->fAcceptFmt = (S_OK == IDataObject_QueryGetData (pDataObject, &fmt)) ?
|
||||
TRUE : FALSE;
|
||||
|
||||
ISFDropTarget_QueryDrop (iface, dwKeyState, pdwEffect);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISFDropTarget_DragOver (IDropTarget * iface, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
|
||||
static HRESULT WINAPI
|
||||
ISFDropTarget_DragOver (IDropTarget * iface, DWORD dwKeyState, POINTL pt,
|
||||
DWORD * pdwEffect)
|
||||
{
|
||||
_ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -1380,7 +1524,8 @@ static HRESULT WINAPI ISFDropTarget_DragLeave (IDropTarget * iface)
|
|||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
|
||||
ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject,
|
||||
DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
|
||||
{
|
||||
_ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* Virtual Workplace folder
|
||||
*
|
||||
|
@ -109,7 +108,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
|
|||
if (pUnkOuter)
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
|
||||
sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
|
||||
sf = LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
|
||||
if (!sf)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
|
@ -118,7 +117,8 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
|
|||
sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
|
||||
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));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
@ -132,7 +132,8 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
|
|||
*
|
||||
* NOTES supports not IPersist/IPersistFolder
|
||||
*/
|
||||
static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 *iface,
|
||||
REFIID riid, LPVOID *ppvObj)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
|
@ -141,14 +142,20 @@ static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 * iface, RE
|
|||
*ppvObj = NULL;
|
||||
|
||||
if (IsEqualIID (riid, &IID_IUnknown) ||
|
||||
IsEqualIID (riid, &IID_IShellFolder) || IsEqualIID (riid, &IID_IShellFolder2)) {
|
||||
IsEqualIID (riid, &IID_IShellFolder) ||
|
||||
IsEqualIID (riid, &IID_IShellFolder2))
|
||||
{
|
||||
*ppvObj = This;
|
||||
} else if (IsEqualIID (riid, &IID_IPersist) ||
|
||||
IsEqualIID (riid, &IID_IPersistFolder) || IsEqualIID (riid, &IID_IPersistFolder2)) {
|
||||
}
|
||||
else if (IsEqualIID (riid, &IID_IPersist) ||
|
||||
IsEqualIID (riid, &IID_IPersistFolder) ||
|
||||
IsEqualIID (riid, &IID_IPersistFolder2))
|
||||
{
|
||||
*ppvObj = _IPersistFolder2_ (This);
|
||||
}
|
||||
|
||||
if (*ppvObj) {
|
||||
if (*ppvObj)
|
||||
{
|
||||
IUnknown_AddRef ((IUnknown *) (*ppvObj));
|
||||
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
|
||||
return S_OK;
|
||||
|
@ -174,7 +181,8 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
|
|||
|
||||
TRACE ("(%p)->(count=%lu)\n", This, refCount + 1);
|
||||
|
||||
if (!refCount) {
|
||||
if (!refCount)
|
||||
{
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", This);
|
||||
if (This->pidlRoot)
|
||||
SHFree (This->pidlRoot);
|
||||
|
@ -186,48 +194,53 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnParseDisplayName
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
|
||||
HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName,
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
LPCWSTR szNext = NULL;
|
||||
WCHAR szElement[MAX_PATH];
|
||||
LPITEMIDLIST pidlTemp = NULL;
|
||||
CLSID clsid;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
|
||||
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
|
||||
TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This,
|
||||
hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
|
||||
pchEaten, ppidl, pdwAttributes);
|
||||
|
||||
*ppidl = 0;
|
||||
if (pchEaten)
|
||||
*pchEaten = 0; /* strange but like the original */
|
||||
|
||||
/* handle CLSID paths */
|
||||
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
|
||||
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
|
||||
{
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
TRACE ("-- element: %s\n", debugstr_w (szElement));
|
||||
SHCLSIDFromStringW (szElement + 2, &clsid);
|
||||
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
|
||||
}
|
||||
/* do we have an absolute path name ? */
|
||||
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && lpszDisplayName[2] == (WCHAR) '\\') {
|
||||
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 &&
|
||||
lpszDisplayName[2] == (WCHAR) '\\')
|
||||
{
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
szElement[0] = toupper(szElement[0]); /* make drive letter uppercase to enable PIDL comparison */
|
||||
/* make drive letter uppercase to enable PIDL comparison */
|
||||
szElement[0] = toupper(szElement[0]);
|
||||
pidlTemp = _ILCreateDrive (szElement);
|
||||
}
|
||||
|
||||
if (szNext && *szNext) {
|
||||
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
|
||||
} else {
|
||||
if (pdwAttributes && *pdwAttributes) {
|
||||
SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
|
||||
if (szNext && *szNext)
|
||||
{
|
||||
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp,
|
||||
(LPOLESTR) szNext, pchEaten, pdwAttributes);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pdwAttributes && *pdwAttributes)
|
||||
SHELL32_GetItemAttributes (_IShellFolder_ (This),
|
||||
pidlTemp, pdwAttributes);
|
||||
hr = S_OK;
|
||||
}
|
||||
|
||||
|
@ -241,14 +254,20 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
|
|||
/**************************************************************************
|
||||
* 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)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
|
||||
TRACE("(%p)->(flags=0x%08lx) \n",list,dwFlags);
|
||||
|
||||
/*enumerate the folders*/
|
||||
if(dwFlags & SHCONTF_FOLDERS)
|
||||
/* enumerate the folders */
|
||||
if (dwFlags & SHCONTF_FOLDERS)
|
||||
{
|
||||
WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
|
||||
DWORD dwDrivemap = GetLogicalDrives();
|
||||
|
@ -263,27 +282,27 @@ static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
|
|||
}
|
||||
|
||||
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list);
|
||||
if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
||||
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\mycomputer\\NameSpace",
|
||||
if (ret && !RegOpenKeyExW(HKEY_LOCAL_MACHINE, MyComputer_NameSpaceW,
|
||||
0, KEY_READ, &hkey))
|
||||
{
|
||||
char iid[50];
|
||||
WCHAR iid[50];
|
||||
int i=0;
|
||||
|
||||
while (ret)
|
||||
{
|
||||
DWORD size = sizeof (iid);
|
||||
LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
|
||||
NULL);
|
||||
DWORD size;
|
||||
LONG r;
|
||||
|
||||
if (ERROR_SUCCESS == apiRet)
|
||||
size = sizeof(iid) / sizeof(iid[0]);
|
||||
r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
|
||||
if (ERROR_SUCCESS == r)
|
||||
{
|
||||
/* FIXME: shell extensions, shouldn't the type be
|
||||
* PT_SHELLEXT? */
|
||||
ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
|
||||
ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid));
|
||||
i++;
|
||||
}
|
||||
else if (ERROR_NO_MORE_ITEMS == apiRet)
|
||||
else if (ERROR_NO_MORE_ITEMS == r)
|
||||
break;
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -297,12 +316,13 @@ static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnEnumObjects
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnEnumObjects (IShellFolder2 *iface,
|
||||
HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This,
|
||||
hwndOwner, dwFlags, ppEnumIDList);
|
||||
|
||||
*ppEnumIDList = IEnumIDList_Constructor();
|
||||
if (*ppEnumIDList)
|
||||
|
@ -316,13 +336,13 @@ ISF_MyComputer_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFla
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnBindToObject
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnBindToObject (IShellFolder2 *iface,
|
||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This,
|
||||
pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
|
||||
}
|
||||
|
@ -330,13 +350,13 @@ ISF_MyComputer_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnBindToStorage
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This,
|
||||
pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
*ppvOut = NULL;
|
||||
return E_NOTIMPL;
|
||||
|
@ -346,11 +366,10 @@ ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
|
|||
* ISF_MyComputer_fnCompareIDs
|
||||
*/
|
||||
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnCompareIDs (IShellFolder2 *iface,
|
||||
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
int nReturn;
|
||||
|
||||
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
|
||||
|
@ -362,33 +381,40 @@ ISF_MyComputer_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnCreateViewObject
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject (IShellFolder2 *iface,
|
||||
HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
LPSHELLVIEW pShellView;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
|
||||
TRACE("(%p)->(hwnd=%p,%s,%p)\n", This,
|
||||
hwndOwner, shdebugstr_guid (riid), ppvOut);
|
||||
|
||||
if (!ppvOut)
|
||||
return hr;
|
||||
|
||||
if (ppvOut) {
|
||||
*ppvOut = NULL;
|
||||
|
||||
if (IsEqualIID (riid, &IID_IDropTarget)) {
|
||||
if (IsEqualIID (riid, &IID_IDropTarget))
|
||||
{
|
||||
WARN ("IDropTarget not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
} else if (IsEqualIID (riid, &IID_IContextMenu)) {
|
||||
}
|
||||
else if (IsEqualIID (riid, &IID_IContextMenu))
|
||||
{
|
||||
WARN ("IContextMenu not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
} else if (IsEqualIID (riid, &IID_IShellView)) {
|
||||
}
|
||||
else if (IsEqualIID (riid, &IID_IShellView))
|
||||
{
|
||||
pShellView = IShellView_Constructor ((IShellFolder *) iface);
|
||||
if (pShellView) {
|
||||
if (pShellView)
|
||||
{
|
||||
hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
|
||||
IShellView_Release (pShellView);
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
|
||||
return hr;
|
||||
}
|
||||
|
@ -396,22 +422,22 @@ ISF_MyComputer_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnGetAttributesOf
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
|
||||
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
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;
|
||||
|
||||
if (*rgfInOut == 0)
|
||||
*rgfInOut = ~0;
|
||||
|
||||
while (cidl > 0 && *apidl) {
|
||||
while (cidl > 0 && *apidl)
|
||||
{
|
||||
pdump (*apidl);
|
||||
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
|
||||
apidl++;
|
||||
|
@ -426,18 +452,17 @@ ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIS
|
|||
* ISF_MyComputer_fnGetUIObjectOf
|
||||
*
|
||||
* PARAMETERS
|
||||
* HWND hwndOwner, //[in ] Parent window for any output
|
||||
* UINT cidl, //[in ] array size
|
||||
* LPCITEMIDLIST* apidl, //[in ] simple pidl array
|
||||
* REFIID riid, //[in ] Requested Interface
|
||||
* UINT* prgfInOut, //[ ] reserved
|
||||
* LPVOID* ppvObject) //[out] Resulting Interface
|
||||
* hwndOwner [in] Parent window for any output
|
||||
* cidl [in] array size
|
||||
* apidl [in] simple pidl array
|
||||
* riid [in] Requested Interface
|
||||
* prgfInOut [ ] reserved
|
||||
* ppvObject [out] Resulting Interface
|
||||
*
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
|
||||
HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
|
||||
UINT * prgfInOut, LPVOID * ppvOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
|
@ -445,44 +470,59 @@ ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
IUnknown *pObj = NULL;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
|
||||
This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
|
||||
TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This,
|
||||
hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
|
||||
|
||||
if (!ppvOut)
|
||||
return hr;
|
||||
|
||||
if (ppvOut) {
|
||||
*ppvOut = NULL;
|
||||
|
||||
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
|
||||
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
|
||||
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
|
||||
{
|
||||
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface,
|
||||
This->pidlRoot, apidl, cidl);
|
||||
hr = S_OK;
|
||||
} else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
|
||||
pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
|
||||
}
|
||||
else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
|
||||
{
|
||||
pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner,
|
||||
This->pidlRoot, apidl, cidl);
|
||||
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]);
|
||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
||||
SHFree (pidl);
|
||||
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]);
|
||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
||||
SHFree (pidl);
|
||||
hr = S_OK;
|
||||
} 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))
|
||||
&& (cidl == 1)) {
|
||||
pidl = ILCombine (This->pidlRoot, apidl[0]);
|
||||
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
|
||||
SHFree (pidl);
|
||||
} else {
|
||||
hr = E_NOINTERFACE;
|
||||
}
|
||||
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)) && (cidl == 1))
|
||||
{
|
||||
pidl = ILCombine (This->pidlRoot, apidl[0]);
|
||||
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*) &pObj);
|
||||
SHFree (pidl);
|
||||
}
|
||||
else
|
||||
hr = E_NOINTERFACE;
|
||||
|
||||
if (SUCCEEDED(hr) && !pObj)
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
*ppvOut = pObj;
|
||||
}
|
||||
TRACE ("(%p)->hr=0x%08lx\n", This, hr);
|
||||
return hr;
|
||||
}
|
||||
|
@ -490,12 +530,12 @@ ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
|
|||
/**************************************************************************
|
||||
* ISF_MyComputer_fnGetDisplayNameOf
|
||||
*/
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
|
||||
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
char szPath[MAX_PATH],
|
||||
szDrive[18];
|
||||
char szPath[MAX_PATH], szDrive[18];
|
||||
int len = 0;
|
||||
BOOL bSimplePidl;
|
||||
HRESULT hr = S_OK;
|
||||
|
@ -511,39 +551,66 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
|
||||
bSimplePidl = _ILIsPidlSimple (pidl);
|
||||
|
||||
if (!pidl->mkid.cb) {
|
||||
if (!pidl->mkid.cb)
|
||||
{
|
||||
/* parsing name like ::{...} */
|
||||
lstrcpyA (szPath, "::");
|
||||
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 */
|
||||
if (bSimplePidl) {
|
||||
if (bSimplePidl)
|
||||
{
|
||||
GUID const *clsid;
|
||||
|
||||
if ((clsid = _ILGetGUIDPointer (pidl))) {
|
||||
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
|
||||
int bWantsForParsing;
|
||||
clsid = _ILGetGUIDPointer (pidl);
|
||||
if (clsid)
|
||||
{
|
||||
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 if the value WantsFORPARSING in
|
||||
* CLSID\\{...}\\shellfolder exists
|
||||
* exception: the MyComputer folder has this keys not but like any filesystem backed
|
||||
* We can only get a filesystem path from a shellfolder
|
||||
* if the value WantsFORPARSING exists in
|
||||
* CLSID\\{...}\\shellfolder
|
||||
* exception: the MyComputer folder has this keys not
|
||||
* but like any filesystem backed
|
||||
* folder it needs these behaviour
|
||||
*
|
||||
* Get the "WantsFORPARSING" flag from the registry
|
||||
*/
|
||||
/* get the "WantsFORPARSING" flag from the registry */
|
||||
char szRegPath[100];
|
||||
|
||||
lstrcpyA (szRegPath, "CLSID\\");
|
||||
SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
|
||||
lstrcatA (szRegPath, "\\shellfolder");
|
||||
bWantsForParsing =
|
||||
(ERROR_SUCCESS ==
|
||||
SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
|
||||
lstrcpyW (szRegPath, clsidW);
|
||||
SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
|
||||
lstrcatW (szRegPath, shellfolderW);
|
||||
r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath,
|
||||
wantsForParsingW, NULL, NULL, NULL);
|
||||
if (r == ERROR_SUCCESS)
|
||||
bWantsForParsing = TRUE;
|
||||
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && 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 {
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
|
||||
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
|
||||
{
|
||||
LPSTR p;
|
||||
|
||||
/* parsing name like ::{...} */
|
||||
|
@ -554,17 +621,26 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
p += 3;
|
||||
SHELL32_GUIDToStringA(clsid, p);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* user friendly name */
|
||||
HCR_GetClassNameA (clsid, szPath, MAX_PATH);
|
||||
}
|
||||
} else
|
||||
_ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* append my own path */
|
||||
_ILSimpleGetText (pidl, szPath, MAX_PATH);
|
||||
}
|
||||
}
|
||||
else
|
||||
FIXME ("special folder\n");
|
||||
}
|
||||
} else {
|
||||
if (!_ILIsDrive (pidl)) {
|
||||
else
|
||||
{
|
||||
if (!_ILIsDrive (pidl))
|
||||
{
|
||||
ERR ("Wrong pidl type\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
@ -572,12 +648,12 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
_ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
|
||||
|
||||
/* long view "lw_name (C:)" */
|
||||
if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING)) {
|
||||
DWORD dwVolumeSerialNumber,
|
||||
dwMaximumComponetLength,
|
||||
dwFileSystemFlags;
|
||||
if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING))
|
||||
{
|
||||
DWORD dwVolumeSerialNumber, dwMaximumComponetLength, dwFileSystemFlags;
|
||||
|
||||
GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6, &dwVolumeSerialNumber,
|
||||
GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6,
|
||||
&dwVolumeSerialNumber,
|
||||
&dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0);
|
||||
strcat (szDrive, " (");
|
||||
strncat (szDrive, szPath, 2);
|
||||
|
@ -586,14 +662,18 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
}
|
||||
}
|
||||
|
||||
if (!bSimplePidl) { /* go deeper if needed */
|
||||
if (!bSimplePidl)
|
||||
{
|
||||
/* go deeper if needed */
|
||||
PathAddBackslashA (szPath);
|
||||
len = strlen (szPath);
|
||||
|
||||
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
|
||||
hr = SHELL32_GetDisplayNameOfChild (iface, pidl,
|
||||
dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
|
||||
}
|
||||
|
||||
if (SUCCEEDED (hr)) {
|
||||
if (SUCCEEDED (hr))
|
||||
{
|
||||
strRet->uType = STRRET_CSTR;
|
||||
lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
|
||||
}
|
||||
|
@ -608,53 +688,64 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
* identifier in the process.
|
||||
*
|
||||
* PARAMETERS
|
||||
* HWND hwndOwner, //[in ] Owner window for output
|
||||
* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
|
||||
* LPCOLESTR lpszName, //[in ] the items new display name
|
||||
* DWORD dwFlags, //[in ] SHGNO formatting flags
|
||||
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
|
||||
* hwndOwner [in] Owner window for output
|
||||
* pidl [in] simple pidl of item to change
|
||||
* lpszName [in] the items new display name
|
||||
* dwFlags [in] SHGNO formatting flags
|
||||
* ppidlOut [out] simple pidl returned
|
||||
*/
|
||||
static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
||||
static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (
|
||||
IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl,
|
||||
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
|
||||
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This,
|
||||
hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (
|
||||
IShellFolder2 * iface, GUID * pguid)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
FIXME ("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (
|
||||
IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
FIXME ("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn (
|
||||
IShellFolder2 *iface, DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
TRACE ("(%p)\n", This);
|
||||
|
||||
if (pSort) *pSort = 0;
|
||||
if (pDisplay) *pDisplay = 0;
|
||||
if (pSort)
|
||||
*pSort = 0;
|
||||
if (pDisplay)
|
||||
*pDisplay = 0;
|
||||
return S_OK;
|
||||
}
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (
|
||||
IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
|
||||
TRACE ("(%p)\n", This);
|
||||
|
||||
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) return E_INVALIDARG;
|
||||
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
|
||||
return E_INVALIDARG;
|
||||
*pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
|
||||
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;
|
||||
FIXME ("(%p)\n", This);
|
||||
|
@ -662,7 +753,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface, LPCI
|
|||
}
|
||||
|
||||
/* FIXME: drive size >4GB is rolling over */
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
|
||||
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface,
|
||||
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
|
||||
{
|
||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||
HRESULT hr;
|
||||
|
@ -672,34 +764,42 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, LPCI
|
|||
if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!pidl) {
|
||||
if (!pidl)
|
||||
{
|
||||
psd->fmt = MyComputerSFHeader[iColumn].fmt;
|
||||
psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
|
||||
LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid,
|
||||
psd->str.u.cStr, MAX_PATH);
|
||||
return S_OK;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
char szPath[MAX_PATH];
|
||||
ULARGE_INTEGER ulBytes;
|
||||
|
||||
psd->str.u.cStr[0] = 0x00;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
switch (iColumn) {
|
||||
switch (iColumn)
|
||||
{
|
||||
case 0: /* name */
|
||||
hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
|
||||
hr = IShellFolder_GetDisplayNameOf (iface, pidl,
|
||||
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
|
||||
break;
|
||||
case 1: /* type */
|
||||
_ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
|
||||
break;
|
||||
case 2: /* total size */
|
||||
if (_ILIsDrive (pidl)) {
|
||||
if (_ILIsDrive (pidl))
|
||||
{
|
||||
_ILSimpleGetText (pidl, szPath, MAX_PATH);
|
||||
GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL);
|
||||
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
|
||||
}
|
||||
break;
|
||||
case 3: /* free size */
|
||||
if (_ILIsDrive (pidl)) {
|
||||
if (_ILIsDrive (pidl))
|
||||
{
|
||||
_ILSimpleGetText (pidl, szPath, MAX_PATH);
|
||||
GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL);
|
||||
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
|
||||
|
@ -711,7 +811,9 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, LPCI
|
|||
|
||||
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;
|
||||
FIXME ("(%p)\n", This);
|
||||
|
@ -746,7 +848,8 @@ static IShellFolder2Vtbl vt_ShellFolder2 =
|
|||
/************************************************************************
|
||||
* IMCFldr_PersistFolder2_QueryInterface
|
||||
*/
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (
|
||||
IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -782,7 +885,8 @@ static ULONG WINAPI IMCFldr_PersistFolder2_Release (IPersistFolder2 * iface)
|
|||
/************************************************************************
|
||||
* IMCFldr_PersistFolder2_GetClassID
|
||||
*/
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (IPersistFolder2 * iface, CLSID * lpClassId)
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (
|
||||
IPersistFolder2 * iface, CLSID * lpClassId)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
|
||||
|
||||
|
@ -800,7 +904,8 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (IPersistFolder2 * iface
|
|||
*
|
||||
* NOTES: it makes no sense to change the pidl
|
||||
*/
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (IPersistFolder2 * iface, LPCITEMIDLIST pidl)
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (
|
||||
IPersistFolder2 * iface, LPCITEMIDLIST pidl)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
|
||||
TRACE ("(%p)->(%p)\n", This, pidl);
|
||||
|
@ -810,7 +915,8 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (IPersistFolder2 * iface
|
|||
/**************************************************************************
|
||||
* IPersistFolder2_fnGetCurFolder
|
||||
*/
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (IPersistFolder2 * iface, LPITEMIDLIST * pidl)
|
||||
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (
|
||||
IPersistFolder2 * iface, LPITEMIDLIST * pidl)
|
||||
{
|
||||
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
|
||||
|
||||
|
|
21
reactos/lib/shell32/shfldr_unixfs.c
Normal file
21
reactos/lib/shell32/shfldr_unixfs.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* 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 */
|
|
@ -365,7 +365,7 @@ static UINT SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
|
|||
}
|
||||
else if ((retval = GetLastError()) >= 32)
|
||||
{
|
||||
FIXME("Strange error set by CreateProcess: %d\n", retval);
|
||||
TRACE("CreateProcess returned error %d\n", retval);
|
||||
retval = ERROR_BAD_FORMAT;
|
||||
}
|
||||
|
||||
|
|
|
@ -861,7 +861,8 @@ static const char * debug_shfileops_action( DWORD op )
|
|||
#define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026
|
||||
#define HIGH_ADR (LPWSTR)0xffffffff
|
||||
|
||||
static int file_operation_delete( WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW nFileOp, LPWSTR pFromFile,LPWSTR pTempFrom,HANDLE *hFind)
|
||||
/* handle the complete deletion of `pTempFrom` */
|
||||
static int shfileops_delete(WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW nFileOp, LPWSTR pFromFile,LPWSTR pTempFrom,HANDLE *hFind)
|
||||
|
||||
{
|
||||
LPWSTR lpFileName;
|
||||
|
@ -914,7 +915,7 @@ static int file_operation_delete( WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW nFileOp,
|
|||
* FOF_ALLOWUNDO, FOF_WANTMAPPINGHANDLE
|
||||
*/
|
||||
|
||||
static int file_operation_checkFlags(SHFILEOPSTRUCTW nFileOp)
|
||||
static int shfileops_check_flags(SHFILEOPSTRUCTW nFileOp)
|
||||
{
|
||||
FILEOP_FLAGS OFl = ((FILEOP_FLAGS)nFileOp.fFlags & 0xfff);
|
||||
long FuncSwitch = (nFileOp.wFunc & FO_MASK);
|
||||
|
@ -945,6 +946,53 @@ static int file_operation_checkFlags(SHFILEOPSTRUCTW nFileOp)
|
|||
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.@]
|
||||
*
|
||||
|
@ -964,7 +1012,6 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
LPWSTR pTempTo = NULL;
|
||||
LPWSTR pFromFile;
|
||||
LPWSTR pToFile = NULL;
|
||||
LPWSTR lpFileName;
|
||||
int retCode = 0;
|
||||
DWORD ToAttr;
|
||||
DWORD ToPathAttr;
|
||||
|
@ -986,8 +1033,6 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
long FuncSwitch = (nFileOp.wFunc & FO_MASK);
|
||||
long level= nFileOp.wFunc>>4;
|
||||
|
||||
int ret;
|
||||
|
||||
/* default no error */
|
||||
nFileOp.fAnyOperationsAborted = FALSE;
|
||||
|
||||
|
@ -1016,12 +1061,9 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
* create dir 0 0 0 0 0 0 1 0
|
||||
*/
|
||||
|
||||
ret = file_operation_checkFlags(nFileOp);
|
||||
if (ret != 0)
|
||||
{
|
||||
retCode = ret;
|
||||
retCode = shfileops_check_flags(nFileOp);
|
||||
if (retCode)
|
||||
goto shfileop_end;
|
||||
}
|
||||
|
||||
if ((pNextFrom) && (!(b_MultiTo) || (pNextTo)))
|
||||
{
|
||||
|
@ -1108,18 +1150,11 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
hFind = FindFirstFileW(pFrom, &wfd);
|
||||
if (INVALID_HANDLE_VALUE == hFind)
|
||||
{
|
||||
if ((FO_DELETE == FuncSwitch) && (b_Mask))
|
||||
{
|
||||
DWORD FromPathAttr;
|
||||
pFromFile[0] = '\0';
|
||||
FromPathAttr = GetFileAttributesW(pTempFrom);
|
||||
pFromFile[0] = '\\';
|
||||
if (IsAttribDir(FromPathAttr))
|
||||
if ((FO_DELETE == FuncSwitch) && (b_Mask) && IsAttribDir(shfileops_get_parent_attr(pFromFile,pTempFrom)))
|
||||
{
|
||||
/* FO_DELETE with mask and without found is valid */
|
||||
goto shfileop_end;
|
||||
}
|
||||
}
|
||||
/* root (without mask) is also not allowed as source, tested in W98 */
|
||||
retCode = ERROR_SHELL_INTERNAL_FILE_NOT_FOUND;
|
||||
goto shfileop_end;
|
||||
|
@ -1130,13 +1165,8 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
/* ??? b_Mask = (!SHFileStrICmpA(&pFromFile[1], &wfd.cFileName[0], HIGH_ADR, HIGH_ADR)); */
|
||||
if (!pTo) /* FO_DELETE */
|
||||
{
|
||||
ret = file_operation_delete(&wfd,nFileOp,pFromFile,pTempFrom,&hFind);
|
||||
/* if ret is not 0, nFileOp.fAnyOperationsAborted is TRUE */
|
||||
if (ret != 0)
|
||||
{
|
||||
retCode = ret;
|
||||
goto shfileop_end;
|
||||
}
|
||||
retCode = shfileops_delete(&wfd,nFileOp,pFromFile,pTempFrom,&hFind);
|
||||
/* if ret is not 0, nFileOp.fAnyOperationsAborted is TRUE and the loop will end */
|
||||
continue;
|
||||
} /* FO_DELETE ends, pTo must be always valid from here */
|
||||
|
||||
|
@ -1146,9 +1176,7 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
ToPathAttr = ToAttr = GetFileAttributesW(pTempTo);
|
||||
if (!b_Mask && (ToAttr == INVALID_FILE_ATTRIBUTES) && (pToFile))
|
||||
{
|
||||
pToFile[0] = '\0';
|
||||
ToPathAttr = GetFileAttributesW(pTempTo);
|
||||
pToFile[0] = '\\';
|
||||
ToPathAttr = shfileops_get_parent_attr(pToFile,pTempTo);
|
||||
}
|
||||
|
||||
if (FO_RENAME == FuncSwitch)
|
||||
|
@ -1202,15 +1230,7 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
nFileOp.fFlags = (nFileOp.fFlags | FOF_MULTIDESTFILES);
|
||||
do
|
||||
{
|
||||
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);
|
||||
retCode = shfileops_do_operation(wfd,&nFileOp,pToFile,pFromFile);
|
||||
} while(!nFileOp.fAnyOperationsAborted && FindNextFileW(hFind, &wfd));
|
||||
}
|
||||
FindClose(hFind);
|
||||
|
@ -1224,19 +1244,9 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
{
|
||||
if (pToFile)
|
||||
{
|
||||
pToFile[0] = '\0';
|
||||
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 */
|
||||
ToPathAttr = shfileops_get_parent_attr2(pToFile,pTempTo,b_ToValid,&retCode);
|
||||
if (retCode)
|
||||
goto shfileop_end;
|
||||
}
|
||||
ToPathAttr = GetFileAttributesW(pTempTo);
|
||||
}
|
||||
pToFile[0] = '\\';
|
||||
if (b_ToInvalidTail)
|
||||
{
|
||||
retCode = 0x10003;
|
||||
|
@ -1270,9 +1280,7 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|||
}
|
||||
else
|
||||
{
|
||||
pToFile[0] = '\0';
|
||||
ToPathAttr = GetFileAttributesW(pTempTo);
|
||||
pToFile[0] = '\\';
|
||||
ToPathAttr = shfileops_get_parent_attr(pToFile,pTempTo);
|
||||
if (IsAttribFile(ToPathAttr))
|
||||
{
|
||||
/* error, is this tested ? */
|
||||
|
@ -1403,7 +1411,16 @@ void WINAPI SHFreeNameMappings(HANDLE hNameMapping)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SheGetDirW [SHELL32.281]
|
||||
* SheGetDirA [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
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)
|
||||
|
@ -1412,7 +1429,16 @@ HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SheChangeDirW [SHELL32.274]
|
||||
* SheChangeDirA [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SheChangeDirA(LPSTR u)
|
||||
{ FIXME("(%s),stub\n",debugstr_a(u));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SheChangeDirW [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SheChangeDirW(LPWSTR u)
|
||||
|
|
|
@ -422,7 +422,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
|
|||
if (SFGAO_LINK & *pdwAttributes) {
|
||||
char ext[MAX_PATH];
|
||||
|
||||
if (!_ILGetExtension(pidl, ext, MAX_PATH) || strcasecmp(ext, "lnk"))
|
||||
if (!_ILGetExtension(pidl, ext, MAX_PATH) || lstrcmpiA(ext, "lnk"))
|
||||
*pdwAttributes &= ~SFGAO_LINK;
|
||||
}
|
||||
} else {
|
||||
|
@ -469,7 +469,7 @@ HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST p
|
|||
/* test for name of pidl */
|
||||
_ILSimpleGetText (pidl1, szTemp1, MAX_PATH);
|
||||
_ILSimpleGetText (pidl2, szTemp2, MAX_PATH);
|
||||
nReturn = strcasecmp (szTemp1, szTemp2);
|
||||
nReturn = lstrcmpiA (szTemp1, szTemp2);
|
||||
if (nReturn < 0)
|
||||
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
|
||||
else if (nReturn > 0)
|
||||
|
|
|
@ -47,11 +47,11 @@ typedef struct
|
|||
WIN32_FIND_DATAW findFile;
|
||||
} IFileSystemBindDataImpl;
|
||||
|
||||
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *iface, REFIID riid, LPVOID* ppvObj);
|
||||
static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *iface);
|
||||
static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface);
|
||||
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd);
|
||||
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd);
|
||||
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *, REFIID, LPVOID*);
|
||||
static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *);
|
||||
static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *);
|
||||
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *, WIN32_FIND_DATAW *);
|
||||
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *, const WIN32_FIND_DATAW *);
|
||||
|
||||
static struct IFileSystemBindDataVtbl sbvt =
|
||||
{
|
||||
|
@ -62,7 +62,8 @@ static struct IFileSystemBindDataVtbl sbvt =
|
|||
IFileSystemBindData_fnGetFindData,
|
||||
};
|
||||
|
||||
static const WCHAR wFileSystemBindData[] = {'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
|
||||
static const WCHAR wFileSystemBindData[] = {
|
||||
'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)
|
||||
{
|
||||
|
@ -76,7 +77,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
|
|||
|
||||
*ppV = NULL;
|
||||
|
||||
sb = (IFileSystemBindDataImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileSystemBindDataImpl));
|
||||
sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileSystemBindDataImpl));
|
||||
if (!sb)
|
||||
return ret;
|
||||
|
||||
|
@ -88,6 +89,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
|
|||
if (SUCCEEDED(ret))
|
||||
{
|
||||
BIND_OPTS bindOpts;
|
||||
|
||||
bindOpts.cbStruct = sizeof(BIND_OPTS);
|
||||
bindOpts.grfFlags = 0;
|
||||
bindOpts.grfMode = STGM_CREATE;
|
||||
|
@ -146,11 +148,11 @@ HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *
|
|||
}
|
||||
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;
|
||||
TRACE("(%p)->(\n\tIID:\t%s, %p)\n", This, debugstr_guid(riid), ppV);
|
||||
|
@ -158,13 +160,9 @@ static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *
|
|||
*ppV = NULL;
|
||||
|
||||
if (IsEqualIID(riid, &IID_IUnknown))
|
||||
{
|
||||
*ppV = This;
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IFileSystemBindData))
|
||||
{
|
||||
*ppV = (IFileSystemBindData*)This;
|
||||
}
|
||||
|
||||
if (*ppV)
|
||||
{
|
||||
|
@ -201,7 +199,8 @@ static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface)
|
|||
return refCount;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd)
|
||||
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(
|
||||
IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd)
|
||||
{
|
||||
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
|
||||
TRACE("(%p), %p\n", This, pfd);
|
||||
|
@ -213,7 +212,8 @@ static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *ifa
|
|||
return NOERROR;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd)
|
||||
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(
|
||||
IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd)
|
||||
{
|
||||
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
|
||||
TRACE("(%p), %p\n", This, pfd);
|
||||
|
|
|
@ -454,7 +454,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
|
|||
{
|
||||
_ILGetFileAttributes(pItemIdList1, strName1, MAX_PATH);
|
||||
_ILGetFileAttributes(pItemIdList2, strName2, MAX_PATH);
|
||||
nDiff = strcasecmp(strName1, strName2);
|
||||
nDiff = lstrcmpiA(strName1, strName2);
|
||||
}
|
||||
/* Sort by FileName: Folder or Files can be sorted */
|
||||
else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_NAME || bIsBothFolder)
|
||||
|
@ -462,7 +462,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
|
|||
/* Sort by Text */
|
||||
_ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
|
||||
_ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
|
||||
nDiff = strcasecmp(strName1, strName2);
|
||||
nDiff = lstrcmpiA(strName1, strName2);
|
||||
}
|
||||
/* Sort by File Size, Only valid for Files */
|
||||
else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_SIZE)
|
||||
|
@ -475,7 +475,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam
|
|||
/* Sort by Type */
|
||||
_ILGetFileType(pItemIdList1, strName1, MAX_PATH);
|
||||
_ILGetFileType(pItemIdList2, strName2, MAX_PATH);
|
||||
nDiff = strcasecmp(strName1, strName2);
|
||||
nDiff = lstrcmpiA(strName1, strName2);
|
||||
}
|
||||
}
|
||||
/* 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(pItemIdList2, strName2, MAX_PATH);
|
||||
nDiff = strcasecmp(strName1, strName2);
|
||||
nDiff = lstrcmpiA(strName1, strName2);
|
||||
}
|
||||
|
||||
if(!pSortInfo->bIsAscending)
|
||||
|
|
Loading…
Reference in a new issue