| 666 | } |
| 667 | |
| 668 | nfdresult_t NFD_PathSet_EnumNextN(nfdpathsetenum_t* enumerator, nfdnchar_t** outPath) { |
| 669 | assert(enumerator->ptr); |
| 670 | |
| 671 | ::IEnumShellItems* pesiPaths = static_cast<::IEnumShellItems*>(enumerator->ptr); |
| 672 | |
| 673 | ::IShellItem* psiPath; |
| 674 | HRESULT res = pesiPaths->Next(1, &psiPath, NULL); |
| 675 | if (!SUCCEEDED(res)) { |
| 676 | NFDi_SetError("Could not get next item of enumerator."); |
| 677 | return NFD_ERROR; |
| 678 | } |
| 679 | if (res != S_OK) { |
| 680 | *outPath = nullptr; |
| 681 | return NFD_OKAY; |
| 682 | } |
| 683 | |
| 684 | Release_Guard<::IShellItem> psiPathGuard(psiPath); |
| 685 | |
| 686 | nfdnchar_t* name; |
| 687 | if (!SUCCEEDED(psiPath->GetDisplayName(::SIGDN_FILESYSPATH, &name))) { |
| 688 | NFDi_SetError("Could not get file path from shell item."); |
| 689 | return NFD_ERROR; |
| 690 | } |
| 691 | |
| 692 | *outPath = name; |
| 693 | return NFD_OKAY; |
| 694 | } |
| 695 | |
| 696 | void NFD_PathSet_Free(const nfdpathset_t* pathSet) { |
| 697 | assert(pathSet); |
no test coverage detected