module.cpp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/logging/log.h"
  5. #include "core/hle/ipc_helpers.h"
  6. #include "core/hle/service/pctl/module.h"
  7. #include "core/hle/service/pctl/pctl.h"
  8. namespace Service::PCTL {
  9. class IParentalControlService final : public ServiceFramework<IParentalControlService> {
  10. public:
  11. IParentalControlService() : ServiceFramework("IParentalControlService") {
  12. static const FunctionInfo functions[] = {
  13. {1, &IParentalControlService::Initialize, "Initialize"},
  14. {1001, nullptr, "CheckFreeCommunicationPermission"},
  15. {1002, nullptr, "ConfirmLaunchApplicationPermission"},
  16. {1003, nullptr, "ConfirmResumeApplicationPermission"},
  17. {1004, nullptr, "ConfirmSnsPostPermission"},
  18. {1005, nullptr, "ConfirmSystemSettingsPermission"},
  19. {1006, nullptr, "IsRestrictionTemporaryUnlocked"},
  20. {1007, nullptr, "RevertRestrictionTemporaryUnlocked"},
  21. {1008, nullptr, "EnterRestrictedSystemSettings"},
  22. {1009, nullptr, "LeaveRestrictedSystemSettings"},
  23. {1010, nullptr, "IsRestrictedSystemSettingsEntered"},
  24. {1011, nullptr, "RevertRestrictedSystemSettingsEntered"},
  25. {1012, nullptr, "GetRestrictedFeatures"},
  26. {1013, nullptr, "ConfirmStereoVisionPermission"},
  27. {1014, nullptr, "ConfirmPlayableApplicationVideoOld"},
  28. {1015, nullptr, "ConfirmPlayableApplicationVideo"},
  29. {1031, nullptr, "IsRestrictionEnabled"},
  30. {1032, nullptr, "GetSafetyLevel"},
  31. {1033, nullptr, "SetSafetyLevel"},
  32. {1034, nullptr, "GetSafetyLevelSettings"},
  33. {1035, nullptr, "GetCurrentSettings"},
  34. {1036, nullptr, "SetCustomSafetyLevelSettings"},
  35. {1037, nullptr, "GetDefaultRatingOrganization"},
  36. {1038, nullptr, "SetDefaultRatingOrganization"},
  37. {1039, nullptr, "GetFreeCommunicationApplicationListCount"},
  38. {1042, nullptr, "AddToFreeCommunicationApplicationList"},
  39. {1043, nullptr, "DeleteSettings"},
  40. {1044, nullptr, "GetFreeCommunicationApplicationList"},
  41. {1045, nullptr, "UpdateFreeCommunicationApplicationList"},
  42. {1046, nullptr, "DisableFeaturesForReset"},
  43. {1047, nullptr, "NotifyApplicationDownloadStarted"},
  44. {1061, nullptr, "ConfirmStereoVisionRestrictionConfigurable"},
  45. {1062, nullptr, "GetStereoVisionRestriction"},
  46. {1063, nullptr, "SetStereoVisionRestriction"},
  47. {1064, nullptr, "ResetConfirmedStereoVisionPermission"},
  48. {1065, nullptr, "IsStereoVisionPermitted"},
  49. {1201, nullptr, "UnlockRestrictionTemporarily"},
  50. {1202, nullptr, "UnlockSystemSettingsRestriction"},
  51. {1203, nullptr, "SetPinCode"},
  52. {1204, nullptr, "GenerateInquiryCode"},
  53. {1205, nullptr, "CheckMasterKey"},
  54. {1206, nullptr, "GetPinCodeLength"},
  55. {1207, nullptr, "GetPinCodeChangedEvent"},
  56. {1208, nullptr, "GetPinCode"},
  57. {1403, nullptr, "IsPairingActive"},
  58. {1406, nullptr, "GetSettingsLastUpdated"},
  59. {1411, nullptr, "GetPairingAccountInfo"},
  60. {1421, nullptr, "GetAccountNickname"},
  61. {1424, nullptr, "GetAccountState"},
  62. {1432, nullptr, "GetSynchronizationEvent"},
  63. {1451, nullptr, "StartPlayTimer"},
  64. {1452, nullptr, "StopPlayTimer"},
  65. {1453, nullptr, "IsPlayTimerEnabled"},
  66. {1454, nullptr, "GetPlayTimerRemainingTime"},
  67. {1455, nullptr, "IsRestrictedByPlayTimer"},
  68. {1456, nullptr, "GetPlayTimerSettings"},
  69. {1457, nullptr, "GetPlayTimerEventToRequestSuspension"},
  70. {1458, nullptr, "IsPlayTimerAlarmDisabled"},
  71. {1471, nullptr, "NotifyWrongPinCodeInputManyTimes"},
  72. {1472, nullptr, "CancelNetworkRequest"},
  73. {1473, nullptr, "GetUnlinkedEvent"},
  74. {1474, nullptr, "ClearUnlinkedEvent"},
  75. {1601, nullptr, "DisableAllFeatures"},
  76. {1602, nullptr, "PostEnableAllFeatures"},
  77. {1603, nullptr, "IsAllFeaturesDisabled"},
  78. {1901, nullptr, "DeleteFromFreeCommunicationApplicationListForDebug"},
  79. {1902, nullptr, "ClearFreeCommunicationApplicationListForDebug"},
  80. {1903, nullptr, "GetExemptApplicationListCountForDebug"},
  81. {1904, nullptr, "GetExemptApplicationListForDebug"},
  82. {1905, nullptr, "UpdateExemptApplicationListForDebug"},
  83. {1906, nullptr, "AddToExemptApplicationListForDebug"},
  84. {1907, nullptr, "DeleteFromExemptApplicationListForDebug"},
  85. {1908, nullptr, "ClearExemptApplicationListForDebug"},
  86. {1941, nullptr, "DeletePairing"},
  87. {1951, nullptr, "SetPlayTimerSettingsForDebug"},
  88. {1952, nullptr, "GetPlayTimerSpentTimeForTest"},
  89. {1953, nullptr, "SetPlayTimerAlarmDisabledForDebug"},
  90. {2001, nullptr, "RequestPairingAsync"},
  91. {2002, nullptr, "FinishRequestPairing"},
  92. {2003, nullptr, "AuthorizePairingAsync"},
  93. {2004, nullptr, "FinishAuthorizePairing"},
  94. {2005, nullptr, "RetrievePairingInfoAsync"},
  95. {2006, nullptr, "FinishRetrievePairingInfo"},
  96. {2007, nullptr, "UnlinkPairingAsync"},
  97. {2008, nullptr, "FinishUnlinkPairing"},
  98. {2009, nullptr, "GetAccountMiiImageAsync"},
  99. {2010, nullptr, "FinishGetAccountMiiImage"},
  100. {2011, nullptr, "GetAccountMiiImageContentTypeAsync"},
  101. {2012, nullptr, "FinishGetAccountMiiImageContentType"},
  102. {2013, nullptr, "SynchronizeParentalControlSettingsAsync"},
  103. {2014, nullptr, "FinishSynchronizeParentalControlSettings"},
  104. {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"},
  105. {2016, nullptr, "RequestUpdateExemptionListAsync"},
  106. };
  107. RegisterHandlers(functions);
  108. }
  109. private:
  110. void Initialize(Kernel::HLERequestContext& ctx) {
  111. NGLOG_WARNING(Service_PCTL, "(STUBBED) called");
  112. IPC::ResponseBuilder rb{ctx, 2, 0, 0};
  113. rb.Push(RESULT_SUCCESS);
  114. }
  115. };
  116. void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
  117. IPC::ResponseBuilder rb{ctx, 2, 0, 1};
  118. rb.Push(RESULT_SUCCESS);
  119. rb.PushIpcInterface<IParentalControlService>();
  120. NGLOG_DEBUG(Service_PCTL, "called");
  121. }
  122. void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx) {
  123. IPC::ResponseBuilder rb{ctx, 2, 0, 1};
  124. rb.Push(RESULT_SUCCESS);
  125. rb.PushIpcInterface<IParentalControlService>();
  126. NGLOG_DEBUG(Service_PCTL, "called");
  127. }
  128. Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
  129. : ServiceFramework(name), module(std::move(module)) {}
  130. void InstallInterfaces(SM::ServiceManager& service_manager) {
  131. auto module = std::make_shared<Module>();
  132. std::make_shared<PCTL>(module, "pctl")->InstallAsService(service_manager);
  133. std::make_shared<PCTL>(module, "pctl:a")->InstallAsService(service_manager);
  134. std::make_shared<PCTL>(module, "pctl:r")->InstallAsService(service_manager);
  135. std::make_shared<PCTL>(module, "pctl:s")->InstallAsService(service_manager);
  136. }
  137. } // namespace Service::PCTL