}\r
\r
unit lcorelocalips;\r
-\r
+{$ifdef fpc}\r
+ {$mode delphi}\r
+{$endif}\r
interface\r
\r
uses binipstuff,pgtypes;\r
\r
function getsystemdnsservers:tbiniplist;\r
\r
-{$ifdef win32}\r
+{$ifdef mswindows}\r
function gethostname:ansistring;\r
{$endif}\r
\r
{$else}\r
\r
uses\r
- sysutils,windows,winsock,dnssync,dnscore;\r
+ sysutils,windows,winsock,dnswin;\r
\r
{the following code's purpose is to determine what IP windows would come from, to reach an IP\r
it can be abused to find if there's any global v6 IPs on a local interface}\r
a:integer;\r
ip:tbinip;\r
usewindnstemp:boolean;\r
+ error:integer;\r
begin\r
- {this lookup must always be done with the windows API lookup\r
- setting usewindns to false on windows will fail with infinite recursion}\r
- usewindnstemp := usewindns;\r
- usewindns := true;\r
- result := forwardlookuplist('',0);\r
- usewindns := usewindnstemp;\r
+ result := winforwardlookuplist('',0,error);\r
\r
{$ifdef ipv6}\r
\r
\r
\r
\r
-{$ifdef win32}\r
+{$ifdef mswindows}\r
const\r
MAX_HOSTNAME_LEN = 132;\r
MAX_DOMAIN_NAME_LEN = 132;\r
\r
function getsystemdnsservers:tbiniplist;\r
var\r
- {$ifdef win32}\r
+ {$ifdef mswindows}\r
fixed_info : pfixed_info;\r
currentdnsserver : pip_addr_string;\r
{$else}\r
\r
result := biniplist_new;\r
\r
- {$ifdef win32}\r
+ {$ifdef mswindows}\r
fixed_info := callgetnetworkparams;\r
if fixed_info = nil then exit;\r
\r
{$endif}\r
end;\r
\r
-{$ifdef win32}\r
+{$ifdef mswindows}\r
function gethostname:ansistring;\r
var\r
fixed_info : pfixed_info;\r
end;\r
{$endif}\r
\r
-end.\r
+end.\r
\ No newline at end of file