PINTERNET_DIAGNOSTIC_SOCKET_INFO = ^TINTERNET_DIAGNOSTIC_SOCKET_INFO Īnd then you can wrote a function to return the socket infoįunction GetSocketInfo(hInet: HINTERNET) : TINTERNET_DIAGNOSTIC_SOCKET_INFO } INTERNET_DIAGNOSTIC_SOCKET_INFO, * LPINTERNET_DIAGNOSTIC_SOCKET_INFO
You are correct about use the InternetQueryOption function with the INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO flag, this will return a INTERNET_DIAGNOSTIC_SOCKET_INFO Structure
#DELPHI XE 1023 DOWNLOAD WINDOWS#
Windows - dynamic arrays and wininet in delphi? - Stack Overflow windows delphi arrays wininet If any problem was fixed by using one instead of the other, then the problem lay deeper than either one of them. Move and CopyMemory should behave identically in every way since the latter is implemented with the former. I saw that, it was very clear on the comments Mason wrote. read of address yyyyyĭid you call SetLength first? If you called SetLength, and you're not using and you're not exceeding the size of text, then that shouldn't Please notice that the lack of the is not the only difference between CopyMemory and move - the two first arguments comes in different order, (Destionation, Source) versus (Source, Destination)! The "move" fails with an exception: access violation of address xxxxx. If your buffer is overrun, you should assume that your program is under attack and react accordingly. You should either be able to find this in the documentation, or call another API first that will give you the size of the incoming data.Īlso put some check on there so that if it returns something larger than your buffer, it immediately raises an exception.
You need to have some way to know what the upper bound is on the size that it will return, and make your buffer at least that large. As for problem #1, that's between you and the server. (Yes, without the symbols.) That should solve problem #2. Instead of CopyMemory, try using the Move routine, like so: