This commit is contained in:
Scott E. Graves 2024-10-09 13:58:41 -05:00
parent 92295506a7
commit 27b37eb570

View File

@ -59,7 +59,7 @@ auto remote_winfsp_drive::winfsp_service::OnStart(ULONG, PWSTR *) -> NTSTATUS {
const auto drive_letter =
((mount_location.size() == 2U) ||
((mount_location.size() == 3U) && (mount_location.at(2U) == '\\'))) &&
(mount_location[1U] == ':');
(mount_location.at(1U) == ':');
auto ret = drive_letter ? STATUS_DEVICE_BUSY : STATUS_NOT_SUPPORTED;
if ((drive_letter && not utils::file::directory(mount_location).exists())) {
@ -119,7 +119,7 @@ auto remote_winfsp_drive::CanDelete(PVOID /*file_node*/, PVOID file_desc,
VOID remote_winfsp_drive::Cleanup(PVOID /*file_node*/, PVOID file_desc,
PWSTR file_name, ULONG flags) {
BOOLEAN was_closed;
BOOLEAN was_closed{};
remote_instance_->winfsp_cleanup(file_desc, file_name, flags, was_closed);
}
@ -295,9 +295,9 @@ auto remote_winfsp_drive::Open(PWSTR file_name, UINT32 create_options,
if (ret == STATUS_SUCCESS) {
set_file_info(ofi->FileInfo, fi);
const auto file_path = utils::string::from_utf8(normalize_name);
wcsncpy(ofi->NormalizedName, &file_path[0], wcslen(&file_path[0]));
wcsncpy(ofi->NormalizedName, file_path.data(), wcslen(file_path.c_str()));
ofi->NormalizedNameSize =
static_cast<UINT16>(wcslen(&file_path[0]) * sizeof(WCHAR));
static_cast<UINT16>(wcslen(file_path.c_str()) * sizeof(WCHAR));
}
return ret;