mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-17 06:12:15 +02:00
ncm client: SubmissionPackageInstallTask fixes
This commit is contained in:
parent
0f3a315c20
commit
d11ecc9208
@ -23,10 +23,10 @@ namespace ams::ncm {
|
|||||||
private:
|
private:
|
||||||
class Impl;
|
class Impl;
|
||||||
private:
|
private:
|
||||||
Impl *impl;
|
std::unique_ptr<Impl> impl;
|
||||||
public:
|
public:
|
||||||
SubmissionPackageInstallTask() { /* ... */ }
|
SubmissionPackageInstallTask() { /* ... */ }
|
||||||
~SubmissionPackageInstallTask();
|
virtual ~SubmissionPackageInstallTask() override { /* ... */ }
|
||||||
|
|
||||||
Result Initialize(fs::FileHandle handle, StorageId storage_id, void *buffer, size_t buffer_size, bool ignore_ticket);
|
Result Initialize(fs::FileHandle handle, StorageId storage_id, void *buffer, size_t buffer_size, bool ignore_ticket);
|
||||||
};
|
};
|
||||||
|
@ -21,17 +21,18 @@ namespace ams::ncm {
|
|||||||
class SubmissionPackageInstallTask::Impl {
|
class SubmissionPackageInstallTask::Impl {
|
||||||
private:
|
private:
|
||||||
fs::FileHandleStorage storage;
|
fs::FileHandleStorage storage;
|
||||||
bool initialized;
|
std::optional<impl::MountName> mount_name;
|
||||||
impl::MountName mount_name;
|
|
||||||
public:
|
public:
|
||||||
Impl(fs::FileHandle handle) : storage(handle), initialized(false) { /* ... */ }
|
explicit Impl(fs::FileHandle handle) : storage(handle), mount_name(std::nullopt) { /* ... */ }
|
||||||
~Impl() {
|
~Impl() {
|
||||||
if (this->initialized) {
|
if (this->mount_name) {
|
||||||
fs::fsa::Unregister(this->mount_name.str);
|
fs::fsa::Unregister(this->mount_name->str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Result Initialize() {
|
Result Initialize() {
|
||||||
|
AMS_ASSERT(!this->mount_name);
|
||||||
|
|
||||||
/* Allocate a partition file system. */
|
/* Allocate a partition file system. */
|
||||||
auto partition_file_system = std::make_unique<fssystem::PartitionFileSystem>();
|
auto partition_file_system = std::make_unique<fssystem::PartitionFileSystem>();
|
||||||
R_UNLESS(partition_file_system != nullptr, ncm::ResultAllocationFailed());
|
R_UNLESS(partition_file_system != nullptr, ncm::ResultAllocationFailed());
|
||||||
@ -42,7 +43,6 @@ namespace ams::ncm {
|
|||||||
|
|
||||||
/* Initialize members. */
|
/* Initialize members. */
|
||||||
this->mount_name = mount_name;
|
this->mount_name = mount_name;
|
||||||
this->initialized = true;
|
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,8 +58,10 @@ namespace ams::ncm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result SubmissionPackageInstallTask::Initialize(fs::FileHandle handle, StorageId storage_id, void *buffer, size_t buffer_size, bool ignore_ticket) {
|
Result SubmissionPackageInstallTask::Initialize(fs::FileHandle handle, StorageId storage_id, void *buffer, size_t buffer_size, bool ignore_ticket) {
|
||||||
|
AMS_ASSERT(!this->impl);
|
||||||
|
|
||||||
/* Allocate impl. */
|
/* Allocate impl. */
|
||||||
this->impl = new (std::nothrow) Impl(handle);
|
this->impl.reset(new (std::nothrow) Impl(handle));
|
||||||
R_UNLESS(this->impl != nullptr, ncm::ResultAllocationFailed());
|
R_UNLESS(this->impl != nullptr, ncm::ResultAllocationFailed());
|
||||||
|
|
||||||
/* Initialize impl. */
|
/* Initialize impl. */
|
||||||
|
Loading…
Reference in New Issue
Block a user