| 431 | } |
| 432 | |
| 433 | static std::string readAllFromPipe(HANDLE hPipe) |
| 434 | { |
| 435 | const int BUFFER_SIZE = 1024; |
| 436 | std::string csoutput; |
| 437 | while (true) |
| 438 | { |
| 439 | char buf[BUFFER_SIZE + 1]; |
| 440 | DWORD readword; |
| 441 | if (!::ReadFile(hPipe, buf, BUFFER_SIZE, &readword, 0)) |
| 442 | { |
| 443 | break; |
| 444 | } |
| 445 | if (readword == 0) |
| 446 | { |
| 447 | break; |
| 448 | } |
| 449 | buf[readword] = '\0'; |
| 450 | std::string cstemp = buf; |
| 451 | csoutput += cstemp; |
| 452 | } |
| 453 | return csoutput; |
| 454 | } |
| 455 | |
| 456 | QString WinUtils::executeBlockingCmd(QString cmd, const QString & /*params*/, int timeoutMs) |
| 457 | { |
no outgoing calls
no test coverage detected