For more info see: https://docs.microsoft.com/en-us/windows/win32/fileio/reparse-points https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-get-reparse-point https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_reparse_data_buffer
| 193 | // * https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-get-reparse-point |
| 194 | // * https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_reparse_data_buffer |
| 195 | REPARSE_DATA_BUFFER* ReadReparsePoint(HANDLE h, TTempBuf& buf) { |
| 196 | while (true) { |
| 197 | DWORD bytesReturned = 0; |
| 198 | BOOL res = DeviceIoControl(h, FSCTL_GET_REPARSE_POINT, nullptr, 0, buf.Data(), buf.Size(), &bytesReturned, nullptr); |
| 199 | if (res) { |
| 200 | REPARSE_DATA_BUFFER* rdb = (REPARSE_DATA_BUFFER*)buf.Data(); |
| 201 | return rdb; |
| 202 | } else { |
| 203 | if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { |
| 204 | buf = TTempBuf(buf.Size() * 2); |
| 205 | } else { |
| 206 | return nullptr; |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | TString WinReadLink(const TString& name) { |
| 213 | TFileHandle h = CreateFileWithUtf8Name(name, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, |
no test coverage detected