diff --git a/MeoAssistance.sln b/MeoAssistance.sln
index 7edf658493..b62df20fb0 100644
--- a/MeoAssistance.sln
+++ b/MeoAssistance.sln
@@ -19,6 +19,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCaller", "tools\TestCal
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeoAsstGui", "src\MeoAsstGui\MeoAsstGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestPipe", "tools\TestPipe\TestPipe.vcxproj", "{0565E66B-28A0-435C-BDFC-6565CADE28D2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|x64 = Release|x64
@@ -41,6 +43,10 @@ Global
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|Any CPU
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|Any CPU
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|Any CPU
+ {0565E66B-28A0-435C-BDFC-6565CADE28D2}.Release|x64.ActiveCfg = Release|x64
+ {0565E66B-28A0-435C-BDFC-6565CADE28D2}.Release|x64.Build.0 = Release|x64
+ {0565E66B-28A0-435C-BDFC-6565CADE28D2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {0565E66B-28A0-435C-BDFC-6565CADE28D2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -48,6 +54,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{36BC08F3-71CF-429A-AE69-291BE8962CB2} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6}
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6}
+ {0565E66B-28A0-435C-BDFC-6565CADE28D2} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4F2C0E4B-4FE9-47C6-A878-6BD2FAD8B9B2}
diff --git a/tools/TestPipe/TestPipe.vcxproj b/tools/TestPipe/TestPipe.vcxproj
new file mode 100644
index 0000000000..987107f183
--- /dev/null
+++ b/tools/TestPipe/TestPipe.vcxproj
@@ -0,0 +1,157 @@
+
+
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+ RelWithDebInfo
+ Win32
+
+
+ RelWithDebInfo
+ x64
+
+
+
+
+
+
+ 16.0
+ Win32Proj
+ {0565e66b-28a0-435c-bdfc-6565cade28d2}
+ TestPipe
+ 10.0
+
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tools/TestPipe/TestPipe.vcxproj.filters b/tools/TestPipe/TestPipe.vcxproj.filters
new file mode 100644
index 0000000000..65fa6d5ae5
--- /dev/null
+++ b/tools/TestPipe/TestPipe.vcxproj.filters
@@ -0,0 +1,22 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ 源文件
+
+
+
\ No newline at end of file
diff --git a/tools/TestPipe/main.cpp b/tools/TestPipe/main.cpp
new file mode 100644
index 0000000000..7e8e541cde
--- /dev/null
+++ b/tools/TestPipe/main.cpp
@@ -0,0 +1,93 @@
+#include
+#include
+#include
+
+#include
+
+int main()
+{
+ HANDLE parent_read = nullptr;
+ HANDLE parent_write = nullptr;
+ HANDLE child_read = nullptr;
+ HANDLE child_write = nullptr;
+
+ // 安全属性描述符
+ SECURITY_ATTRIBUTES sa_out_pipe = { 0 };
+ sa_out_pipe.nLength = sizeof(SECURITY_ATTRIBUTES);
+ sa_out_pipe.lpSecurityDescriptor = NULL;
+ sa_out_pipe.bInheritHandle = TRUE;
+
+ constexpr int PipeBuffSize = 1048576;
+ // 创建管道,父进程读-子进程写
+ BOOL pipe_ret1 = ::CreatePipe(&parent_read, &child_write, &sa_out_pipe, PipeBuffSize);
+ // 创建管道,父进程写-子进程读
+ BOOL pipe_ret2 = ::CreatePipe(&child_read, &parent_write, &sa_out_pipe, PipeBuffSize);
+
+ STARTUPINFOA startup_info = { 0 }; // 启动信息结构体
+ startup_info.cb = sizeof(STARTUPINFO);
+ startup_info.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ startup_info.wShowWindow = SW_HIDE;
+ // 重定向子进程的读写
+ startup_info.hStdInput = child_read;
+ startup_info.hStdOutput = child_write;
+ startup_info.hStdError = child_write;
+
+ PROCESS_INFORMATION process_info = { 0 }; // 进程信息结构体
+
+ std::string adb = "adb -s 127.0.0.1:5555 shell";
+ ::CreateProcessA(NULL, const_cast(adb.c_str()), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &startup_info, &process_info);
+
+ std::string pipe_str;
+ const std::string end_flag = "__END__\r\n";
+ while (true) {
+ DWORD read_num = 0;
+ DWORD std_num = 0;
+ DWORD write_num = 0;
+ std::string cmd = "screencap";
+ cmd += "; echo " + end_flag;
+ WriteFile(parent_write, cmd.c_str(), cmd.size(), &write_num, NULL);
+
+ auto time = std::chrono::system_clock::now();
+ while (true) {
+ while (::PeekNamedPipe(parent_read, NULL, 0, NULL, &read_num, NULL) && read_num > 0) {
+ //std::cout << read_num << std::endl;
+ char* pipe_buffer = new char[read_num];
+
+ BOOL read_ret = ::ReadFile(parent_read, pipe_buffer, read_num, &std_num, NULL);
+
+ if (read_ret) {
+ pipe_str += std::string(pipe_buffer, std_num);
+ }
+
+ delete[] pipe_buffer;
+
+ }
+ if (pipe_str.size() >= end_flag.size()
+ && pipe_str.compare(pipe_str.size() - end_flag.size(), end_flag.size(), end_flag) == 0) {
+ break;
+
+ }
+
+ }
+ std::cout << std::chrono::duration_cast(std::chrono::system_clock::now() - time).count() << "ms" << std::endl;
+
+ std::cout << "size: " << pipe_str.size() << std::endl;
+ pipe_str.clear();
+ }
+
+
+ DWORD ret = -1;
+ ::GetExitCodeProcess(process_info.hProcess, &ret);
+
+ ::CloseHandle(process_info.hProcess);
+ ::CloseHandle(process_info.hThread);
+
+ ::CloseHandle(parent_read);
+ ::CloseHandle(parent_write);
+ ::CloseHandle(child_read);
+ ::CloseHandle(child_write);
+
+
+
+ return 0;
+}
\ No newline at end of file