5 * Copyright 1997 Marcus Meissner
6 * Copyright 1998, 1999, 2002 Juergen Schmied
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "wine/port.h"
30 #define NONAMELESSUNION
31 #define NONAMELESSSTRUCT
40 #include "undocshell.h"
41 #include "shell32_main.h"
44 #include "shellfolder.h"
45 #include "wine/debug.h"
49 WINE_DEFAULT_DEBUG_CHANNEL (shell);
51 /***********************************************************************
52 * IShellFolder implementation
56 ICOM_VFIELD (IUnknown);
58 ICOM_VTABLE (IShellFolder2) * lpvtblShellFolder;
59 ICOM_VTABLE (IPersistFolder3) * lpvtblPersistFolder3;
60 ICOM_VTABLE (IDropTarget) * lpvtblDropTarget;
61 ICOM_VTABLE (ISFHelper) * lpvtblSFHelper;
63 IUnknown *pUnkOuter; /* used for aggregation */
67 /* both paths are parsible from the desktop */
68 LPSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
70 LPITEMIDLIST pidlRoot; /* absolute pidl */
72 int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
74 UINT cfShellIDList; /* clipboardformat for IDropTarget */
75 BOOL fAcceptFmt; /* flag for pending Drop */
78 static struct ICOM_VTABLE (IUnknown) unkvt;
79 static struct ICOM_VTABLE (IShellFolder2) sfvt;
80 static struct ICOM_VTABLE (IPersistFolder3) vt_FSFldr_PersistFolder3; /* IPersistFolder3 for a FS_Folder */
81 static struct ICOM_VTABLE (IDropTarget) dtvt;
82 static struct ICOM_VTABLE (ISFHelper) shvt;
84 #define _IShellFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblShellFolder)))
85 #define _ICOM_THIS_From_IShellFolder2(class, name) class* This = (class*)(((char*)name)-_IShellFolder2_Offset);
87 #define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblPersistFolder3)))
88 #define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset);
90 #define _IPersistFolder3_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblPersistFolder3)))
91 #define _ICOM_THIS_From_IPersistFolder3(class, name) class* This = (class*)(((char*)name)-_IPersistFolder3_Offset);
93 #define _IDropTarget_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblDropTarget)))
94 #define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
96 #define _ISFHelper_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblSFHelper)))
97 #define _ICOM_THIS_From_ISFHelper(class, name) class* This = (class*)(((char*)name)-_ISFHelper_Offset);
100 converts This to a interface pointer
102 #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
103 #define _IShellFolder_(This) (IShellFolder*)&(This->lpvtblShellFolder)
104 #define _IShellFolder2_(This) (IShellFolder2*)&(This->lpvtblShellFolder)
105 #define _IPersist_(This) (IPersist*)&(This->lpvtblPersistFolder3)
106 #define _IPersistFolder_(This) (IPersistFolder*)&(This->lpvtblPersistFolder3)
107 #define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpvtblPersistFolder3)
108 #define _IPersistFolder3_(This) (IPersistFolder3*)&(This->lpvtblPersistFolder3)
109 #define _IDropTarget_(This) (IDropTarget*)&(This->lpvtblDropTarget)
110 #define _ISFHelper_(This) (ISFHelper*)&(This->lpvtblSFHelper)
112 /**************************************************************************
113 * registers clipboardformat once
115 static void SF_RegisterClipFmt (IGenericSFImpl * This)
117 TRACE ("(%p)\n", This);
119 if (!This->cfShellIDList) {
120 This->cfShellIDList = RegisterClipboardFormatA (CFSTR_SHELLIDLIST);
124 /**************************************************************************
125 * we need a separate IUnknown to handle aggregation
128 static HRESULT WINAPI IUnknown_fnQueryInterface (IUnknown * iface, REFIID riid, LPVOID * ppvObj)
130 ICOM_THIS (IGenericSFImpl, iface);
132 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
136 if (IsEqualIID (riid, &IID_IUnknown))
137 *ppvObj = _IUnknown_ (This);
138 else if (IsEqualIID (riid, &IID_IShellFolder))
139 *ppvObj = _IShellFolder_ (This);
140 else if (IsEqualIID (riid, &IID_IShellFolder2))
141 *ppvObj = _IShellFolder_ (This);
142 else if (IsEqualIID (riid, &IID_IPersist))
143 *ppvObj = _IPersist_ (This);
144 else if (IsEqualIID (riid, &IID_IPersistFolder))
145 *ppvObj = _IPersistFolder_ (This);
146 else if (IsEqualIID (riid, &IID_IPersistFolder2))
147 *ppvObj = _IPersistFolder2_ (This);
148 else if (IsEqualIID (riid, &IID_IPersistFolder3))
149 *ppvObj = _IPersistFolder3_ (This);
150 else if (IsEqualIID (riid, &IID_ISFHelper))
151 *ppvObj = _ISFHelper_ (This);
152 else if (IsEqualIID (riid, &IID_IDropTarget)) {
153 *ppvObj = _IDropTarget_ (This);
154 SF_RegisterClipFmt (This);
158 IUnknown_AddRef ((IUnknown *) (*ppvObj));
159 TRACE ("-- Interface = %p\n", *ppvObj);
162 TRACE ("-- Interface: E_NOINTERFACE\n");
163 return E_NOINTERFACE;
166 static ULONG WINAPI IUnknown_fnAddRef (IUnknown * iface)
168 ICOM_THIS (IGenericSFImpl, iface);
170 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
172 return ++(This->ref);
175 static ULONG WINAPI IUnknown_fnRelease (IUnknown * iface)
177 ICOM_THIS (IGenericSFImpl, iface);
179 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
181 if (!--(This->ref)) {
182 TRACE ("-- destroying IShellFolder(%p)\n", This);
185 SHFree (This->pidlRoot);
186 if (This->sPathTarget)
187 SHFree (This->sPathTarget);
188 LocalFree ((HLOCAL) This);
194 static ICOM_VTABLE (IUnknown) unkvt =
196 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IUnknown_fnQueryInterface,
201 static shvheader GenericSFHeader[] = {
202 {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
203 {IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
204 {IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
205 {IDS_SHV_COLUMN4, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 12},
206 {IDS_SHV_COLUMN5, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 5}
209 #define GENERICSHELLVIEWCOLUMNS 5
211 /**************************************************************************
212 * IFSFolder_Constructor
215 * creating undocumented ShellFS_Folder as part of an aggregation
216 * {F3364BA0-65B9-11CE-A9BA-00AA004AE837}
219 HRESULT WINAPI IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
223 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
225 if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
226 return CLASS_E_NOAGGREGATION;
227 sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
229 return E_OUTOFMEMORY;
232 ICOM_VTBL (sf) = &unkvt;
233 sf->lpvtblShellFolder = &sfvt;
234 sf->lpvtblPersistFolder3 = &vt_FSFldr_PersistFolder3;
235 sf->lpvtblDropTarget = &dtvt;
236 sf->lpvtblSFHelper = &shvt;
237 sf->pclsid = (CLSID *) & CLSID_ShellFSFolder;
238 sf->pUnkOuter = pUnkOuter ? pUnkOuter : _IUnknown_ (sf);
240 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
241 IUnknown_Release (_IUnknown_ (sf));
242 return E_NOINTERFACE;
245 TRACE ("--%p\n", *ppv);
249 /**************************************************************************
250 * IShellFolder_fnQueryInterface
253 * REFIID riid [in ] Requested InterfaceID
254 * LPVOID* ppvObject [out] Interface* to hold the result
256 static HRESULT WINAPI IShellFolder_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
258 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
260 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
262 return IUnknown_QueryInterface (This->pUnkOuter, riid, ppvObj);
265 /**************************************************************************
266 * IShellFolder_AddRef
269 static ULONG WINAPI IShellFolder_fnAddRef (IShellFolder2 * iface)
271 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
273 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
275 return IUnknown_AddRef (This->pUnkOuter);
278 /**************************************************************************
279 * IShellFolder_fnRelease
281 static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface)
283 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
285 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
287 return IUnknown_Release (This->pUnkOuter);
290 /**************************************************************************
291 * IShellFolder_ParseDisplayName {SHELL32}
293 * Parse a display name.
296 * hwndOwner [in] Parent window for any message's
298 * lpszDisplayName [in] Unicode displayname.
299 * pchEaten [out] (unicode) characters processed
300 * ppidl [out] complex pidl to item
301 * pdwAttributes [out] items attributes
304 * Every folder tries to parse only its own (the leftmost) pidl and creates a
305 * subfolder to evaluate the remaining parts.
306 * Now we can parse into namespaces implemented by shell extensions
308 * Behaviour on win98: lpszDisplayName=NULL -> crash
309 * lpszDisplayName="" -> returns mycoputer-pidl
312 * pdwAttributes is not set
313 * pchEaten is not set like in windows
315 static HRESULT WINAPI
316 IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
319 LPOLESTR lpszDisplayName,
320 DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
322 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
324 HRESULT hr = E_OUTOFMEMORY;
325 LPCWSTR szNext = NULL;
326 WCHAR szElement[MAX_PATH];
327 CHAR szTempA[MAX_PATH],
329 LPITEMIDLIST pidlTemp = NULL;
331 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
332 This, hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
334 if (!lpszDisplayName || !ppidl)
338 *pchEaten = 0; /* strange but like the original */
340 if (*lpszDisplayName) {
341 /* get the next element */
342 szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
344 /* build the full pathname to the element */
345 WideCharToMultiByte (CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL);
346 lstrcpyA (szPath, This->sPathTarget);
347 PathAddBackslashA (szPath);
348 lstrcatA (szPath, szTempA);
351 pidlTemp = SHSimpleIDListFromPathA (szPath);
354 if (szNext && *szNext) {
355 /* try to analyse the next element */
356 hr = SHELL32_ParseNextElement (hwndOwner, iface, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
358 /* it's the last element */
359 if (pdwAttributes && *pdwAttributes) {
360 SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
372 TRACE ("(%p)->(-- pidl=%p ret=0x%08lx)\n", This, ppidl ? *ppidl : 0, hr);
377 /**************************************************************************
378 * IShellFolder_fnEnumObjects
380 * HWND hwndOwner, //[in ] Parent Window
381 * DWORD grfFlags, //[in ] SHCONTF enumeration mask
382 * LPENUMIDLIST* ppenumIDList //[out] IEnumIDList interface
384 static HRESULT WINAPI
385 IShellFolder_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
387 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
389 TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
391 *ppEnumIDList = IEnumIDList_Constructor (This->sPathTarget, dwFlags, EIDL_FILE);
393 TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
395 return *ppEnumIDList ? S_OK : E_OUTOFMEMORY;
398 /**************************************************************************
399 * IShellFolder_fnBindToObject
401 * LPCITEMIDLIST pidl, //[in ] relative pidl to open
402 * LPBC pbc, //[in ] reserved
403 * REFIID riid, //[in ] Initial Interface
404 * LPVOID* ppvObject //[out] Interface*
406 static HRESULT WINAPI
407 IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
409 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
411 TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
413 return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
416 /**************************************************************************
417 * IShellFolder_fnBindToStorage
419 * LPCITEMIDLIST pidl, //[in ] complex pidl to store
420 * LPBC pbc, //[in ] reserved
421 * REFIID riid, //[in ] Initial storage interface
422 * LPVOID* ppvObject //[out] Interface* returned
424 static HRESULT WINAPI
425 IShellFolder_fnBindToStorage (IShellFolder2 * iface, LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
427 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
429 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
435 /**************************************************************************
436 * IShellFolder_fnCompareIDs
439 static HRESULT WINAPI
440 IShellFolder_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
442 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
446 TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
447 nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2);
448 TRACE ("-- %i\n", nReturn);
452 /**************************************************************************
453 * IShellFolder_fnCreateViewObject
455 static HRESULT WINAPI
456 IShellFolder_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
458 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
460 LPSHELLVIEW pShellView;
461 HRESULT hr = E_INVALIDARG;
463 TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
468 if (IsEqualIID (riid, &IID_IDropTarget)) {
469 hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, ppvOut);
470 } else if (IsEqualIID (riid, &IID_IContextMenu)) {
471 FIXME ("IContextMenu not implemented\n");
473 } else if (IsEqualIID (riid, &IID_IShellView)) {
474 pShellView = IShellView_Constructor ((IShellFolder *) iface);
476 hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
477 IShellView_Release (pShellView);
481 TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
485 /**************************************************************************
486 * IShellFolder_fnGetAttributesOf
489 * UINT cidl, //[in ] num elements in pidl array
490 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
491 * ULONG* rgfInOut) //[out] result array
494 static HRESULT WINAPI
495 IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
497 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
501 TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
503 if ((!cidl) || (!apidl) || (!rgfInOut))
506 while (cidl > 0 && *apidl) {
508 SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
513 TRACE ("-- result=0x%08lx\n", *rgfInOut);
518 /**************************************************************************
519 * IShellFolder_fnGetUIObjectOf
522 * HWND hwndOwner, //[in ] Parent window for any output
523 * UINT cidl, //[in ] array size
524 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
525 * REFIID riid, //[in ] Requested Interface
526 * UINT* prgfInOut, //[ ] reserved
527 * LPVOID* ppvObject) //[out] Resulting Interface
530 * This function gets asked to return "view objects" for one or more (multiple select)
532 * The viewobject typically is an COM object with one of the following interfaces:
533 * IExtractIcon,IDataObject,IContextMenu
534 * In order to support icon positions in the default Listview your DataObject
535 * must implement the SetData method (in addition to GetData :) - the shell passes
536 * a barely documented "Icon positions" structure to SetData when the drag starts,
537 * and GetData's it if the drop is in another explorer window that needs the positions.
539 static HRESULT WINAPI
540 IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
542 UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
544 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
547 IUnknown *pObj = NULL;
548 HRESULT hr = E_INVALIDARG;
550 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
551 This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
556 if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
557 pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
559 } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
560 pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
562 } else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
563 pidl = ILCombine (This->pidlRoot, apidl[0]);
564 pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
567 } else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) {
568 pidl = ILCombine (This->pidlRoot, apidl[0]);
569 pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
572 } else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) {
573 hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
583 TRACE ("(%p)->hr=0x%08lx\n", This, hr);
587 /**************************************************************************
588 * IShellFolder_fnGetDisplayNameOf
589 * Retrieves the display name for the specified file object or subfolder
592 * LPCITEMIDLIST pidl, //[in ] complex pidl to item
593 * DWORD dwFlags, //[in ] SHGNO formatting flags
594 * LPSTRRET lpName) //[out] Returned display name
597 * if the name is in the pidl the ret value should be a STRRET_OFFSET
600 static HRESULT WINAPI
601 IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
603 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
605 CHAR szPath[MAX_PATH] = "";
609 TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This, pidl, dwFlags, strRet);
612 if (!pidl || !strRet)
615 bSimplePidl = _ILIsPidlSimple (pidl);
617 /* take names of special folders only if its only this folder */
618 if (_ILIsSpecialFolder (pidl)) {
620 _ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
622 FIXME ("special pidl\n");
625 if (!(dwFlags & SHGDN_INFOLDER) && (dwFlags & SHGDN_FORPARSING) && This->sPathTarget) {
626 lstrcpyA (szPath, This->sPathTarget); /* get path to root */
627 PathAddBackslashA (szPath);
628 len = lstrlenA (szPath);
630 _ILSimpleGetText (pidl, szPath + len, MAX_PATH - len); /* append my own path */
632 /* MSDN also mentions SHGDN_FOREDITING, which isn't defined in wine */
633 if (!_ILIsFolder (pidl) && !(dwFlags & SHGDN_FORPARSING) &&
634 ((dwFlags & SHGDN_INFOLDER) || (dwFlags == SHGDN_NORMAL))) {
637 DWORD dwDataSize = sizeof (DWORD);
638 BOOL doHide = 0; /* The default value is FALSE (win98 at least) */
640 /* XXX should it do this only for known file types? -- that would make it even slower! */
641 /* XXX That's what the prompt says!! */
642 if (!RegCreateKeyExA (HKEY_CURRENT_USER,
643 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
644 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
645 if (!RegQueryValueExA (hKey, "HideFileExt", 0, 0, (LPBYTE) & dwData, &dwDataSize))
649 if (doHide && szPath[0] != '.')
650 PathRemoveExtensionA (szPath);
654 if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) { /* go deeper if needed */
655 PathAddBackslashA (szPath);
656 len = lstrlenA (szPath);
659 (SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len)))
660 return E_OUTOFMEMORY;
662 strRet->uType = STRRET_CSTR;
663 lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
665 TRACE ("-- (%p)->(%s)\n", This, szPath);
669 /**************************************************************************
670 * IShellFolder_fnSetNameOf
671 * Changes the name of a file object or subfolder, possibly changing its item
672 * identifier in the process.
675 * HWND hwndOwner, //[in ] Owner window for output
676 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
677 * LPCOLESTR lpszName, //[in ] the items new display name
678 * DWORD dwFlags, //[in ] SHGNO formatting flags
679 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
681 static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
682 LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
684 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
685 char szSrc[MAX_PATH],
688 BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl));
690 TRACE ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
692 /* build source path */
693 if (dwFlags & SHGDN_INFOLDER) {
694 strcpy (szSrc, This->sPathTarget);
695 PathAddBackslashA (szSrc);
696 len = strlen (szSrc);
697 _ILSimpleGetText (pidl, szSrc + len, MAX_PATH - len);
699 SHGetPathFromIDListA (pidl, szSrc);
702 /* build destination path */
703 strcpy (szDest, This->sPathTarget);
704 PathAddBackslashA (szDest);
705 len = strlen (szDest);
706 WideCharToMultiByte (CP_ACP, 0, lpName, -1, szDest + len, MAX_PATH - len, NULL, NULL);
707 szDest[MAX_PATH - 1] = 0;
708 TRACE ("src=%s dest=%s\n", szSrc, szDest);
709 if (MoveFileA (szSrc, szDest)) {
711 *pPidlOut = SHSimpleIDListFromPathA (szDest);
712 SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHCNF_PATHA, szSrc, szDest);
718 static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
720 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
721 FIXME ("(%p)\n", This);
724 static HRESULT WINAPI IShellFolder_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
726 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
727 FIXME ("(%p)\n", This);
730 static HRESULT WINAPI
731 IShellFolder_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
733 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
735 TRACE ("(%p)\n", This);
744 static HRESULT WINAPI IShellFolder_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
746 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
748 TRACE ("(%p)\n", This);
750 if (!pcsFlags || iColumn >= GENERICSHELLVIEWCOLUMNS)
753 *pcsFlags = GenericSFHeader[iColumn].pcsFlags;
757 static HRESULT WINAPI
758 IShellFolder_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
760 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
761 FIXME ("(%p)\n", This);
765 static HRESULT WINAPI
766 IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
768 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
771 TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
773 if (!psd || iColumn >= GENERICSHELLVIEWCOLUMNS)
777 /* the header titles */
778 psd->fmt = GenericSFHeader[iColumn].fmt;
779 psd->cxChar = GenericSFHeader[iColumn].cxChar;
780 psd->str.uType = STRRET_CSTR;
781 LoadStringA (shell32_hInstance, GenericSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
784 /* the data from the pidl */
787 hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
790 _ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
793 _ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
796 _ILGetFileDate (pidl, psd->str.u.cStr, MAX_PATH);
798 case 4: /* attributes */
799 _ILGetFileAttributes (pidl, psd->str.u.cStr, MAX_PATH);
803 psd->str.uType = STRRET_CSTR;
808 static HRESULT WINAPI IShellFolder_fnMapNameToSCID (IShellFolder2 * iface, LPCWSTR pwszName, SHCOLUMNID * pscid)
810 _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
811 FIXME ("(%p)\n", This);
815 static ICOM_VTABLE (IShellFolder2) sfvt =
817 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
818 IShellFolder_fnQueryInterface,
819 IShellFolder_fnAddRef,
820 IShellFolder_fnRelease,
821 IShellFolder_fnParseDisplayName,
822 IShellFolder_fnEnumObjects,
823 IShellFolder_fnBindToObject,
824 IShellFolder_fnBindToStorage,
825 IShellFolder_fnCompareIDs,
826 IShellFolder_fnCreateViewObject,
827 IShellFolder_fnGetAttributesOf,
828 IShellFolder_fnGetUIObjectOf,
829 IShellFolder_fnGetDisplayNameOf,
830 IShellFolder_fnSetNameOf,
832 IShellFolder_fnGetDefaultSearchGUID,
833 IShellFolder_fnEnumSearches,
834 IShellFolder_fnGetDefaultColumn,
835 IShellFolder_fnGetDefaultColumnState,
836 IShellFolder_fnGetDetailsEx,
837 IShellFolder_fnGetDetailsOf,
838 IShellFolder_fnMapNameToSCID
841 /****************************************************************************
842 * ISFHelper for IShellFolder implementation
845 static HRESULT WINAPI ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj)
847 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface);
849 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
851 return IUnknown_QueryInterface (This->pUnkOuter, riid, ppvObj);
854 static ULONG WINAPI ISFHelper_fnAddRef (ISFHelper * iface)
856 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface);
858 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
860 return IUnknown_AddRef (This->pUnkOuter);
863 static ULONG WINAPI ISFHelper_fnRelease (ISFHelper * iface)
865 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface);
867 TRACE ("(%p)\n", This);
869 return IUnknown_Release (This->pUnkOuter);
872 /****************************************************************************
873 * ISFHelper_fnAddFolder
875 * creates a unique folder name
878 static HRESULT WINAPI ISFHelper_fnGetUniqueName (ISFHelper * iface, LPSTR lpName, UINT uLen)
880 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
883 char szText[MAX_PATH];
884 char *szNewFolder = "New Folder";
886 TRACE ("(%p)(%s %u)\n", This, lpName, uLen);
888 if (uLen < strlen (szNewFolder) + 4)
891 strcpy (lpName, szNewFolder);
893 hr = IShellFolder_fnEnumObjects (_IShellFolder2_ (This), 0,
894 SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penum);
900 next:IEnumIDList_Reset (penum);
901 while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) && dwFetched) {
902 _ILSimpleGetText (pidl, szText, MAX_PATH);
903 if (0 == strcasecmp (szText, lpName)) {
904 sprintf (lpName, "%s %d", szNewFolder, i++);
913 IEnumIDList_Release (penum);
918 /****************************************************************************
919 * ISFHelper_fnAddFolder
924 static HRESULT WINAPI ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCSTR lpName, LPITEMIDLIST * ppidlOut)
926 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
927 char lpstrNewDir[MAX_PATH];
929 HRESULT hres = E_FAIL;
931 TRACE ("(%p)(%s %p)\n", This, lpName, ppidlOut);
933 strcpy (lpstrNewDir, This->sPathTarget);
934 PathAddBackslashA (lpstrNewDir);
935 strcat (lpstrNewDir, lpName);
937 bRes = CreateDirectoryA (lpstrNewDir, NULL);
943 pidlitem = SHSimpleIDListFromPathA (lpstrNewDir);
945 pidl = ILCombine (This->pidlRoot, pidlitem);
946 SHChangeNotify (SHCNE_MKDIR, SHCNF_IDLIST, pidl, NULL);
950 *ppidlOut = pidlitem;
953 char lpstrText[128 + MAX_PATH];
954 char lpstrTempText[128];
955 char lpstrCaption[256];
957 /* Cannot Create folder because of permissions */
958 LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_DENIED, lpstrTempText, sizeof (lpstrTempText));
959 LoadStringA (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, lpstrCaption, sizeof (lpstrCaption));
960 sprintf (lpstrText, lpstrTempText, lpstrNewDir);
961 MessageBoxA (hwnd, lpstrText, lpstrCaption, MB_OK | MB_ICONEXCLAMATION);
967 /****************************************************************************
968 * ISFHelper_fnDeleteItems
970 * deletes items in folder
972 static HRESULT WINAPI ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
974 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface)
976 char szPath[MAX_PATH];
977 BOOL bConfirm = TRUE;
979 TRACE ("(%p)(%u %p)\n", This, cidl, apidl);
981 /* deleting multiple items so give a slightly different warning */
985 snprintf (tmp, sizeof (tmp), "%d", cidl);
986 if (!SHELL_ConfirmDialog(ASK_DELETE_MULTIPLE_ITEM, tmp))
991 for (i = 0; i < cidl; i++) {
992 strcpy (szPath, This->sPathTarget);
993 PathAddBackslashA (szPath);
994 _ILSimpleGetText (apidl[i], szPath + strlen (szPath), MAX_PATH);
996 if (_ILIsFolder (apidl[i])) {
999 TRACE ("delete %s\n", szPath);
1000 if (!SHELL_DeleteDirectoryA (szPath, bConfirm)) {
1001 TRACE ("delete %s failed, bConfirm=%d\n", szPath, bConfirm);
1004 pidl = ILCombine (This->pidlRoot, apidl[i]);
1005 SHChangeNotify (SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL);
1007 } else if (_ILIsValue (apidl[i])) {
1010 TRACE ("delete %s\n", szPath);
1011 if (!SHELL_DeleteFileA (szPath, bConfirm)) {
1012 TRACE ("delete %s failed, bConfirm=%d\n", szPath, bConfirm);
1015 pidl = ILCombine (This->pidlRoot, apidl[i]);
1016 SHChangeNotify (SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL);
1024 /****************************************************************************
1025 * ISFHelper_fnCopyItems
1027 * copies items to this folder
1029 static HRESULT WINAPI
1030 ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl)
1033 IPersistFolder2 *ppf2 = NULL;
1034 char szSrcPath[MAX_PATH],
1035 szDstPath[MAX_PATH];
1037 _ICOM_THIS_From_ISFHelper (IGenericSFImpl, iface);
1039 TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl);
1041 IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, (LPVOID *) & ppf2);
1045 if (SUCCEEDED (IPersistFolder2_GetCurFolder (ppf2, &pidl))) {
1046 for (i = 0; i < cidl; i++) {
1047 SHGetPathFromIDListA (pidl, szSrcPath);
1048 PathAddBackslashA (szSrcPath);
1049 _ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath), MAX_PATH);
1051 strcpy (szDstPath, This->sPathTarget);
1052 PathAddBackslashA (szDstPath);
1053 _ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), MAX_PATH);
1054 MESSAGE ("would copy %s to %s\n", szSrcPath, szDstPath);
1058 IPersistFolder2_Release (ppf2);
1063 static ICOM_VTABLE (ISFHelper) shvt =
1065 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1066 ISFHelper_fnQueryInterface,
1068 ISFHelper_fnRelease,
1069 ISFHelper_fnGetUniqueName,
1070 ISFHelper_fnAddFolder,
1071 ISFHelper_fnDeleteItems,
1072 ISFHelper_fnCopyItems
1075 /************************************************************************
1076 * IFSFldr_PersistFolder3_QueryInterface
1079 static HRESULT WINAPI IFSFldr_PersistFolder3_QueryInterface (IPersistFolder3 * iface, REFIID iid, LPVOID * ppvObj)
1081 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1083 TRACE ("(%p)\n", This);
1085 return IUnknown_QueryInterface (This->pUnkOuter, iid, ppvObj);
1088 /************************************************************************
1089 * IFSFldr_PersistFolder3_AddRef
1092 static ULONG WINAPI IFSFldr_PersistFolder3_AddRef (IPersistFolder3 * iface)
1094 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1096 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
1098 return IUnknown_AddRef (This->pUnkOuter);
1101 /************************************************************************
1102 * IFSFldr_PersistFolder3_Release
1105 static ULONG WINAPI IFSFldr_PersistFolder3_Release (IPersistFolder3 * iface)
1107 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1109 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
1111 return IUnknown_Release (This->pUnkOuter);
1114 /************************************************************************
1115 * IFSFldr_PersistFolder3_GetClassID
1117 static HRESULT WINAPI IFSFldr_PersistFolder3_GetClassID (IPersistFolder3 * iface, CLSID * lpClassId)
1119 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1121 TRACE ("(%p)\n", This);
1125 *lpClassId = *This->pclsid;
1130 /************************************************************************
1131 * IFSFldr_PersistFolder3_Initialize
1134 * sPathTarget is not set. Don't know how to handle in a non rooted environment.
1136 static HRESULT WINAPI IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
1138 char sTemp[MAX_PATH];
1140 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1142 TRACE ("(%p)->(%p)\n", This, pidl);
1145 SHFree (This->pidlRoot); /* free the old pidl */
1146 This->pidlRoot = ILClone (pidl); /* set my pidl */
1148 if (This->sPathTarget)
1149 SHFree (This->sPathTarget);
1152 if (SHGetPathFromIDListA (pidl, sTemp)) {
1153 This->sPathTarget = SHAlloc (strlen (sTemp) + 1);
1154 strcpy (This->sPathTarget, sTemp);
1157 TRACE ("--(%p)->(%s)\n", This, This->sPathTarget);
1161 /**************************************************************************
1162 * IFSFldr_PersistFolder3_GetCurFolder
1164 static HRESULT WINAPI IFSFldr_PersistFolder3_fnGetCurFolder (IPersistFolder3 * iface, LPITEMIDLIST * pidl)
1166 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1168 TRACE ("(%p)->(%p)\n", This, pidl);
1170 if (!pidl) return E_POINTER;
1171 *pidl = ILClone (This->pidlRoot);
1175 /**************************************************************************
1176 * IFSFldr_PersistFolder3_InitializeEx
1178 * FIXME: errorhandling
1180 static HRESULT WINAPI
1181 IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
1182 IBindCtx * pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO * ppfti)
1184 char sTemp[MAX_PATH];
1186 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1188 TRACE ("(%p)->(%p,%p,%p)\n", This, pbc, pidlRoot, ppfti);
1190 TRACE ("--%p %s %s 0x%08lx 0x%08x\n",
1191 ppfti->pidlTargetFolder, debugstr_w (ppfti->szTargetParsingName),
1192 debugstr_w (ppfti->szNetworkProvider), ppfti->dwAttributes, ppfti->csidl);
1195 if (ppfti && ppfti->pidlTargetFolder)
1196 pdump (ppfti->pidlTargetFolder);
1199 __SHFreeAndNil (&This->pidlRoot); /* free the old */
1200 if (This->sPathTarget)
1201 __SHFreeAndNil (&This->sPathTarget);
1204 * Root path and pidl
1206 This->pidlRoot = ILClone (pidlRoot);
1209 * the target folder is spezified in csidl OR pidlTargetFolder OR szTargetParsingName
1212 if (ppfti->csidl != -1) {
1213 if (SHGetSpecialFolderPathA (0, sTemp, ppfti->csidl, ppfti->csidl & CSIDL_FLAG_CREATE)) {
1214 __SHCloneStrA (&This->sPathTarget, sTemp);
1216 } else if (ppfti->szTargetParsingName[0]) {
1217 __SHCloneStrWtoA (&This->sPathTarget, ppfti->szTargetParsingName);
1218 } else if (ppfti->pidlTargetFolder) {
1219 if (SHGetPathFromIDListA (ppfti->pidlTargetFolder, sTemp)) {
1220 __SHCloneStrA (&This->sPathTarget, sTemp);
1225 TRACE ("--(%p)->(target=%s)\n", This, debugstr_a (This->sPathTarget));
1226 pdump (This->pidlRoot);
1227 return (This->sPathTarget) ? S_OK : E_FAIL;
1230 static HRESULT WINAPI
1231 IFSFldr_PersistFolder3_GetFolderTargetInfo (IPersistFolder3 * iface, PERSIST_FOLDER_TARGET_INFO * ppfti)
1233 _ICOM_THIS_From_IPersistFolder3 (IGenericSFImpl, iface);
1234 FIXME ("(%p)->(%p)\n", This, ppfti);
1235 ZeroMemory (ppfti, sizeof (ppfti));
1239 static ICOM_VTABLE (IPersistFolder3) vt_FSFldr_PersistFolder3 =
1241 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1242 IFSFldr_PersistFolder3_QueryInterface,
1243 IFSFldr_PersistFolder3_AddRef,
1244 IFSFldr_PersistFolder3_Release,
1245 IFSFldr_PersistFolder3_GetClassID,
1246 IFSFldr_PersistFolder3_Initialize,
1247 IFSFldr_PersistFolder3_fnGetCurFolder,
1248 IFSFldr_PersistFolder3_InitializeEx,
1249 IFSFldr_PersistFolder3_GetFolderTargetInfo
1252 /****************************************************************************
1253 * ISFDropTarget implementation
1255 static BOOL ISFDropTarget_QueryDrop (IDropTarget * iface, DWORD dwKeyState, LPDWORD pdwEffect)
1257 DWORD dwEffect = *pdwEffect;
1259 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1261 *pdwEffect = DROPEFFECT_NONE;
1263 if (This->fAcceptFmt) { /* Does our interpretation of the keystate ... */
1264 *pdwEffect = KeyStateToDropEffect (dwKeyState);
1266 /* ... matches the desired effect ? */
1267 if (dwEffect & *pdwEffect) {
1274 static HRESULT WINAPI ISFDropTarget_QueryInterface (IDropTarget * iface, REFIID riid, LPVOID * ppvObj)
1276 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1278 TRACE ("(%p)\n", This);
1280 return IUnknown_QueryInterface (This->pUnkOuter, riid, ppvObj);
1283 static ULONG WINAPI ISFDropTarget_AddRef (IDropTarget * iface)
1285 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1287 TRACE ("(%p)\n", This);
1289 return IUnknown_AddRef (This->pUnkOuter);
1292 static ULONG WINAPI ISFDropTarget_Release (IDropTarget * iface)
1294 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1296 TRACE ("(%p)\n", This);
1298 return IUnknown_Release (This->pUnkOuter);
1301 static HRESULT WINAPI
1302 ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
1306 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1308 TRACE ("(%p)->(DataObject=%p)\n", This, pDataObject);
1310 InitFormatEtc (fmt, This->cfShellIDList, TYMED_HGLOBAL);
1312 This->fAcceptFmt = (S_OK == IDataObject_QueryGetData (pDataObject, &fmt)) ? TRUE : FALSE;
1314 ISFDropTarget_QueryDrop (iface, dwKeyState, pdwEffect);
1319 static HRESULT WINAPI ISFDropTarget_DragOver (IDropTarget * iface, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
1321 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1323 TRACE ("(%p)\n", This);
1326 return E_INVALIDARG;
1328 ISFDropTarget_QueryDrop (iface, dwKeyState, pdwEffect);
1333 static HRESULT WINAPI ISFDropTarget_DragLeave (IDropTarget * iface)
1335 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1337 TRACE ("(%p)\n", This);
1339 This->fAcceptFmt = FALSE;
1344 static HRESULT WINAPI
1345 ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect)
1347 _ICOM_THIS_From_IDropTarget (IGenericSFImpl, iface);
1349 FIXME ("(%p) object dropped\n", This);
1354 static struct ICOM_VTABLE (IDropTarget) dtvt = {
1355 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1356 ISFDropTarget_QueryInterface,
1357 ISFDropTarget_AddRef,
1358 ISFDropTarget_Release,
1359 ISFDropTarget_DragEnter,
1360 ISFDropTarget_DragOver,
1361 ISFDropTarget_DragLeave,