mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Services/APT: Use the right error codes in ReceiveParameter and GlanceParameter when the parameter doesn't exist.
This commit is contained in:
		
							parent
							
								
									5682608df7
								
							
						
					
					
						commit
						2dc720c355
					
				
					 1 changed files with 28 additions and 0 deletions
				
			
		|  | @ -227,6 +227,20 @@ void ReceiveParameter(Service::Interface* self) { | |||
|             "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", | ||||
|             buffer_size, static_buff_size); | ||||
| 
 | ||||
|     if (!next_parameter) { | ||||
|         IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||||
|         rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet, | ||||
|                            ErrorSummary::InvalidState, ErrorLevel::Status)); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     if (next_parameter->destination_id != app_id) { | ||||
|         IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||||
|         rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, | ||||
|                            ErrorLevel::Status)); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     IPC::RequestBuilder rb = rp.MakeBuilder(4, 4); | ||||
| 
 | ||||
|     rb.Push(RESULT_SUCCESS); // No error
 | ||||
|  | @ -259,6 +273,20 @@ void GlanceParameter(Service::Interface* self) { | |||
|             "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", | ||||
|             buffer_size, static_buff_size); | ||||
| 
 | ||||
|     if (!next_parameter) { | ||||
|         IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||||
|         rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet, | ||||
|                            ErrorSummary::InvalidState, ErrorLevel::Status)); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     if (next_parameter->destination_id != app_id) { | ||||
|         IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||||
|         rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, | ||||
|                            ErrorLevel::Status)); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     IPC::RequestBuilder rb = rp.MakeBuilder(4, 4); | ||||
|     rb.Push(RESULT_SUCCESS); // No error
 | ||||
|     rb.Push(next_parameter->sender_id); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue