Comments (4)
Robert Austen contacted me with a solution to the problem.
The core issue that a binary compiled with x86 architecture won't be able to call WlanSetProfileEapXmlUserData on a x64 Windows 7/8. See: http://social.msdn.microsoft.com/Forums/en-US/130b1fef-213b-493b-9aab-0ee8978106b2/wlanapidll-wlansetprofileeapxmluserdata
Mail from Robert
Well after much work, I finally got this working. I haven't been able to convert this to C# yet but I got it working with C++. The key was the make the application x64 in order for it to work with Windows 7 64-bit. So don't forget to change the Active Platform to x64. At least I know this will work on Windows 7 64-bit now. So I was able to use the Native WIFI API in C# to create the profile and then this test C++ application to set the credentials. I verified that it works and I can connect. I probably won't spend too much time trying to get this to work in C#. I might end up just making this into 2 DLLs (x86 and x64) that my C# application will call.
Sample code provided by Robert: https://gist.github.com/robinwassen/6164456
from simplewifi.
The solution I would propose for SimpleWifi is probably something similar. Create a shim in c++ compiled to both a x86 and x64 assembly, then make the C# library select the appropriate assembly depending on the current OS architecture.
from simplewifi.
Some followup from Robert:
What is strange is that I created a x64 DLL which sets the XML. In fact I am not passing it any data and is basically my console application turned into a DLL. If my C# calls the DLL, I get the same 1206 error that I was getting before. I have my C# application x64 as well so it appears something funny is going on when a x64 C# console application tries to load a x64 DLL that makes this API call. Worst case scenario I will just make it a console application where you pass it parameters to use.
Looks like the issue is running the application in debug mode within Visual Studio. If I just run the application outside VS it gets a return code of 0.
So doing some more testing. I finally got the PInvoke in C# to work now. The key is that I can't debug in Windows as I have to run the code outside of the application and I have to set the platform to x64. Setting it to Any CPU causes it to fail. So now I don't have to create a C++ DLL.
from simplewifi.
Thanks for your answer. I shall pass from time to time to see if there has been some progress.
from simplewifi.
Related Issues (20)
- SimpleWifi fails to detect connection to unsecured WifiHotspot
- Not able to connect to a WLAN in case the SSID contains a '&' in its name HOT 2
- example in vb.net HOT 19
- Temporary profiles HOT 1
- hot spot with simplewifi? HOT 1
- Feature request: Add Scan() function to Wifi class HOT 4
- Getting Selected Access Point from windows forms listbox HOT 1
- This framework doens't manage IPs?
- Wifi Proteceted Setup(WPS)
- Not getting interfaces
- Multiple wifi interfaces HOT 1
- Still the problem with Windows Xp SP3 don't detect the real status of connection !!
- Windows 10 GetAccessPoints doesnt list wifi points after reboot HOT 1
- 在win10 中不支持中文wifi名 HOT 3
- Error When Radio turned off - Windows 10 HOT 2
- It can't support chinese wifi name HOT 2
- Auto reconnect HOT 1
- Is there any method to turn on/off the WiFi interface by using SimpleWiFi?
- Filter only 2.4 ghz networks
- ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplewifi.