erpt: update for 11.0.0 (closes #1218)

This commit is contained in:
Michael Scire
2020-12-03 11:13:35 -08:00
parent bba99d49da
commit 6da28f4a27
24 changed files with 438 additions and 146 deletions

View File

@@ -99,22 +99,22 @@ namespace ams::erpt::srv {
Result SetProductModel(const char *model, u32 model_len) {
/* NOTE: Nintendo does not check that this allocation succeeds. */
auto *record = new ContextRecord(CategoryId_ProductModelInfo);
auto record = std::make_unique<ContextRecord>(CategoryId_ProductModelInfo);
R_UNLESS(record != nullptr, erpt::ResultOutOfMemory());
R_TRY(record->Add(FieldId_ProductModel, model, model_len));
R_TRY(Context::SubmitContextRecord(record));
R_TRY(Context::SubmitContextRecord(std::move(record)));
return ResultSuccess();
}
Result SetRegionSetting(const char *region, u32 region_len) {
/* NOTE: Nintendo does not check that this allocation succeeds. */
auto *record = new ContextRecord(CategoryId_RegionSettingInfo);
auto record = std::make_unique<ContextRecord>(CategoryId_RegionSettingInfo);
R_UNLESS(record != nullptr, erpt::ResultOutOfMemory());
R_TRY(record->Add(FieldId_RegionSetting, region, region_len));
R_TRY(Context::SubmitContextRecord(record));
R_TRY(Context::SubmitContextRecord(std::move(record)));
return ResultSuccess();
}