Changeset 1695 for trunk/src/shell32/shlfolder.cpp
- Timestamp:
- Nov 10, 1999, 11:14:12 PM (26 years ago)
- 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:47phaller Exp $ */1 /* $Id: shlfolder.cpp,v 1.4 1999-11-10 22:13:09 phaller Exp $ */ 2 2 /* 3 3 * Shell Folder stuff … … 78 78 static HRESULT SHELL32_ParseNextElement( 79 79 HWND hwndOwner, 80 IShellFolder * psf,80 IShellFolder2 * psf, 81 81 LPITEMIDLIST * pidlInOut, 82 82 LPOLESTR szNext, … … 86 86 HRESULT hr = E_OUTOFMEMORY; 87 87 LPITEMIDLIST pidlOut, pidlTemp = NULL; 88 IShellFolder 88 IShellFolder *psfChild; 89 89 90 90 TRACE("(%p %p %s)\n",psf, pidlInOut? *pidlInOut: NULL, debugstr_w(szNext)); … … 126 126 HRESULT hr; 127 127 LPITEMIDLIST absPidl; 128 IShellFolder 128 IShellFolder2 *pShellFolder; 129 129 IPersistFolder *pPersistFolder; 130 130 … … 153 153 154 154 static HRESULT SHELL32_GetDisplayNameOfChild( 155 IShellFolder * psf,155 IShellFolder2 * psf, 156 156 LPCITEMIDLIST pidl, 157 157 DWORD dwFlags, … … 160 160 { 161 161 LPITEMIDLIST pidlFirst, pidlNext; 162 IShellFolder *psfChild;162 IShellFolder2 * psfChild; 163 163 HRESULT hr = E_OUTOFMEMORY; 164 164 STRRET strTemp; … … 196 196 typedef struct 197 197 { 198 ICOM_VTABLE(IShellFolder )* lpvtbl;198 ICOM_VTABLE(IShellFolder2)* lpvtbl; 199 199 DWORD ref; 200 200 … … 211 211 } IGenericSFImpl; 212 212 213 extern struct ICOM_VTABLE(IShellFolder ) sfvt;213 extern struct ICOM_VTABLE(IShellFolder2) sfvt; 214 214 extern struct ICOM_VTABLE(IPersistFolder) psfvt; 215 215 extern struct ICOM_VTABLE(IDropTarget) dt2vt; … … 226 226 * registers clipboardformat once 227 227 */ 228 static void SF_RegisterClipFmt (IShellFolder * iface)228 static void SF_RegisterClipFmt (IShellFolder2 * iface) 229 229 { 230 230 ICOM_THIS(IGenericSFImpl, iface); … … 310 310 */ 311 311 static HRESULT WINAPI IShellFolder_fnQueryInterface( 312 IShellFolder * iface,312 IShellFolder2 * iface, 313 313 REFIID riid, 314 314 LPVOID *ppvObj) … … 329 329 *ppvObj = (IShellFolder*)This; 330 330 } 331 else if(IsEqualIID(riid, &IID_IShellFolder2)) 332 { 333 *ppvObj = (IShellFolder2*)This; 334 } 331 335 else if(IsEqualIID(riid, &IID_IPersist)) 332 336 { … … 340 344 { 341 345 *ppvObj = (IDropTarget*)&(This->lpvtblDropTarget); 342 SF_RegisterClipFmt((IShellFolder *)This);346 SF_RegisterClipFmt((IShellFolder2*)This); 343 347 } 344 348 … … 357 361 */ 358 362 359 static ULONG WINAPI IShellFolder_fnAddRef(IShellFolder * iface)363 static ULONG WINAPI IShellFolder_fnAddRef(IShellFolder2 * iface) 360 364 { 361 365 ICOM_THIS(IGenericSFImpl, iface); … … 373 377 * IShellFolder_fnRelease 374 378 */ 375 static ULONG WINAPI IShellFolder_fnRelease(IShellFolder * iface)379 static ULONG WINAPI IShellFolder_fnRelease(IShellFolder2 * iface) 376 380 { 377 381 ICOM_THIS(IGenericSFImpl, iface); … … 386 390 { TRACE("-- destroying IShellFolder(%p)\n",This); 387 391 388 if (pdesktopfolder == iface)392 if (pdesktopfolder == (IShellFolder*)iface) 389 393 { pdesktopfolder=NULL; 390 394 TRACE("-- destroyed IShellFolder(%p) was Desktopfolder\n",This); … … 426 430 */ 427 431 static HRESULT WINAPI IShellFolder_fnParseDisplayName( 428 IShellFolder * iface,432 IShellFolder2 * iface, 429 433 HWND hwndOwner, 430 434 LPBC pbcReserved, … … 469 473 if (szNext && *szNext) 470 474 { 471 hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder *)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);475 hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder2*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes); 472 476 } 473 477 else … … 493 497 */ 494 498 static HRESULT WINAPI IShellFolder_fnEnumObjects( 495 IShellFolder * iface,499 IShellFolder2 * iface, 496 500 HWND hwndOwner, 497 501 DWORD dwFlags, … … 520 524 * LPVOID* ppvObject //[out] Interface* 521 525 */ 522 static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder * iface, LPCITEMIDLIST pidl,526 static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITEMIDLIST pidl, 523 527 LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) 524 528 { … … 586 590 */ 587 591 static HRESULT WINAPI IShellFolder_fnBindToStorage( 588 IShellFolder * iface,592 IShellFolder2 * iface, 589 593 LPCITEMIDLIST pidl, 590 594 LPBC pbcReserved, … … 620 624 621 625 static HRESULT WINAPI IShellFolder_fnCompareIDs( 622 IShellFolder * iface,626 IShellFolder2 * iface, 623 627 LPARAM lParam, 624 628 LPCITEMIDLIST pidl1, … … 708 712 * IShellFolder_fnCreateViewObject 709 713 */ 710 static HRESULT WINAPI IShellFolder_fnCreateViewObject( IShellFolder * iface,714 static HRESULT WINAPI IShellFolder_fnCreateViewObject( IShellFolder2 * iface, 711 715 HWND hwndOwner, REFIID riid, LPVOID *ppvOut) 712 716 { … … 756 760 * 757 761 */ 758 static HRESULT WINAPI IShellFolder_fnGetAttributesOf(IShellFolder * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)762 static HRESULT WINAPI IShellFolder_fnGetAttributesOf(IShellFolder2 * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut) 759 763 { 760 764 ICOM_THIS(IGenericSFImpl, iface); … … 812 816 */ 813 817 static HRESULT WINAPI IShellFolder_fnGetUIObjectOf( 814 IShellFolder * iface,818 IShellFolder2 * iface, 815 819 HWND hwndOwner, 816 820 UINT cidl, … … 887 891 888 892 static HRESULT WINAPI IShellFolder_fnGetDisplayNameOf( 889 IShellFolder * iface,893 IShellFolder2 * iface, 890 894 LPCITEMIDLIST pidl, 891 895 DWORD dwFlags, … … 929 933 len = strlen(szPath); 930 934 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))) 932 936 return E_OUTOFMEMORY; 933 937 } … … 952 956 */ 953 957 static HRESULT WINAPI IShellFolder_fnSetNameOf( 954 IShellFolder * iface,958 IShellFolder2 * iface, 955 959 HWND hwndOwner, 956 960 LPCITEMIDLIST pidl, /*simple pidl*/ … … 970 974 * IShellFolder_fnGetFolderPath 971 975 */ 972 static HRESULT WINAPI IShellFolder_fnGetFolderPath(IShellFolder * iface, LPSTR lpszOut, DWORD dwOutSize)976 static HRESULT WINAPI IShellFolder_fnGetFolderPath(IShellFolder2 * iface, LPSTR lpszOut, DWORD dwOutSize) 973 977 { 974 978 ICOM_THIS(IGenericSFImpl, iface); … … 988 992 } 989 993 990 ICOM_VTABLE(IShellFolder) sfvt = 994 static 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 } 1002 static 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 } 1010 static 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 } 1020 static 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 } 1029 static 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 } 1039 static 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 } 1049 static 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 1061 ICOM_VTABLE(IShellFolder2) sfvt = 991 1062 { 992 1063 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE … … 1004 1075 IShellFolder_fnGetDisplayNameOf, 1005 1076 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 1007 1086 }; 1008 1087 … … 1010 1089 * [Desktopfolder] IShellFolder implementation 1011 1090 */ 1012 extern struct ICOM_VTABLE(IShellFolder ) sfdvt;1091 extern struct ICOM_VTABLE(IShellFolder2) sfdvt; 1013 1092 1014 1093 /************************************************************************** … … 1037 1116 */ 1038 1117 static HRESULT WINAPI ISF_Desktop_fnQueryInterface( 1039 IShellFolder * iface,1118 IShellFolder2 * iface, 1040 1119 REFIID riid, 1041 1120 LPVOID *ppvObj) … … 1054 1133 else if(IsEqualIID(riid, &IID_IShellFolder)) /*IShellFolder*/ 1055 1134 { *ppvObj = (IShellFolder*)This; 1135 } 1136 else if(IsEqualIID(riid, &IID_IShellFolder2)) /*IShellFolder2*/ 1137 { *ppvObj = (IShellFolder2*)This; 1056 1138 } 1057 1139 … … 1074 1156 */ 1075 1157 static HRESULT WINAPI ISF_Desktop_fnParseDisplayName( 1076 IShellFolder * iface,1158 IShellFolder2 * iface, 1077 1159 HWND hwndOwner, 1078 1160 LPBC pbcReserved, … … 1101 1183 if (szNext && *szNext) 1102 1184 { 1103 hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder *)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);1185 hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder2*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes); 1104 1186 } 1105 1187 else … … 1119 1201 */ 1120 1202 static HRESULT WINAPI ISF_Desktop_fnEnumObjects( 1121 IShellFolder * iface,1203 IShellFolder2 * iface, 1122 1204 HWND hwndOwner, 1123 1205 DWORD dwFlags, … … 1141 1223 * ISF_Desktop_fnBindToObject 1142 1224 */ 1143 static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder * iface, LPCITEMIDLIST pidl,1225 static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEMIDLIST pidl, 1144 1226 LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) 1145 1227 { … … 1197 1279 * ISF_Desktop_fnCreateViewObject 1198 1280 */ 1199 static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder * iface,1281 static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder2 * iface, 1200 1282 HWND hwndOwner, REFIID riid, LPVOID *ppvOut) 1201 1283 { … … 1240 1322 * ISF_Desktop_fnGetAttributesOf 1241 1323 */ 1242 static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf(IShellFolder * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)1324 static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf(IShellFolder2 * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut) 1243 1325 { 1244 1326 ICOM_THIS(IGenericSFImpl, iface); … … 1302 1384 */ 1303 1385 static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf( 1304 IShellFolder * iface,1386 IShellFolder2 * iface, 1305 1387 LPCITEMIDLIST pidl, 1306 1388 DWORD dwFlags, … … 1326 1408 else 1327 1409 { 1328 if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder *)This, pidl, dwFlags, szPath, MAX_PATH)))1410 if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild((IShellFolder2*)This, pidl, dwFlags, szPath, MAX_PATH))) 1329 1411 return E_OUTOFMEMORY; 1330 1412 } … … 1337 1419 } 1338 1420 1339 ICOM_VTABLE(IShellFolder ) sfdvt =1421 ICOM_VTABLE(IShellFolder2) sfdvt = 1340 1422 { 1341 1423 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE … … 1353 1435 ISF_Desktop_fnGetDisplayNameOf, 1354 1436 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 1356 1446 }; 1357 1447 … … 1361 1451 */ 1362 1452 1363 extern struct ICOM_VTABLE(IShellFolder ) sfmcvt;1453 extern struct ICOM_VTABLE(IShellFolder2) sfmcvt; 1364 1454 1365 1455 /************************************************************************** … … 1388 1478 */ 1389 1479 static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName( 1390 IShellFolder * iface,1480 IShellFolder2 * iface, 1391 1481 HWND hwndOwner, 1392 1482 LPBC pbcReserved, … … 1419 1509 if (szNext && *szNext) 1420 1510 { 1421 hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder *)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes);1511 hr = SHELL32_ParseNextElement(hwndOwner, (IShellFolder2*)This, &pidlTemp, (LPOLESTR)szNext, pchEaten, pdwAttributes); 1422 1512 } 1423 1513 else … … 1437 1527 */ 1438 1528 static HRESULT WINAPI ISF_MyComputer_fnEnumObjects( 1439 IShellFolder * iface,1529 IShellFolder2 * iface, 1440 1530 HWND hwndOwner, 1441 1531 DWORD dwFlags, … … 1459 1549 * ISF_MyComputer_fnBindToObject 1460 1550 */ 1461 static HRESULT WINAPI ISF_MyComputer_fnBindToObject( IShellFolder * iface, LPCITEMIDLIST pidl,1551 static HRESULT WINAPI ISF_MyComputer_fnBindToObject( IShellFolder2 * iface, LPCITEMIDLIST pidl, 1462 1552 LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) 1463 1553 { … … 1511 1601 * ISF_MyComputer_fnCreateViewObject 1512 1602 */ 1513 static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder * iface,1603 static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder2 * iface, 1514 1604 HWND hwndOwner, REFIID riid, LPVOID *ppvOut) 1515 1605 { … … 1554 1644 * ISF_MyComputer_fnGetAttributesOf 1555 1645 */ 1556 static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf(IShellFolder * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)1646 static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf(IShellFolder2 * iface,UINT cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut) 1557 1647 { 1558 1648 ICOM_THIS(IGenericSFImpl, iface); … … 1604 1694 */ 1605 1695 static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf( 1606 IShellFolder * iface,1696 IShellFolder2 * iface, 1607 1697 LPCITEMIDLIST pidl, 1608 1698 DWORD dwFlags, … … 1661 1751 len = strlen(szPath); 1662 1752 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))) 1664 1754 return E_OUTOFMEMORY; 1665 1755 } … … 1672 1762 } 1673 1763 1674 ICOM_VTABLE(IShellFolder ) sfmcvt =1764 ICOM_VTABLE(IShellFolder2) sfmcvt = 1675 1765 { 1676 1766 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE … … 1688 1778 ISF_MyComputer_fnGetDisplayNameOf, 1689 1779 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 1691 1789 }; 1692 1790
Note:
See TracChangeset
for help on using the changeset viewer.