arp.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <memory>
  5. #include "common/logging/log.h"
  6. #include "core/hle/ipc_helpers.h"
  7. #include "core/hle/kernel/hle_ipc.h"
  8. #include "core/hle/service/arp/arp.h"
  9. #include "core/hle/service/service.h"
  10. #include "core/hle/service/sm/sm.h"
  11. namespace Service::ARP {
  12. class ARP_R final : public ServiceFramework<ARP_R> {
  13. public:
  14. explicit ARP_R() : ServiceFramework{"arp:r"} {
  15. // clang-format off
  16. static const FunctionInfo functions[] = {
  17. {0, nullptr, "GetApplicationLaunchProperty"},
  18. {1, nullptr, "GetApplicationLaunchPropertyWithApplicationId"},
  19. {2, nullptr, "GetApplicationControlProperty"},
  20. {3, nullptr, "GetApplicationControlPropertyWithApplicationId"},
  21. };
  22. // clang-format on
  23. RegisterHandlers(functions);
  24. }
  25. };
  26. class IRegistrar final : public ServiceFramework<IRegistrar> {
  27. public:
  28. explicit IRegistrar() : ServiceFramework{"IRegistrar"} {
  29. // clang-format off
  30. static const FunctionInfo functions[] = {
  31. {0, nullptr, "Issue"},
  32. {1, nullptr, "SetApplicationLaunchProperty"},
  33. {2, nullptr, "SetApplicationControlProperty"},
  34. };
  35. // clang-format on
  36. RegisterHandlers(functions);
  37. }
  38. };
  39. class ARP_W final : public ServiceFramework<ARP_W> {
  40. public:
  41. explicit ARP_W() : ServiceFramework{"arp:w"} {
  42. // clang-format off
  43. static const FunctionInfo functions[] = {
  44. {0, &ARP_W::AcquireRegistrar, "AcquireRegistrar"},
  45. {1, nullptr, "DeleteProperties"},
  46. };
  47. // clang-format on
  48. RegisterHandlers(functions);
  49. }
  50. private:
  51. void AcquireRegistrar(Kernel::HLERequestContext& ctx) {
  52. LOG_DEBUG(Service_ARP, "called");
  53. IPC::ResponseBuilder rb{ctx, 2, 0, 1};
  54. rb.Push(RESULT_SUCCESS);
  55. rb.PushIpcInterface<IRegistrar>();
  56. }
  57. };
  58. void InstallInterfaces(SM::ServiceManager& sm) {
  59. std::make_shared<ARP_R>()->InstallAsService(sm);
  60. std::make_shared<ARP_W>()->InstallAsService(sm);
  61. }
  62. } // namespace Service::ARP