简体   繁体   English

Citrix Virtual Channel SDK-如何从ICA客户端向服务器返回字符串值?

[英]Citrix Virtual Channel SDK - How to return a string value from ICA client to server?

I'm using XenDesktop 5.6 (server) and Citrix Receiver 3.6 (client). 我正在使用XenDesktop 5.6(服务器)和Citrix Receiver 3.6(客户端)。 I've used the Virtual Channel SDK to create a channel between server and client and pass C-style structures back and forth, using the examples found here . 我已经使用虚拟通道SDK在服务器和客户端之间创建了一个通道,并使用此处找到的示例来回传递C样式的结构。 I can easily pass simple numeric types (USHORT, etc.) between client and server just by setting the appropriate structure field (eg g_pMixHd->dwRetVal = 1 ) but I cannot do the same with string types (LPBYTES, PSZ, PUCHAR). 我可以通过设置适当的结构字段(例如g_pMixHd->dwRetVal = 1 )轻松地在客户端和服务器之间传递简单的数字类型(USHORT等),但是我不能对字符串类型(LPBYTES,PSZ,PUCHAR)执行相同的操作。 I have tried allocating memory on client and/or server, updating the structure's length field and other approaches but nothing seems to work. 我尝试在客户端和/或服务器上分配内存,更新结构的length字段和其他方法,但似乎没有任何效果。

All I want to do is have my client assign a simple ANSI/ASCII string in the receiving structure and have it passed back to the server. 我要做的就是让我的客户端在接收结构中分配一个简单的ANSI / ASCII字符串,并将其传递回服务器。 Has anybody done this? 有人这样做吗? Can you help? 你能帮我吗?

Without seeing more details, I'll gues that this is probably because you're using pointer-based strings. 在没有看到更多细节的情况下,我猜测这可能是因为您使用的是基于指针的字符串。

Let's say you have a C structure that has a string member. 假设您有一个包含字符串成员的C结构。 That member should not be a string, rather it should be a byte array, and you should copy the string into the byte array before sending the packet. 该成员不应为字符串,而应为字节数组,并且在发送数据包之前,应将字符串复制到字节数组中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM