diff --git a/stratosphere/ncm/source/ncm_contentstorage.cpp b/stratosphere/ncm/source/ncm_contentstorage.cpp index cd259df3f..ab460e800 100644 --- a/stratosphere/ncm/source/ncm_contentstorage.cpp +++ b/stratosphere/ncm/source/ncm_contentstorage.cpp @@ -640,7 +640,7 @@ namespace sts::ncm { this->placeholder_accessor.GetPlaceHolderPathUncached(placeholder_path, placeholder_id); if (stat(placeholder_path, &st) == -1) { - return fsdevGetLastResult();; + return fsdevGetLastResult(); } out_size.SetValue(st.st_size); diff --git a/stratosphere/ncm/source/ncm_main.cpp b/stratosphere/ncm/source/ncm_main.cpp index 361153b9d..ef2140636 100644 --- a/stratosphere/ncm/source/ncm_main.cpp +++ b/stratosphere/ncm/source/ncm_main.cpp @@ -76,19 +76,48 @@ void __appExit(void) { fsExit(); } +struct ServerOptions { + static constexpr size_t PointerBufferSize = 0x400; + static constexpr size_t MaxDomains = 0; + static constexpr size_t MaxDomainObjects = 0; +}; + +void ContentManagerServerMain(void* arg) { + static auto s_server_manager = WaitableManager(1); + + /* Create services. */ + s_server_manager.AddWaitable(new ServiceServer("ncm", 0x10)); + + /* Loop forever, servicing our services. */ + s_server_manager.Process(); +} + +void LocationResolverServerMain(void* arg) { + static auto s_server_manager = WaitableManager(1); + + /* Create services. */ + s_server_manager.AddWaitable(new ServiceServer("lr", 0x10)); + + /* Loop forever, servicing our services. */ + s_server_manager.Process(); +} + int main(int argc, char **argv) { - static auto s_server_manager = WaitableManager(2); - /* Initialize content manager implementation. */ R_ASSERT(sts::ncm::impl::InitializeContentManager()); - /* Create services. */ - s_server_manager.AddWaitable(new ServiceServer("ncm", 0x10)); - s_server_manager.AddWaitable(new ServiceServer("lr", 0x10)); - - /* Loop forever, servicing our services. */ - s_server_manager.Process(); + static HosThread s_content_manager_thread; + static HosThread s_location_resolver_thread; + + R_ASSERT(s_content_manager_thread.Initialize(&ContentManagerServerMain, nullptr, 0x4000, 0x15)); + R_ASSERT(s_content_manager_thread.Start()); + + R_ASSERT(s_location_resolver_thread.Initialize(&LocationResolverServerMain, nullptr, 0x4000, 0x15)); + R_ASSERT(s_location_resolver_thread.Start()); + + s_content_manager_thread.Join(); + s_location_resolver_thread.Join(); return 0; } \ No newline at end of file