Archive for January, 2013

Creating a Remote Desktop Plugin Using Delphi - Errata

Wednesday, January 9th, 2013

After I had implemented my plugin and it was just going into production, I discovered a rather ugly truth.  WTSVirtualChannelOpen will succeed even if the plugin is not installed on the client side.  You don’t find out about the problem until the first time you try to write to the channel, whereupon you get an obscure error.  Something about an “invalid function”.

It appears as though the only solution to this problem is to implement a “ping” function in the plugin. Then, on the server side, you need to open the virtual channel and ping the client.  If both of these succeed then the plugin exists, otherwise it does not.

You would think that Microsoft would at least check to see if the client has registered the virtual channel before returning a handle for it.