Welcome to YLOAN.COM
yloan.com » Sportboats » User mode transport of the library via virtual channels
Sportboats Motors Recreation Sports Baseball Cycling Fishing Football Golf Martial-Arts Running Soccer Swimming Tennis Basketball Volleyball Squash Badminton racing Bowling Climbing Dance Gymnastics Handball Skiing

User mode transport of the library via virtual channels

User mode transport of the library via virtual channels


Written by:Sergey Popenko,Junior Developer of Driver Development Team,Apriorit Inc.General descriptionVirtual channels are software extensions that can be used to add functional enhancements to a Remote Desktop Services application. Examples of functional enhancements may include support for special types of hardware, audio, or other additions to the core functionality provided by the Remote Desktop ServicesRemote Desktop Protocol (RDP).To use virtual channels, you should provide the server-side and client-side modules of the virtual channels application. The server-side module can be a user-mode application or a kernel-mode driver. The client-side module must be a DLL.Library descriptionIn this article, we provide the library which can be used in client server applications to cover transport layer using virtual channels. Also we attached sample add-in project (client side) and sample server application.The user interface definitions can be found in the RdcTransport.h header file. This is the master header and should be included in you project.Interface descriptionstruct IVirtChannel { virtual ~IVirtChannel() { } virtual void Write(Buffer* pBuffer) = 0; // may take a long time, need synchronization for multithreading };This structure is used for writing data to the clientserver side.struct IReadHandler { virtual ~IReadHandler(){}; virtual void OnRead(Buffer* pBuffer) throw() = 0; virtual void OnReadFail(const char* what) throw() = 0; };This structure is used for reading notifications from clientserver side.struct IClientVirtChannelCallback { virtual ~IClientVirtChannelCallback() { } virtual void OnConnect() = 0; virtual void OnDisconnect() = 0; virtual void OnTerminate() = 0; };Callback interfaces for providing information about the client side connection.struct IServerVirtChannelCallback { virtual ~IServerVirtChannelCallback() { } virtual void OnDisconnect() = 0; virtual void OnReconnect() = 0; };Callback interfaces for providing information about the server side connection.Build factory:Client side:std::auto_ptr CreateClientChannel( __in const char* szChannelName, __in PCHANNEL_ENTRY_POINTS pEntryPoints, __in IClientVirtChannelCallback* pCallback, __in IReadHandler* pReadHandler, __in bool bShowProtocol = false);Server side:std::auto_ptr CreateServerChannel( __in const char* szChannelName, __in LPTSTR szAddinRGSName, __in IServerVirtChannelCallback* pCallback, __in IReadHandler* pReadHandler, __in bool bShowProtocol = false);How to useClient sideFor the creation of the add-in DLL of the mstsc.exe file, you need to implement the following function in your DLL:BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints){} To work with the client side transport, you need to create the global object, which will contain your transport and provide readwrite interfaces. You can do this in the following way:std::auto_ptr channel; BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints){ try { channel = rdc_transport::CreateClientChannel("Test", pEntryPoints, &connection, &reader, false); return TRUE; } catch(...) { // TODO:: add log for example return false; }}where connection and reader are the objects, which implement the rdc_transport::IClientVirtChannelCallback and rdc_transport::IReadHandler interfaces.Server sideTo use the server side of the virtual channel transport, you need to create the transport object in your code. This object provides readwrite interfaces and contain the server side of the connection. For example, it can be performed in the main function:int main(){std::auto_ptr ch = rdc_transport::CreateServerChannel("Test", L"Test",&cc, &rh);}where cc and rh are the objects, which implement the rdc_transport::IServerVirtChannelCallback and rdc_transport::IReadHandler interfaces.To close the server side connection, destroy the ch object.You can find the sample of implementation in the test solution.Build requirementsSoftware:Visual Studio 2008 sp1.Boost1.40.0 source code (seehttp://boost.org).Nullsoft Scriptable Install System (NSIS)2.45 or higher (seehttp://nsis.sourceforge.net/). It is used only for the sample and is not required for the library.Environment variables:NSIS - should contain the path where NSIS is installed;BOOST_ROOT - should contain the path to the Boost directory.Preparing build systemBefore building the sample solution from the source code, you should perform several simple preliminary steps. First of all, you should install all the applications specified inthe Build requirements section, and set the environment variables, which are also specified in the section mentioned above.After that, you should build Boost libraries from the source code. To do this, go to the Boost directory (BOOST_ROOT) and invoke the following two commands one after another:1) bootstrap.bat2) bjam.exe toolset=msvc --build-type=completeThat should be enough. For more detailed information, see Boost documentation.Linkshttp://msdn.microsoft.com/en-us/library/aa383580(v=VS.85).aspx Virtual Channel Client DLL. http://msdn.microsoft.com/en-us/library/aa383586(v=VS.85).aspx Virtual Channel Server Application. http://technet.microsoft.com/ru-ru/library/cc751287(en-us).aspx - Extended API.http://msdn.microsoft.com/en-us/library/bb892075(v=VS.85).aspx Remote Desktop Services. http://msdn.microsoft.com/en-us/library/aa383509(v=VS.85).aspx What is virtual channel. http://msdn.microsoft.com/en-us/library/aa383550(v=VS.85).aspx Using the Remote Desktop ActiveX Control with Virtual Channels.Download example source. http://www.articlesbase.com/programming-articles/user-mode-transport-of-the-library-via-virtual-channels-2610002.html
Famous Steroid Use Cases in US Sports Your Fishing Boat Buyer's Guide Transporting Cargo with a Pickup Currency Trading School Online - Your Passport To Forex Success Sports Betting Involves Fun and Huge Money Sporty style: do leather and leisure mix? Sports Bra Reviews - Are They Any Good? The Importance Of High Impact Sports Bra Getting Ready With a White Sports Bra Successful Sports Betting Picks Fitness Equipment Overview: The Beny Sports V-fit AR1 Artemis II Air Rowing Machine Four screed teams install a sports hall of 630m2 of FlexiDry fast drying floor screed in one day Sports Summer Camps in the Bay Area
print
www.yloan.com guest:  register | login | search IP(216.73.216.125) California / Anaheim Processed in 0.028072 second(s), 7 queries , Gzip enabled , discuz 5.5 through PHP 8.3.9 , debug code: 2 , 5729, 40,
User mode transport of the library via virtual channels Anaheim