diff --git a/src/context.c b/src/context.c index 959d43d0..46a89d97 100644 --- a/src/context.c +++ b/src/context.c @@ -4677,7 +4677,9 @@ _getdns_context_config_setting(getdns_context *context, CONTEXT_SETTING_STRING(trust_anchors_verify_CA) CONTEXT_SETTING_STRING(trust_anchors_verify_email) CONTEXT_SETTING_STRING(appdata_dir) +#ifndef USE_WINSOCK CONTEXT_SETTING_STRING(resolvconf) +#endif CONTEXT_SETTING_STRING(hosts) CONTEXT_SETTING_STRING(CApath) CONTEXT_SETTING_STRING(CAfile) @@ -5149,14 +5151,14 @@ getdns_context *_getdns_context_get_sys_ctxt( context->mf.mf.ext.free))) DEBUG_ANCHOR("Could not create system context: %s\n" , getdns_get_errorstr_by_id(r)); - +#ifndef USE_WINSOCK else if (*context->fchg_resolvconf.fn && (r = getdns_context_set_resolvconf( context->sys_ctxt, context->fchg_resolvconf.fn))) DEBUG_ANCHOR("Could initialize system context with resolvconf " "\"%s\": %s\n", context->fchg_resolvconf.fn , getdns_get_errorstr_by_id(r)); - +#endif else if (*context->fchg_hosts.fn && (r = getdns_context_set_hosts( context->sys_ctxt, context->fchg_hosts.fn))) diff --git a/src/tools/getdns_query.c b/src/tools/getdns_query.c index 4601f097..713783fc 100644 --- a/src/tools/getdns_query.c +++ b/src/tools/getdns_query.c @@ -91,7 +91,9 @@ static int async = 0, interactive = 0; static enum { GENERAL, ADDRESS, HOSTNAME, SERVICE } calltype = GENERAL; static int bogus_answers = 0; static int check_dnssec = 0; +#ifndef USE_WINSOCK static char *resolvconf = NULL; +#endif static int print_api_info = 0, print_trust_anchors = 0; static int get_rrtype(const char *t) @@ -256,8 +258,10 @@ print_usage(FILE *out, const char *progname) fprintf(out, "\t\t(should look like '" EXAMPLE_PIN "')\n"); fprintf(out, "\t-m\tSet TLS authentication mode to REQUIRED\n"); fprintf(out, "\t-n\tSet TLS authentication mode to NONE (default)\n"); +#ifndef USE_WINSOCK fprintf(out, "\t-o \tSet resolver configuration file path\n"); fprintf(out, "\t\t(default = %s)\n", GETDNS_FN_RESOLVCONF); +#endif fprintf(out, "\t-p\tPretty print response dict (default)\n"); fprintf(out, "\t-P \tPad TLS queries to a multiple of blocksize\n" "\t\t(special values: 0: no padding, 1: sensible default policy)\n"); @@ -824,6 +828,7 @@ getdns_return_t parse_args(int argc, char **argv) getdns_context_set_tls_authentication(context, GETDNS_AUTHENTICATION_REQUIRED); break; +#ifndef USE_WINSOCK case 'o': if (c[1] != 0 || ++i >= argc || !*argv[i]) { fprintf(stderr, "" @@ -832,6 +837,7 @@ getdns_return_t parse_args(int argc, char **argv) } resolvconf = argv[i]; break; +#endif case 'P': if (c[1] != 0 || ++i >= argc || !*argv[i]) { fprintf(stderr, "tls_query_padding_blocksize " @@ -1733,6 +1739,7 @@ main(int argc, char **argv) if ((r = parse_args(argc, argv)) && r != CONTINUE) goto done_destroy_context; +#ifndef USE_WINSOCK if (resolvconf) { if ((r = getdns_context_set_resolvconf(context, resolvconf))) { fprintf(stderr, "Problem initializing with resolvconf: %d\n", (int)r); @@ -1741,6 +1748,7 @@ main(int argc, char **argv) if ((r = parse_args(argc, argv))) goto done_destroy_context; } +#endif if (print_api_info) { getdns_dict *api_information = getdns_context_get_api_information(context);