Changeset b0b707b12891…
Parent d82692de648b…
by
Changes to 3 files · Browse files at b0b707b12891 Showing diff from parent d82692de648b Diff from another changeset...
@@ -91,40 +91,14 @@ // Note: if the command is a batch file and the [full] path to the
// batch contains spaces, the path must be double-quoted.
// (see http://www.encocoservices.com/createprocess.html)
-bool LaunchCommand(const std::string& command, const std::string& cwd, const std::string& filelist)
+bool LaunchCommand(const std::string& command, const std::string& cwd)
{
TDEBUG_TRACE("LaunchCommand: " << command);
PROCESS_INFORMATION processInfo;
memset(&processInfo, 0, sizeof(processInfo));
- HANDLE hChildStd_IN_Rd = NULL;
- HANDLE hChildStd_IN_Wr = NULL;
-
- SECURITY_ATTRIBUTES saAttr;
- // Set the bInheritHandle flag so pipe handles are inherited.
- saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
- saAttr.bInheritHandle = TRUE;
- saAttr.lpSecurityDescriptor = NULL;
-
- // Create a pipe for the child process's STDIN.
- if (!CreatePipe(&hChildStd_IN_Rd, &hChildStd_IN_Wr, &saAttr, 0))
- {
- TDEBUG_TRACE("LaunchCommand: unable to create stdin pipe");
- return false;
- }
-
- // Ensure the write handle to the pipe for STDIN is not inherited.
- if (!SetHandleInformation(hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0) )
- {
- TDEBUG_TRACE("LaunchCommand: unable to clear stdin write handle");
- return false;
- }
-
STARTUPINFOA startupInfo;
memset(&startupInfo, 0, sizeof(startupInfo));
- startupInfo.cb = sizeof(startupInfo);
- startupInfo.hStdInput = hChildStd_IN_Rd;
- startupInfo.dwFlags |= STARTF_USESTDHANDLES;
int res = CreateProcessA(NULL, // No module name, use command line
const_cast<char*>(command.c_str()),
@@ -142,17 +116,6 @@ return false;
}
- if( !filelist.empty() )
- {
- DWORD dwWritten;
- WriteFile(hChildStd_IN_Wr, filelist.c_str(), filelist.size(), &dwWritten, NULL);
- }
-
- if ( !CloseHandle(hChildStd_IN_Wr) )
- {
- TDEBUG_TRACE("LaunchCommand: Unable to close process stdin");
- }
-
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
return true;
|
@@ -31,7 +31,7 @@ bool IsDirectory(const std::string&);
std::string DirName(const std::string&);
std::string BaseName(const std::string&);
-bool LaunchCommand(const std::string& command, const std::string& cwd, const std::string& filelist);
+bool LaunchCommand(const std::string& command, const std::string& cwd);
HICON GetTortoiseIcon(const std::string & iconname);
std::string GetHgRepoRoot(const std::string& path);
bool IsHgRepo(const std::string& path);
|
Loading...