summaryrefslogtreecommitdiff
path: root/extcap/randpktdump.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2016-02-22 16:28:15 +0100
committerRoland Knall <rknall@gmail.com>2016-02-26 10:02:59 +0000
commit298012359b52a9bf1ca22e0d1bedf23ec3e7680f (patch)
treea45d34417930edf1b3a9299bac31efdf7f71ef2b /extcap/randpktdump.c
parent3b9306e91b397755785b6b85be10594b2bfaf740 (diff)
downloadwireshark-298012359b52a9bf1ca22e0d1bedf23ec3e7680f.tar.gz
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/randpktdump.c')
-rw-r--r--extcap/randpktdump.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/extcap/randpktdump.c b/extcap/randpktdump.c
index c808fbaf74..7651b6635c 100644
--- a/extcap/randpktdump.c
+++ b/extcap/randpktdump.c
@@ -34,7 +34,6 @@
#define RANDPKTDUMP_VERSION_RELEASE 0
#define verbose_print(...) { if (verbose) printf(__VA_ARGS__); }
-#define errmsg_print(...) { fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); }
static gboolean verbose = TRUE;
@@ -63,48 +62,6 @@ static struct option longopts[] = {
{ 0, 0, 0, 0 }
};
-#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
static void help(const char* binname)
{