Dear boss, I use RDP5 x virtual channels, to open channels to send data, why???????
On my machine I create a DLL, ClientDLL. DLL, is such a configuration in the registry, item Name: Clip11Rdp, string value: Name=C: \ work \ TS Window Clipper \ Release \ ClientDLL DLL
On a remote machine, there was a exe, listening session, can listen to and then open the channel
# define CHANNELNAME "CLIP11
"M_vcHandle=WTSVirtualChannelOpen (WTS_CURRENT_SERVER_HANDLE WTS_CURRENT_SESSION, CHANNELNAME);
M_vcHandle isn't empty,
Open channel was successful, but to write data failure, returns 0, GetLastError 1
PULONG bytesRead=0;
PULONG pBytesWritten=0;
BOOL result=WTSVirtualChannelWrite (m_vcHandle, buffer, (ULONG) strlen (buffer), pBytesWritten);
If (result)
{
return 1;
}
The else
{
Int nRet=GetLastError ();//1
return 0;
}
At the same time, I in ClientDll. DLL VirtualChannelEntry print log entry function, also didn't see the log
The header file statement:
BOOL VCAPITYPE VirtualChannelEntry (PCHANNEL_ENTRY_POINTS pEntryPoints);
CPP implementation:
BOOL VCAPITYPE VirtualChannelEntry (PCHANNEL_ENTRY_POINTS pEntryPoints)
{
The FILE * f=fopen (" c: \ \ work \ \ clipert TXT ", "ab +");
If (f!=NULL)
{
Fwrite (" aaaa \ r \ n ", 1, strlen (" aaaa \ r \ n "), f); I can't see//file
The fclose (f);
}
}
Def file to:
The LIBRARY
EXPORTS
VirtualChannelEntry @ 1
Why???????