| 198 | } |
| 199 | |
| 200 | static PCASC_FILE_SPAN_INFO GetFileInfo(HANDLE hFile, CASC_FILE_FULL_INFO& FileInfo) noexcept |
| 201 | { |
| 202 | PCASC_FILE_SPAN_INFO pSpans = nullptr; |
| 203 | // Retrieve the full file info |
| 204 | if (CascGetFileInfo(hFile, CascFileFullInfo, &FileInfo, sizeof(CASC_FILE_FULL_INFO), nullptr) |
| 205 | && (pSpans = CASC_ALLOC<CASC_FILE_SPAN_INFO>(FileInfo.SpanCount)) != nullptr |
| 206 | && !CascGetFileInfo(hFile, CascFileSpanInfo, pSpans, FileInfo.SpanCount * sizeof(CASC_FILE_SPAN_INFO), nullptr)) |
| 207 | { |
| 208 | CASC_FREE(pSpans); |
| 209 | pSpans = nullptr; |
| 210 | } |
| 211 | return pSpans; |
| 212 | } |
| 213 | |
| 214 | static bool ExtractFile(HANDLE hStorage, const CASC_FIND_DATA& findData, const char* targetDirPath, const char* targetFilePath) { |
| 215 | namespace fs = std::filesystem; |
no test coverage detected