LaunchAPPLServer: don't need separate code for Sys 6 MultiFinder and single-process Finder

This commit is contained in:
Wolfgang Thaller 2018-04-27 08:58:19 +02:00
parent d7ac3a94a0
commit 40430409f5

View File

@ -4,32 +4,6 @@
#include <TextUtils.h> #include <TextUtils.h>
#include <string.h> #include <string.h>
class AppLauncherSingle : public AppLauncher
{
public:
virtual bool Launch(ConstStr255Param name)
{
LaunchParamBlockRec lpb;
memset(&lpb, 0, sizeof(lpb));
lpb.reserved1 = (unsigned long) name;
lpb.reserved2 = 0;
lpb.launchBlockID = extendedBlock;
lpb.launchEPBLength = 6;
lpb.launchFileFlags = 0;
lpb.launchControlFlags = 0xC000;
LaunchApplication(&lpb);
return false;
}
virtual bool IsRunning(ConstStr255Param name)
{
return false;
}
};
class AppLauncher7 : public AppLauncher class AppLauncher7 : public AppLauncher
{ {
ProcessSerialNumber psn; ProcessSerialNumber psn;
@ -62,7 +36,7 @@ public:
} }
}; };
class AppLauncherMultiFinder : public AppLauncher class AppLauncher6 : public AppLauncher
{ {
public: public:
virtual bool Launch(ConstStr255Param name) virtual bool Launch(ConstStr255Param name)
@ -111,12 +85,6 @@ std::unique_ptr<AppLauncher> CreateAppLauncher()
if(environ.systemVersion >= 0x0700) if(environ.systemVersion >= 0x0700)
return std::make_unique<AppLauncher7>(); return std::make_unique<AppLauncher7>();
else else
{ return std::make_unique<AppLauncher6>();
uint32_t& Twitcher2 = *(uint32_t*) 0xB7C;
if(Twitcher2 == 0 || Twitcher2 == 0xFFFFFFFF)
return std::make_unique<AppLauncherSingle>();
else
return std::make_unique<AppLauncherMultiFinder>();
}
#endif #endif
} }