------------------------------------------------------------------------
| 216 | |
| 217 | //------------------------------------------------------------------------ |
| 218 | bool isFolderSymbolicLink (const filesystem::path& p) |
| 219 | { |
| 220 | #if USE_FILESYSTEM |
| 221 | if (/*filesystem::exists (p) &&*/ filesystem::is_symlink (p)) |
| 222 | return true; |
| 223 | #else |
| 224 | std::wstring wString = p.generic_wstring (); |
| 225 | auto attrib = GetFileAttributesW (reinterpret_cast<LPCWSTR> (wString.c_str ())); |
| 226 | if (attrib & FILE_ATTRIBUTE_REPARSE_POINT) |
| 227 | { |
| 228 | auto hFile = CreateFileW (reinterpret_cast<LPCWSTR> (wString.c_str ()), GENERIC_READ, |
| 229 | FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr); |
| 230 | if (hFile == INVALID_HANDLE_VALUE) |
| 231 | return true; |
| 232 | else |
| 233 | CloseHandle (hFile); |
| 234 | } |
| 235 | #endif |
| 236 | return false; |
| 237 | } |
| 238 | |
| 239 | //------------------------------------------------------------------------ |
| 240 | Optional<std::string> getKnownFolder (REFKNOWNFOLDERID folderID) |
no test coverage detected