0

I have this situation. I have a custom screensaver that starts another process using System.Diagnostics.Process.Start("MyHelperApp.exe"). That second process lives on after the screensaver itself is closed and disposed.

The problem is that the screensaver only gets displayed once. Unless I do one of two things:

  • Go to Task Manager and kill "MyHelperApp.exe". This will allow the screensaver to run one more time, then I have to repeat this step.
  • Comment out System.Diagnostics.Process.Start("MyHelperApp.exe"). Now the screensaver runs normally, as you would expect.

If I test the screensaver by right-clicking and selecting 'Test', I do not get these problems. I can test it as many times as I want. It is only when Windows manages the installed screensaver that I see this problem.

It is not a blocking problem, because I have screensaver write to a file before getting to System.Diagnostics.Process.Start("MyHelperApp.exe"), and the file never gets written, so the screensaver is not called a second time.

Windows 7 desktop.

mcu
  • 3,302
  • 8
  • 38
  • 64
  • 1
    The system runs screen savers in a job object. Screen savers are not supposed to create child processes that outlive them. That is a security vulnerability (repudiation). – Raymond Chen Jul 25 '15 at 14:36
  • @RaymondChen Thanks. That's really good to know. – mcu Jul 25 '15 at 17:54

0 Answers0