aboutsummaryrefslogtreecommitdiffstats
path: root/capchild/capture_sync.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-08-19 23:39:21 +0200
committerAnders Broman <a.broman58@gmail.com>2017-08-23 07:26:18 +0000
commit45401950257ec58d01efefdbc53149739c7785e4 (patch)
tree72a2be65add4aa8d63d604b368fe24100570b061 /capchild/capture_sync.c
parent5574b78dae2f607d4ace66ab60d516d0c569357d (diff)
extcap: Create unique pipe names for each interface
On Windows the pipe names does not get random characters appended. Add the interface name and pipe type to make it unique. This partly fixes the issue with capturing from multiple extcap interfaces on Windows. Ping-Bug: 13653 Ping-Bug: 13833 Change-Id: I4290b37cf789bf77608993682a803aca29513d28 Reviewed-on: https://code.wireshark.org/review/23158 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'capchild/capture_sync.c')
-rw-r--r--capchild/capture_sync.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c
index 9f3d0ca0b9..33e730ed66 100644
--- a/capchild/capture_sync.c
+++ b/capchild/capture_sync.c
@@ -526,19 +526,12 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf
#else
si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE; /* this hides the console window */
-#if defined(_WIN32)
- /* needs first a check if NULL *
- * otherwise wouldn't work with non extcap interfaces */
- if(interface_opts.extcap_fifo != NULL)
- {
- if(strncmp(interface_opts.extcap_fifo,"\\\\.\\pipe\\",9)== 0)
- {
- si.hStdInput = extcap_get_win32_handle();
- }
- }
+#ifdef HAVE_EXTCAP
+ if(interface_opts.extcap_pipe_h != INVALID_HANDLE_VALUE)
+ si.hStdInput = interface_opts.extcap_pipe_h;
else
#endif
- si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+ si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
si.hStdError = sync_pipe_write;