Changeset 3243 for trunk/src/shell32/folders.cpp
- Timestamp:
- Mar 26, 2000, 6:34:57 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/folders.cpp
r1214 r3243 1 /* $Id: folders.cpp,v 1. 1 1999-10-09 11:13:19 sandervlExp $ */1 /* $Id: folders.cpp,v 1.2 2000-03-26 16:34:41 cbratschi Exp $ */ 2 2 3 3 /* … … 7 7 * Project Odin Software License can be found in LICENSE.TXT 8 8 * 9 * Corel WINE 20000324 level 9 10 */ 10 11 11 12 /* 12 * Copyright 1997Marcus Meissner13 * Copyright 1998Juergen Schmied13 * Copyright 1997 Marcus Meissner 14 * Copyright 1998 Juergen Schmied 14 15 * 15 16 */ … … 49 50 50 51 typedef struct 51 { ICOM_VTABLE(IExtractIconA)*lpvtbl;52 DWORDref;53 ICOM_VTABLE(IPersistFile)*lpvtblPersistFile;54 LPITEMIDLISTpidl;52 { ICOM_VTABLE(IExtractIconA)* lpvtbl; 53 DWORD ref; 54 ICOM_VTABLE(IPersistFile)* lpvtblPersistFile; 55 LPITEMIDLIST pidl; 55 56 } IExtractIconAImpl; 56 57 … … 66 67 static HRESULT WINAPI IExtractIconA_fnQueryInterface( IExtractIconA * iface, REFIID riid, LPVOID *ppvObj) 67 68 { 68 69 70 charxriid[50];71 72 69 ICOM_THIS(IExtractIconAImpl,iface); 70 71 char xriid[50]; 72 WINE_StringFromCLSID((LPCLSID)riid,xriid); 73 dprintf(("SHELL32:folders IExtractIconA_fnQueryInterface(%p)->(\n\tIID:\t%s,%p)\n", 73 74 This, 74 75 xriid, 75 76 ppvObj)); 76 77 77 78 79 if(IsEqualIID(riid, &IID_IUnknown))/*IUnknown*/80 81 82 else if(IsEqualIID(riid, &IID_IPersistFile))/*IExtractIcon*/83 84 85 else if(IsEqualIID(riid, &IID_IExtractIconA))/*IExtractIcon*/86 87 88 89 90 { IExtractIconA_AddRef((IExtractIconA*) *ppvObj); 91 92 93 94 95 78 *ppvObj = NULL; 79 80 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 81 { *ppvObj = This; 82 } 83 else if(IsEqualIID(riid, &IID_IPersistFile)) /*IExtractIcon*/ 84 { *ppvObj = (IPersistFile*)&(This->lpvtblPersistFile); 85 } 86 else if(IsEqualIID(riid, &IID_IExtractIconA)) /*IExtractIcon*/ 87 { *ppvObj = (IExtractIconA*)This; 88 } 89 90 if(*ppvObj) 91 { IExtractIconA_AddRef((IExtractIconA*) *ppvObj); 92 dprintf(("SHELL32:folders IExtractIconA_fnQueryInterface-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj)); 93 return S_OK; 94 } 95 dprintf(("SHELL32:folders IExtractIconA_fnQueryInterface-- Interface: E_NOINTERFACE\n")); 96 return E_NOINTERFACE; 96 97 } 97 98 … … 101 102 static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface) 102 103 { 103 104 105 104 ICOM_THIS(IExtractIconAImpl,iface); 105 106 dprintf(("SHELL32:folders IExtractIconA_fnAddRef(%p)->(count=%lu)\n", 106 107 This, 107 108 This->ref)); 108 109 109 110 111 110 shell32_ObjCount++; 111 112 return ++(This->ref); 112 113 } 113 114 /************************************************************************** … … 116 117 static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface) 117 118 { 118 119 120 119 ICOM_THIS(IExtractIconAImpl,iface); 120 121 dprintf(("SHELL32:folders IExtractIconA_fnRelease(%p)->()\n", 121 122 This)); 122 123 123 124 125 126 124 shell32_ObjCount--; 125 126 if (!--(This->ref)) 127 { dprintf(("SHELL32:folders IExtractIconA_fnRelease destroying IExtractIcon(%p)\n", 127 128 This)); 128 129 130 131 132 129 SHFree(This->pidl); 130 HeapFree(GetProcessHeap(),0,This); 131 return 0; 132 } 133 return This->ref; 133 134 } 134 135 /************************************************************************** … … 138 139 */ 139 140 static HRESULT WINAPI IExtractIconA_fnGetIconLocation( 140 141 142 143 144 145 146 { 147 148 149 charsTemp[MAX_PATH];150 DWORDdwNr;151 152 LPITEMIDLISTpSimplePidl = ILFindLastID(This->pidl);153 154 141 IExtractIconA * iface, 142 UINT uFlags, 143 LPSTR szIconFile, 144 UINT cchMax, 145 int * piIndex, 146 UINT * pwFlags) 147 { 148 ICOM_THIS(IExtractIconAImpl,iface); 149 150 char sTemp[MAX_PATH]; 151 DWORD dwNr; 152 GUID const * riid; 153 LPITEMIDLIST pSimplePidl = ILFindLastID(This->pidl); 154 155 dprintf(("SHELL32:folders IExtractIconA_fnGetIconLocation(%p) (flags=%u %p %u %p %p)\n", 155 156 This, 156 157 uFlags, … … 160 161 pwFlags)); 161 162 162 163 164 165 166 167 168 169 170 171 172 else if ( (riid = _ILGetGUIDPointer(pSimplePidl)))173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 } 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 else/* object is file */217 218 219 220 221 222 if (!strcmp("%1",sTemp))/* icon is in the file */223 224 225 226 227 228 229 230 else/* default icon */231 232 233 234 235 236 237 163 if (pwFlags) 164 *pwFlags = 0; 165 166 if (_ILIsDesktop(pSimplePidl)) 167 { 168 lstrcpynA(szIconFile, "shell32.dll", cchMax); 169 *piIndex = 34; 170 } 171 172 /* my computer and other shell extensions */ 173 else if (riid = _ILGetGUIDPointer(pSimplePidl)) 174 { 175 char xriid[50]; 176 strcpy(xriid,"CLSID\\"); 177 WINE_StringFromCLSID((LPCLSID)riid,&xriid[strlen(xriid)]); 178 179 if (HCR_GetDefaultIcon(xriid, sTemp, MAX_PATH, &dwNr)) 180 { 181 lstrcpynA(szIconFile, sTemp, cchMax); 182 *piIndex = dwNr; 183 } 184 else 185 { 186 lstrcpynA(szIconFile, "shell32.dll", cchMax); 187 *piIndex = 15; 188 } 189 190 } 191 else if (_ILIsDrive (pSimplePidl)) 192 { 193 if (HCR_GetDefaultIcon("Drive", sTemp, MAX_PATH, &dwNr)) 194 { 195 lstrcpynA(szIconFile, sTemp, cchMax); 196 *piIndex = dwNr; 197 } 198 else 199 { 200 lstrcpynA(szIconFile, "shell32.dll", cchMax); 201 *piIndex = 8; 202 } 203 } 204 else if (_ILIsFolder (pSimplePidl)) 205 { 206 if (HCR_GetDefaultIcon("Folder", sTemp, MAX_PATH, &dwNr)) 207 { 208 lstrcpynA(szIconFile, sTemp, cchMax); 209 *piIndex = dwNr; 210 } 211 else 212 { 213 lstrcpynA(szIconFile, "shell32.dll", cchMax); 214 *piIndex = 3; 215 } 216 } 217 else /* object is file */ 218 { 219 if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH) 220 && HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH, TRUE) 221 && HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr)) 222 { 223 if (!strcmp("%1",sTemp)) /* icon is in the file */ 224 { 225 SHGetPathFromIDListA(This->pidl, sTemp); 226 dwNr = 0; 227 } 228 lstrcpynA(szIconFile, sTemp, cchMax); 229 *piIndex = dwNr; 230 } 231 else /* default icon */ 232 { 233 lstrcpynA(szIconFile, "shell32.dll", cchMax); 234 *piIndex = 0; 235 } 236 } 237 238 dprintf(("SHELL32:folders IExtractIconA_fnGetIconLocation -- %s %x\n", 238 239 szIconFile, 239 240 *piIndex)); 240 241 return NOERROR; 241 242 } 242 243 /************************************************************************** … … 245 246 static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) 246 247 { 247 248 249 248 ICOM_THIS(IExtractIconAImpl,iface); 249 250 dprintf(("SHELL32:folders IExtractIconA_fnExtract (%p) (file=%p index=%u %p %p size=%u) semi-stub\n", 250 251 This, 251 252 pszFile, … … 255 256 nIconSize)); 256 257 257 258 259 260 261 262 263 258 if (phiconLarge) 259 *phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT); 260 261 if (phiconSmall) 262 *phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT); 263 264 return S_OK; 264 265 } 265 266 266 267 static struct ICOM_VTABLE(IExtractIconA) eivt = 267 { 268 269 270 271 272 273 268 { 269 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 270 IExtractIconA_fnQueryInterface, 271 IExtractIconA_fnAddRef, 272 IExtractIconA_fnRelease, 273 IExtractIconA_fnGetIconLocation, 274 IExtractIconA_fnExtract 274 275 }; 275 276 … … 279 280 */ 280 281 static HRESULT WINAPI IEIPersistFile_fnQueryInterface( 281 IPersistFile*iface,282 REFIIDiid,283 LPVOID*ppvObj)284 { 285 286 287 282 IPersistFile *iface, 283 REFIID iid, 284 LPVOID *ppvObj) 285 { 286 _ICOM_THIS_From_IPersistFile(IExtractIconA, iface); 287 288 return IShellFolder_QueryInterface((IExtractIconA*)This, iid, ppvObj); 288 289 } 289 290 … … 292 293 */ 293 294 static ULONG WINAPI IEIPersistFile_fnAddRef( 294 IPersistFile*iface)295 { 296 297 298 295 IPersistFile *iface) 296 { 297 _ICOM_THIS_From_IPersistFile(IExtractIconA, iface); 298 299 return IExtractIconA_AddRef((IExtractIconA*)This); 299 300 } 300 301 … … 303 304 */ 304 305 static ULONG WINAPI IEIPersistFile_fnRelease( 305 IPersistFile*iface)306 { 307 308 309 306 IPersistFile *iface) 307 { 308 _ICOM_THIS_From_IPersistFile(IExtractIconA, iface); 309 310 return IExtractIconA_Release((IExtractIconA*)This); 310 311 } 311 312 … … 314 315 */ 315 316 static HRESULT WINAPI IEIPersistFile_fnGetClassID( 316 IPersistFile*iface,317 LPCLSIDlpClassId)318 { 319 320 321 322 323 324 325 326 317 IPersistFile *iface, 318 LPCLSID lpClassId) 319 { 320 CLSID StdFolderID = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; 321 322 if (lpClassId==NULL) 323 return E_POINTER; 324 325 memcpy(lpClassId, &StdFolderID, sizeof(StdFolderID)); 326 327 return S_OK; 327 328 } 328 329 … … 342 343 static HRESULT WINAPI IEIPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode) 343 344 { 344 345 346 345 _ICOM_THIS_From_IPersistFile(IExtractIconA, iface); 346 FIXME("%p\n", This); 347 return E_NOTIMPL; 347 348 348 349 } … … 380 381 static struct ICOM_VTABLE(IPersistFile) pfvt = 381 382 { 382 383 384 385 386 387 388 389 390 391 383 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 384 IEIPersistFile_fnQueryInterface, 385 IEIPersistFile_fnAddRef, 386 IEIPersistFile_fnRelease, 387 IEIPersistFile_fnGetClassID, 388 IEIPersistFile_fnIsDirty, /* IEIPersistFile_fnIsDirty */ 389 IEIPersistFile_fnLoad, 390 IEIPersistFile_fnSave, /* IEIPersistFile_fnSave */ 391 IEIPersistFile_fnSaveCompleted, /* IEIPersistFile_fnSaveCompleted */ 392 IEIPersistFile_fnGetCurFile /* IEIPersistFile_fnGetCurFile */ 392 393 }; 393 394 … … 397 398 IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl) 398 399 { 399 400 401 402 403 404 405 406 407 408 409 400 IExtractIconAImpl* ei; 401 402 ei=(IExtractIconAImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconAImpl)); 403 ei->ref=1; 404 ei->lpvtbl = &eivt; 405 ei->lpvtblPersistFile = &pfvt; 406 ei->pidl=ILClone(pidl); 407 408 pdump(pidl); 409 410 dprintf(("SHELL32:folders IExtractIconA_Constructor(%p)\n", 410 411 ei)); 411 412 413 } 414 415 412 shell32_ObjCount++; 413 return (IExtractIconA *)ei; 414 } 415 416
Note:
See TracChangeset
for help on using the changeset viewer.