- June 10, 2008
- 24
- 8
Hi there,
I use the Translator of the IR Server Suite to map the buttons on my remote to certain key combinations, so that I can control PowerDVD 8 Ultra with my remote. Unfortunately, as soon as I start a blu-ray disc, the translator stops sending key combinations to the PowerDVD process.
I have been doing some digging in the code and came up with the following reason.
- When a key press (on the remote) event is sent to Translator, it gets the foreground window.
- Then it gets the PID that belongs to that window.
- Using the .NET Process class it gets the process by that PID.
- It uses the MainModule property on the Process class to get the full executable path of that process.
- It then maps that full executable path to find the appropriate mapping to use.
The problem with this implementation is that Vista has introduced something called protected processes. As soon as PowerDVD starts playing a blu-ray disc, it converts itself to a protected process. It is impossible to get any module information on a protected process, so the Process.MainModule property will fail horribly. Thus it can't get the full executable path. And without that, Translator can't find the appropriate mapping to use.
Getting the process name on a protected process is still possible. So would it be possible to refactor this, so that you can specify the process name instead of the full executable path. I guess the protected process shit is the reason why the PowerScheduler plugin in TV Server lets you specify the process names of process which should prevent putting the PC to sleep.
PS: I do love the flexibility of the IR Server Suite. Good work.
I use the Translator of the IR Server Suite to map the buttons on my remote to certain key combinations, so that I can control PowerDVD 8 Ultra with my remote. Unfortunately, as soon as I start a blu-ray disc, the translator stops sending key combinations to the PowerDVD process.
I have been doing some digging in the code and came up with the following reason.
- When a key press (on the remote) event is sent to Translator, it gets the foreground window.
- Then it gets the PID that belongs to that window.
- Using the .NET Process class it gets the process by that PID.
- It uses the MainModule property on the Process class to get the full executable path of that process.
- It then maps that full executable path to find the appropriate mapping to use.
The problem with this implementation is that Vista has introduced something called protected processes. As soon as PowerDVD starts playing a blu-ray disc, it converts itself to a protected process. It is impossible to get any module information on a protected process, so the Process.MainModule property will fail horribly. Thus it can't get the full executable path. And without that, Translator can't find the appropriate mapping to use.
Getting the process name on a protected process is still possible. So would it be possible to refactor this, so that you can specify the process name instead of the full executable path. I guess the protected process shit is the reason why the PowerScheduler plugin in TV Server lets you specify the process names of process which should prevent putting the PC to sleep.
PS: I do love the flexibility of the IR Server Suite. Good work.