winfsp unit tests and fixes

This commit is contained in:
Scott E. Graves 2024-10-30 12:37:26 -05:00
parent da60c39216
commit 7d74d192f9

View File

@ -166,10 +166,9 @@ auto winfsp_drive::CanDelete(PVOID /*file_node*/, PVOID file_desc,
}
api_path = file->get_api_path();
if (file->is_directory()) {
return handle_error(provider_.get_directory_item_count(api_path) == 0U
? api_error::success
: api_error::directory_not_empty);
if (file->is_directory() &&
provider_.get_directory_item_count(api_path) != 0U) {
return handle_error(api_error::directory_not_empty);
}
return handle_error(api_error::success);
@ -422,6 +421,7 @@ auto winfsp_drive::GetFileInfo(PVOID /*file_node*/, PVOID file_desc,
return handle_error(api_error::invalid_handle);
}
api_path = file->get_api_path();
return handle_error(api_error::success);
}