Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for WPA2 Enterprise. #2

Open
robinwassen opened this issue May 14, 2013 · 4 comments
Open

Add support for WPA2 Enterprise. #2

robinwassen opened this issue May 14, 2013 · 4 comments

Comments

@robinwassen
Copy link
Contributor

The library does not currently support WPA2 Enterprise.

@ghost ghost assigned robinwassen May 14, 2013
@robinwassen
Copy link
Contributor Author

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

@robinwassen
Copy link
Contributor Author

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.

@robinwassen
Copy link
Contributor Author

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.

@Mk2209
Copy link

Mk2209 commented Oct 21, 2013

Thanks for your answer. I shall pass from time to time to see if there has been some progress.

@robinwassen robinwassen changed the title Need support for WPA2 Enterprise. Add support for WPA2 Enterprise. Jul 9, 2015
@robinwassen robinwassen removed their assignment Oct 24, 2017
TheObliterator pushed a commit to TheObliterator/simplewifi that referenced this issue May 18, 2019
AccessPoint.IsConnected: report IsConnected if current network has sa…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants