Compare commits
2 Commits
281d3758e0
...
dab8c61f87
Author | SHA1 | Date | |
---|---|---|---|
dab8c61f87 | |||
e0cf58b01e |
@ -142,6 +142,7 @@ public:
|
|||||||
granted_access, attributes,
|
granted_access, attributes,
|
||||||
allocation_size, &file_desc, &file_info,
|
allocation_size, &file_desc, &file_info,
|
||||||
normalized_name, exists);
|
normalized_name, exists);
|
||||||
|
fmt::println("{}|{}", utils::string::to_utf8(file_name), exists);
|
||||||
if (ret == STATUS_SUCCESS) {
|
if (ret == STATUS_SUCCESS) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
this->set_client_id(file_desc, client_id);
|
this->set_client_id(file_desc, client_id);
|
||||||
@ -589,8 +590,9 @@ public:
|
|||||||
DECODE_OR_RETURN(request, flags);
|
DECODE_OR_RETURN(request, flags);
|
||||||
|
|
||||||
remote::file_handle handle{};
|
remote::file_handle handle{};
|
||||||
if ((ret = this->fuse_create(path.data(), mode, flags, handle)) >=
|
|
||||||
0) {
|
ret = this->fuse_create(path.data(), mode, flags, handle);
|
||||||
|
if (ret >= 0) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
this->set_compat_client_id(handle, client_id);
|
this->set_compat_client_id(handle, client_id);
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
@ -846,7 +848,8 @@ public:
|
|||||||
DECODE_OR_RETURN(request, flags);
|
DECODE_OR_RETURN(request, flags);
|
||||||
|
|
||||||
remote::file_handle handle;
|
remote::file_handle handle;
|
||||||
if ((ret = this->fuse_open(path.c_str(), flags, handle)) >= 0) {
|
ret = this->fuse_open(path.c_str(), flags, handle);
|
||||||
|
if (ret >= 0) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
this->set_compat_client_id(handle, client_id);
|
this->set_compat_client_id(handle, client_id);
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
@ -867,7 +870,8 @@ public:
|
|||||||
DECODE_OR_RETURN(request, path);
|
DECODE_OR_RETURN(request, path);
|
||||||
|
|
||||||
remote::file_handle handle{0};
|
remote::file_handle handle{0};
|
||||||
if ((ret = this->fuse_opendir(path.c_str(), handle)) >= 0) {
|
ret = this->fuse_opendir(path.c_str(), handle);
|
||||||
|
if (ret >= 0) {
|
||||||
this->add_directory(client_id, handle);
|
this->add_directory(client_id, handle);
|
||||||
response.encode(handle);
|
response.encode(handle);
|
||||||
}
|
}
|
||||||
|
@ -1122,11 +1122,12 @@ auto remote_server::winfsp_create(PWSTR file_name, UINT32 create_options,
|
|||||||
|
|
||||||
auto relative_path = utils::string::to_utf8(file_name);
|
auto relative_path = utils::string::to_utf8(file_name);
|
||||||
auto file_path = construct_path(relative_path);
|
auto file_path = construct_path(relative_path);
|
||||||
exists = utils::file::file{file_path}.exists() ||
|
exists = static_cast<BOOLEAN>(utils::file::file{file_path}.exists() ||
|
||||||
utils::file::directory{file_path}.exists();
|
utils::file::directory{file_path}.exists());
|
||||||
|
fmt::println("{}|{}", file_path, exists);
|
||||||
|
|
||||||
auto ret{static_cast<packet::error_type>(STATUS_SUCCESS)};
|
auto ret{static_cast<packet::error_type>(STATUS_SUCCESS)};
|
||||||
if (not exists) {
|
if (exists == 0U) {
|
||||||
if ((create_options & FILE_DIRECTORY_FILE) != 0U) {
|
if ((create_options & FILE_DIRECTORY_FILE) != 0U) {
|
||||||
attributes |= FILE_ATTRIBUTE_DIRECTORY;
|
attributes |= FILE_ATTRIBUTE_DIRECTORY;
|
||||||
} else {
|
} else {
|
||||||
|
@ -201,11 +201,11 @@ auto remote_client::winfsp_create(PWSTR file_name, UINT32 create_options,
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
else {
|
else {
|
||||||
ret = STATUS_OBJECT_NAME_COLLISION;
|
ret = STATUS_OBJECT_NAME_COLLISION;
|
||||||
::SetLastError(ERROR_FILE_EXISTS);
|
|
||||||
}
|
}
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt::println("{}|{}|{}", file_name, exists, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user