mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
parent
da8d868a9e
commit
c82915cb71
1 changed files with 14 additions and 2 deletions
|
|
@ -311,8 +311,20 @@ static int run_command_redirected(char *cmdexec, struct subprocess_info *info)
|
|||
memset(&pi, 0, sizeof(pi));
|
||||
|
||||
if (CreateProcess(NULL, cmdexec, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi) == 0) {
|
||||
if (o.verbose)
|
||||
logdebug("Error in CreateProcess: %d\n", GetLastError());
|
||||
if (o.verbose) {
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&lpMsgBuf,
|
||||
0, NULL);
|
||||
|
||||
logdebug("Error in CreateProcess: %s\nCommand was: %s\n", (lpMsgBuf), cmdexec);
|
||||
}
|
||||
CloseHandle(info->child_in_r);
|
||||
CloseHandle(info->child_in_w);
|
||||
CloseHandle(info->child_out_r);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue