5#define NTDDI_VERSION 0x06000000
10w32error_make_error(
DWORD e)
17w32error_raise(
DWORD e)
23get_dns_server_list(
VALUE self)
25 FIXED_INFO *fixedinfo =
NULL;
30 ret = GetNetworkParams(
NULL, &buflen);
31 if (ret != NO_ERROR && ret != ERROR_BUFFER_OVERFLOW) {
35 ret = GetNetworkParams(fixedinfo, &buflen);
36 if (ret == NO_ERROR) {
37 const IP_ADDR_STRING *ipaddr = &fixedinfo->DnsServerList;
40 const char *s = ipaddr->IpAddress.String;
42 if (
strcmp(s,
"0.0.0.0") == 0)
continue;
44 }
while ((ipaddr = ipaddr->Next) !=
NULL);
47 if (ret != NO_ERROR) w32error_raise(ret);
VALUE rb_singleton_class(VALUE)
Returns the singleton class of obj.
VALUE rb_define_module(const char *)
VALUE rb_define_module_under(VALUE, const char *)
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
unsigned char buf[MIME_BUF_SIZE]