Append a function Applet::GetRegisteredAppletCount()!
This commit is contained in:
		@@ -58,7 +58,7 @@ ResultCode Applet::Create(Service::APT::AppletId id) {
 | 
			
		||||
        applets[id] = std::make_shared<ErrEula>(id);
 | 
			
		||||
        break;
 | 
			
		||||
    default:
 | 
			
		||||
        LOG_ERROR(Service_APT, "Could not create applet %u", id);
 | 
			
		||||
        LOG_ERROR(Service_APT, "Could not create applet 0x%08X", id);
 | 
			
		||||
        // TODO(Subv): Find the right error code
 | 
			
		||||
        return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotSupported, ErrorLevel::Permanent);
 | 
			
		||||
    }
 | 
			
		||||
@@ -73,6 +73,17 @@ std::shared_ptr<Applet> Applet::Get(Service::APT::AppletId id) {
 | 
			
		||||
    return nullptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
u32 GetRegisteredAppletCount() {
 | 
			
		||||
    u32 registered_count = 0;
 | 
			
		||||
 | 
			
		||||
    for (auto itr = applets.begin(); itr != applets.end(); ++itr) {
 | 
			
		||||
        if (itr->second != nullptr) {
 | 
			
		||||
            ++registered_count;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return registered_count;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Handles updating the current Applet every time it's called.
 | 
			
		||||
static void AppletUpdateEvent(u64 applet_id, int cycles_late) {
 | 
			
		||||
    Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id);
 | 
			
		||||
 
 | 
			
		||||
@@ -68,6 +68,9 @@ protected:
 | 
			
		||||
    std::shared_ptr<std::vector<u8>> heap_memory; ///< Heap memory for this Applet
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
//Return the registered applet count
 | 
			
		||||
u32 GetRegisteredAppletCount();
 | 
			
		||||
 | 
			
		||||
/// Returns whether a library applet is currently running
 | 
			
		||||
bool IsLibraryAppletRunning();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user