0

When I try to invoke WlanOpenHandle method of wlanapi.dll, code throws EntryPointNotFoundException.

C#:

[DllImport("wlanapi.dll", SetLastError = true)]
public static extern uint WlanOpenHandle([In] UInt32 clientVersion, [In, Out] IntPtr pReserved, [Out] out UInt32 negotiatedVersion, [Out] out IntPtr clientHandle);

C#:

uint dwClientVersion = 1;
IntPtr pReserved = IntPtr.Zero;
uint pdwNegotiatedVersion;
IntPtr phClientHandle;

var result = WlanOpenHandle(dwClientVersion, pReserved, out pdwNegotiatedVersion, out phClientHandle);

The web site says that entry point exist. What is the missing part?

SLYN
  • 176
  • 1
  • 4
  • 16
  • MSDN is the real reference, what does it say? – David Heffernan Apr 22 '18 at 21:54
  • 1
    wlanapi.dll contains WlanOpenHandle function. ([MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/ms706759(v=vs.85).aspx)) but my pinvoke code does not work – SLYN Apr 22 '18 at 23:50
  • Seems a bit odd. What OS and what type of app? – David Heffernan Apr 23 '18 at 00:03
  • 1
    first part of code(dll import) used in **_standard class library_** and second part used in **_.net framework 4.7.1 console app_**. OS version is windows 10 @DavidHeffernan – SLYN Apr 23 '18 at 09:59

0 Answers0