I am trying to access the Wireless interface of the Windows API. It seems that there is no support for these functions in Free Pascal so I defined them myself and accessed them via "Loadlibrary". But WlanOpenHandle always results in error 87 (invalid parameter). I defined:
-----------------------------------------------------------------------
type WlanOpenHandleTyp = function(ClientVersion : DWord;
Reserved : Pointer;
var NegotiatedVersion : DWord;
var ClientHandle : Hwnd) : DWord;
-----------------------------------------------------------------------but also tried a different definitions of the first two parameters with CONST.
I then coded:
-----------------------------------------------------------------------
Var LibHandle : THandle;
H : Hwnd;
WlanOpenHandle : WlanOpenHandleTyp;
begin
LibHandle := Windows.LoadLibrary('wlanapi.dll');
if LibHandle0 then
begin
WlanOpenHandle := WlanOpenHandleTyp(GetProcAddress(LibHandle,'WlanOpenHandle'));
if WlanOpenHandlenil then
begin
j := WlanOpenHandle(1,nil,i,H);
if j=Error_Success then ....
-----------------------------------------------------------------------at this point j is 87 (should be 0). Anybody who has an idea why WlanOpenHandle is reporting this error?
