diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-02-22 16:28:15 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2016-02-26 10:02:59 +0000 |
commit | 298012359b52a9bf1ca22e0d1bedf23ec3e7680f (patch) | |
tree | a45d34417930edf1b3a9299bac31efdf7f71ef2b /extcap/sshdump.c | |
parent | 3b9306e91b397755785b6b85be10594b2bfaf740 (diff) |
extcap: move windows functions into extcap-base
Change-Id: Iec7fed027a24992afd673b09c32470af51739ae5
Reviewed-on: https://code.wireshark.org/review/14075
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap/sshdump.c')
-rw-r--r-- | extcap/sshdump.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/extcap/sshdump.c b/extcap/sshdump.c index c57de0bdd2..da7df908dd 100644 --- a/extcap/sshdump.c +++ b/extcap/sshdump.c @@ -68,7 +68,6 @@ #define DEFAULT_CAPTURE_BIN "dumpcap" #define verbose_print(...) { if (verbose) printf(__VA_ARGS__); } -#define errmsg_print(...) { fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); } static gboolean verbose = FALSE; @@ -544,49 +543,6 @@ static char* concat_filters(const char* extcap_filter, const char* remote_filter return g_strdup_printf("(%s) and (%s)", extcap_filter, remote_filter); } -#ifdef _WIN32 -BOOLEAN IsHandleRedirected(DWORD handle) -{ - HANDLE h = GetStdHandle(handle); - if (h) { - BY_HANDLE_FILE_INFORMATION fi; - if (GetFileInformationByHandle(h, &fi)) { - return TRUE; - } - } - return FALSE; -} - -static void attach_parent_console() -{ - BOOL outRedirected, errRedirected; - - outRedirected = IsHandleRedirected(STD_OUTPUT_HANDLE); - errRedirected = IsHandleRedirected(STD_ERROR_HANDLE); - - if (outRedirected && errRedirected) { - /* Both standard output and error handles are redirected. - * There is no point in attaching to parent process console. - */ - return; - } - - if (AttachConsole(ATTACH_PARENT_PROCESS) == 0) { - /* Console attach failed. */ - return; - } - - /* Console attach succeeded */ - if (outRedirected == FALSE) { - freopen("CONOUT$", "w", stdout); - } - - if (errRedirected == FALSE) { - freopen("CONOUT$", "w", stderr); - } -} -#endif - int main(int argc, char **argv) { int result; |