locked
RemoteAccess services API question RRS feed

  • Question

  • Greetings,

    I am developing a wrapper class around RAS API to connect to a VPN network. I developed using VS 2008 on Windows 7. I have a function that uses the API called  RasEnumConnections(lpRasConn, &dwCb, &dwConnections) to enumerate all the active VPN connection. Next having done this we determin the connection status using  RasGetConnectStatus.

    The objective is to list all the RAS connection and determine their connection status. This works on Windows 7 and is able to tell me all my RAS connections and their connection status

    The problem is when you compile, link and generate your executable, and run that executable in Windows XP, or Vista, I am getting weird errors. Specifically, RasGetConnectStatus() returns error code 632 which when converted to a string says to the effect that there is an incorrect structure size.

    What is this behavior?Also on Windows Vista, the same executable when run, does not detect or return the RAS connections even after you establish a VPN connection on Vista. The code works well on Windows 7. Please can anyone help give me some direction. I am using C++ and VS 2008

    Can anyone help me figure out what I am doing wrong? How can I get the function to return the right results? Any ideas or pointers might be helpful.

    mANY thanks in advance. any advice will be helpful

     

    Tuesday, April 13, 2010 12:56 PM

All replies

  • RasEnumConnections() has some MAJOR faults that MSFT needs to look into. The sample code works for Windows 7, but when the exact same code is compiled, linked and run from Windows XP and Windows Vista, it fails to properly detect and enumerate a VPN connection.

    We need help and I will try contacting the RAS folks to see if this can be resolved. Otherwise we will just have to drop the enumeration feature from the project. If anyone has any fixes or ideas on the internals of their implementation/source and a work around please share.

     

    Best of success!

     

     

    Tuesday, April 13, 2010 9:17 PM