From a7619aab292a6c6cf038f03f274f638a973d3f6b Mon Sep 17 00:00:00 2001 From: horizonlin Date: Tue, 11 Dec 2018 14:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9urlprotocol=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加对urlprotocol参数判断 --- client/tp_assist_win/tp_assist.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/client/tp_assist_win/tp_assist.cpp b/client/tp_assist_win/tp_assist.cpp index 4e9506a..4b05076 100644 --- a/client/tp_assist_win/tp_assist.cpp +++ b/client/tp_assist_win/tp_assist.cpp @@ -85,8 +85,9 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd if (0 == g_ulSingleInstanceMsgId) return FALSE; - LPWSTR szCmdLine = (LPWSTR)::GetCommandLineW(); //ȡв - g_argv = CommandLineToArgvW(szCmdLine, &g_argc); //вַ + LPWSTR szCmdLine = (LPWSTR)::GetCommandLineW(); //获取命令行参数; + g_argv = CommandLineToArgvW(szCmdLine, &g_argc); //拆分命令行参数字符串; + std::wstring arg; for (int i = 0; i < g_argc; ++i) { @@ -96,6 +97,23 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd LocalFree(g_argv); g_argv = NULL; return -1; + }else if (arg.find(L"teleport_ip",0) !=std::wstring::npos && arg.find(L"teleport_port") != std::wstring::npos && arg.find(L"remote_host_ip") != std::wstring::npos && arg.find(L"session_id") != std::wstring::npos) { + //把wchar_t **转换为std::string + size_t len = wcslen(g_argv[i]) + 1; + size_t converted = 0; + char *CStr; + CStr = (char*)malloc(len * sizeof(char)); + wcstombs_s(&converted, CStr, len, g_argv[i], _TRUNCATE); + std::string func_args = CStr; + + TsHttpRpc ts_http_rpc; + ex_astr buf; + ts_http_rpc._rpc_func_url_protocol(func_args, buf); + + free(CStr); + LocalFree(g_argv); + g_argv = NULL; + return 0; } }