Skip to content

Commit

Permalink
Revert "resolv ffi"
Browse files Browse the repository at this point in the history
This reverts commit 105a417.
  • Loading branch information
enebo committed May 23, 2018
1 parent daeb255 commit da36c92
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 135 deletions.
4 changes: 0 additions & 4 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -1759,10 +1759,6 @@ public void load(Ruby runtime, boolean wrap) throws IOException {
});

addLazyBuiltin("cgi/escape.jar", "cgi/escape", "org.jruby.ext.cgi.escape.CGIEscape");

if(Platform.IS_WINDOWS) {
addLazyBuiltin("win32/resolv.jar", "win32/resolv", "org.jruby.ext.win32.resolv.Win32Resolv");
}
}

private void initRubyKernel() {
Expand Down
66 changes: 0 additions & 66 deletions core/src/main/java/org/jruby/ext/win32/resolv/Win32Resolv.java

This file was deleted.

65 changes: 0 additions & 65 deletions core/src/main/java/org/jruby/util/WindowsFFI.java
Expand Up @@ -57,71 +57,6 @@ public static interface Kernel32 {
int TerminateProcess(jnr.ffi.Pointer hProcess, int uExitCode);
}

public static interface Iphlpapi {
public static final int MAX_HOSTNAME_LEN = 128;
public static final int MAX_DOMAIN_NAME_LEN = 128;
public static final int MAX_SCOPE_ID_LEN = 256;

// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366067(v=vs.85).aspx
public static final class IP_ADDRESS_STRING extends Struct {
public byte[] String = new byte[16];

public IP_ADDRESS_STRING(Runtime runtime) {
super(runtime);
}
}

// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366068(v=vs.85).aspx
public static class IP_ADDR_STRING extends Struct {
public IP_ADDR_STRING Next; // pointer?
public IP_ADDRESS_STRING IpAddress;
public IP_ADDRESS_STRING IpMask;
public int Context;

public IP_ADDR_STRING(Runtime runtime) {
super(runtime);
}
}

// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365900(v=vs.85).aspx
public static final class FIXED_INFO extends Struct {
public byte[] HostName = new byte[MAX_HOSTNAME_LEN + 4];
public byte[] DomainName = new byte[MAX_DOMAIN_NAME_LEN + 4];
public IP_ADDR_STRING CurrentDnsServer; // pointer?
public IP_ADDR_STRING DnsServerList;
public int NodeType;
public byte[] ScopeId = new byte[MAX_SCOPE_ID_LEN + 4];
public int EnableRouting;
public int EnableProxy;
public int EnableDns;

public FIXED_INFO(Runtime runtime) {
super(runtime);
}
}

// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365968(v=vs.85).aspx
int GetNetworkParams(FIXED_INFO pFixedInfo, IntByReference pOutBufLen);
}



// Iphlpapi
private static final class SingletonHolderIphlpapi {
static final Iphlpapi Iphlpapi = LibraryLoader.create(Iphlpapi.class)
.load("iphlpapi");
}

public static Iphlpapi getIphlpapi() {
return iphlpapi();
}

public static Iphlpapi iphlpapi() {
return SingletonHolderIphlpapi.Iphlpapi;
}


// Kernel32
private static final class SingletonHolder {
static final Kernel32 Kernel32 = LibraryLoader.create(Kernel32.class)
.convention(CallingConvention.STDCALL)
Expand Down

0 comments on commit da36c92

Please sign in to comment.