Пример #1
0
 public static extern int RasDial(
     [In][Optional] IntPtr extensions,
     [In][Optional][MarshalAs(UnmanagedType.LPStr)] string phonebook,
     [In] ref RasDialParams dialParams,
     [In] int notifierType,
     [In][Optional] RasDialFunc callback,
     [Out] out IntPtr connection);
Пример #2
0
        public static IntPtr RasDial(RasDialParams dialParams, string phonebook = null, RasDialFunc callback = null)
        {
            int result = RasDial(IntPtr.Zero, phonebook, ref dialParams, 0, callback, out IntPtr connection);

            if (result == RasErrorCodes.ERROR_SUCCESS)
            {
                return(connection);
            }
            throw new RasApi32Exception(result);
        }