diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-05-18 18:40:13 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-05-19 01:40:46 +0000 |
commit | a273d9dd91f72f3e34ac969a17a68f3ca089459f (patch) | |
tree | fa2e5a1a01134de4cb589075be777a6736c3c15e /capchild/capture_sync.c | |
parent | 376ba916d479d4b7c55cec0064dfd57f52ca7052 (diff) |
Pass the executable path to CreateProcess(), and end it with ".exe".
On Windows, 1) pass the path of the executable as the first argument to
CreateProcess(), which requires that we 2) have that path end with
".exe.
Maybe it'll fix the searching-for-dumpcap that showed up in bug 11196.
Change-Id: I9d06c07c3513fd42b98d3f8d9a1d2d545f651fe2
Reviewed-on: https://code.wireshark.org/review/8534
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'capchild/capture_sync.c')
-rw-r--r-- | capchild/capture_sync.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index d2c2fc51aa..c0308dad56 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -329,7 +329,11 @@ init_pipe_args(int *argc) { *argv = NULL; /* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */ - exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap", progfile_dir); +#ifdef _WIN32 + exename = g_strdup_printf("%s\\dumpcap.exe", progfile_dir); +#else + exename = g_strdup_printf("%s/dumpcap", progfile_dir); +#endif /* Make that the first argument in the argument list (argv[0]). */ argv = sync_pipe_add_arg(argv, argc, exename); @@ -643,7 +647,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi } /* call dumpcap */ - if(!CreateProcess(NULL, utf_8to16(args->str), NULL, NULL, TRUE, + if(!CreateProcess(utf8_to_16(argv[0]), utf_8to16(args->str), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) { report_failure("Couldn't run %s in child process: %s", args->str, win32strerror(GetLastError())); @@ -857,7 +861,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd, } /* call dumpcap */ - if(!CreateProcess(NULL, utf_8to16(args->str), NULL, NULL, TRUE, + if(!CreateProcess(utf8_to_16(argv[0]), utf_8to16(args->str), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) { *msg = g_strdup_printf("Couldn't run %s in child process: %s", args->str, win32strerror(GetLastError())); |