This commit is contained in:
Scott E. Graves 2024-10-09 14:03:06 -05:00
parent 27b37eb570
commit b35e100bb2
2 changed files with 12 additions and 6 deletions

View File

@ -346,8 +346,10 @@ auto remote_winfsp_drive::ReadDirectory(PVOID /*file_node*/, PVOID file_desc,
PVOID buffer, ULONG buffer_length,
PULONG bytes_transferred) -> NTSTATUS {
json item_list;
auto ret = remote_instance_->winfsp_read_directory(file_desc, pattern, marker,
item_list);
auto ret{
static_cast<NTSTATUS>(remote_instance_->winfsp_read_directory(
file_desc, pattern, marker, item_list)),
};
if (ret == STATUS_SUCCESS) {
PVOID *directory_buffer{nullptr};
if ((ret = remote_instance_->winfsp_get_dir_buffer(

View File

@ -1324,14 +1324,18 @@ TEST(file_manager,
#if defined(_WIN32)
EXPECT_EQ(api_error::success, fm.open(non_writeable, {}, handle, f));
EXPECT_CALL(*non_writeable, get_open_data())
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data> {
return {{handle, {}}};
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data>& {
static std::map<std::uint64_t, open_file_data> map;
map[handle]={};
return map;
});
#else
EXPECT_EQ(api_error::success, fm.open(non_writeable, O_RDWR, handle, f));
EXPECT_CALL(*non_writeable, get_open_data())
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data> {
return {{handle, O_RDWR}};
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data>& {
static std::map<std::uint64_t, open_file_data> map;
map[handle]=O_RDWR;
return map;
});
#endif