Changeset 3243 for trunk/src/shell32/shelllink.cpp
- Timestamp:
- Mar 26, 2000, 6:34:57 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/shelllink.cpp
r1215 r3243 1 /* $Id: shelllink.cpp,v 1. 2 1999-10-09 11:17:04 sandervlExp $ */1 /* $Id: shelllink.cpp,v 1.3 2000-03-26 16:34:50 cbratschi Exp $ */ 2 2 /* 3 3 * 4 * Copyright 1997Marcus Meissner5 * Copyright 1998Juergen Schmied4 * Copyright 1997 Marcus Meissner 5 * Copyright 1998 Juergen Schmied 6 6 * 7 * Corel WINE 20000324 level 7 8 */ 8 9 … … 37 38 38 39 /* flag1: lnk elements: simple link has 0x0B */ 39 #define WORKDIR0x1040 #define ARGUMENT0x2041 #define ICON0x4042 #define UNC 40 #define WORKDIR 0x10 41 #define ARGUMENT 0x20 42 #define ICON 0x40 43 #define UNC 0x80 43 44 44 45 /* fStartup */ 45 #define NORMAL0x0146 #define MAXIMIZED0x0347 #define MINIMIZED0x0748 49 typedef struct _LINK_HEADER 50 { DWORD MagicStr;/* 0x00 'L','\0','\0','\0' */51 GUID MagicGuid;/* 0x04 is CLSID_ShellLink */52 DWORD Flag1;/* 0x14 describes elements following */53 DWORD Flag2;/* 0x18 */54 FILETIME Time1;/* 0x1c */55 FILETIME Time2;/* 0x24 */56 FILETIME Time3;/* 0x2c */57 DWORD Unknown1;/* 0x34 */58 DWORD Unknown2;/* 0x38 icon number */59 DWORD fStartup;/* 0x3c startup type */60 DWORD wHotKey;/* 0x40 hotkey */61 DWORD Unknown5;/* 0x44 */62 DWORD Unknown6;/* 0x48 */63 USHORT PidlSize;/* 0x4c */64 ITEMIDLIST Pidl;/* 0x4e */46 #define NORMAL 0x01 47 #define MAXIMIZED 0x03 48 #define MINIMIZED 0x07 49 50 typedef struct _LINK_HEADER 51 { DWORD MagicStr; /* 0x00 'L','\0','\0','\0' */ 52 GUID MagicGuid; /* 0x04 is CLSID_ShellLink */ 53 DWORD Flag1; /* 0x14 describes elements following */ 54 DWORD Flag2; /* 0x18 */ 55 FILETIME Time1; /* 0x1c */ 56 FILETIME Time2; /* 0x24 */ 57 FILETIME Time3; /* 0x2c */ 58 DWORD Unknown1; /* 0x34 */ 59 DWORD Unknown2; /* 0x38 icon number */ 60 DWORD fStartup; /* 0x3c startup type */ 61 DWORD wHotKey; /* 0x40 hotkey */ 62 DWORD Unknown5; /* 0x44 */ 63 DWORD Unknown6; /* 0x48 */ 64 USHORT PidlSize; /* 0x4c */ 65 ITEMIDLIST Pidl; /* 0x4e */ 65 66 } LINK_HEADER, * PLINK_HEADER; 66 67 … … 69 70 #include "poppack.h" 70 71 71 //static ICOM_VTABLE(IShellLink) 72 //static ICOM_VTABLE(IShellLinkW) 73 //static ICOM_VTABLE(IPersistFile) 74 //static ICOM_VTABLE(IPersistStream) 72 //static ICOM_VTABLE(IShellLink) slvt; 73 //static ICOM_VTABLE(IShellLinkW) slvtw; 74 //static ICOM_VTABLE(IPersistFile) pfvt; 75 //static ICOM_VTABLE(IPersistStream) psvt; 75 76 76 77 /* IShellLink Implementation */ … … 78 79 typedef struct 79 80 { 80 ICOM_VTABLE(IShellLink)*lpvtbl;81 DWORDref;82 83 ICOM_VTABLE(IShellLinkW)*lpvtblw;84 ICOM_VTABLE(IPersistFile)*lpvtblPersistFile;85 ICOM_VTABLE(IPersistStream)*lpvtblPersistStream;86 87 88 IStream*lpFileStream;89 90 91 LPSTRsPath;92 LPITEMIDLISTpPidl;93 WORDwHotKey;94 SYSTEMTIMEtime1;95 SYSTEMTIMEtime2;96 SYSTEMTIMEtime3;81 ICOM_VTABLE(IShellLink)* lpvtbl; 82 DWORD ref; 83 84 ICOM_VTABLE(IShellLinkW)* lpvtblw; 85 ICOM_VTABLE(IPersistFile)* lpvtblPersistFile; 86 ICOM_VTABLE(IPersistStream)* lpvtblPersistStream; 87 88 /* internal stream of the IPersistFile interface */ 89 IStream* lpFileStream; 90 91 /* data structures according to the informations in the lnk */ 92 LPSTR sPath; 93 LPITEMIDLIST pPidl; 94 WORD wHotKey; 95 SYSTEMTIME time1; 96 SYSTEMTIME time2; 97 SYSTEMTIME time3; 97 98 98 99 } IShellLinkImpl; … … 112 113 */ 113 114 static HRESULT WINAPI IPersistFile_fnQueryInterface( 114 115 116 117 { 118 119 120 121 122 115 IPersistFile* iface, 116 REFIID riid, 117 LPVOID *ppvObj) 118 { 119 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 120 121 TRACE("(%p)\n",This); 122 123 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj); 123 124 } 124 125 … … 128 129 static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface) 129 130 { 130 131 132 133 134 131 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 132 133 TRACE("(%p)->(count=%lu)\n",This,This->ref); 134 135 return IShellLink_AddRef((IShellLink*)This); 135 136 } 136 137 /****************************************************************************** … … 139 140 static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface) 140 141 { 141 142 143 144 145 142 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 143 144 TRACE("(%p)->(count=%lu)\n",This,This->ref); 145 146 return IShellLink_Release((IShellLink*)This); 146 147 } 147 148 148 149 static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile* iface, CLSID *pClassID) 149 150 { 150 151 152 151 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 152 FIXME("(%p)\n",This); 153 return NOERROR; 153 154 } 154 155 static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface) 155 156 { 156 157 158 157 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 158 FIXME("(%p)\n",This); 159 return NOERROR; 159 160 } 160 161 static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode) 161 162 { 162 163 164 165 LPSTRsFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);166 HRESULThRet = E_FAIL;167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 163 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 164 _IPersistStream_From_ICOM_THIS(IPersistStream, This) 165 166 LPSTR sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName); 167 HRESULT hRet = E_FAIL; 168 169 TRACE("(%p, %s)\n",This, sFile); 170 171 172 if (This->lpFileStream) 173 IStream_Release(This->lpFileStream); 174 175 if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream))) 176 { 177 if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream)) 178 { 179 return NOERROR; 180 } 181 } 182 183 return hRet; 183 184 } 184 185 185 186 static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember) 186 187 { 187 188 189 188 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); 189 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName)); 190 return NOERROR; 190 191 } 191 192 static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName) 192 193 { 193 194 195 194 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); 195 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName)); 196 return NOERROR; 196 197 } 197 198 static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *ppszFileName) 198 199 { 199 200 201 200 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); 201 FIXME("(%p)\n",This); 202 return NOERROR; 202 203 } 203 204 204 205 static ICOM_VTABLE(IPersistFile) pfvt = 205 206 { 206 207 208 209 210 211 212 213 214 215 207 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 208 IPersistFile_fnQueryInterface, 209 IPersistFile_fnAddRef, 210 IPersistFile_fnRelease, 211 IPersistFile_fnGetClassID, 212 IPersistFile_fnIsDirty, 213 IPersistFile_fnLoad, 214 IPersistFile_fnSave, 215 IPersistFile_fnSaveCompleted, 216 IPersistFile_fnGetCurFile 216 217 }; 217 218 … … 220 221 */ 221 222 static HRESULT WINAPI IPersistStream_fnQueryInterface( 222 223 224 225 { 226 227 228 229 230 223 IPersistStream* iface, 224 REFIID riid, 225 VOID** ppvoid) 226 { 227 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 228 229 TRACE("(%p)\n",This); 230 231 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvoid); 231 232 } 232 233 … … 235 236 */ 236 237 static ULONG WINAPI IPersistStream_fnRelease( 237 238 { 239 240 241 242 243 238 IPersistStream* iface) 239 { 240 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 241 242 TRACE("(%p)\n",This); 243 244 return IShellLink_Release((IShellLink*)This); 244 245 } 245 246 … … 248 249 */ 249 250 static ULONG WINAPI IPersistStream_fnAddRef( 250 251 { 252 253 254 255 256 251 IPersistStream* iface) 252 { 253 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 254 255 TRACE("(%p)\n",This); 256 257 return IShellLink_AddRef((IShellLink*)This); 257 258 } 258 259 … … 262 263 */ 263 264 static HRESULT WINAPI IPersistStream_fnGetClassID( 264 265 266 { 267 268 269 270 271 272 273 274 /* 275 276 265 IPersistStream* iface, 266 CLSID* pClassID) 267 { 268 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 269 270 TRACE("(%p)\n", This); 271 272 if (pClassID==0) 273 return E_POINTER; 274 275 /* memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */ 276 277 return S_OK; 277 278 } 278 279 … … 281 282 */ 282 283 static HRESULT WINAPI IPersistStream_fnIsDirty( 283 284 { 285 286 287 288 289 284 IPersistStream* iface) 285 { 286 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 287 288 TRACE("(%p)\n", This); 289 290 return S_OK; 290 291 } 291 292 /************************************************************************ … … 294 295 295 296 static HRESULT WINAPI IPersistStream_fnLoad( 296 297 298 { 299 300 ULONGdwBytesRead;301 DWORDret = E_FAIL;302 charsTemp[512];303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 { 327 328 329 330 331 332 333 334 335 297 IPersistStream* iface, 298 IStream* pLoadStream) 299 { 300 PLINK_HEADER lpLinkHeader = (PLINK_HEADER)HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE); 301 ULONG dwBytesRead; 302 DWORD ret = E_FAIL; 303 char sTemp[512]; 304 305 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 306 307 TRACE("(%p)(%p)\n", This, pLoadStream); 308 309 if ( ! pLoadStream) 310 { 311 return STG_E_INVALIDPOINTER; 312 } 313 314 IStream_AddRef (pLoadStream); 315 if(lpLinkHeader) 316 { 317 if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead))) 318 { 319 if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink)) 320 { 321 lpLinkHeader = (PLINK_HEADER)HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize); 322 if (lpLinkHeader) 323 { 324 if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead))) 325 { 326 if (pcheck (&lpLinkHeader->Pidl)) 327 { 328 This->pPidl = ILClone (&lpLinkHeader->Pidl); 329 330 SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp); 331 This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp); 332 } 333 This->wHotKey = lpLinkHeader->wHotKey; 334 FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1); 335 FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2); 336 FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3); 336 337 #if 1 337 338 339 340 341 342 343 344 #endif 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 338 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256); 339 TRACE("-- time1: %s\n", sTemp); 340 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256); 341 TRACE("-- time1: %s\n", sTemp); 342 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256); 343 TRACE("-- time1: %s\n", sTemp); 344 pdump (This->pPidl); 345 #endif 346 ret = S_OK; 347 } 348 } 349 } 350 else 351 { 352 WARN("stream contains no link!\n"); 353 } 354 } 355 } 356 357 IStream_Release (pLoadStream); 358 359 pdump(This->pPidl); 360 361 HeapFree(GetProcessHeap(), 0, lpLinkHeader); 362 363 return ret; 363 364 } 364 365 … … 367 368 */ 368 369 static HRESULT WINAPI IPersistStream_fnSave( 369 370 371 372 { 373 374 375 376 377 370 IPersistStream* iface, 371 IStream* pOutStream, 372 BOOL fClearDirty) 373 { 374 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 375 376 TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty); 377 378 return E_NOTIMPL; 378 379 } 379 380 … … 382 383 */ 383 384 static HRESULT WINAPI IPersistStream_fnGetSizeMax( 384 385 386 { 387 388 389 390 391 385 IPersistStream* iface, 386 ULARGE_INTEGER* pcbSize) 387 { 388 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 389 390 TRACE("(%p)\n", This); 391 392 return E_NOTIMPL; 392 393 } 393 394 394 395 static ICOM_VTABLE(IPersistStream) psvt = 395 396 { 396 397 398 399 400 401 402 403 404 397 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 398 IPersistStream_fnQueryInterface, 399 IPersistStream_fnAddRef, 400 IPersistStream_fnRelease, 401 IPersistStream_fnGetClassID, 402 IPersistStream_fnIsDirty, 403 IPersistStream_fnLoad, 404 IPersistStream_fnSave, 405 IPersistStream_fnGetSizeMax 405 406 }; 406 407 … … 410 411 static HRESULT WINAPI IShellLink_fnQueryInterface( IShellLink * iface, REFIID riid, LPVOID *ppvObj) 411 412 { 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 413 ICOM_THIS(IShellLinkImpl, iface); 414 415 char xriid[50]; 416 WINE_StringFromCLSID((LPCLSID)riid,xriid); 417 TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid); 418 419 *ppvObj = NULL; 420 421 if(IsEqualIID(riid, &IID_IUnknown) || 422 IsEqualIID(riid, &IID_IShellLink)) 423 { 424 *ppvObj = This; 425 } 426 else if(IsEqualIID(riid, &IID_IShellLinkW)) 427 { 428 *ppvObj = (IShellLinkW *)&(This->lpvtblw); 429 } 430 else if(IsEqualIID(riid, &IID_IPersistFile)) 431 { 432 *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile); 433 } 434 else if(IsEqualIID(riid, &IID_IPersistStream)) 435 { 436 *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream); 437 } 438 439 if(*ppvObj) 440 { 441 IUnknown_AddRef((IUnknown*)(*ppvObj)); 442 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); 443 return S_OK; 444 } 445 TRACE("-- Interface: E_NOINTERFACE\n"); 446 return E_NOINTERFACE; 446 447 } 447 448 /****************************************************************************** … … 450 451 static ULONG WINAPI IShellLink_fnAddRef(IShellLink * iface) 451 452 { 452 453 454 455 456 457 453 ICOM_THIS(IShellLinkImpl, iface); 454 455 TRACE("(%p)->(count=%lu)\n",This,This->ref); 456 457 shell32_ObjCount++; 458 return ++(This->ref); 458 459 } 459 460 /****************************************************************************** 460 * 461 * IShellLink_Release 461 462 */ 462 463 static ULONG WINAPI IShellLink_fnRelease(IShellLink * iface) 463 464 { 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 465 ICOM_THIS(IShellLinkImpl, iface); 466 467 TRACE("(%p)->(count=%lu)\n",This,This->ref); 468 469 shell32_ObjCount--; 470 if (!--(This->ref)) 471 { TRACE("-- destroying IShellLink(%p)\n",This); 472 473 if (This->sPath) 474 HeapFree(GetProcessHeap(),0,This->sPath); 475 476 if (This->pPidl) 477 SHFree(This->pPidl); 478 479 if (This->lpFileStream) 480 IStream_Release(This->lpFileStream); 481 482 HeapFree(GetProcessHeap(),0,This); 483 return 0; 484 } 485 return This->ref; 485 486 } 486 487 487 488 static HRESULT WINAPI IShellLink_fnGetPath(IShellLink * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) 488 489 { 489 490 491 492 493 494 495 496 497 498 490 ICOM_THIS(IShellLinkImpl, iface); 491 492 TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath)); 493 494 if (This->sPath) 495 lstrcpynA(pszFile,This->sPath, cchMaxPath); 496 else 497 return E_FAIL; 498 499 return NOERROR; 499 500 } 500 501 static HRESULT WINAPI IShellLink_fnGetIDList(IShellLink * iface, LPITEMIDLIST * ppidl) 501 502 { 502 503 504 505 506 507 503 ICOM_THIS(IShellLinkImpl, iface); 504 505 TRACE("(%p)->(ppidl=%p)\n",This, ppidl); 506 507 *ppidl = ILClone(This->pPidl); 508 return NOERROR; 508 509 } 509 510 static HRESULT WINAPI IShellLink_fnSetIDList(IShellLink * iface, LPCITEMIDLIST pidl) 510 511 { 511 512 513 514 515 516 517 518 512 ICOM_THIS(IShellLinkImpl, iface); 513 514 TRACE("(%p)->(pidl=%p)\n",This, pidl); 515 516 if (This->pPidl) 517 SHFree(This->pPidl); 518 This->pPidl = ILClone (pidl); 519 return NOERROR; 519 520 } 520 521 static HRESULT WINAPI IShellLink_fnGetDescription(IShellLink * iface, LPSTR pszName,INT cchMaxName) 521 522 { 522 523 524 525 526 523 ICOM_THIS(IShellLinkImpl, iface); 524 525 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); 526 lstrcpynA(pszName,"Description, FIXME",cchMaxName); 527 return NOERROR; 527 528 } 528 529 static HRESULT WINAPI IShellLink_fnSetDescription(IShellLink * iface, LPCSTR pszName) 529 530 { 530 531 532 533 531 ICOM_THIS(IShellLinkImpl, iface); 532 533 FIXME("(%p)->(desc=%s)\n",This, pszName); 534 return NOERROR; 534 535 } 535 536 static HRESULT WINAPI IShellLink_fnGetWorkingDirectory(IShellLink * iface, LPSTR pszDir,INT cchMaxPath) 536 537 { 537 538 539 540 541 538 ICOM_THIS(IShellLinkImpl, iface); 539 540 FIXME("(%p)->()\n",This); 541 lstrcpynA(pszDir,"c:\\", cchMaxPath); 542 return NOERROR; 542 543 } 543 544 static HRESULT WINAPI IShellLink_fnSetWorkingDirectory(IShellLink * iface, LPCSTR pszDir) 544 545 { 545 546 547 548 546 ICOM_THIS(IShellLinkImpl, iface); 547 548 FIXME("(%p)->(dir=%s)\n",This, pszDir); 549 return NOERROR; 549 550 } 550 551 static HRESULT WINAPI IShellLink_fnGetArguments(IShellLink * iface, LPSTR pszArgs,INT cchMaxPath) 551 552 { 552 553 554 555 556 553 ICOM_THIS(IShellLinkImpl, iface); 554 555 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath); 556 lstrcpynA(pszArgs, "", cchMaxPath); 557 return NOERROR; 557 558 } 558 559 static HRESULT WINAPI IShellLink_fnSetArguments(IShellLink * iface, LPCSTR pszArgs) 559 560 { 560 561 562 563 564 561 ICOM_THIS(IShellLinkImpl, iface); 562 563 FIXME("(%p)->(args=%s)\n",This, pszArgs); 564 565 return NOERROR; 565 566 } 566 567 static HRESULT WINAPI IShellLink_fnGetHotkey(IShellLink * iface, WORD *pwHotkey) 567 568 { 568 569 570 571 572 573 574 569 ICOM_THIS(IShellLinkImpl, iface); 570 571 TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey); 572 573 *pwHotkey = This->wHotKey; 574 575 return NOERROR; 575 576 } 576 577 static HRESULT WINAPI IShellLink_fnSetHotkey(IShellLink * iface, WORD wHotkey) 577 578 { 578 579 580 581 582 583 584 579 ICOM_THIS(IShellLinkImpl, iface); 580 581 TRACE("(%p)->(hotkey=%x)\n",This, wHotkey); 582 583 This->wHotKey = wHotkey; 584 585 return NOERROR; 585 586 } 586 587 static HRESULT WINAPI IShellLink_fnGetShowCmd(IShellLink * iface, INT *piShowCmd) 587 588 { 588 589 590 591 592 589 ICOM_THIS(IShellLinkImpl, iface); 590 591 FIXME("(%p)->(%p)\n",This, piShowCmd); 592 *piShowCmd=0; 593 return NOERROR; 593 594 } 594 595 static HRESULT WINAPI IShellLink_fnSetShowCmd(IShellLink * iface, INT iShowCmd) 595 596 { 596 597 598 599 597 ICOM_THIS(IShellLinkImpl, iface); 598 599 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd); 600 return NOERROR; 600 601 } 601 602 static HRESULT WINAPI IShellLink_fnGetIconLocation(IShellLink * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon) 602 603 { 603 604 605 606 607 608 604 ICOM_THIS(IShellLinkImpl, iface); 605 606 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon); 607 lstrcpynA(pszIconPath,"shell32.dll",cchIconPath); 608 *piIcon=1; 609 return NOERROR; 609 610 } 610 611 static HRESULT WINAPI IShellLink_fnSetIconLocation(IShellLink * iface, LPCSTR pszIconPath,INT iIcon) 611 612 { 612 613 614 615 613 ICOM_THIS(IShellLinkImpl, iface); 614 615 FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon); 616 return NOERROR; 616 617 } 617 618 static HRESULT WINAPI IShellLink_fnSetRelativePath(IShellLink * iface, LPCSTR pszPathRel, DWORD dwReserved) 618 619 { 619 620 621 622 620 ICOM_THIS(IShellLinkImpl, iface); 621 622 FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved); 623 return NOERROR; 623 624 } 624 625 static HRESULT WINAPI IShellLink_fnResolve(IShellLink * iface, HWND hwnd, DWORD fFlags) 625 626 { 626 627 628 629 627 ICOM_THIS(IShellLinkImpl, iface); 628 629 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags); 630 return NOERROR; 630 631 } 631 632 static HRESULT WINAPI IShellLink_fnSetPath(IShellLink * iface, LPCSTR pszFile) 632 633 { 633 634 635 636 634 ICOM_THIS(IShellLinkImpl, iface); 635 636 FIXME("(%p)->(path=%s)\n",This, pszFile); 637 return NOERROR; 637 638 } 638 639 … … 642 643 643 644 static ICOM_VTABLE(IShellLink) slvt = 644 { 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 645 { 646 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 647 IShellLink_fnQueryInterface, 648 IShellLink_fnAddRef, 649 IShellLink_fnRelease, 650 IShellLink_fnGetPath, 651 IShellLink_fnGetIDList, 652 IShellLink_fnSetIDList, 653 IShellLink_fnGetDescription, 654 IShellLink_fnSetDescription, 655 IShellLink_fnGetWorkingDirectory, 656 IShellLink_fnSetWorkingDirectory, 657 IShellLink_fnGetArguments, 658 IShellLink_fnSetArguments, 659 IShellLink_fnGetHotkey, 660 IShellLink_fnSetHotkey, 661 IShellLink_fnGetShowCmd, 662 IShellLink_fnSetShowCmd, 663 IShellLink_fnGetIconLocation, 664 IShellLink_fnSetIconLocation, 665 IShellLink_fnSetRelativePath, 666 IShellLink_fnResolve, 667 IShellLink_fnSetPath 667 668 }; 668 669 … … 674 675 IShellLinkW * iface, REFIID riid, LPVOID *ppvObj) 675 676 { 676 677 678 677 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 678 679 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj); 679 680 } 680 681 … … 684 685 static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface) 685 686 { 686 687 688 689 690 687 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 688 689 TRACE("(%p)->(count=%lu)\n",This,This->ref); 690 691 return IShellLink_AddRef((IShellLink*)This); 691 692 } 692 693 /****************************************************************************** … … 696 697 static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface) 697 698 { 698 699 700 701 702 699 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 700 701 TRACE("(%p)->(count=%lu)\n",This,This->ref); 702 703 return IShellLink_Release((IShellLink*)This); 703 704 } 704 705 705 706 static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) 706 707 { 707 708 709 710 711 708 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 709 710 FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags); 711 lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath); 712 return NOERROR; 712 713 } 713 714 714 715 static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl) 715 716 { 716 717 718 719 720 717 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 718 719 FIXME("(%p)->(ppidl=%p)\n",This, ppidl); 720 *ppidl = _ILCreateDesktop(); 721 return NOERROR; 721 722 } 722 723 723 724 static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl) 724 725 { 725 726 727 728 726 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 727 728 FIXME("(%p)->(pidl=%p)\n",This, pidl); 729 return NOERROR; 729 730 } 730 731 731 732 static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName) 732 733 { 733 734 735 736 737 734 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 735 736 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); 737 lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName); 738 return NOERROR; 738 739 } 739 740 740 741 static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName) 741 742 { 742 743 744 745 743 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 744 745 FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName)); 746 return NOERROR; 746 747 } 747 748 748 749 static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath) 749 750 { 750 751 752 753 754 751 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 752 753 FIXME("(%p)->()\n",This); 754 lstrcpynAtoW(pszDir,"c:\\", cchMaxPath); 755 return NOERROR; 755 756 } 756 757 757 758 static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir) 758 759 { 759 760 761 762 760 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 761 762 FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir)); 763 return NOERROR; 763 764 } 764 765 765 766 static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath) 766 767 { 767 768 769 770 771 768 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 769 770 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath); 771 lstrcpynAtoW(pszArgs, "", cchMaxPath); 772 return NOERROR; 772 773 } 773 774 774 775 static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs) 775 776 { 776 777 778 779 777 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 778 779 FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs)); 780 return NOERROR; 780 781 } 781 782 782 783 static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey) 783 784 { 784 785 786 787 788 785 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 786 787 FIXME("(%p)->(%p)\n",This, pwHotkey); 788 *pwHotkey=0x0; 789 return NOERROR; 789 790 } 790 791 791 792 static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey) 792 793 { 793 794 795 796 794 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 795 796 FIXME("(%p)->(hotkey=%x)\n",This, wHotkey); 797 return NOERROR; 797 798 } 798 799 799 800 static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd) 800 801 { 801 802 803 804 805 802 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 803 804 FIXME("(%p)->(%p)\n",This, piShowCmd); 805 *piShowCmd=0; 806 return NOERROR; 806 807 } 807 808 808 809 static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd) 809 810 { 810 811 812 813 811 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 812 813 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd); 814 return NOERROR; 814 815 } 815 816 816 817 static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon) 817 818 { 818 819 820 821 822 823 819 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 820 821 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon); 822 lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath); 823 *piIcon=1; 824 return NOERROR; 824 825 } 825 826 826 827 static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon) 827 828 { 828 829 830 831 829 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 830 831 FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon); 832 return NOERROR; 832 833 } 833 834 834 835 static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved) 835 836 { 836 837 838 839 837 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 838 839 FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved); 840 return NOERROR; 840 841 } 841 842 842 843 static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags) 843 844 { 844 845 846 847 845 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 846 847 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags); 848 return NOERROR; 848 849 } 849 850 850 851 static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile) 851 852 { 852 853 854 855 853 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 854 855 FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile)); 856 return NOERROR; 856 857 } 857 858 … … 861 862 862 863 static ICOM_VTABLE(IShellLinkW) slvtw = 863 { 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 864 { 865 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 866 IShellLinkW_fnQueryInterface, 867 IShellLinkW_fnAddRef, 868 IShellLinkW_fnRelease, 869 IShellLinkW_fnGetPath, 870 IShellLinkW_fnGetIDList, 871 IShellLinkW_fnSetIDList, 872 IShellLinkW_fnGetDescription, 873 IShellLinkW_fnSetDescription, 874 IShellLinkW_fnGetWorkingDirectory, 875 IShellLinkW_fnSetWorkingDirectory, 876 IShellLinkW_fnGetArguments, 877 IShellLinkW_fnSetArguments, 878 IShellLinkW_fnGetHotkey, 879 IShellLinkW_fnSetHotkey, 880 IShellLinkW_fnGetShowCmd, 881 IShellLinkW_fnSetShowCmd, 882 IShellLinkW_fnGetIconLocation, 883 IShellLinkW_fnSetIconLocation, 884 IShellLinkW_fnSetRelativePath, 885 IShellLinkW_fnResolve, 886 IShellLinkW_fnSetPath 886 887 }; 887 888 888 889 /************************************************************************** 889 * 890 * IShellLink_Constructor 890 891 */ 891 892 IShellLink * IShellLink_Constructor(BOOL bUnicode) 892 { 893 894 895 896 897 898 899 900 901 902 903 904 } 905 906 893 { IShellLinkImpl * sl; 894 895 sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl)); 896 sl->ref = 1; 897 sl->lpvtbl = &slvt; 898 sl->lpvtblw = &slvtw; 899 sl->lpvtblPersistFile = &pfvt; 900 sl->lpvtblPersistStream = &psvt; 901 902 TRACE("(%p)->()\n",sl); 903 shell32_ObjCount++; 904 return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl; 905 } 906 907
Note:
See TracChangeset
for help on using the changeset viewer.