Execution Mode is an important project setting in SoftwareShield, it specifies how the license model pops up its user interface to interact with the game player when wrapped game launches, expires or exits. First let us explain why we introduce execution mode in SoftwareShield.
By design, SoftwareShield tries to be as non-intrusive as possible when integrating our DRM logic with the original game binaries, in most cases, we don't have access to the game's source code and cannot modify the game's original behavior at source code level. However, our DRM logic (LMApp HTML UI, etc.) might have to interact with game player before game launches, while game running or after game existing. Depending on the game's nature or development tool-kits, there are chances that popping up a full-fledged Windows UI might cause unexpected conflicts with current game execution context.
Full Screen Conflicts
If a game is a full screen video game, LMApp UI cannot be seen by end users;
COM Thread Model Conflicts
If a Windows game must run in a thread COM model (STA/MTA, etc.), the execution of LMApp might have initialized the thread in another COM thread model, SoftwareShield has tried to avoid COM thread model conflict and the kernel of SoftwareShield runtime is a pure DLL without using any COM technology, but it cannot guarantee that the COM thread model conflicting issue can be completely avoided because any other custom License model dll used to render LMApp UI might initialize a thread context before the game code starts.
Unable to Render License Exit-UI On Exiting When game is terminating, the game process runtime could be in an unknown or unstable state (due to DLL unloading, etc.), the thread message queue might have been destroyed, it is very hard and prune to deadlock at this time to pop up a LMApp UI.
System Menu Conflicts on Mac On Mac, creating a LMApp before the game executes might cause the app's default system menu displays undesired menu items, conflicts with game's main message loop.
The answer to these technical problems in SoftwareShield is: partitioning License and application code in different processes.
This is the most simple execution mode, LMApp and game runs in the same process, so all of the above mentioned conflicts might occur. For a standard Windows GUI-based application or a simple game, P1 might work just fine. On Windows when game expires, Ironwrapper will send WM_CLOSE message to all game's topmost windows, so the game can get a last chance to save game data properly before LMApp pops up its UI.
P1S2 is the behavior of SoftwareShield V4 wrapped games. In P1S2 mode, the LMApp's startup UI shares the same process with game itself, but the Exit UI pops up in a different pass, which means, when game expires or exists, the wrapped game restarts to render the Exit UI. It can guarantee that the Exit-UI can always be rendered safely and properly.
In P1S3 mode, the LMApp logic and game logic are partitioned completely in three different process passes, when game starts in the first pass, the LMApp startup UI is rendered, if license gives positive result, the game restarts to enter the second pass running the game itself, after game terminates, the wrapped game restarts again to enter the third pass to render the LMApp's Exit UI.
P1S3 is the most safe and compatible execution mode because LMApp UI logic and game code never get a chance to co-exist in a same process, however, it does have performance degrade: end users might notice game launches multiple times.
To overcome LMApp UI Rendering and game logic conflicting issues, SoftwareShield has introduced different execution modes, you can try each mode to find the best one for your game. For P1S2/P1S3 mode, as we have discussed in the previous section, the game has to restarted to render LMApp UI or run the game itself.
What if the game player has fully purchased the game? after the game has been activated, in most cases there is no need to go through the execution passes at all, so SoftwareShield has introduced another control setting: Game Launch Express Mode. You can enable this feature in IDE, if this feature is turned on, when a fully activated game is double-clicked, the first pass double-check the license status first, if everything seems ok then the current pass becomes the game pass automatically, when game terminates, there is also no Exit-UI pops up.
Game Launch Express Mode can be quite useful especially for Mac games, restarting game multiple times might cause the game's icon keeps bouncing on the system dock bar.