X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/e27ef2c6aab3a2a8051314bd37bb3b2386775f36..71f094bad8c68b2a3d096b436dc74cf4d9e2895a:/dnswin.pas?ds=inline diff --git a/dnswin.pas b/dnswin.pas index 847f0fd..5e85f70 100644 --- a/dnswin.pas +++ b/dnswin.pas @@ -21,7 +21,6 @@ type tdnswinasync=class(tthread) private freverse : boolean; - error : integer; freewhendone : boolean; hadevent : boolean; protected @@ -40,9 +39,11 @@ type end; +procedure init; + implementation uses - { zipplet: moved pgtypes to interface because it's needed for the string definitions } + // zipplet: moved pgtypes to interface because it's needed for the string definitions lsocket,sysutils,winsock,windows,messages; type @@ -88,6 +89,7 @@ var hostent : phostent; addrlist:^pointer; begin + output := nil; if hints.ai_family <> af_inet6 then begin result := 0; @@ -108,15 +110,15 @@ begin getmem(output,sizeof(taddrinfo)); if assigned(prev) then prev.ai_next := output; - getmem(output.ai_addr,sizeof(tinetsockaddr)); + getmem(output.ai_addr,sizeof(tlinetsockaddr4)); if servname <> nil then output.ai_addr.InAddr.port := htons(strtoint(servname)) else output.ai_addr.InAddr.port := 0; output.ai_addr.InAddr.addr := longint(addrlist^^); - inc(integer(addrlist),4); + inc(taddrint(addrlist),4); output.ai_flags := 0; output.ai_family := af_inet; output.ai_socktype := 0; output.ai_protocol := 0; - output.ai_addrlen := sizeof(tinetsockaddr); + output.ai_addrlen := sizeof(tlinetsockaddr4); output.ai_canonname := nil; output.ai_next := nil; prev := output; @@ -264,6 +266,7 @@ begin if assigned (dwas.onrequestdone) then dwas.onrequestdone(dwas,awparam); dwas.hadevent := true; if dwas.freewhendone then dwas.free; + result := 0; {added returning 0 when handling --beware} end else begin //not passing unknown messages on to defwindowproc will cause window //creation to fail! --plugwash @@ -329,6 +332,7 @@ var hbrBackground : 0; lpszMenuName : nil; lpszClassName : 'dnswinClass'); +procedure init; begin if Windows.RegisterClass(MyWindowClass) = 0 then halt; @@ -345,4 +349,7 @@ begin nil); { CreateParam } //writeln('dnswin hwnd is ',hwnddnswin); //writeln('last error is ',GetLastError); +end; + + end.