While we are doing our best to mind-read who post questions, we still are on the brainstorm phase...
So please be more specific!
If your problem is that when WlanConnet() returns the connection is not completed yet please read better
about WlanConnect()[
^], and you'll discover that the connection is not completed when it returns, but is on the way for completion. To be notified when connection is completed you have to register for a callback notification using
WlanRegisterNotification()[
^].
The ERROR_SUCCESS value means simply that the WlanConnect() made everything correctly and also correctly started the connection procedure. The outcome of the connection is available through WlanRegisterNotification().