This commit is contained in:
@ -101,8 +101,6 @@ E_SIMPLE3(winfsp_event, debug,
|
|||||||
std::string, api_path, ap, E_FROM_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
NTSTATUS, result, res, E_FROM_INT32
|
NTSTATUS, result, res, E_FROM_INT32
|
||||||
);
|
);
|
||||||
E_SIMPLE(drive_stop_begin, info);
|
|
||||||
E_SIMPLE(drive_stop_end, info);
|
|
||||||
E_SIMPLE(drive_stop_timed_out, info);
|
E_SIMPLE(drive_stop_timed_out, info);
|
||||||
E_SIMPLE3(remote_winfsp_client_event, debug,
|
E_SIMPLE3(remote_winfsp_client_event, debug,
|
||||||
std::string, function, func, E_FROM_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
|
@ -126,7 +126,7 @@ auto winfsp_drive::winfsp_service::OnStart(ULONG /*Argc*/,
|
|||||||
}
|
}
|
||||||
|
|
||||||
event_system::instance().raise<drive_mount_failed>(function_name,
|
event_system::instance().raise<drive_mount_failed>(function_name,
|
||||||
mount_location, ret);
|
mount_location, ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -134,8 +134,6 @@ auto winfsp_drive::winfsp_service::OnStart(ULONG /*Argc*/,
|
|||||||
auto winfsp_drive::winfsp_service::OnStop() -> NTSTATUS {
|
auto winfsp_drive::winfsp_service::OnStop() -> NTSTATUS {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
event_system::instance().raise<drive_stop_begin>();
|
|
||||||
|
|
||||||
timeout stop_timeout(
|
timeout stop_timeout(
|
||||||
[]() {
|
[]() {
|
||||||
event_system::instance().raise<drive_stop_timed_out>();
|
event_system::instance().raise<drive_stop_timed_out>();
|
||||||
@ -146,8 +144,6 @@ auto winfsp_drive::winfsp_service::OnStop() -> NTSTATUS {
|
|||||||
|
|
||||||
stop_timeout.disable();
|
stop_timeout.disable();
|
||||||
|
|
||||||
event_system::instance().raise<drive_stop_end>();
|
|
||||||
|
|
||||||
if (not lock_.set_mount_state(false, "", -1)) {
|
if (not lock_.set_mount_state(false, "", -1)) {
|
||||||
utils::error::raise_error(function_name, "failed to set mount state");
|
utils::error::raise_error(function_name, "failed to set mount state");
|
||||||
}
|
}
|
||||||
@ -621,7 +617,7 @@ auto winfsp_drive::mount(const std::vector<std::string> &drive_args) -> int {
|
|||||||
auto ret = svc.Run();
|
auto ret = svc.Run();
|
||||||
|
|
||||||
event_system::instance().raise<drive_mount_result>(function_name, "",
|
event_system::instance().raise<drive_mount_result>(function_name, "",
|
||||||
std::to_string(ret));
|
std::to_string(ret));
|
||||||
event_system::instance().stop();
|
event_system::instance().stop();
|
||||||
cons.reset();
|
cons.reset();
|
||||||
|
|
||||||
@ -675,7 +671,7 @@ auto winfsp_drive::Mounted(PVOID host) -> NTSTATUS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
event_system::instance().raise<drive_mounted>(function_name,
|
event_system::instance().raise<drive_mounted>(function_name,
|
||||||
mount_location);
|
mount_location);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
utils::error::raise_error(function_name, e, "exception occurred");
|
utils::error::raise_error(function_name, e, "exception occurred");
|
||||||
@ -1214,12 +1210,12 @@ VOID winfsp_drive::Unmounted(PVOID host) {
|
|||||||
auto *file_system_host = reinterpret_cast<FileSystemHost *>(host);
|
auto *file_system_host = reinterpret_cast<FileSystemHost *>(host);
|
||||||
auto mount_location = parse_mount_location(file_system_host->MountPoint());
|
auto mount_location = parse_mount_location(file_system_host->MountPoint());
|
||||||
event_system::instance().raise<drive_unmount_pending>(function_name,
|
event_system::instance().raise<drive_unmount_pending>(function_name,
|
||||||
mount_location);
|
mount_location);
|
||||||
|
|
||||||
stop_all();
|
stop_all();
|
||||||
|
|
||||||
event_system::instance().raise<drive_unmounted>(function_name,
|
event_system::instance().raise<drive_unmounted>(function_name,
|
||||||
mount_location);
|
mount_location);
|
||||||
config_.save();
|
config_.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user