Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -3219,7 +3219,7 @@ namespace filesystem {

_NODISCARD inline __std_win_error _Read_reparse_data(
const _Fs_file& _Handle, unique_ptr<char[]>& _Buffer_unique_ptr) noexcept {
constexpr auto _Buffer_size = 16 * 1024 + sizeof(wchar_t); // MAXIMUM_REPARSE_DATA_BUFFER_SIZE + sizeof(wchar_t)
constexpr auto _Buffer_size = 16 * 1024; // MAXIMUM_REPARSE_DATA_BUFFER_SIZE

_Buffer_unique_ptr.reset(::new (nothrow) char[_Buffer_size]);
if (!_Buffer_unique_ptr) {
Expand Down
2 changes: 2 additions & 0 deletions stl/inc/xfilesystem_abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ struct __std_fs_reparse_data_buffer { // typedef struct _REPARSE_DATA_BUFFER
};
};

inline constexpr unsigned long __std_fs_reparse_data_buffer_header_size = 8; // REPARSE_DATA_BUFFER_HEADER_SIZE

struct __std_ulong_and_error {
unsigned long _Size;
__std_win_error _Error;
Expand Down
4 changes: 2 additions & 2 deletions stl/src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ struct __std_fs_file_id { // typedef struct _FILE_ID_INFO {

[[nodiscard]] __std_win_error __stdcall __std_fs_write_reparse_data_buffer(
_In_ const __std_fs_file_handle _Handle, _In_ const __std_fs_reparse_data_buffer* const _Buffer) noexcept {
const auto _Buffer_size = __std_fs_reparse_data_buffer_header_size + _Buffer->_Reparse_data_length;
if (DeviceIoControl(reinterpret_cast<HANDLE>(_Handle), FSCTL_SET_REPARSE_POINT,
const_cast<__std_fs_reparse_data_buffer*>(_Buffer), sizeof(_Buffer) + _Buffer->_Reparse_data_length,
nullptr, 0, nullptr, nullptr)) {
const_cast<__std_fs_reparse_data_buffer*>(_Buffer), _Buffer_size, nullptr, 0, nullptr, nullptr)) {
return __std_win_error::_Success;
}

Expand Down