| 606 | } |
| 607 | |
| 608 | HRESULT NFileOperations::CreateLinkToFile(const std::wstring &strTargetFilename, |
| 609 | const std::wstring &strLinkFilename, const std::wstring &strLinkDescription) |
| 610 | { |
| 611 | IShellLink *pShellLink = NULL; |
| 612 | HRESULT hr = |
| 613 | CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pShellLink)); |
| 614 | |
| 615 | if (SUCCEEDED(hr)) |
| 616 | { |
| 617 | pShellLink->SetPath(strTargetFilename.c_str()); |
| 618 | pShellLink->SetDescription(strLinkDescription.c_str()); |
| 619 | |
| 620 | IPersistFile *pPersistFile = NULL; |
| 621 | hr = pShellLink->QueryInterface(IID_PPV_ARGS(&pPersistFile)); |
| 622 | |
| 623 | if (SUCCEEDED(hr)) |
| 624 | { |
| 625 | pPersistFile->Save(strLinkFilename.c_str(), TRUE); |
| 626 | pPersistFile->Release(); |
| 627 | } |
| 628 | |
| 629 | pShellLink->Release(); |
| 630 | } |
| 631 | |
| 632 | return hr; |
| 633 | } |
| 634 | |
| 635 | HRESULT NFileOperations::ResolveLink( |
| 636 | HWND hwnd, DWORD fFlags, const TCHAR *szLinkFilename, TCHAR *szResolvedPath, int nBufferSize) |
nothing calls this directly
no test coverage detected