What an idiot.
"Michael M." <nospam@mike.com> wrote in message
news:%23x4kfFqMHHA.2140@TK2MSFTNGP03.phx.gbl...
> Ok I have converted the C++ sample and I have it working now, but I have a
> question
>
> I am new to VB.net have been only programming on and off for the last two
> months.
>
> using the interop marshal class I need to retrieve a string from a pointer
> the string is passed from the
>
> DnsGetCacheDataTable() so it is a C++ string, all I have is the start
> memory address of a string; how do I determine the length of the string so
> I don't hit the tried to read protected memory error?
>
> Right now I am just reading 128 bytes from the start address of the string
> pointer it seems to work about 95 out of 100 which is wierd.
>
> Eric <eric@ejproductions.com> posted me this which had a link to C++
> example which I converted.
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> Very interesting question... there's so little out there!
>
> All I've learned so far is that the DnsGetCacheDataTable() function is in
> dnsapi.dll, but you've probably already figured that one out. There
> appears
> to be good info in the article titled: "Explore the Windows DNS cache"
> here:
>
http://www.codepieces.net/ , but I guess I'm not literate enough to
> understand the example.
>
> I was thinking I could just figure out where the cache is stored and
> access
> it myself, but I've learned it's all in RAM, so no-go on that front.
>
> Anyway, good luck!
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>
> Ps if anyone is intrested I can post my VB.Net port of this function.
>
> Regards,
>
> Michael.
>
>
>
> "Michael M." <nospam@mike.com> wrote in message
> news:%23crnTOSMHHA.600@TK2MSFTNGP02.phx.gbl...
>> OK.
>>
>> So I opended the IPconfig.exe from C:\windows\system32\
>>
>> I see an External sysbol link to a function called DnsGetCacheDataTable()
>> Sounds like it could be the one!
>>
>> Does any one no where to get the C/C++ header for this or an already VB
>> converted one.
>>
>> Its not listed in the Win2k3 SDK
>>
>> regards
>>
>> Mike.
>>
>> "Michael M." <nospam@mike.com> wrote in message
>> news:%23GJxQJSMHHA.1280@TK2MSFTNGP04.phx.gbl...
>>> Hi all,
>>>
>>> I would like to know how to access the NT/2000/XP/2003 Name cache; what
>>> I mean by this is:
>>>
>>> Open a Command Prompt and..,
>>>
>>> C:\>
>>> C:\>IPCONFIG /DISPLAYDNS
>>>
>>> You will see a bunch of cached name records for pretty much all of the
>>> websites / domains that have been resovled since you booted the
>>> computer. I would realy like to know what API or function I could access
>>> this data with so it could speed up my DNS lookups but I have been
>>> unable to find the API function.
>>>
>>> Please help
>>>
>>> Regards,
>>>
>>> Michael.
>>>
>>>
>>>
>>
>>
>
>