Esempio n. 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);
Esempio n. 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);
        }
Esempio n. 3
0
        public static RasDialParams RasGetEntryDialParams(string entryName, string phonebook = null)
        {
            var dialparams = new RasDialParams
            {
                Size      = Marshal.SizeOf <RasDialParams>(),
                EntryName = entryName
            };

            int result = RasGetEntryDialParams(phonebook, ref dialparams, out _);

            if (result == RasErrorCodes.ERROR_SUCCESS)
            {
                return(dialparams);
            }
            throw new RasApi32Exception(result);
        }
Esempio n. 4
0
 public static extern int RasGetEntryDialParams(
     [In][Optional][MarshalAs(UnmanagedType.LPStr)] string phonebook,
     [In][Out] ref RasDialParams dialParams,
     [Out] out bool passwordRetrieved);