MCPcopy Create free account
hub / github.com/catboost/catboost / ReadReparsePoint

Function ReadReparsePoint

util/system/fs_win.cpp:195–210  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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,

Callers 2

WinReadLinkFunction · 0.85
WinReadReparseTagFunction · 0.85

Calls 3

TTempBufClass · 0.85
DataMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected