| 65 | } |
| 66 | |
| 67 | std::vector<String> FilterFiles(const std::vector<String>& files_src) |
| 68 | { |
| 69 | std::vector<String> files(files_src); |
| 70 | tchar_t szTempPath[MAX_PATH]; |
| 71 | tchar_t szTempPathShort[MAX_PATH]; |
| 72 | GetTempPath(sizeof(szTempPath) / sizeof(szTempPath[0]), szTempPath); |
| 73 | GetShortPathName(szTempPath, szTempPathShort, sizeof(szTempPathShort) / sizeof(szTempPathShort[0])); |
| 74 | |
| 75 | for (UINT i = 0; i < files.size(); i++) |
| 76 | { |
| 77 | if (paths::IsShortcut(files[i])) |
| 78 | { |
| 79 | // if this was a shortcut, we need to expand it to the target path |
| 80 | String expandedFile = paths::ExpandShortcut(files[i]); |
| 81 | |
| 82 | // if that worked, we should have a real file name |
| 83 | if (!expandedFile.empty()) |
| 84 | files[i] = expandedFile; |
| 85 | } |
| 86 | else if (paths::IsDecendant(files[i], szTempPath) || paths::IsDecendant(files[i], szTempPathShort)) |
| 87 | { |
| 88 | String tmpdir = env::GetTempChildPath(); |
| 89 | CopyFileOrFolder(files[i], tmpdir); |
| 90 | files[i] = paths::ConcatPath(tmpdir, paths::FindFileName(files[i])); |
| 91 | } |
| 92 | } |
| 93 | return files; |
| 94 | } |
| 95 | |
| 96 | HRESULT IStream_WriteToFile(IStream *pStream, const String& filename) |
| 97 | { |
no test coverage detected