Forum > Windows
[SOLVED] WINAPI DhcpRequestParams works in 32-bit, but returns error 87in 64bit
tboege:
DHCPCAPI_PARAMS_ARRAY is defined in JwaDhcpCSdk - a part of Jedi. I was not aware, that Jedi units generally not are 64-bit proof.
If that is the problem, it is strange, that sdeligo had no problems in 64bit.
tboege:
I have now had a brief look at the definitions in JwaDhcpCSdk and tried to compare to https://learn.microsoft.com/en-us/windows/win32/api/dhcpcsdk/nf-dhcpcsdk-dhcprequestparams and the links to DHCPCAPI_PARAMS_ARRAY and to DHCPCAPI_PARAMS .
I cannot figure out, if there are any important differences - I'm afraid I dont have the skills.
tboege:
I have now tried to install a fresh Virtual Machine, and installed Lazarus.
Windows 10, Lazarus 2.2.4 (FPC 3.2.2 with the crosscompile component, so I could change bewteeen Win64/x86_64, Win32/i386 and (Default)/(Default)
Unfortunatley, I was NOT able to reproduce deselico's success on Win64 - it only succedes in Win32.
--- Quote from: dseligo on October 18, 2022, 11:33:39 am ---I tried your code and I get this for Win64/x86_64, Win32/i386 and (Default)/(Default):
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---=========================DhcpCApiInitialize: 0DhcpRequestParams: 0lanlan
Windows 11, Lazarus 2.2.4 (rev lazarus_2_2_4) FPC 3.2.2 x86_64-win64-win32/win64
Maybe you should initialize buffer after GetMem:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---FillChar(buffer^, size, 0);
--- End quote ---
tboege:
Thank you for your effort.
The solution was to replace jwaWindows with jwadhcpcsdk as suggested by Aserge in https://forum.lazarus.freepascal.org/index.php?topic=60922.msg457312#msg457312
Navigation
[0] Message Index
[*] Previous page