This article is for people who use Citrix virtual channel technologies. So if you have not used the VCSDK (Virtual Channel SDK), you may just stop here.
A virtual channel solution requires both a client side driver and a server side application. We'll only talk about the server side application this time.
WFAPI is the server side SDK for developers to write virtual channel applications. There is a set of virtual channel calls that allow people to access a virtual channel just like accessing a file. WFAPI provides a C interface.
I've created a .NET wrapper for the WFAPI virtual channel calls for those who would like to create a virtual channel solution but need to integrate the server side code in .NET. The wrapper uses the .NET PInvoke (Platform Invoke) technology to allow managed code, such as C#, to access unmanaged code.
The following code implements a simple virtual channel class. It allows the users of this class to read and write virtual channel data. This blog site doesn't seem to allow attachments, so I just post the entire source code below.
Following the VirtualChannel class, there's an implementation of the VCSDK's PING example. The server side example CtxPing now has been re-written using the new VirtualChannel class in .NET. Most of the code involves defining the proper C structs. Once those things are settled, it's easy to write the code.
I've not done a lot of testing, so if you find any bug, please let me know. I'd love to hear any feedback on how to improve the code. I'd like to try to wrap the entire WFAPI in .NET. So if you would like to contribute, let me know and your contribution is very much appreciated
Attached is the Visual Studio project that includes the complete code: d
Download Link
Thanks for posting this.. I'm having a little trouble getting it work however. This is what I get after running the example.exe from within the ica session:
SESSIONNAME=ICA-tcp#97
c:\example.exe 97
Running VDPING
Test failed Value cannot be null.
Parameter name: Failed to open virtual channel, error code 5
Also, I'm interested in knowing how I would go about adding in functionality to determine the current sessionID