diff options
| -rw-r--r-- | src/core/hle/service/ns/ns.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/sm/sm.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 9 |
4 files changed, 27 insertions, 3 deletions
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 8fb88990e..7e5ceccdb 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -371,10 +371,15 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage( | |||
| 371 | // Convert to application language, get priority list | 371 | // Convert to application language, get priority list |
| 372 | const auto application_language = ConvertToApplicationLanguage(language_code); | 372 | const auto application_language = ConvertToApplicationLanguage(language_code); |
| 373 | if (application_language == std::nullopt) { | 373 | if (application_language == std::nullopt) { |
| 374 | LOG_ERROR(Service_NS, "Could not convert application language! language_code={}", | ||
| 375 | language_code); | ||
| 374 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 376 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; |
| 375 | } | 377 | } |
| 376 | const auto priority_list = GetApplicationLanguagePriorityList(*application_language); | 378 | const auto priority_list = GetApplicationLanguagePriorityList(*application_language); |
| 377 | if (!priority_list) { | 379 | if (!priority_list) { |
| 380 | LOG_ERROR(Service_NS, | ||
| 381 | "Could not find application language priorities! application_language={}", | ||
| 382 | *application_language); | ||
| 378 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 383 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; |
| 379 | } | 384 | } |
| 380 | 385 | ||
| @@ -386,6 +391,8 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage( | |||
| 386 | } | 391 | } |
| 387 | } | 392 | } |
| 388 | 393 | ||
| 394 | LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}", | ||
| 395 | supported_languages); | ||
| 389 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 396 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; |
| 390 | } | 397 | } |
| 391 | 398 | ||
| @@ -410,6 +417,7 @@ ResultVal<u64> IApplicationManagerInterface::ConvertApplicationLanguageToLanguag | |||
| 410 | const auto language_code = | 417 | const auto language_code = |
| 411 | ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language)); | 418 | ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language)); |
| 412 | if (language_code == std::nullopt) { | 419 | if (language_code == std::nullopt) { |
| 420 | LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language); | ||
| 413 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 421 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; |
| 414 | } | 422 | } |
| 415 | 423 | ||
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index 9e12c76fc..f3b4b286c 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp | |||
| @@ -67,6 +67,7 @@ void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { | |||
| 67 | const auto index = rp.Pop<u32>(); | 67 | const auto index = rp.Pop<u32>(); |
| 68 | 68 | ||
| 69 | if (index >= available_language_codes.size()) { | 69 | if (index >= available_language_codes.size()) { |
| 70 | LOG_ERROR(Service_SET, "Invalid language code index! index={}", index); | ||
| 70 | IPC::ResponseBuilder rb{ctx, 2}; | 71 | IPC::ResponseBuilder rb{ctx, 2}; |
| 71 | rb.Push(ERR_INVALID_LANGUAGE); | 72 | rb.Push(ERR_INVALID_LANGUAGE); |
| 72 | return; | 73 | return; |
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 88909504d..6ada13be4 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp | |||
| @@ -28,9 +28,11 @@ void ServiceManager::InvokeControlRequest(Kernel::HLERequestContext& context) { | |||
| 28 | 28 | ||
| 29 | static ResultCode ValidateServiceName(const std::string& name) { | 29 | static ResultCode ValidateServiceName(const std::string& name) { |
| 30 | if (name.size() <= 0 || name.size() > 8) { | 30 | if (name.size() <= 0 || name.size() > 8) { |
| 31 | LOG_ERROR(Service_SM, "Invalid service name! service={}", name); | ||
| 31 | return ERR_INVALID_NAME; | 32 | return ERR_INVALID_NAME; |
| 32 | } | 33 | } |
| 33 | if (name.find('\0') != std::string::npos) { | 34 | if (name.find('\0') != std::string::npos) { |
| 35 | LOG_ERROR(Service_SM, "A non null terminated service was passed"); | ||
| 34 | return ERR_INVALID_NAME; | 36 | return ERR_INVALID_NAME; |
| 35 | } | 37 | } |
| 36 | return RESULT_SUCCESS; | 38 | return RESULT_SUCCESS; |
| @@ -51,8 +53,10 @@ ResultVal<std::shared_ptr<Kernel::ServerPort>> ServiceManager::RegisterService( | |||
| 51 | 53 | ||
| 52 | CASCADE_CODE(ValidateServiceName(name)); | 54 | CASCADE_CODE(ValidateServiceName(name)); |
| 53 | 55 | ||
| 54 | if (registered_services.find(name) != registered_services.end()) | 56 | if (registered_services.find(name) != registered_services.end()) { |
| 57 | LOG_ERROR(Service_SM, "Service is already registered! service={}", name); | ||
| 55 | return ERR_ALREADY_REGISTERED; | 58 | return ERR_ALREADY_REGISTERED; |
| 59 | } | ||
| 56 | 60 | ||
| 57 | auto& kernel = Core::System::GetInstance().Kernel(); | 61 | auto& kernel = Core::System::GetInstance().Kernel(); |
| 58 | auto [server_port, client_port] = | 62 | auto [server_port, client_port] = |
| @@ -66,9 +70,10 @@ ResultCode ServiceManager::UnregisterService(const std::string& name) { | |||
| 66 | CASCADE_CODE(ValidateServiceName(name)); | 70 | CASCADE_CODE(ValidateServiceName(name)); |
| 67 | 71 | ||
| 68 | const auto iter = registered_services.find(name); | 72 | const auto iter = registered_services.find(name); |
| 69 | if (iter == registered_services.end()) | 73 | if (iter == registered_services.end()) { |
| 74 | LOG_ERROR(Service_SM, "Server is not registered! service={}", name); | ||
| 70 | return ERR_SERVICE_NOT_REGISTERED; | 75 | return ERR_SERVICE_NOT_REGISTERED; |
| 71 | 76 | } | |
| 72 | registered_services.erase(iter); | 77 | registered_services.erase(iter); |
| 73 | return RESULT_SUCCESS; | 78 | return RESULT_SUCCESS; |
| 74 | } | 79 | } |
| @@ -79,6 +84,7 @@ ResultVal<std::shared_ptr<Kernel::ClientPort>> ServiceManager::GetServicePort( | |||
| 79 | CASCADE_CODE(ValidateServiceName(name)); | 84 | CASCADE_CODE(ValidateServiceName(name)); |
| 80 | auto it = registered_services.find(name); | 85 | auto it = registered_services.find(name); |
| 81 | if (it == registered_services.end()) { | 86 | if (it == registered_services.end()) { |
| 87 | LOG_ERROR(Service_SM, "Server is not registered! service={}", name); | ||
| 82 | return ERR_SERVICE_NOT_REGISTERED; | 88 | return ERR_SERVICE_NOT_REGISTERED; |
| 83 | } | 89 | } |
| 84 | 90 | ||
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 9390ca83d..46e14c2a3 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -867,6 +867,7 @@ private: | |||
| 867 | 867 | ||
| 868 | const auto layer_id = nv_flinger->CreateLayer(display); | 868 | const auto layer_id = nv_flinger->CreateLayer(display); |
| 869 | if (!layer_id) { | 869 | if (!layer_id) { |
| 870 | LOG_ERROR(Service_VI, "Layer not found! display=0x{:016X}", display); | ||
| 870 | IPC::ResponseBuilder rb{ctx, 2}; | 871 | IPC::ResponseBuilder rb{ctx, 2}; |
| 871 | rb.Push(ERR_NOT_FOUND); | 872 | rb.Push(ERR_NOT_FOUND); |
| 872 | return; | 873 | return; |
| @@ -983,6 +984,7 @@ private: | |||
| 983 | 984 | ||
| 984 | const auto display_id = nv_flinger->OpenDisplay(name); | 985 | const auto display_id = nv_flinger->OpenDisplay(name); |
| 985 | if (!display_id) { | 986 | if (!display_id) { |
| 987 | LOG_ERROR(Service_VI, "Display not found! display_name={}", name); | ||
| 986 | IPC::ResponseBuilder rb{ctx, 2}; | 988 | IPC::ResponseBuilder rb{ctx, 2}; |
| 987 | rb.Push(ERR_NOT_FOUND); | 989 | rb.Push(ERR_NOT_FOUND); |
| 988 | return; | 990 | return; |
| @@ -1082,6 +1084,7 @@ private: | |||
| 1082 | 1084 | ||
| 1083 | const auto display_id = nv_flinger->OpenDisplay(display_name); | 1085 | const auto display_id = nv_flinger->OpenDisplay(display_name); |
| 1084 | if (!display_id) { | 1086 | if (!display_id) { |
| 1087 | LOG_ERROR(Service_VI, "Layer not found! layer_id={}", layer_id); | ||
| 1085 | IPC::ResponseBuilder rb{ctx, 2}; | 1088 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1086 | rb.Push(ERR_NOT_FOUND); | 1089 | rb.Push(ERR_NOT_FOUND); |
| 1087 | return; | 1090 | return; |
| @@ -1089,6 +1092,7 @@ private: | |||
| 1089 | 1092 | ||
| 1090 | const auto buffer_queue_id = nv_flinger->FindBufferQueueId(*display_id, layer_id); | 1093 | const auto buffer_queue_id = nv_flinger->FindBufferQueueId(*display_id, layer_id); |
| 1091 | if (!buffer_queue_id) { | 1094 | if (!buffer_queue_id) { |
| 1095 | LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", *display_id); | ||
| 1092 | IPC::ResponseBuilder rb{ctx, 2}; | 1096 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1093 | rb.Push(ERR_NOT_FOUND); | 1097 | rb.Push(ERR_NOT_FOUND); |
| 1094 | return; | 1098 | return; |
| @@ -1124,6 +1128,7 @@ private: | |||
| 1124 | 1128 | ||
| 1125 | const auto layer_id = nv_flinger->CreateLayer(display_id); | 1129 | const auto layer_id = nv_flinger->CreateLayer(display_id); |
| 1126 | if (!layer_id) { | 1130 | if (!layer_id) { |
| 1131 | LOG_ERROR(Service_VI, "Layer not found! layer_id={}", *layer_id); | ||
| 1127 | IPC::ResponseBuilder rb{ctx, 2}; | 1132 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1128 | rb.Push(ERR_NOT_FOUND); | 1133 | rb.Push(ERR_NOT_FOUND); |
| 1129 | return; | 1134 | return; |
| @@ -1131,6 +1136,7 @@ private: | |||
| 1131 | 1136 | ||
| 1132 | const auto buffer_queue_id = nv_flinger->FindBufferQueueId(display_id, *layer_id); | 1137 | const auto buffer_queue_id = nv_flinger->FindBufferQueueId(display_id, *layer_id); |
| 1133 | if (!buffer_queue_id) { | 1138 | if (!buffer_queue_id) { |
| 1139 | LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", display_id); | ||
| 1134 | IPC::ResponseBuilder rb{ctx, 2}; | 1140 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1135 | rb.Push(ERR_NOT_FOUND); | 1141 | rb.Push(ERR_NOT_FOUND); |
| 1136 | return; | 1142 | return; |
| @@ -1161,6 +1167,7 @@ private: | |||
| 1161 | 1167 | ||
| 1162 | const auto vsync_event = nv_flinger->FindVsyncEvent(display_id); | 1168 | const auto vsync_event = nv_flinger->FindVsyncEvent(display_id); |
| 1163 | if (!vsync_event) { | 1169 | if (!vsync_event) { |
| 1170 | LOG_ERROR(Service_VI, "Vsync event was not found for display_id={}", display_id); | ||
| 1164 | IPC::ResponseBuilder rb{ctx, 2}; | 1171 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1165 | rb.Push(ERR_NOT_FOUND); | 1172 | rb.Push(ERR_NOT_FOUND); |
| 1166 | return; | 1173 | return; |
| @@ -1201,6 +1208,7 @@ private: | |||
| 1201 | case NintendoScaleMode::PreserveAspectRatio: | 1208 | case NintendoScaleMode::PreserveAspectRatio: |
| 1202 | return MakeResult(ConvertedScaleMode::PreserveAspectRatio); | 1209 | return MakeResult(ConvertedScaleMode::PreserveAspectRatio); |
| 1203 | default: | 1210 | default: |
| 1211 | LOG_ERROR(Service_VI, "Invalid scaling mode specified, mode={}", mode); | ||
| 1204 | return ERR_OPERATION_FAILED; | 1212 | return ERR_OPERATION_FAILED; |
| 1205 | } | 1213 | } |
| 1206 | } | 1214 | } |
| @@ -1257,6 +1265,7 @@ void detail::GetDisplayServiceImpl(Kernel::HLERequestContext& ctx, | |||
| 1257 | const auto policy = rp.PopEnum<Policy>(); | 1265 | const auto policy = rp.PopEnum<Policy>(); |
| 1258 | 1266 | ||
| 1259 | if (!IsValidServiceAccess(permission, policy)) { | 1267 | if (!IsValidServiceAccess(permission, policy)) { |
| 1268 | LOG_ERROR(Service_VI, "Permission denied for policy {}", static_cast<u32>(policy)); | ||
| 1260 | IPC::ResponseBuilder rb{ctx, 2}; | 1269 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1261 | rb.Push(ERR_PERMISSION_DENIED); | 1270 | rb.Push(ERR_PERMISSION_DENIED); |
| 1262 | return; | 1271 | return; |