WTSVirtualChannelRead does not read anything

  • Thread starter Thread starter Roman Divacky
  • Start date Start date
R

Roman Divacky

Guest
hi

I am trying to read some data from a virtual channel using
WTSVirtualChannelRead() but it reads nothing.
When I try to write to the channel it goes just fine but reading is no
go :(

The client in question is "rdesktop" so I am quite sure the client is
ok, but my app does not recieve anything from the channel. And yes, I
put some debuging into the rdesktop to see if it really puts something
on the wire.

When I try to use WTSVirtualChannelQuery() to obtain file handle and
ReadFile/WriteFile from/to it nothing works at all (nor reading nor
writing).

plain

HANDLE foo = WTSVirtualChannelOpen(WTS_CURRENT_SERVER_HANDLE,
SessionId, "rdpsnd");
WTSVirtualChannelRead(foo, INFINITY, buf, buf_size, &len);

never returns and when I change the INFINITY to something lower it
returns with 0 bytes read.

does anyone have any comment or an example of working code with
WTSVirtualChannelRead(). I must be doing something bad but I am not
able to figure out what :(

thnx a lot in advance

Roman Divacky
 
Re: WTSVirtualChannelRead does not read anything

From where you can be sure that the rdesktop client supports Virtual Channel
?
I'm not sure that it has this feature implemented (have seen this question a
while ago).

If you use MS RDP Client the virtual channel communication is always
initialized
on the server, 1 round trip looks like this:

Server -> Sends something -> Client
Client -> Receives message
Client -> Sends something back to Server
Server Reads from Virtual Channel .

Thomas T.

"Roman Divacky" <rdivacky@mzm.cz> wrote in message
news:a0eeba60-cbc0-4b41-9e96-8dd1b7d4c41f@v23g2000pro.googlegroups.com...
> hi
>
> I am trying to read some data from a virtual channel using
> WTSVirtualChannelRead() but it reads nothing.
> When I try to write to the channel it goes just fine but reading is no
> go :(
>
> The client in question is "rdesktop" so I am quite sure the client is
> ok, but my app does not recieve anything from the channel. And yes, I
> put some debuging into the rdesktop to see if it really puts something
> on the wire.
>
> When I try to use WTSVirtualChannelQuery() to obtain file handle and
> ReadFile/WriteFile from/to it nothing works at all (nor reading nor
> writing).
>
> plain
>
> HANDLE foo = WTSVirtualChannelOpen(WTS_CURRENT_SERVER_HANDLE,
> SessionId, "rdpsnd");
> WTSVirtualChannelRead(foo, INFINITY, buf, buf_size, &len);
>
> never returns and when I change the INFINITY to something lower it
> returns with 0 bytes read.
>
> does anyone have any comment or an example of working code with
> WTSVirtualChannelRead(). I must be doing something bad but I am not
> able to figure out what :(
>
> thnx a lot in advance
>
> Roman Divacky
 
Re: WTSVirtualChannelRead does not read anything

On Apr 21, 7:49 pm, "ThomasT." <Thom...@nospam.nospam> wrote:
> From where you can be sure that the rdesktop client supports Virtual Channel
> ?
> I'm not sure that it has this feature implemented (have seen this question a
> while ago).


it sends so called completion packet to the server so I guess the
server is supposed
to receive something. And yes, it supports virtual channels, it
initializes for example
the "rdpsnd" virtual channe....

> If you use MS RDP Client the virtual channel communication is always
> initialized
> on the server, 1 round trip looks like this:
>
> Server -> Sends something -> Client
> Client -> Receives message
> Client -> Sends something back to Server
> Server Reads from Virtual Channel .


yeah.. I initialize it on the server, send something to the client and
then I want
to read something back but nothing's there. I googled and it looks
like other
people had this problem too...
 
Back
Top