Add RL_UnmountCurrentRunningBundle export

This commit is contained in:
Maschell 2021-09-28 18:18:03 +02:00
parent cf61f8ce0f
commit a18a28091b
2 changed files with 19 additions and 3 deletions

View File

@ -245,12 +245,28 @@ int32_t RL_UnmountBundle(const char *name) {
return romfsUnmount(name);
}
bool RL_UnmountCurrentRunningBundle(){
if(gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted == false){
return true;
}
if (gReplacementInfo.contentReplacementInfo.mode == CONTENTREDIRECT_FROM_WUHB_BUNDLE) {
if (gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted) {
DEBUG_FUNCTION_LINE("Unmount /vol/content");
romfsUnmount("rom");
gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted = false;
DCFlushRange(&gReplacementInfo, sizeof(gReplacementInfo));
return true;
}
}
return false;
}
int32_t RL_FileOpen(const char *name, uint32_t *handle) {
if (handle == nullptr) {
return -1;
}
FileReader *reader = nullptr;
FileReader *reader;
std::string path = std::string(name);
std::string pathGZ = path + ".gz";
@ -316,3 +332,4 @@ WUMS_EXPORT_FUNCTION(RL_FileClose);
WUMS_EXPORT_FUNCTION(RL_FileExists);
WUMS_EXPORT_FUNCTION(RL_RedirectContentWithFallback);
WUMS_EXPORT_FUNCTION(RL_DisableContentRedirection);
WUMS_EXPORT_FUNCTION(RL_UnmountCurrentRunningBundle);

View File

@ -13,7 +13,6 @@ public:
explicit FileReaderCompressed(std::string &file);
~FileReaderCompressed() override {
DEBUG_FUNCTION_LINE("");
}
int read(uint8_t *buffer, uint32_t size) override;