tdnswinasync=class(tthread)\r
private\r
freverse : boolean;\r
- error : integer;\r
freewhendone : boolean;\r
hadevent : boolean;\r
protected\r
\r
end;\r
\r
+procedure init;\r
+\r
implementation\r
uses\r
- { zipplet: moved pgtypes to interface because it's needed for the string definitions }\r
+ // zipplet: moved pgtypes to interface because it's needed for the string definitions\r
lsocket,sysutils,winsock,windows,messages;\r
\r
type\r
hostent : phostent;\r
addrlist:^pointer;\r
begin\r
+ output := nil;\r
if hints.ai_family <> af_inet6 then begin\r
result := 0;\r
\r
\r
getmem(output,sizeof(taddrinfo));\r
if assigned(prev) then prev.ai_next := output;\r
- getmem(output.ai_addr,sizeof(tinetsockaddr));\r
+ getmem(output.ai_addr,sizeof(tlinetsockaddr4));\r
if servname <> nil then output.ai_addr.InAddr.port := htons(strtoint(servname)) else output.ai_addr.InAddr.port := 0;\r
output.ai_addr.InAddr.addr := longint(addrlist^^);\r
- inc(integer(addrlist),4);\r
+ inc(taddrint(addrlist),4);\r
output.ai_flags := 0;\r
output.ai_family := af_inet;\r
output.ai_socktype := 0;\r
output.ai_protocol := 0;\r
- output.ai_addrlen := sizeof(tinetsockaddr);\r
+ output.ai_addrlen := sizeof(tlinetsockaddr4);\r
output.ai_canonname := nil;\r
output.ai_next := nil;\r
prev := output;\r
if assigned (dwas.onrequestdone) then dwas.onrequestdone(dwas,awparam);\r
dwas.hadevent := true;\r
if dwas.freewhendone then dwas.free;\r
+ result := 0; {added returning 0 when handling --beware}\r
end else begin\r
//not passing unknown messages on to defwindowproc will cause window\r
//creation to fail! --plugwash\r
hbrBackground : 0;\r
lpszMenuName : nil;\r
lpszClassName : 'dnswinClass');\r
+procedure init;\r
begin\r
\r
if Windows.RegisterClass(MyWindowClass) = 0 then halt;\r
nil); { CreateParam }\r
//writeln('dnswin hwnd is ',hwnddnswin);\r
//writeln('last error is ',GetLastError);\r
+end;\r
+\r
+\r
end.\r