Hi,
I have trouble with DnsQuery API, the *ppQueryResultsSet parameter troubles me. Can anyone show me an example of how to make correct DLL calls in python?
import ctypes
from ctypes import wintypes
from windns_types import DNS_RECORD, IP4_ARRAY #declared here http://pastebin.com/f39d8b997
def DnsQuery(host, type, server, opt=0):
server_arr = IP4_ARRAY()
rr = DNS_RECORD()
server_arr.AddrCount=1
server_arr.AddrArray[0] = ctypes.windll.Ws2_32.inet_addr(server)
ctypes.windll.dnsapi.DnsQuery_A(host, type, opt, server_arr, rr, 0)
# WindowsError: exception: access violation reading 0x00000001
return rr
print DnsQuery("www.google.com", 1, "208.67.222.222")