fixes
This commit is contained in:
parent
becd137cf5
commit
97082fa42c
@ -89,23 +89,6 @@ auto from_api_error(const api_error &e) -> NTSTATUS {
|
|||||||
|
|
||||||
auto get_last_error_code() -> DWORD { return ::GetLastError(); }
|
auto get_last_error_code() -> DWORD { return ::GetLastError(); }
|
||||||
|
|
||||||
auto get_local_app_data_directory() -> const std::string & {
|
|
||||||
static std::string app_data = ([]() -> std::string {
|
|
||||||
com_init_wrapper cw;
|
|
||||||
PWSTR local_app_data{};
|
|
||||||
if (SUCCEEDED(::SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr,
|
|
||||||
&local_app_data))) {
|
|
||||||
auto ret = utils::string::to_utf8(local_app_data);
|
|
||||||
::CoTaskMemFree(local_app_data);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw startup_exception("unable to detect local application data folder");
|
|
||||||
})();
|
|
||||||
|
|
||||||
return app_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto get_accessed_time_from_meta(const api_meta_map &meta) -> std::uint64_t {
|
auto get_accessed_time_from_meta(const api_meta_map &meta) -> std::uint64_t {
|
||||||
return utils::string::to_uint64(meta.at(META_ACCESSED));
|
return utils::string::to_uint64(meta.at(META_ACCESSED));
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ mount(std::vector<const char *> args, std::string data_directory,
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if (config.get_enable_mount_manager() &&
|
if (config.get_enable_mount_manager() &&
|
||||||
not utils::is_process_elevated()) {
|
not utils::is_process_elevated()) {
|
||||||
com_init_wrapper cw;
|
utils::com_init_wrapper cw;
|
||||||
if (not lock.set_mount_state(true, "elevating", -1)) {
|
if (not lock.set_mount_state(true, "elevating", -1)) {
|
||||||
std::cerr << "failed to set mount state" << std::endl;
|
std::cerr << "failed to set mount state" << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user