MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / executeShell

Function executeShell

src/jrd/replication/Utils.cpp:234–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232 }
233
234 int executeShell(const string& command)
235 {
236#ifdef WIN_NT
237 string params;
238 params.printf("/c %s", command.c_str());
239 SHELLEXECUTEINFO seInfo = {0};
240 seInfo.cbSize = sizeof(SHELLEXECUTEINFO);
241 seInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
242 seInfo.hwnd = NULL;
243 seInfo.lpVerb = NULL;
244 seInfo.lpFile = "cmd.exe";
245 seInfo.lpParameters = params.c_str();
246 seInfo.lpDirectory = NULL;
247 seInfo.nShow = SW_HIDE;
248 seInfo.hInstApp = NULL;
249 ShellExecuteEx(&seInfo);
250 WaitForSingleObject(seInfo.hProcess, INFINITE);
251 DWORD exitCode = 0;
252 GetExitCodeProcess(seInfo.hProcess, &exitCode);
253 return (int) exitCode;
254#else
255 return system(command.c_str());
256#endif
257 }
258
259 void logPrimaryError(const PathName& database, const string& message)
260 {

Callers 1

archiveExecuteMethod · 0.85

Calls 2

printfMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected