[8614] | 1 | /* $Id: folders.c,v 1.9 2002-06-09 12:41:20 sandervl Exp $ */
|
---|
[4121] | 2 | /*
|
---|
[4691] | 3 | * Copyright 1997 Marcus Meissner
|
---|
| 4 | * Copyright 1998 Juergen Schmied
|
---|
[4121] | 5 | *
|
---|
| 6 | */
|
---|
| 7 | #ifdef __WIN32OS2__
|
---|
[21494] | 8 | #define CINTERFACE
|
---|
[4121] | 9 | #include <odin.h>
|
---|
[4691] | 10 | #include "shellicon.h"
|
---|
[4121] | 11 | #endif
|
---|
| 12 |
|
---|
| 13 | #include <stdlib.h>
|
---|
| 14 | #include <stdio.h>
|
---|
| 15 | #include <string.h>
|
---|
| 16 |
|
---|
| 17 | #include "wine/obj_base.h"
|
---|
| 18 | #include "wine/obj_extracticon.h"
|
---|
[8614] | 19 | #include "undocshell.h"
|
---|
[4121] | 20 | #include "shlguid.h"
|
---|
| 21 |
|
---|
| 22 | #include "debugtools.h"
|
---|
| 23 | #include "winerror.h"
|
---|
| 24 |
|
---|
| 25 | #include "pidl.h"
|
---|
| 26 | #include "shell32_main.h"
|
---|
| 27 |
|
---|
| 28 | DEFAULT_DEBUG_CHANNEL(shell)
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | /***********************************************************************
|
---|
| 32 | * IExtractIconA implementation
|
---|
| 33 | */
|
---|
| 34 |
|
---|
[4691] | 35 | typedef struct
|
---|
| 36 | { ICOM_VFIELD(IExtractIconA);
|
---|
| 37 | DWORD ref;
|
---|
| 38 | ICOM_VTABLE(IPersistFile)* lpvtblPersistFile;
|
---|
| 39 | LPITEMIDLIST pidl;
|
---|
[4121] | 40 | } IExtractIconAImpl;
|
---|
| 41 |
|
---|
| 42 | static struct ICOM_VTABLE(IExtractIconA) eivt;
|
---|
| 43 | static struct ICOM_VTABLE(IPersistFile) pfvt;
|
---|
| 44 |
|
---|
| 45 | #define _IPersistFile_Offset ((int)(&(((IExtractIconAImpl*)0)->lpvtblPersistFile)))
|
---|
| 46 | #define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset);
|
---|
| 47 |
|
---|
| 48 | /**************************************************************************
|
---|
| 49 | * IExtractIconA_Constructor
|
---|
| 50 | */
|
---|
| 51 | IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
|
---|
| 52 | {
|
---|
[4691] | 53 | IExtractIconAImpl* ei;
|
---|
[4121] | 54 |
|
---|
[4691] | 55 | ei=(IExtractIconAImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconAImpl));
|
---|
| 56 | ei->ref=1;
|
---|
| 57 | ICOM_VTBL(ei) = &eivt;
|
---|
| 58 | ei->lpvtblPersistFile = &pfvt;
|
---|
| 59 | ei->pidl=ILClone(pidl);
|
---|
[4121] | 60 |
|
---|
[4691] | 61 | pdump(pidl);
|
---|
[4121] | 62 |
|
---|
[4691] | 63 | TRACE("(%p)\n",ei);
|
---|
| 64 | shell32_ObjCount++;
|
---|
| 65 | return (IExtractIconA *)ei;
|
---|
[4121] | 66 | }
|
---|
| 67 | /**************************************************************************
|
---|
| 68 | * IExtractIconA_QueryInterface
|
---|
| 69 | */
|
---|
| 70 | static HRESULT WINAPI IExtractIconA_fnQueryInterface( IExtractIconA * iface, REFIID riid, LPVOID *ppvObj)
|
---|
| 71 | {
|
---|
[4691] | 72 | ICOM_THIS(IExtractIconAImpl,iface);
|
---|
[4121] | 73 |
|
---|
[4691] | 74 | TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
|
---|
[4121] | 75 |
|
---|
[4691] | 76 | *ppvObj = NULL;
|
---|
[4121] | 77 |
|
---|
[4691] | 78 | if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
|
---|
| 79 | { *ppvObj = This;
|
---|
| 80 | }
|
---|
| 81 | else if(IsEqualIID(riid, &IID_IPersistFile)) /*IExtractIcon*/
|
---|
| 82 | { *ppvObj = (IPersistFile*)&(This->lpvtblPersistFile);
|
---|
| 83 | }
|
---|
| 84 | else if(IsEqualIID(riid, &IID_IExtractIconA)) /*IExtractIcon*/
|
---|
| 85 | { *ppvObj = (IExtractIconA*)This;
|
---|
| 86 | }
|
---|
[4121] | 87 |
|
---|
[4691] | 88 | if(*ppvObj)
|
---|
| 89 | { IExtractIconA_AddRef((IExtractIconA*) *ppvObj);
|
---|
| 90 | TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
|
---|
| 91 | return S_OK;
|
---|
| 92 | }
|
---|
| 93 | TRACE("-- Interface: E_NOINTERFACE\n");
|
---|
| 94 | return E_NOINTERFACE;
|
---|
[4121] | 95 | }
|
---|
| 96 |
|
---|
| 97 | /**************************************************************************
|
---|
| 98 | * IExtractIconA_AddRef
|
---|
| 99 | */
|
---|
| 100 | static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface)
|
---|
| 101 | {
|
---|
[4691] | 102 | ICOM_THIS(IExtractIconAImpl,iface);
|
---|
[4121] | 103 |
|
---|
[4691] | 104 | TRACE("(%p)->(count=%lu)\n",This, This->ref );
|
---|
[4121] | 105 |
|
---|
[4691] | 106 | shell32_ObjCount++;
|
---|
[4121] | 107 |
|
---|
[4691] | 108 | return ++(This->ref);
|
---|
[4121] | 109 | }
|
---|
| 110 | /**************************************************************************
|
---|
| 111 | * IExtractIconA_Release
|
---|
| 112 | */
|
---|
| 113 | static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface)
|
---|
| 114 | {
|
---|
[4691] | 115 | ICOM_THIS(IExtractIconAImpl,iface);
|
---|
[4121] | 116 |
|
---|
[4691] | 117 | TRACE("(%p)->()\n",This);
|
---|
[4121] | 118 |
|
---|
[4691] | 119 | shell32_ObjCount--;
|
---|
[4121] | 120 |
|
---|
[4691] | 121 | if (!--(This->ref))
|
---|
| 122 | { TRACE(" destroying IExtractIcon(%p)\n",This);
|
---|
| 123 | SHFree(This->pidl);
|
---|
| 124 | HeapFree(GetProcessHeap(),0,This);
|
---|
| 125 | return 0;
|
---|
| 126 | }
|
---|
| 127 | return This->ref;
|
---|
[4121] | 128 | }
|
---|
| 129 | /**************************************************************************
|
---|
| 130 | * IExtractIconA_GetIconLocation
|
---|
| 131 | *
|
---|
| 132 | * mapping filetype to icon
|
---|
| 133 | */
|
---|
| 134 | static HRESULT WINAPI IExtractIconA_fnGetIconLocation(
|
---|
[4691] | 135 | IExtractIconA * iface,
|
---|
| 136 | UINT uFlags,
|
---|
| 137 | LPSTR szIconFile,
|
---|
| 138 | UINT cchMax,
|
---|
| 139 | int * piIndex,
|
---|
| 140 | UINT * pwFlags)
|
---|
[4121] | 141 | {
|
---|
[4691] | 142 | ICOM_THIS(IExtractIconAImpl,iface);
|
---|
[4121] | 143 |
|
---|
[4691] | 144 | char sTemp[MAX_PATH];
|
---|
| 145 | DWORD dwNr;
|
---|
| 146 | GUID const * riid;
|
---|
| 147 | LPITEMIDLIST pSimplePidl = ILFindLastID(This->pidl);
|
---|
[4121] | 148 |
|
---|
[4691] | 149 | TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags);
|
---|
[4121] | 150 |
|
---|
[4691] | 151 | if (pwFlags)
|
---|
| 152 | *pwFlags = 0;
|
---|
[4121] | 153 |
|
---|
[4691] | 154 | if (_ILIsDesktop(pSimplePidl))
|
---|
| 155 | {
|
---|
| 156 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 157 | #ifdef __WIN32OS2__
|
---|
[4706] | 158 | *piIndex = SHLICON_DESKTOP;
|
---|
[4691] | 159 | #else
|
---|
| 160 | *piIndex = 34;
|
---|
| 161 | #endif
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | /* my computer and other shell extensions */
|
---|
| 165 | else if ( (riid = _ILGetGUIDPointer(pSimplePidl)) )
|
---|
| 166 | {
|
---|
| 167 | char xriid[50];
|
---|
[4121] | 168 | sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
---|
| 169 | riid->Data1, riid->Data2, riid->Data3,
|
---|
| 170 | riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
|
---|
| 171 | riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
|
---|
| 172 |
|
---|
[4691] | 173 | if (HCR_GetDefaultIcon(xriid, sTemp, MAX_PATH, &dwNr))
|
---|
| 174 | {
|
---|
| 175 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
| 176 | *piIndex = dwNr;
|
---|
| 177 | }
|
---|
| 178 | else
|
---|
| 179 | {
|
---|
| 180 | #ifdef __WIN32OS2__
|
---|
| 181 | /* Not correct. Originally location is explorer.exe, index 1 */
|
---|
| 182 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 183 | *piIndex = -SHLICON_MYCOMPUTER;
|
---|
[4121] | 184 |
|
---|
[4691] | 185 | /* 15 is absolutely wrong! ( Another computer in the network ) */
|
---|
| 186 | #else
|
---|
| 187 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 188 | *piIndex = 15;
|
---|
| 189 | #endif
|
---|
| 190 | }
|
---|
| 191 | }
|
---|
| 192 | else if (_ILIsDrive (pSimplePidl))
|
---|
| 193 | {
|
---|
[4202] | 194 | #ifdef __WIN32OS2__
|
---|
[4691] | 195 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
[4706] | 196 | *piIndex = SHLICON_HARDDISK;
|
---|
[4691] | 197 |
|
---|
| 198 | if ( _ILGetDrive( pSimplePidl, sTemp, cchMax ) )
|
---|
| 199 | {
|
---|
| 200 | if ( ( sTemp[ 0 ] == 'A' ) || ( sTemp[ 0 ] == 'a' ) ||
|
---|
| 201 | ( sTemp[ 0 ] == 'B' ) || ( sTemp[ 0 ] == 'b' ) )
|
---|
| 202 | {
|
---|
| 203 | /* FIXME determine 5.25 Floppy */
|
---|
[4706] | 204 | *piIndex = SHLICON_FLOPPY35;
|
---|
[4691] | 205 | }
|
---|
| 206 | else
|
---|
| 207 | {
|
---|
| 208 | UINT nType = GetDriveTypeA( sTemp );
|
---|
| 209 | switch ( nType )
|
---|
| 210 | {
|
---|
| 211 | case DRIVE_REMOVABLE:
|
---|
[4706] | 212 | *piIndex = SHLICON_REMOVABLE_DISK;
|
---|
[4691] | 213 | break;
|
---|
| 214 |
|
---|
| 215 | case DRIVE_FIXED:
|
---|
[4706] | 216 | *piIndex = SHLICON_HARDDISK;
|
---|
[4691] | 217 | break;
|
---|
| 218 |
|
---|
| 219 | case DRIVE_REMOTE:
|
---|
| 220 | {
|
---|
[4705] | 221 | /* FIXME: connected / disconnected state */
|
---|
[4691] | 222 | BOOL connected = TRUE;
|
---|
| 223 | if ( connected )
|
---|
[4706] | 224 | *piIndex = SHLICON_NETDRIVE_CONN;
|
---|
[4691] | 225 | else
|
---|
[4706] | 226 | *piIndex = SHLICON_NETDRIVE_DISCON;
|
---|
[4691] | 227 | break;
|
---|
| 228 | }
|
---|
| 229 | case DRIVE_CDROM:
|
---|
[4706] | 230 | *piIndex = SHLICON_CDROM_DRIVE;
|
---|
[4691] | 231 | break;
|
---|
| 232 |
|
---|
| 233 | case DRIVE_RAMDISK:
|
---|
[4706] | 234 | *piIndex = SHLICON_RAMDRIVE;
|
---|
[4691] | 235 | break;
|
---|
| 236 |
|
---|
| 237 | case DRIVE_UNKNOWN:
|
---|
| 238 | case DRIVE_NO_ROOT_DIR:
|
---|
| 239 | default:
|
---|
[4706] | 240 | *piIndex = SHLICON_HARDDISK;
|
---|
[4691] | 241 | break;
|
---|
| 242 | }
|
---|
| 243 | }
|
---|
| 244 | }
|
---|
| 245 |
|
---|
[4706] | 246 | if ( ( *piIndex == ( SHLICON_HARDDISK ) ) &&
|
---|
[4691] | 247 | HCR_GetDefaultIcon( "Drive", sTemp, MAX_PATH, &dwNr ) )
|
---|
| 248 | {
|
---|
| 249 | /* kso: Are there special registry keys for particular drives? */
|
---|
| 250 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
| 251 | *piIndex = dwNr;
|
---|
| 252 | }
|
---|
| 253 | #else
|
---|
| 254 | if (HCR_GetDefaultIcon("Drive", sTemp, MAX_PATH, &dwNr))
|
---|
| 255 | {
|
---|
| 256 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
| 257 | *piIndex = dwNr;
|
---|
| 258 | }
|
---|
| 259 | else
|
---|
| 260 | {
|
---|
| 261 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 262 | *piIndex = 8;
|
---|
| 263 | }
|
---|
| 264 | #endif
|
---|
| 265 | }
|
---|
| 266 | else if (_ILIsFolder (pSimplePidl))
|
---|
| 267 | {
|
---|
| 268 | if (HCR_GetDefaultIcon("Folder", sTemp, MAX_PATH, &dwNr))
|
---|
| 269 | {
|
---|
| 270 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
| 271 | *piIndex = dwNr;
|
---|
| 272 | }
|
---|
| 273 | else
|
---|
| 274 | {
|
---|
| 275 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
[4696] | 276 | #ifdef __WIN32OS2__
|
---|
[4705] | 277 | *piIndex = (uFlags & GIL_OPENICON)
|
---|
[4706] | 278 | ? SHLICON_FOLDER_OPEN : SHLICON_FOLDER_CLOSED;
|
---|
[4696] | 279 | #else
|
---|
[4691] | 280 | *piIndex = (uFlags & GIL_OPENICON)? 4 : 3;
|
---|
[4696] | 281 | #endif
|
---|
[4691] | 282 | }
|
---|
| 283 | }
|
---|
| 284 | else /* object is file */
|
---|
| 285 | {
|
---|
| 286 | #ifdef __WIN32OS2__
|
---|
[4202] | 287 | if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH))
|
---|
| 288 | {
|
---|
| 289 | if (HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH, TRUE)
|
---|
| 290 | && HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr))
|
---|
| 291 | {
|
---|
| 292 | if (!strcmp("%1",sTemp)) /* icon is in the file */
|
---|
| 293 | {
|
---|
| 294 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 295 | dwNr = 0;
|
---|
| 296 | }
|
---|
| 297 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
| 298 | *piIndex = dwNr;
|
---|
| 299 | } else
|
---|
| 300 | {
|
---|
| 301 | //icon is in the file/file is icon
|
---|
[4691] | 302 | if ((stricmp(sTemp,"EXE") == 0) ||
|
---|
| 303 | (stricmp(sTemp,"ICO") == 0))
|
---|
[4202] | 304 | {
|
---|
| 305 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 306 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
[4691] | 307 | *piIndex = 0;
|
---|
| 308 | }
|
---|
| 309 | else if (stricmp(sTemp,"FND") == 0)
|
---|
[4202] | 310 | {
|
---|
[4691] | 311 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
[4202] | 312 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
[4706] | 313 | *piIndex = SHLICON_COMPUTERS;
|
---|
[4691] | 314 | }
|
---|
| 315 | else if (stricmp(sTemp,"COM") == 0)
|
---|
| 316 | {
|
---|
| 317 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 318 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
[4706] | 319 | *piIndex = SHLICON_APPLICATION;
|
---|
[4691] | 320 | }
|
---|
| 321 | #if 0
|
---|
| 322 | // icons not yet in resources
|
---|
| 323 |
|
---|
| 324 | else if ((stricmp(sTemp,"INI") == 0) ||
|
---|
| 325 | (stricmp(sTemp,"INF") == 0))
|
---|
| 326 | {
|
---|
| 327 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 328 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 329 | *piIndex = -151;
|
---|
| 330 | }
|
---|
| 331 | else if (stricmp(sTemp,"TXT") == 0)
|
---|
| 332 | {
|
---|
| 333 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 334 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 335 | *piIndex = -152;
|
---|
| 336 | }
|
---|
| 337 | else if ((stricmp(sTemp,"BAT") == 0) ||
|
---|
| 338 | (stricmp(sTemp,"CMD") == 0))
|
---|
| 339 | {
|
---|
| 340 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 341 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 342 | *piIndex = -153;
|
---|
| 343 | }
|
---|
| 344 | else if ((stricmp(sTemp,"DLL") == 0) ||
|
---|
| 345 | (stricmp(sTemp,"SYS") == 0) ||
|
---|
| 346 | (stricmp(sTemp,"VXD") == 0) ||
|
---|
| 347 | (stricmp(sTemp,"DRV") == 0) ||
|
---|
| 348 | (stricmp(sTemp,"CPL") == 0))
|
---|
| 349 | {
|
---|
| 350 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 351 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 352 | *piIndex = -154;
|
---|
| 353 | }
|
---|
| 354 | else if (stricmp(sTemp,"FON") == 0)
|
---|
| 355 | {
|
---|
| 356 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 357 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 358 | *piIndex = -155;
|
---|
| 359 | }
|
---|
| 360 | else if (stricmp(sTemp,"TTF") == 0)
|
---|
| 361 | {
|
---|
| 362 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 363 | lstrcpynA(szIconFile,"shell32.dll", cchMax);
|
---|
| 364 | *piIndex = -156;
|
---|
| 365 | }
|
---|
| 366 | #endif
|
---|
| 367 | else //default icon
|
---|
| 368 | {
|
---|
| 369 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
[4202] | 370 | *piIndex = 0;
|
---|
| 371 | }
|
---|
| 372 | }
|
---|
| 373 | } else /* default icon */
|
---|
| 374 | {
|
---|
| 375 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 376 | *piIndex = 0;
|
---|
| 377 | }
|
---|
| 378 | }
|
---|
| 379 | #else
|
---|
[4691] | 380 | if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH)
|
---|
| 381 | && HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH, TRUE)
|
---|
| 382 | && HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr))
|
---|
| 383 | {
|
---|
| 384 | if (!strcmp("%1",sTemp)) /* icon is in the file */
|
---|
| 385 | {
|
---|
| 386 | SHGetPathFromIDListA(This->pidl, sTemp);
|
---|
| 387 | dwNr = 0;
|
---|
| 388 | }
|
---|
| 389 | lstrcpynA(szIconFile, sTemp, cchMax);
|
---|
| 390 | *piIndex = dwNr;
|
---|
| 391 | }
|
---|
| 392 | else /* default icon */
|
---|
| 393 | {
|
---|
| 394 | lstrcpynA(szIconFile, "shell32.dll", cchMax);
|
---|
| 395 | *piIndex = 0;
|
---|
| 396 | }
|
---|
| 397 | }
|
---|
[4202] | 398 | #endif
|
---|
[4691] | 399 | TRACE("-- %s %x\n", szIconFile, *piIndex);
|
---|
| 400 | return NOERROR;
|
---|
[4121] | 401 | }
|
---|
| 402 | /**************************************************************************
|
---|
| 403 | * IExtractIconA_Extract
|
---|
| 404 | */
|
---|
| 405 | static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
|
---|
| 406 | {
|
---|
[4691] | 407 | ICOM_THIS(IExtractIconAImpl,iface);
|
---|
[4121] | 408 |
|
---|
[4691] | 409 | FIXME("(%p) (file=%p index=%u %p %p size=%u) semi-stub\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
---|
[4121] | 410 |
|
---|
[4691] | 411 | if (phiconLarge)
|
---|
[5618] | 412 | *phiconLarge = ImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
|
---|
[4121] | 413 |
|
---|
[4691] | 414 | if (phiconSmall)
|
---|
[5618] | 415 | *phiconSmall = ImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
|
---|
[4121] | 416 |
|
---|
[4691] | 417 | return S_OK;
|
---|
[4121] | 418 | }
|
---|
| 419 |
|
---|
[4691] | 420 | static struct ICOM_VTABLE(IExtractIconA) eivt =
|
---|
| 421 | {
|
---|
| 422 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
---|
| 423 | IExtractIconA_fnQueryInterface,
|
---|
| 424 | IExtractIconA_fnAddRef,
|
---|
| 425 | IExtractIconA_fnRelease,
|
---|
| 426 | IExtractIconA_fnGetIconLocation,
|
---|
| 427 | IExtractIconA_fnExtract
|
---|
[4121] | 428 | };
|
---|
| 429 |
|
---|
| 430 | /************************************************************************
|
---|
| 431 | * IEIPersistFile_QueryInterface (IUnknown)
|
---|
| 432 | */
|
---|
| 433 | static HRESULT WINAPI IEIPersistFile_fnQueryInterface(
|
---|
[4691] | 434 | IPersistFile *iface,
|
---|
| 435 | REFIID iid,
|
---|
| 436 | LPVOID *ppvObj)
|
---|
[4121] | 437 | {
|
---|
[4691] | 438 | _ICOM_THIS_From_IPersistFile(IExtractIconA, iface);
|
---|
[4121] | 439 |
|
---|
[4691] | 440 | return IShellFolder_QueryInterface((IExtractIconA*)This, iid, ppvObj);
|
---|
[4121] | 441 | }
|
---|
| 442 |
|
---|
| 443 | /************************************************************************
|
---|
| 444 | * IEIPersistFile_AddRef (IUnknown)
|
---|
| 445 | */
|
---|
| 446 | static ULONG WINAPI IEIPersistFile_fnAddRef(
|
---|
[4691] | 447 | IPersistFile *iface)
|
---|
[4121] | 448 | {
|
---|
[4691] | 449 | _ICOM_THIS_From_IPersistFile(IExtractIconA, iface);
|
---|
[4121] | 450 |
|
---|
[4691] | 451 | return IExtractIconA_AddRef((IExtractIconA*)This);
|
---|
[4121] | 452 | }
|
---|
| 453 |
|
---|
| 454 | /************************************************************************
|
---|
| 455 | * IEIPersistFile_Release (IUnknown)
|
---|
| 456 | */
|
---|
| 457 | static ULONG WINAPI IEIPersistFile_fnRelease(
|
---|
[4691] | 458 | IPersistFile *iface)
|
---|
[4121] | 459 | {
|
---|
[4691] | 460 | _ICOM_THIS_From_IPersistFile(IExtractIconA, iface);
|
---|
[4121] | 461 |
|
---|
[4691] | 462 | return IExtractIconA_Release((IExtractIconA*)This);
|
---|
[4121] | 463 | }
|
---|
| 464 |
|
---|
| 465 | /************************************************************************
|
---|
| 466 | * IEIPersistFile_GetClassID (IPersist)
|
---|
| 467 | */
|
---|
| 468 | static HRESULT WINAPI IEIPersistFile_fnGetClassID(
|
---|
[4691] | 469 | IPersistFile *iface,
|
---|
| 470 | LPCLSID lpClassId)
|
---|
[4121] | 471 | {
|
---|
[4691] | 472 | CLSID StdFolderID = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} };
|
---|
[4121] | 473 |
|
---|
[4691] | 474 | if (lpClassId==NULL)
|
---|
| 475 | return E_POINTER;
|
---|
[4121] | 476 |
|
---|
[4691] | 477 | memcpy(lpClassId, &StdFolderID, sizeof(StdFolderID));
|
---|
[4121] | 478 |
|
---|
[4691] | 479 | return S_OK;
|
---|
[4121] | 480 | }
|
---|
| 481 |
|
---|
| 482 | /************************************************************************
|
---|
| 483 | * IEIPersistFile_Load (IPersistFile)
|
---|
| 484 | */
|
---|
| 485 | static HRESULT WINAPI IEIPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
|
---|
| 486 | {
|
---|
[4691] | 487 | _ICOM_THIS_From_IPersistFile(IExtractIconA, iface);
|
---|
| 488 | FIXME("%p\n", This);
|
---|
| 489 | return E_NOTIMPL;
|
---|
[4121] | 490 |
|
---|
| 491 | }
|
---|
| 492 |
|
---|
[4202] | 493 | #ifdef __WIN32OS2__
|
---|
| 494 | /************************************************************************
|
---|
| 495 | * IEIPersistFile_IsDirty (IPersistFile)
|
---|
| 496 | */
|
---|
| 497 | static HRESULT WINAPI IEIPersistFile_fnIsDirty(IPersistFile* iface)
|
---|
| 498 | {
|
---|
| 499 | dprintf(("SHELL32: Folders: IEIPersistFile_fnIsDirty not implemented.\n"));
|
---|
| 500 | return E_NOTIMPL;
|
---|
| 501 | }
|
---|
| 502 |
|
---|
| 503 | /************************************************************************
|
---|
| 504 | * IEIPersistFile_Save (IPersistFile)
|
---|
| 505 | */
|
---|
| 506 | static HRESULT WINAPI IEIPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
|
---|
| 507 | {
|
---|
| 508 | dprintf(("SHELL32: Folders: IEIPersistFile_fnSave not implemented.\n"));
|
---|
| 509 | return E_NOTIMPL;
|
---|
| 510 | }
|
---|
| 511 |
|
---|
| 512 |
|
---|
| 513 | /************************************************************************
|
---|
| 514 | * IEIPersistFile_SaveCompleted (IPersistFile)
|
---|
| 515 | */
|
---|
| 516 | static HRESULT WINAPI IEIPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName)
|
---|
| 517 | {
|
---|
| 518 | dprintf(("SHELL32: Folders: IEIPersistFile_fnSaveCompleted not implemented.\n"));
|
---|
| 519 | return E_NOTIMPL;
|
---|
| 520 | }
|
---|
| 521 |
|
---|
| 522 |
|
---|
| 523 | /************************************************************************
|
---|
| 524 | * IEIPersistFile_GetCurFile (IPersistFile)
|
---|
| 525 | */
|
---|
| 526 | static HRESULT WINAPI IEIPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR* pszFileName)
|
---|
| 527 | {
|
---|
| 528 | dprintf(("SHELL32: Folders: IEIPersistFile_fnGetCurFile not implemented.\n"));
|
---|
| 529 | return E_NOTIMPL;
|
---|
| 530 | }
|
---|
| 531 | #endif
|
---|
| 532 |
|
---|
[4121] | 533 | static struct ICOM_VTABLE(IPersistFile) pfvt =
|
---|
| 534 | {
|
---|
[4691] | 535 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
---|
| 536 | IEIPersistFile_fnQueryInterface,
|
---|
| 537 | IEIPersistFile_fnAddRef,
|
---|
| 538 | IEIPersistFile_fnRelease,
|
---|
| 539 | IEIPersistFile_fnGetClassID,
|
---|
[4202] | 540 | #ifdef __WIN32OS2__
|
---|
| 541 | IEIPersistFile_fnIsDirty, /* IEIPersistFile_fnIsDirty */
|
---|
| 542 | #else
|
---|
[4691] | 543 | (void *) 0xdeadbeef /* IEIPersistFile_fnIsDirty */,
|
---|
[4202] | 544 | #endif
|
---|
[4691] | 545 | IEIPersistFile_fnLoad,
|
---|
[4202] | 546 | #ifdef __WIN32OS2__
|
---|
| 547 | IEIPersistFile_fnSave, /* IEIPersistFile_fnSave */
|
---|
| 548 | IEIPersistFile_fnSaveCompleted, /* IEIPersistFile_fnSaveCompleted */
|
---|
| 549 | IEIPersistFile_fnGetCurFile /* IEIPersistFile_fnGetCurFile */
|
---|
| 550 | #else
|
---|
[4691] | 551 | (void *) 0xdeadbeef /* IEIPersistFile_fnSave */,
|
---|
| 552 | (void *) 0xdeadbeef /* IEIPersistFile_fnSaveCompleted */,
|
---|
| 553 | (void *) 0xdeadbeef /* IEIPersistFile_fnGetCurFile */
|
---|
[4202] | 554 | #endif
|
---|
[4121] | 555 | };
|
---|
| 556 |
|
---|