-
Notifications
You must be signed in to change notification settings - Fork 3
PsfRuntime Dll and PsfRunDll exe
The PSF includes some required elements in order to use the PSF.
The PsfRuntime32.dll and PsfRuntime64.dll files are required any time the PSF is in use. This dll module is used in two ways:
- It is automatically loaded by PsfLauncher processes to read in the
applications
section of theconfig.json
file to locate the appropriate configuration for this instance of PsfLauncher.- It will start any monitor defined in the configuration (like PsfMonitor).
- It will run any start script defined in the configuration.
- It will run the target application defined in the configuration.
- It will inject a copy of PsfRuntime dll into this target application process before the process runs.
- It will run any end script defined in the configuration.
- When injected into a process running inside the container, this dll will also read the
config.json
file to locate the appropriateprocess
configuration. This configuration may consist of a variety offixups
, which are the FixupDlls to also be injected into this process before allowing the process to run. It will also add a dll intercept to the Windows API that starts new processes so that it may inject another copy of PsfRuntime into any process started in the container.
The copy of the PsfRuntime dll used by PsfLauncher must always be the same bitness as that of the PsfLauncher which should also match that of the target application process.
There are times when different processes inside the container may run under different bitnesses. This may be due to vendor design, or due to AnyCPU executables that may run differently on different systems. As dlls must always match the bitness of the process they are in, this means that there are times a PsfRuntime of one bitness must inject a PsfRuntime of a different bitness into a new process.
When this situation arises, the PsfRuntime will attempt to use PsfRun32.exe or PsfRun64.exe The bitness of the PsfRun process requested will match that of the new process needing a copy of PsfRuntime, and this PsfRun process will be able to perform the injection.
It is common practice to include copies of multiple bitnesses of PsfComponents, including PsfRuntime Dll and PsfRunDll Exe in the package to ensure that the package can run on any system/configuration.