diff --git a/Core/ConnectWindow.cpp b/Core/ConnectWindow.cpp index c0be90b3..985ac697 100644 --- a/Core/ConnectWindow.cpp +++ b/Core/ConnectWindow.cpp @@ -62,7 +62,7 @@ namespace SL { ptr->Host = host.substr(0, portspecified); } else ptr->Host = host; -#if defined(DEBUG) || defined(_DEBUG) +#if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG) if (!ptr->_Config->Public_Certficate) { ptr->_Config->Public_Certficate = std::static_pointer_cast(std::make_shared(Crypto::cert.data(), Crypto::cert.size())); diff --git a/Core/ConnectionInfoWindow.cpp b/Core/ConnectionInfoWindow.cpp index ed28e79d..ae9bdd90 100644 --- a/Core/ConnectionInfoWindow.cpp +++ b/Core/ConnectionInfoWindow.cpp @@ -123,7 +123,7 @@ namespace SL { else { auto config = ptr->config; -#if defined(DEBUG) || defined(_DEBUG) +#if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG) if (!config->Private_Key || !config->Public_Certficate || config->Password.empty()) { config->Private_Key = std::static_pointer_cast(std::make_shared(Crypto::private_key.data(), Crypto::private_key.size())); diff --git a/Core/Core.project b/Core/Core.project index e18f30ba..96b8d119 100644 --- a/Core/Core.project +++ b/Core/Core.project @@ -133,6 +133,11 @@ + + + + + diff --git a/Core/Core.vcxitems b/Core/Core.vcxitems index cc9bfd6b..b94b4f44 100644 --- a/Core/Core.vcxitems +++ b/Core/Core.vcxitems @@ -1,140 +1,142 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - {45d41acc-2c3c-43d2-bc10-02aa73ffc7c7} - Core - - - - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) - - - - - - - - - - NotUsing - - - NotUsing - - - NotUsing - - - NotUsing - - - NotUsing - - - NotUsing - - - NotUsing - - - - - - - - - - - - - Disabled - EnableFastChecks - - - - - - - - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Document - npm install ntypescript -g -ntypescript $(SolutionDir)wwwroot\Core.ts -t ES5 - Core.js - true - false - - - - - - + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + {45d41acc-2c3c-43d2-bc10-02aa73ffc7c7} + Core + + + + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) + + + + + + + + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + + + + + + + + + + + Disabled + EnableFastChecks + + + + + + + + + + + + + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Document + call npm install ntypescript -g + + +call ntsc $(SolutionDir)wwwroot\Core.ts -t ES5 + Core.js + true + false + + + + + + \ No newline at end of file diff --git a/Core/HttpsSocket.cpp b/Core/HttpsSocket.cpp index 43e115fa..51e051d7 100644 --- a/Core/HttpsSocket.cpp +++ b/Core/HttpsSocket.cpp @@ -69,9 +69,10 @@ namespace SL { HttpsSocketImpl(IBaseNetworkDriver* netdriver, boost::asio::io_service& io_service, std::shared_ptr sslcontext) : _socket(io_service, *sslcontext), + _IBaseNetworkDriver(netdriver), _read_deadline(io_service), - _write_deadline(io_service), - _IBaseNetworkDriver(netdriver) + _write_deadline(io_service) + { _read_deadline.expires_at(boost::posix_time::pos_infin); _write_deadline.expires_at(boost::posix_time::pos_infin); @@ -90,13 +91,13 @@ namespace SL { std::shared_ptr _ssl_context; boost::asio::ssl::stream _socket; - IBaseNetworkDriver* _IBaseNetworkDriver = nullptr; - + IBaseNetworkDriver* _IBaseNetworkDriver; - std::deque _OutgoingPackets; - std::vector _IncomingBuffer; boost::asio::deadline_timer _read_deadline; boost::asio::deadline_timer _write_deadline; + + std::deque _OutgoingPackets; + std::vector _IncomingBuffer; std::unordered_map _Header; bool _Server = false; std::string _Host; @@ -129,7 +130,6 @@ namespace SL { auto compack(std::make_shared(std::move(pack))); _socket.get_io_service().post([self, compack, beforesize]() { - auto outgoingempty = self->_OutgoingPackets.empty(); self->_OutgoingPackets.push_back({ compack, beforesize }); self->writeheader(); @@ -377,6 +377,10 @@ namespace SL { if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "use_certificate_chain_file error " << ec.message()); ec.clear(); + sslcontext->set_default_verify_paths(ec); + if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "set_default_verify_paths error " << ec.message()); + ec.clear(); + boost::asio::const_buffer privkey(config->Private_Key->get_buffer(), config->Private_Key->get_size()); sslcontext->use_private_key(privkey, boost::asio::ssl::context::pem, ec); if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "use_private_key_file error " << ec.message()); diff --git a/Core/ImageControl.cpp b/Core/ImageControl.cpp index 7463d936..378d6729 100644 --- a/Core/ImageControl.cpp +++ b/Core/ImageControl.cpp @@ -145,10 +145,12 @@ namespace SL { case FL_PUSH: _ImageControlInfo._MouseCallback(e, Fl::event_button(), Input::Mouse::Press::DOWN, Fl::event_x() + _ImageControlInfo._Scroller->xposition(), Fl::event_y() + _ImageControlInfo._Scroller->yposition()); - break; + return 1; case FL_RELEASE: _ImageControlInfo._MouseCallback(e, Fl::event_button(), Input::Mouse::Press::UP, Fl::event_x() + _ImageControlInfo._Scroller->xposition(), Fl::event_y() + _ImageControlInfo._Scroller->yposition()); - break; + break; + case FL_ENTER: + return 1; case FL_DRAG: case FL_MOUSEWHEEL: case FL_MOVE: @@ -161,6 +163,7 @@ namespace SL { _ImageControlInfo._KeyCallback(e, Input::Keyboard::Press::UP); return 1; case FL_FOCUS: + return 1; default: break; diff --git a/Core/Keyboard.cpp b/Core/Keyboard.cpp index 48fa8367..cd8d6e92 100644 --- a/Core/Keyboard.cpp +++ b/Core/Keyboard.cpp @@ -12,8 +12,50 @@ #define SL_DIVIDE 0xf06F #if _WIN32 + unsigned int Map_ToPlatformKey(unsigned int key) { + if (key >= 0x0030 && key <= 0x0039) return key;//VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39) + else if (key >= 0x0041 && key <= 0x005A) {//VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) + return key;// regular ascii alphabet characters + } + else if (key >= 0x0061 && key <= 0x007a) { + return key - static_cast('a' - 'A');//on windows, the keys are always in CAPS... + } + switch (key) { + + case (FL_BackSpace): + return VK_BACK; + case (FL_Tab): + return VK_TAB; + case (FL_Enter): + return VK_RETURN; + case(' '): + return VK_SPACE; + + case('='): + return VK_OEM_PLUS; + case(','): + return VK_OEM_COMMA; + case('-'): + return VK_OEM_MINUS; + case('.'): + return VK_OEM_PERIOD; + case (';'): + return VK_OEM_1; + case('/'): + return VK_OEM_2; + case('`'): + return VK_OEM_3; + case('['): + return VK_OEM_4; + case('\\'): + return VK_OEM_5; + case(']'): + return VK_OEM_6; + case('\''): + return VK_OEM_7; + case (FL_Help): return VK_HELP; case (FL_Shift_L): @@ -136,6 +178,40 @@ unsigned int Map_ToPlatformKey(unsigned int key) { return VK_F24; case (FL_Num_Lock): return VK_NUMLOCK; + case (FL_KP +'0'): + return VK_NUMPAD0; + case (FL_KP + '1'): + return VK_NUMPAD1; + case (FL_KP + '2'): + return VK_NUMPAD2; + case (FL_KP + '3'): + return VK_NUMPAD3; + case (FL_KP + '4'): + return VK_NUMPAD4; + case (FL_KP + '5'): + return VK_NUMPAD5; + case (FL_KP + '6'): + return VK_NUMPAD6; + case (FL_KP + '7'): + return VK_NUMPAD7; + case (FL_KP + '8'): + return VK_NUMPAD8; + case (FL_KP + '9'): + return VK_NUMPAD9; + case (FL_KP + '/'): + return VK_DIVIDE; + case (FL_KP + '*'): + return VK_MULTIPLY; + case (FL_KP + '-'): + return VK_SUBTRACT; + case (FL_KP + '+'): + return VK_ADD; + case (FL_KP + '.'): + return VK_DECIMAL; + + case (FL_KP_Enter): + return VK_RETURN; + case (FL_Scroll_Lock): return VK_SCROLL; case (FL_Volume_Down): @@ -159,7 +235,14 @@ unsigned int Map_ToPlatformKey(unsigned int key) { #elif __linux__ unsigned int Map_ToPlatformKey(unsigned int key) { - switch (key) { + switch (key) { + case (FL_BackSpace): + return XK_BackSpace; + case (FL_Tab): + return XK_Tab; + case (FL_Enter): + return XK_Return; + case (FL_Help): return XK_Help; case (FL_Shift_L): @@ -294,20 +377,28 @@ void SL::Remote_Access_Library::Input::SimulateKeyboardEvent(KeyEvent ev) { SL_RAT_LOG(Utilities::Logging_Levels::INFO_log_level, "Received SetKeyEvent Key:" << ev.Key << " SpecialKey: " << ev.SpecialKey << " PressData: " << ev.PressData); if (ev.Key == 0) return;//unmapped key +#if _WIN32 + ev.Key = Map_ToPlatformKey(ev.Key); +#else if (ev.Key & 0xf000) {//special key, needs to be mapped to platform specific code ev.Key = Map_ToPlatformKey(ev.Key); }//must be ascii char, do a check to make sure it is actually an ascii char. Below are the hex values of ascii chars - else if ( ev.Key != 0x0008 && ev.Key != 0x0009 && ev.Key != 0x000d && ev.Key != 0x0020 && ev.Key != 0x0027 && !(ev.Key >= 0x002b && ev.Key <= 0x007f)) { + else if (ev.Key != 0x0020 && ev.Key != 0x0027 && !(ev.Key >= 0x002b && ev.Key <= 0x007f)) { SL_RAT_LOG(Utilities::Logging_Levels::Debug_log_level, "Recevied a key event which is outside of the asci char set"); return; } +#endif + if (ev.Key == 0) {//no mapping available SL_RAT_LOG(Utilities::Logging_Levels::Debug_log_level, "No Mapping Available for key"); return; } + #if _WIN32 + + INPUT input; memset(&input, 0, sizeof(input)); input.type = INPUT_KEYBOARD; @@ -320,20 +411,21 @@ void SL::Remote_Access_Library::Input::SimulateKeyboardEvent(KeyEvent ev) #elif __ANDROID__ -hkl + #elif __linux__ auto display = XOpenDisplay(NULL); auto keycode = XKeysymToKeycode(display, ev.Key); - SL_RAT_LOG(Utilities::Logging_Levels::Debug_log_level, "AFter XKeysymToKeycode '"< 32 || width > 32) { + SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "Cursor dimensions are outside normal sizes, could be an error"); + return Utilities::Image::CreateImage(0, 0); } - int width = bm.bmWidth; + BITMAPINFOHEADER bi; memset(&bi, 0, sizeof(bi)); @@ -72,6 +87,7 @@ namespace SL bi.biSizeImage = ((width * bi.biBitCount + 31) / 32) * 4 * height; auto retimg(Utilities::Image::CreateImage(width, height)); + GetDIBits(desktopdc.get(), capturebmp.get(), 0, (UINT)height, retimg->data(), (BITMAPINFO*)&bi, DIB_RGB_COLORS); SelectObject(capturedc.get(), originalBmp); @@ -98,11 +114,18 @@ namespace SL Utilities::Point pos; CURSORINFO cursorInfo; cursorInfo.cbSize = sizeof(cursorInfo); - GetCursorInfo(&cursorInfo); + if(GetCursorInfo(&cursorInfo) == FALSE) { + SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "GetCursorInfo == FALSE"); + return pos; + } - ICONINFOEX ii = { 0 }; + ICONINFOEXA ii = { 0 }; ii.cbSize = sizeof(ii); - GetIconInfoEx(cursorInfo.hCursor, &ii); + if(GetIconInfoExA(cursorInfo.hCursor, &ii) == FALSE) { + //this tends to fail on hyper-v enviornments generating alot of noise. so lower its level to Info.. + SL_RAT_LOG(Utilities::Logging_Levels::INFO_log_level, "GetIconInfoEx == FALSE"); + return pos; + } auto colorbmp = RAIIHBITMAP(ii.hbmColor); // make sure this is cleaned up properly auto maskbmp = RAIIHBITMAP(ii.hbmMask); // make sure this is cleaned up properly diff --git a/Core/Mouse.h b/Core/Mouse.h index 24446c36..f01e84c1 100644 --- a/Core/Mouse.h +++ b/Core/Mouse.h @@ -11,17 +11,18 @@ namespace SL { namespace Input { namespace Mouse { enum Events : unsigned int { + NO_EVENTDATA, LEFT, MIDDLE, RIGHT, - SCROLL, - NO_EVENTDATA + SCROLL + }; enum Press : unsigned int { + NO_PRESS_DATA, UP, DOWN, - DBLCLICK, - NO_PRESS_DATA + DBLCLICK }; } diff --git a/Core/ServerNetworkDriver.cpp b/Core/ServerNetworkDriver.cpp index d5015c31..f0397001 100644 --- a/Core/ServerNetworkDriver.cpp +++ b/Core/ServerNetworkDriver.cpp @@ -57,7 +57,7 @@ namespace SL { } virtual void OnConnect(const std::shared_ptr& socket) override { - if (_Clients.size() > _Config->MaxNumConnections) { + if (_Clients.size() > static_cast(_Config->MaxNumConnections) ){ socket->close("CLosing due to max number of connections!"); return; } diff --git a/Core/Server_Config.h b/Core/Server_Config.h index 2dcb7608..4652b92b 100644 --- a/Core/Server_Config.h +++ b/Core/Server_Config.h @@ -21,7 +21,7 @@ namespace SL { bool IgnoreIncomingMouseEvents = false; bool IgnoreIncomingKeyboardEvents = false; - int MaxNumConnections = 10;// + unsigned int MaxNumConnections = 10;// //CRYPTO SETTINGS std::shared_ptr Private_Key; diff --git a/Core/ViewerController.cpp b/Core/ViewerController.cpp index a4c3c4ca..276b7d71 100644 --- a/Core/ViewerController.cpp +++ b/Core/ViewerController.cpp @@ -33,9 +33,10 @@ namespace SL { ImageControl* _ImageControl = nullptr; Fl_Scroll* _Fl_Scroll = nullptr; - + + std::shared_ptr _Config; Network::ClientNetworkDriver _ClientNetworkDriver; - std::shared_ptr _Config; + std::chrono::time_point _NetworkStatsTimer; std::chrono::time_point _FrameTimer; float MaxFPS = 30.0f; @@ -76,21 +77,23 @@ namespace SL { void handle_key(int e, Input::Keyboard::Press press) { + UNUSED(e); auto key = Fl::event_key(); auto text = Fl::event_text(); auto len = Fl::event_length(); auto t = *text; - if (t >= '0' && t < 'Z') key = static_cast(t); - if (t >= 'a' && t <= 'z') key = static_cast(t - ('a' - 'A')); - SL_RAT_LOG(Utilities::Logging_Levels::INFO_log_level, "key: '" << key << "' text: '" << text << "' len: '" << len << "'"); + //make sure to map all keys to their lower case equivelents. + if (t >= 'A' && t < 'Z') key = static_cast(t + ('a' - 'A')); + Input::KeyEvent k; - k.Key = t; + k.Key = key; k.PressData = press; + k.SpecialKey = Input::Keyboard::Specials::NO_PRESS_DATA; _ClientNetworkDriver.SendKey(k); } void handle_mouse(int e, int button, Input::Mouse::Press press, int x, int y) { - + auto scale = _ImageControl->GetScaleFactor(); Input::MouseEvent ev; @@ -199,7 +202,8 @@ namespace SL { imp->cursor(Fl_Cursor::FL_CURSOR_NONE); } virtual void OnReceive_MouseImage(const std::shared_ptr& socket, std::shared_ptr& img)override { - if (_HasFocus && !_CursorHidden) { + UNUSED(socket); + if (_HasFocus && !_CursorHidden) { Fl::awake(awakenhidecursor, this); _CursorHidden = true; } @@ -208,6 +212,7 @@ namespace SL { } virtual void OnReceive_MousePos(const std::shared_ptr& socket, Utilities::Point* pos)override { + UNUSED(socket); _ImageControl->SetMousePosition(*pos); } }; diff --git a/Core/WebSocket.cpp b/Core/WebSocket.cpp index 2e98428c..5a5b1e90 100644 --- a/Core/WebSocket.cpp +++ b/Core/WebSocket.cpp @@ -56,21 +56,21 @@ namespace SL { boost::asio::io_service io_service; std::thread io_servicethread; boost::asio::io_service::work work; - + }; class WSSocketImpl : public ISocket, public std::enable_shared_from_this { private: - + public: WSSocketImpl(IBaseNetworkDriver* netdriver, boost::asio::io_service& io_service, std::shared_ptr sslcontext) : _socket(io_service, *sslcontext), + _IBaseNetworkDriver(netdriver), _read_deadline(io_service), - _write_deadline(io_service), - _IBaseNetworkDriver(netdriver) + _write_deadline(io_service) { _read_deadline.expires_at(boost::posix_time::pos_infin); _write_deadline.expires_at(boost::posix_time::pos_infin); @@ -87,7 +87,7 @@ namespace SL { } std::shared_ptr _ssl_context; boost::asio::ssl::stream _socket; - + IBaseNetworkDriver* _IBaseNetworkDriver; std::deque _OutgoingPackets; @@ -164,7 +164,7 @@ namespace SL { auto compack(std::make_shared(std::move(compress(pack)))); _socket.get_io_service().post([self, compack, beforesize]() { - + self->_OutgoingPackets.push_back({ compack, beforesize }); self->writeWSheader(); }); @@ -598,10 +598,24 @@ namespace SL { void SL::Remote_Access_Library::Network::WebSocket::Connect(Client_Config* config, IBaseNetworkDriver* driver, const char * host) { static std::unique_ptr io_runner; - if(!io_runner) io_runner = std::make_unique(); + if (!io_runner) io_runner = std::make_unique(); + auto sslcontext = std::make_shared(boost::asio::ssl::context::tlsv11); boost::asio::const_buffer cert(config->Public_Certficate->get_buffer(), config->Public_Certficate->get_size()); - sslcontext->add_certificate_authority(cert); + boost::system::error_code ec; + sslcontext->add_certificate_authority(cert, ec); + if (ec) { + SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "add_certificate_authority error " << ec.message()); + return; + } + ec.clear(); + + sslcontext->set_default_verify_paths(ec); + if (ec) { + SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "set_default_verify_paths error " << ec.message()); + return; + } + ec.clear(); auto sock = std::make_shared(driver, io_runner->io_service, sslcontext); @@ -621,6 +635,7 @@ void SL::Remote_Access_Library::Network::WebSocket::Connect(Client_Config* confi } else { + sock->_socket.set_verify_mode(boost::asio::ssl::verify_peer); sock->_socket.set_verify_callback(std::bind(&WSSocketImpl::verify_certificate, sock.get(), std::placeholders::_1, std::placeholders::_2)); boost::asio::async_connect(sock->_socket.lowest_layer(), endpoint, [sock](const boost::system::error_code& ec, boost::asio::ip::tcp::resolver::iterator) @@ -658,7 +673,7 @@ namespace SL { std::shared_ptr _WSSAsio_Context; std::shared_ptr sslcontext; IBaseNetworkDriver* _IBaseNetworkDriver; - + ListinerImpl(IBaseNetworkDriver* netevent, std::shared_ptr asiocontext, std::shared_ptr config) : _acceptor(asiocontext->io_service, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), config->WebSocketTLSLPort)), _config(config), @@ -679,12 +694,16 @@ namespace SL { sslcontext->use_tmp_dh(dhparams, ec); if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "use_tmp_dh error " << ec.message()); ec.clear(); + boost::asio::const_buffer cert(config->Public_Certficate->get_buffer(), config->Public_Certficate->get_size()); sslcontext->use_certificate_chain(cert, ec); - if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "use_certificate_chain_file error " << ec.message()); ec.clear(); + sslcontext->set_default_verify_paths(ec); + if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "set_default_verify_paths error " << ec.message()); + ec.clear(); + boost::asio::const_buffer privkey(config->Private_Key->get_buffer(), config->Private_Key->get_size()); sslcontext->use_private_key(privkey, boost::asio::ssl::context::pem, ec); if (ec) SL_RAT_LOG(Utilities::Logging_Levels::ERROR_log_level, "use_private_key_file error " << ec.message()); diff --git a/Core/crypto.cpp b/Core/crypto.cpp index 01bf6e1f..6fe91246 100644 --- a/Core/crypto.cpp +++ b/Core/crypto.cpp @@ -195,7 +195,7 @@ std::string SL::Remote_Access_Library::Crypto::Createdhparams(std::string savelo std::string SL::Remote_Access_Library::Crypto::ValidateCertificate(ICrypoLoader* certficate) { std::string ret; - + auto mem = BIO_new(BIO_s_mem()); BIO_puts(mem, certficate->get_buffer()); auto cert = PEM_read_bio_X509(mem, NULL, NULL, NULL); diff --git a/Core/crypto.h b/Core/crypto.h index 1202ffb3..80228afe 100644 --- a/Core/crypto.h +++ b/Core/crypto.h @@ -65,7 +65,8 @@ f4pf5b+c+w+99vHpUlkbIzV0tI5vGZo1uwIBAg== -----END DH PARAMETERS-----)"; -#if defined(DEBUG) || defined(_DEBUG) +#if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG) + //THIS SHOULD ONLY BE USED IN DEBUG MODE FOR EASE OF TESTING!!!! //DO NOT USE THIS IN PRODUCTION!! const std::string cert = R"(-----BEGIN CERTIFICATE----- diff --git a/Desktop_Client/Desktop_Client.vcxproj b/Desktop_Client/Desktop_Client.vcxproj index 6e271bb4..26d5cfa5 100644 --- a/Desktop_Client/Desktop_Client.vcxproj +++ b/Desktop_Client/Desktop_Client.vcxproj @@ -194,14 +194,14 @@ - - + + @@ -209,13 +209,13 @@ - - + + \ No newline at end of file diff --git a/Desktop_Client/packages.config b/Desktop_Client/packages.config index 3e3aaeed..83f64606 100644 --- a/Desktop_Client/packages.config +++ b/Desktop_Client/packages.config @@ -5,8 +5,8 @@ - - + + diff --git a/Desktop_Server/Desktop_Server.desktop b/Desktop_Server/Desktop_Server.desktop new file mode 100644 index 00000000..76639d8b --- /dev/null +++ b/Desktop_Server/Desktop_Server.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=RDP Desktop Server +Comment=The best RDP viewer Period +TryExec=Desktop_Server +Exec=Desktop_Server +Icon=Desktop_Server.ico diff --git a/Desktop_Server/Desktop_Server.vcxproj b/Desktop_Server/Desktop_Server.vcxproj index dce8f9c1..b5ae5b52 100644 --- a/Desktop_Server/Desktop_Server.vcxproj +++ b/Desktop_Server/Desktop_Server.vcxproj @@ -165,7 +165,7 @@ Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true - MultiThreadedDebugDLL + MultiThreadedDebug NotSet Default @@ -194,7 +194,7 @@ Disabled _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true - MultiThreadedDebugDLL + MultiThreadedDebug NotSet Default @@ -223,7 +223,7 @@ Disabled _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true - MultiThreadedDebugDLL + MultiThreadedDebug NotSet Default @@ -254,7 +254,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true - MultiThreadedDLL + MultiThreaded StreamingSIMDExtensions2 16Bytes @@ -287,7 +287,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true - MultiThreadedDLL + MultiThreaded StreamingSIMDExtensions2 16Bytes @@ -320,7 +320,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true - MultiThreadedDLL + MultiThreaded StreamingSIMDExtensions2 16Bytes @@ -365,12 +365,12 @@ - - + + @@ -380,11 +380,11 @@ - - + + \ No newline at end of file diff --git a/Desktop_Server/packages.config b/Desktop_Server/packages.config index 3e3aaeed..83f64606 100644 --- a/Desktop_Server/packages.config +++ b/Desktop_Server/packages.config @@ -5,8 +5,8 @@ - - + + diff --git a/wwwroot/Core.js b/wwwroot/Core.js index e6c81a51..ed4572dd 100644 --- a/wwwroot/Core.js +++ b/wwwroot/Core.js @@ -53,10 +53,10 @@ var SL; var KeyPress = Input.KeyPress; ; (function (SpecialKeys) { - SpecialKeys[SpecialKeys["ALT"] = 0] = "ALT"; - SpecialKeys[SpecialKeys["CTRL"] = 1] = "CTRL"; - SpecialKeys[SpecialKeys["SHIFT"] = 2] = "SHIFT"; - SpecialKeys[SpecialKeys["NO_PRESS_DATA"] = 3] = "NO_PRESS_DATA"; + SpecialKeys[SpecialKeys["NO_PRESS_DATA"] = 0] = "NO_PRESS_DATA"; + SpecialKeys[SpecialKeys["ALT"] = 1] = "ALT"; + SpecialKeys[SpecialKeys["CTRL"] = 2] = "CTRL"; + SpecialKeys[SpecialKeys["SHIFT"] = 3] = "SHIFT"; })(Input.SpecialKeys || (Input.SpecialKeys = {})); var SpecialKeys = Input.SpecialKeys; ; @@ -83,12 +83,12 @@ var SL; 0, 0xff68, 0, - 8, - 9, + 0xff08, + 0xff09, 0, 0, 0, - 0x000d, + 0xff0d, 0, 0, 0xffe1, @@ -251,7 +251,7 @@ var SL; 0x2d, 0x5b, 0x5d, - 0x27, + 0x60, 0, 0, 0, @@ -337,19 +337,19 @@ var SL; Input.KeyEvent = KeyEvent; ; (function (MouseEvents) { - MouseEvents[MouseEvents["LEFT"] = 0] = "LEFT"; - MouseEvents[MouseEvents["MIDDLE"] = 1] = "MIDDLE"; - MouseEvents[MouseEvents["RIGHT"] = 2] = "RIGHT"; - MouseEvents[MouseEvents["SCROLL"] = 3] = "SCROLL"; - MouseEvents[MouseEvents["NO_EVENTDATA"] = 4] = "NO_EVENTDATA"; + MouseEvents[MouseEvents["NO_EVENTDATA"] = 0] = "NO_EVENTDATA"; + MouseEvents[MouseEvents["LEFT"] = 1] = "LEFT"; + MouseEvents[MouseEvents["MIDDLE"] = 2] = "MIDDLE"; + MouseEvents[MouseEvents["RIGHT"] = 3] = "RIGHT"; + MouseEvents[MouseEvents["SCROLL"] = 4] = "SCROLL"; })(Input.MouseEvents || (Input.MouseEvents = {})); var MouseEvents = Input.MouseEvents; ; (function (MousePress) { - MousePress[MousePress["UP"] = 0] = "UP"; - MousePress[MousePress["DOWN"] = 1] = "DOWN"; - MousePress[MousePress["DBLCLICK"] = 2] = "DBLCLICK"; - MousePress[MousePress["NO_PRESS_DATA"] = 3] = "NO_PRESS_DATA"; + MousePress[MousePress["NO_PRESS_DATA"] = 0] = "NO_PRESS_DATA"; + MousePress[MousePress["UP"] = 1] = "UP"; + MousePress[MousePress["DOWN"] = 2] = "DOWN"; + MousePress[MousePress["DBLCLICK"] = 3] = "DBLCLICK"; })(Input.MousePress || (Input.MousePress = {})); var MousePress = Input.MousePress; ; diff --git a/wwwroot/Core.ts b/wwwroot/Core.ts index 762cfc6f..b43c5439 100644 --- a/wwwroot/Core.ts +++ b/wwwroot/Core.ts @@ -38,10 +38,10 @@ module SL { DOWN }; export enum SpecialKeys { + NO_PRESS_DATA, ALT, CTRL, - SHIFT, - NO_PRESS_DATA + SHIFT }; export class KeyEvent { constructor(public PressData: KeyPress, public Key: number, public SpecialKey: SpecialKeys) { } @@ -63,12 +63,12 @@ module SL { 0, // [5] 0xff68,//"HELP", // [6] 0, // [7] - 8,//"BACK_SPACE", // [8] - 9,//"TAB", // [9] + 0xff08,//"BACK_SPACE", // [8] + 0xff09,//"TAB", // [9] 0, // [10] 0, // [11] 0,//"CLEAR", // [12] - 0x000d,//"ENTER", // [13] + 0xff0d,//"ENTER", // [13] 0, // [14] 0, // [15] 0xffe1,//"SHIFT", // [16] @@ -231,7 +231,7 @@ module SL { 0x2d,//"HYPHEN_MINUS", // [173] 0x5b,//"OPEN_CURLY_BRACKET", // [174] 0x5d,//"CLOSE_CURLY_BRACKET", // [175] - 0x27,//"TILDE", // [176] + 0x60,//"TILDE", // [176] 0, // [177] 0, // [178] 0, // [179] @@ -315,17 +315,18 @@ module SL { }; export enum MouseEvents { + NO_EVENTDATA, LEFT, MIDDLE, RIGHT, - SCROLL, - NO_EVENTDATA + SCROLL + }; export enum MousePress { + NO_PRESS_DATA, UP, DOWN, - DBLCLICK, - NO_PRESS_DATA + DBLCLICK }; export class MouseEvent {