Compare commits

...

1 Commits

Author SHA1 Message Date
mailwl
0569827a68 BCAT: Stub CreateDeliveryCacheStorageService, add some services 2019-09-08 12:53:55 +03:00
3 changed files with 115 additions and 1 deletions

View File

@@ -8,9 +8,16 @@ namespace Service::BCAT {
BCAT::BCAT(std::shared_ptr<Module> module, const char* name)
: Module::Interface(std::move(module), name) {
// clang-format off
static const FunctionInfo functions[] = {
{0, &BCAT::CreateBcatService, "CreateBcatService"},
{1, &BCAT::CreateDeliveryCacheStorageService, "CreateDeliveryCacheStorageService"},
{2, nullptr, "CreateDeliveryCacheStorageServiceWithApplicationId"},
{3, nullptr, "CreateDeliveryCacheProgressService"},
{4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"},
};
// clang-format on
RegisterHandlers(functions);
}

View File

@@ -9,11 +9,26 @@
namespace Service::BCAT {
class IDeliveryCacheProgressService final : public ServiceFramework<IDeliveryCacheProgressService> {
public:
IDeliveryCacheProgressService() : ServiceFramework("IDeliveryCacheProgressService") {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "GetEvent"},
{1, nullptr, "GetImpl"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class IBcatService final : public ServiceFramework<IBcatService> {
public:
IBcatService() : ServiceFramework("IBcatService") {
// clang-format off
static const FunctionInfo functions[] = {
{10100, nullptr, "RequestSyncDeliveryCache"},
{10100, &IBcatService::RequestSyncDeliveryCache, "RequestSyncDeliveryCache"},
{10101, nullptr, "RequestSyncDeliveryCacheWithDirectoryName"},
{10200, nullptr, "CancelSyncDeliveryCacheRequest"},
{20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"},
@@ -28,8 +43,91 @@ public:
{90201, nullptr, "ClearDeliveryCacheStorage"},
{90300, nullptr, "GetPushNotificationLog"},
};
// clang-format on
RegisterHandlers(functions);
}
private:
void RequestSyncDeliveryCache(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_BCAT, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDeliveryCacheProgressService>();
}
};
class IDeliveryCacheFileService final : public ServiceFramework<IDeliveryCacheFileService> {
public:
IDeliveryCacheFileService() : ServiceFramework("IDeliveryCacheFileService") {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "Open"},
{1, nullptr, "Read"},
{2, nullptr, "GetSize"},
{4, nullptr, "GetDigest"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class IDeliveryCacheDirectoryService final
: public ServiceFramework<IDeliveryCacheDirectoryService> {
public:
IDeliveryCacheDirectoryService() : ServiceFramework("IDeliveryCacheDirectoryService") {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "Open"},
{1, nullptr, "Read"},
{2, nullptr, "GetCount"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class IDeliveryCacheStorageService final : public ServiceFramework<IDeliveryCacheStorageService> {
public:
IDeliveryCacheStorageService() : ServiceFramework("IDeliveryCacheStorageService") {
// clang-format off
static const FunctionInfo functions[] = {
{0, &IDeliveryCacheStorageService::CreateFileService, "CreateFileService"},
{1, &IDeliveryCacheStorageService::CreateDirectoryService, "CreateDirectoryService"},
{10, &IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory, "EnumerateDeliveryCacheDirectory"},
};
// clang-format on
RegisterHandlers(functions);
}
private:
void CreateFileService(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_BCAT, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDeliveryCacheFileService>();
}
void CreateDirectoryService(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_BCAT, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDeliveryCacheDirectoryService>();
}
void EnumerateDeliveryCacheDirectory(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_BCAT, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0);
}
};
void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
@@ -40,6 +138,14 @@ void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
rb.PushIpcInterface<IBcatService>();
}
void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_BCAT, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDeliveryCacheStorageService>();
}
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {}

View File

@@ -16,6 +16,7 @@ public:
~Interface() override;
void CreateBcatService(Kernel::HLERequestContext& ctx);
void CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx);
protected:
std::shared_ptr<Module> module;