Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

RasGetConnectStatus (coredll)
 

coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for RasGetConnectStatus in other DLLs exists, click on Find References to the right.

.
Summary
This function retrieves information on the current status of the specified remote access connection

C# Signature:

[DllImport("coredll.dll", SetLastError=true)]
public static extern int RasGetConnectStatus(IntPtr hrasconn, ref RASCONNSTATUS lprasconnstatus);

User-Defined Types:

    const int RASCS_PAUSED = 0x1000;
    const int RASCS_DONE = 0x2000;
    const int RAS_MaxDeviceType = 16;
    const int RAS_MaxDeviceName = 128;

    internal enum RASCONNSTATE
    {
        RASCS_OpenPort = 0,
        RASCS_PortOpened,
        RASCS_ConnectDevice,
        RASCS_DeviceConnected,
        RASCS_AllDevicesConnected,
        RASCS_Authenticate,
        RASCS_AuthNotify,
        RASCS_AuthRetry,
        RASCS_AuthCallback,
        RASCS_AuthChangePassword,
        RASCS_AuthProject,
        RASCS_AuthLinkSpeed,
        RASCS_AuthAck,
        RASCS_ReAuthenticate,
        RASCS_Authenticated,
        RASCS_PrepareForCallback,
        RASCS_WaitForModemReset,
        RASCS_WaitForCallback,
        RASCS_Projected,
        RASCS_Interactive = RASCS_PAUSED,
        RASCS_RetryAuthentication,
        RASCS_CallbackSetByCaller,
        RASCS_PasswordExpired,
        RASCS_Connected = RASCS_DONE,
        RASCS_Disconnected
      }

    internal struct RASCONNSTATUS
    {
        public UInt32 dwSize;
        public RASCONNSTATE rasconnstate;
        public UInt32 dwError;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = RAS_MaxDeviceType + 1)]
        public string szDeviceType;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = RAS_MaxDeviceName + 1)]
        public string szDeviceName;
    }

Notes:

function info on msdn at http://msdn.microsoft.com/en-us/library/ms897100.aspx

Sample Code:

    public static RASCONNSTATUS GetConnectStatus(IntPtr hrasconn)
    {
        RASCONNSTATUS status = new RASCONNSTATUS();
        status.dwSize = (UInt32)Marshal.SizeOf(status);
        RasGetConnectStatus(hrasconn, ref status);
        return status;
    }

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions