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

MultinetGetConnectionPerformance (mpr)
 
.
Summary
The MultinetGetConnectionPerformance function returns information about the expected performance of a connection used to access a network resource.

C# Signature:

    [DllImport("mpr.dll", CharSet = CharSet.Unicode)]
    [return: MarshalAs(UnmanagedType.U4)]
    static extern int MultinetGetConnectionPerformance(
        NetResource lpNetResource,
        ref NetConnectInfoStruct lpNetConnectInfoStruct);

User-Defined Types:

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
    public struct NetConnectInfoStruct {
        public int cbStructure;
        public WNCON dwFlags;
        public int dwSpeed;
        public int dwDelay;
        public int dwOptDataSize;
    }

    [Flags]
    public enum WNCON {
        /// <summary>
        /// In the absence of information about the actual connection,
        /// the information returned applies to the performance of the
        /// network card.
        /// If this flag is not set, information is being returned for
        /// the current connection with the resource, with any routing
        /// degradation taken into consideration.
        /// </summary>
        FORNETCARD = 0x00000001,

        /// <summary>
        /// The connection is not being routed.
        /// If this flag is not set, the connection may be going through
        /// routers that limit performance. Consequently, if
        /// WNCON_FORNETCARD is set, actual performance may be much less
        /// than the information returned.
        /// </summary>
        NOTROUTED = 0x00000002,

        /// <summary>
        /// The connection is over a medium that is typically slow (for
        /// example, over a modem using a normal quality phone line).
        /// You should not set the WNCON_SLOWLINK bit if the dwSpeed
        /// member is set to a nonzero value.
        /// </summary>
        SLOWLINK = 0x00000004,

        /// <summary>
        /// Some of the information returned is calculated dynamically,
        /// so reissuing this request may return different (and more
        /// current) information.
        /// </summary>
        DYNAMIC = 0x00000008,
    }

    const int WNCON_FORNETCARD = 0x00000001;
    const int WNCON_NOTROUTED = 0x00000002;
    const int WNCON_SLOWLINK = 0x00000004;
    const int WNCON_DYNAMIC = 0x00000008;

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Don't forget to initialize cbStructure member.

        NetConnectInfoStruct ci = new NetConnectInfoStruct();
        ci.cbStructure = Marshal.SizeOf(ci);

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

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