Ignore:
Timestamp:
Nov 10, 1999, 11:14:12 PM (26 years ago)
Author:
phaller
Message:

Add: updated to WINE19991108

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/shlfolder.cpp

    r1558 r1695  
    1 /* $Id: shlfolder.cpp,v 1.3 1999-11-02 20:38:47 phaller Exp $ */
     1/* $Id: shlfolder.cpp,v 1.4 1999-11-10 22:13:09 phaller Exp $ */
    22/*
    33 * Shell Folder stuff
     
    7878static HRESULT SHELL32_ParseNextElement(
    7979   HWND hwndOwner,
    80    IShellFolder * psf,
     80   IShellFolder2 * psf,
    8181   LPITEMIDLIST * pidlInOut,
    8282   LPOLESTR szNext,
     
    8686   HRESULT     hr = E_OUTOFMEMORY;
    8787   LPITEMIDLIST   pidlOut, pidlTemp = NULL;
    88    IShellFolder   *psfChild;
     88   IShellFolder  *psfChild;
    8989
    9090   TRACE("(%p %p %s)\n",psf, pidlInOut? *pidlInOut: NULL, debugstr_w(szNext));
     
    126126   HRESULT hr;
    127127   LPITEMIDLIST   absPidl;
    128    IShellFolder   *pShellFolder;
     128   IShellFolder2  *pShellFolder;
    129129   IPersistFolder *pPersistFolder;
    130130
     
    153153
    154154static HRESULT SHELL32_GetDisplayNameOfChild(
    155    IShellFolder * psf,
     155   IShellFolder2 * psf,
    156156   LPCITEMIDLIST pidl,
    157157   DWORD dwFlags,
     
    160160{
    161161   LPITEMIDLIST   pidlFirst, pidlNext;
    162    IShellFolder *                        psfChild;
     162   IShellFolder2 * psfChild;
    163163   HRESULT     hr = E_OUTOFMEMORY;
    164164   STRRET strTemp;
     
    196196typedef struct
    197197{
    198    ICOM_VTABLE(IShellFolder)*            lpvtbl;
     198   ICOM_VTABLE(IShellFolder2)*            lpvtbl;
    199199   DWORD          ref;
    200200
     
    211211} IGenericSFImpl;
    212212
    213 extern struct ICOM_VTABLE(IShellFolder) sfvt;
     213extern struct ICOM_VTABLE(IShellFolder2) sfvt;
    214214extern struct ICOM_VTABLE(IPersistFolder) psfvt;
    215215extern struct ICOM_VTABLE(IDropTarget) dt2vt;
     
    226226*  registers clipboardformat once
    227227*/
    228 static void SF_RegisterClipFmt (IShellFolder * iface)
     228static void SF_RegisterClipFmt (IShellFolder2 * iface)
    229229{
    230230   ICOM_THIS(IGenericSFImpl, iface);
     
    310310 */
    311311static HRESULT WINAPI IShellFolder_fnQueryInterface(
    312    IShellFolder * iface,
     312   IShellFolder2 * iface,
    313313   REFIID riid,
    314314   LPVOID *ppvObj)
     
    329329     *ppvObj = (IShellFolder*)This;
    330330   }
     331   else if(IsEqualIID(riid, &IID_IShellFolder2))
     332   {
     333     *ppvObj = (IShellFolder2*)This;
     334   }
    331335   else if(IsEqualIID(riid, &IID_IPersist))
    332336   {
     
    340344   {
    341345     *ppvObj = (IDropTarget*)&(This->lpvtblDropTarget);
    342      SF_RegisterClipFmt((IShellFolder*)This);
     346     SF_RegisterClipFmt((IShellFolder2*)This);
    343347   }
    344348
     
    357361*/
    358362
    359 static ULONG WINAPI IShellFolder_fnAddRef(IShellFolder * iface)
     363static ULONG WINAPI IShellFolder_fnAddRef(IShellFolder2 * iface)
    360364{
    361365   ICOM_THIS(IGenericSFImpl, iface);
     
    373377 *  IShellFolder_fnRelease
    374378 */
    375 static ULONG WINAPI IShellFolder_fnRelease(IShellFolder * iface)
     379static ULONG WINAPI IShellFolder_fnRelease(IShellFolder2 * iface)
    376380{
    377381   ICOM_THIS(IGenericSFImpl, iface);
     
    386390   { TRACE("-- destroying IShellFolder(%p)\n",This);
    387391
    388      if (pdesktopfolder == iface)
     392     if (pdesktopfolder == (IShellFolder*)iface)
    389393     { pdesktopfolder=NULL;
    390394       TRACE("-- destroyed IShellFolder(%p) was Desktopfolder\n",This);
     
    426430*/
    427431static HRESULT WINAPI IShellFolder_fnParseDisplayName(
    428    IShellFolder * iface,
     432   IShellFolder2 * iface,
    429433   HWND hwndOwner,
    430434   LPBC pbcReserved,
     
    469473       if (szNext && *szNext)
    470474       {
    471          hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);
     475         hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder2*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);
    472476       }
    473477       else
     
    493497*/
    494498static HRESULT WINAPI IShellFolder_fnEnumObjects(
    495    IShellFolder * iface,
     499   IShellFolder2 * iface,
    496500   HWND hwndOwner,
    497501   DWORD dwFlags,
     
    520524*  LPVOID*       ppvObject   //[out] Interface*
    521525*/
    522 static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder * iface, LPCITEMIDLIST pidl,
     526static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITEMIDLIST pidl,
    523527         LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
    524528{
     
    586590*/
    587591static HRESULT WINAPI IShellFolder_fnBindToStorage(
    588    IShellFolder * iface,
     592   IShellFolder2 * iface,
    589593   LPCITEMIDLIST pidl,
    590594   LPBC pbcReserved,
     
    620624
    621625static HRESULT WINAPI  IShellFolder_fnCompareIDs(
    622    IShellFolder * iface,
     626   IShellFolder2 * iface,
    623627   LPARAM lParam,
    624628   LPCITEMIDLIST pidl1,
     
    708712*  IShellFolder_fnCreateViewObject
    709713*/
    710 static HRESULT WINAPI IShellFolder_fnCreateViewObject( IShellFolder * iface,
     714static HRESULT WINAPI IShellFolder_fnCreateViewObject( IShellFolder2 * iface,
    711715       HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
    712716{
     
    756760*
    757761*/
    758 static HRESULT WINAPI IShellFolder_fnGetAttributesOf(IShellFolder * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
     762static HRESULT WINAPI IShellFolder_fnGetAttributesOf(IShellFolder2 * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
    759763{
    760764   ICOM_THIS(IGenericSFImpl, iface);
     
    812816*/
    813817static HRESULT WINAPI IShellFolder_fnGetUIObjectOf(
    814    IShellFolder * iface,
     818   IShellFolder2 * iface,
    815819   HWND     hwndOwner,
    816820   UINT     cidl,
     
    887891
    888892static HRESULT WINAPI IShellFolder_fnGetDisplayNameOf(
    889    IShellFolder * iface,
     893   IShellFolder2 * iface,
    890894   LPCITEMIDLIST pidl,
    891895   DWORD dwFlags,
     
    929933     len = strlen(szPath);
    930934
    931      if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder*)This, pidl, dwFlags, szPath + len, MAX_PATH - len)))
     935     if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder2*)This, pidl, dwFlags, szPath + len, MAX_PATH - len)))
    932936       return E_OUTOFMEMORY;
    933937   }
     
    952956*/
    953957static HRESULT WINAPI IShellFolder_fnSetNameOf(
    954    IShellFolder * iface,
     958   IShellFolder2 * iface,
    955959   HWND hwndOwner,
    956960   LPCITEMIDLIST pidl, /*simple pidl*/
     
    970974*  IShellFolder_fnGetFolderPath
    971975*/
    972 static HRESULT WINAPI IShellFolder_fnGetFolderPath(IShellFolder * iface, LPSTR lpszOut, DWORD dwOutSize)
     976static HRESULT WINAPI IShellFolder_fnGetFolderPath(IShellFolder2 * iface, LPSTR lpszOut, DWORD dwOutSize)
    973977{
    974978   ICOM_THIS(IGenericSFImpl, iface);
     
    988992}
    989993
    990 ICOM_VTABLE(IShellFolder) sfvt =
     994static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID(
     995   IShellFolder2 * iface,
     996   GUID *pguid)
     997{
     998   ICOM_THIS(IGenericSFImpl, iface);
     999   TRACE("(%p)\n",This);
     1000   return E_NOTIMPL;
     1001}
     1002static HRESULT WINAPI IShellFolder_fnEnumSearches(
     1003   IShellFolder2 * iface,
     1004   IEnumExtraSearch **ppenum)
     1005{
     1006   ICOM_THIS(IGenericSFImpl, iface);
     1007   TRACE("(%p)\n",This);
     1008   return E_NOTIMPL;
     1009}
     1010static HRESULT WINAPI IShellFolder_fnGetDefaultColumn(
     1011   IShellFolder2 * iface,
     1012   DWORD dwRes,
     1013   ULONG *pSort,
     1014   ULONG *pDisplay)
     1015{
     1016   ICOM_THIS(IGenericSFImpl, iface);
     1017   TRACE("(%p)\n",This);
     1018   return E_NOTIMPL;
     1019}
     1020static HRESULT WINAPI IShellFolder_fnGetDefaultColumnState(
     1021   IShellFolder2 * iface,
     1022   UINT iColumn,
     1023   DWORD *pcsFlags)
     1024{
     1025   ICOM_THIS(IGenericSFImpl, iface);
     1026   TRACE("(%p)\n",This);
     1027   return E_NOTIMPL;
     1028}
     1029static HRESULT WINAPI IShellFolder_fnGetDetailsEx(
     1030   IShellFolder2 * iface,
     1031   LPCITEMIDLIST pidl,
     1032   const SHCOLUMNID *pscid,
     1033   VARIANT *pv)
     1034{
     1035   ICOM_THIS(IGenericSFImpl, iface);
     1036   TRACE("(%p)\n",This);
     1037   return E_NOTIMPL;
     1038}
     1039static HRESULT WINAPI IShellFolder_fnGetDetailsOf(
     1040   IShellFolder2 * iface,
     1041   LPCITEMIDLIST pidl,
     1042   UINT iColumn,
     1043   SHELLDETAILS *psd)
     1044{
     1045   ICOM_THIS(IGenericSFImpl, iface);
     1046   TRACE("(%p)\n",This);
     1047   return E_NOTIMPL;
     1048}
     1049static HRESULT WINAPI IShellFolder_fnMapNameToSCID(
     1050   IShellFolder2 * iface,
     1051   LPCWSTR pwszName,
     1052   SHCOLUMNID *pscid)
     1053{
     1054   ICOM_THIS(IGenericSFImpl, iface);
     1055   TRACE("(%p)\n",This);
     1056   return E_NOTIMPL;
     1057}
     1058
     1059
     1060
     1061ICOM_VTABLE(IShellFolder2) sfvt =
    9911062{
    9921063   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     
    10041075   IShellFolder_fnGetDisplayNameOf,
    10051076   IShellFolder_fnSetNameOf,
    1006    IShellFolder_fnGetFolderPath
     1077
     1078   /* ShellFolder2 */
     1079   IShellFolder_fnGetDefaultSearchGUID,
     1080   IShellFolder_fnEnumSearches,
     1081   IShellFolder_fnGetDefaultColumn,
     1082   IShellFolder_fnGetDefaultColumnState,
     1083   IShellFolder_fnGetDetailsEx,
     1084   IShellFolder_fnGetDetailsOf,
     1085   IShellFolder_fnMapNameToSCID
    10071086};
    10081087
     
    10101089*  [Desktopfolder]                       IShellFolder implementation
    10111090*/
    1012 extern struct ICOM_VTABLE(IShellFolder) sfdvt;
     1091extern struct ICOM_VTABLE(IShellFolder2) sfdvt;
    10131092
    10141093/**************************************************************************
     
    10371116 */
    10381117static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
    1039    IShellFolder * iface,
     1118   IShellFolder2 * iface,
    10401119   REFIID riid,
    10411120   LPVOID *ppvObj)
     
    10541133   else if(IsEqualIID(riid, &IID_IShellFolder))  /*IShellFolder*/
    10551134   {    *ppvObj = (IShellFolder*)This;
     1135   }
     1136   else if(IsEqualIID(riid, &IID_IShellFolder2))  /*IShellFolder2*/
     1137   {    *ppvObj = (IShellFolder2*)This;
    10561138   }
    10571139
     
    10741156*/
    10751157static HRESULT WINAPI ISF_Desktop_fnParseDisplayName(
    1076    IShellFolder * iface,
     1158   IShellFolder2 * iface,
    10771159   HWND hwndOwner,
    10781160   LPBC pbcReserved,
     
    11011183   if (szNext && *szNext)
    11021184   {
    1103      hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);
     1185     hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder2*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);
    11041186   }
    11051187   else
     
    11191201*/
    11201202static HRESULT WINAPI ISF_Desktop_fnEnumObjects(
    1121    IShellFolder * iface,
     1203   IShellFolder2 * iface,
    11221204   HWND hwndOwner,
    11231205   DWORD dwFlags,
     
    11411223*     ISF_Desktop_fnBindToObject
    11421224*/
    1143 static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder * iface, LPCITEMIDLIST pidl,
     1225static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEMIDLIST pidl,
    11441226         LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
    11451227{
     
    11971279*  ISF_Desktop_fnCreateViewObject
    11981280*/
    1199 static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder * iface,
     1281static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder2 * iface,
    12001282       HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
    12011283{
     
    12401322*  ISF_Desktop_fnGetAttributesOf
    12411323*/
    1242 static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf(IShellFolder * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
     1324static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf(IShellFolder2 * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
    12431325{
    12441326   ICOM_THIS(IGenericSFImpl, iface);
     
    13021384*/
    13031385static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf(
    1304    IShellFolder * iface,
     1386   IShellFolder2 * iface,
    13051387   LPCITEMIDLIST pidl,
    13061388   DWORD dwFlags,
     
    13261408   else
    13271409   {
    1328      if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder*)This, pidl, dwFlags, szPath, MAX_PATH)))
     1410     if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder2*)This, pidl, dwFlags, szPath, MAX_PATH)))
    13291411       return E_OUTOFMEMORY;
    13301412   }
     
    13371419}
    13381420
    1339 ICOM_VTABLE(IShellFolder) sfdvt =
     1421ICOM_VTABLE(IShellFolder2) sfdvt =
    13401422{
    13411423   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     
    13531435   ISF_Desktop_fnGetDisplayNameOf,
    13541436   IShellFolder_fnSetNameOf,
    1355    IShellFolder_fnGetFolderPath
     1437
     1438   /* ShellFolder2 */
     1439   IShellFolder_fnGetDefaultSearchGUID,
     1440   IShellFolder_fnEnumSearches,
     1441   IShellFolder_fnGetDefaultColumn,
     1442   IShellFolder_fnGetDefaultColumnState,
     1443   IShellFolder_fnGetDetailsEx,
     1444   IShellFolder_fnGetDetailsOf,
     1445   IShellFolder_fnMapNameToSCID
    13561446};
    13571447
     
    13611451*/
    13621452
    1363 extern struct ICOM_VTABLE(IShellFolder) sfmcvt;
     1453extern struct ICOM_VTABLE(IShellFolder2) sfmcvt;
    13641454
    13651455/**************************************************************************
     
    13881478*/
    13891479static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName(
    1390    IShellFolder * iface,
     1480   IShellFolder2 * iface,
    13911481   HWND hwndOwner,
    13921482   LPBC pbcReserved,
     
    14191509     if (szNext && *szNext)
    14201510     {
    1421        hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);
     1511       hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder2*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);
    14221512     }
    14231513     else
     
    14371527*/
    14381528static HRESULT WINAPI ISF_MyComputer_fnEnumObjects(
    1439    IShellFolder * iface,
     1529   IShellFolder2 * iface,
    14401530   HWND hwndOwner,
    14411531   DWORD dwFlags,
     
    14591549*     ISF_MyComputer_fnBindToObject
    14601550*/
    1461 static HRESULT WINAPI ISF_MyComputer_fnBindToObject( IShellFolder * iface, LPCITEMIDLIST pidl,
     1551static HRESULT WINAPI ISF_MyComputer_fnBindToObject( IShellFolder2 * iface, LPCITEMIDLIST pidl,
    14621552         LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
    14631553{
     
    15111601*  ISF_MyComputer_fnCreateViewObject
    15121602*/
    1513 static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder * iface,
     1603static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder2 * iface,
    15141604       HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
    15151605{
     
    15541644*  ISF_MyComputer_fnGetAttributesOf
    15551645*/
    1556 static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf(IShellFolder * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
     1646static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf(IShellFolder2 * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
    15571647{
    15581648   ICOM_THIS(IGenericSFImpl, iface);
     
    16041694*/
    16051695static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf(
    1606    IShellFolder * iface,
     1696   IShellFolder2 * iface,
    16071697   LPCITEMIDLIST pidl,
    16081698   DWORD dwFlags,
     
    16611751     len = strlen(szPath);
    16621752
    1663      if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder*)This, pidl, dwFlags | SHGDN_FORPARSING, szPath + len, MAX_PATH - len)))
     1753     if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder2*)This, pidl, dwFlags | SHGDN_FORPARSING, szPath + len, MAX_PATH - len)))
    16641754       return E_OUTOFMEMORY;
    16651755   }
     
    16721762}
    16731763
    1674 ICOM_VTABLE(IShellFolder) sfmcvt =
     1764ICOM_VTABLE(IShellFolder2) sfmcvt =
    16751765{
    16761766   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     
    16881778   ISF_MyComputer_fnGetDisplayNameOf,
    16891779   IShellFolder_fnSetNameOf,
    1690    IShellFolder_fnGetFolderPath
     1780
     1781   /* ShellFolder2 */
     1782   IShellFolder_fnGetDefaultSearchGUID,
     1783   IShellFolder_fnEnumSearches,
     1784   IShellFolder_fnGetDefaultColumn,
     1785   IShellFolder_fnGetDefaultColumnState,
     1786   IShellFolder_fnGetDetailsEx,
     1787   IShellFolder_fnGetDetailsOf,
     1788   IShellFolder_fnMapNameToSCID
    16911789};
    16921790
Note: See TracChangeset for help on using the changeset viewer.