| 153 | } |
| 154 | |
| 155 | HRESULT NFileOperations::CopyFilesToFolder( |
| 156 | HWND hOwner, const std::wstring &strTitle, std::vector<PCIDLIST_ABSOLUTE> &pidls, bool move) |
| 157 | { |
| 158 | PIDLIST_ABSOLUTE pidl; |
| 159 | BOOL bRes = NFileOperations::CreateBrowseDialog(hOwner, strTitle, &pidl); |
| 160 | |
| 161 | if (!bRes) |
| 162 | { |
| 163 | return E_FAIL; |
| 164 | } |
| 165 | |
| 166 | BOOST_SCOPE_EXIT(pidl) |
| 167 | { |
| 168 | CoTaskMemFree(pidl); |
| 169 | } |
| 170 | BOOST_SCOPE_EXIT_END |
| 171 | |
| 172 | IShellItem *destinationFolder = nullptr; |
| 173 | HRESULT hr = SHCreateItemFromIDList(pidl, IID_PPV_ARGS(&destinationFolder)); |
| 174 | |
| 175 | if (FAILED(hr)) |
| 176 | { |
| 177 | return E_FAIL; |
| 178 | } |
| 179 | |
| 180 | BOOST_SCOPE_EXIT(destinationFolder) |
| 181 | { |
| 182 | destinationFolder->Release(); |
| 183 | } |
| 184 | BOOST_SCOPE_EXIT_END |
| 185 | |
| 186 | hr = CopyFiles(hOwner, destinationFolder, pidls, move); |
| 187 | |
| 188 | return hr; |
| 189 | } |
| 190 | |
| 191 | HRESULT NFileOperations::CopyFiles( |
| 192 | HWND hwnd, IShellItem *destinationFolder, std::vector<PCIDLIST_ABSOLUTE> &pidls, bool move) |
nothing calls this directly
no test coverage detected