public RASDIALEXTENSIONS Build(RasDialContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var rasDialExtensions = structFactory.Create <RASDIALEXTENSIONS>(); RasDialerOptions options; if ((options = context.Options) != null) { if (options.Owner != null) { rasDialExtensions.hwndParent = options.Owner.Handle; } rasDialExtensions.dwfOptions = BuildOptions(); } if (getEapUserData.TryUnsafeGetEapUserData(IntPtr.Zero, context.EntryName, context.PhoneBookPath, out var eapInfo)) { rasDialExtensions.RasEapInfo = eapInfo; } return(rasDialExtensions); }
private RASCREDENTIALS CreateStructure(RASCM mask) { var rasCredentials = structFactory.Create <RASCREDENTIALS>(); rasCredentials.dwMask = mask; return(rasCredentials); }
private RASCONNSTATUS GetConnectionStatusByHandle(IntPtr handle) { var rasConnStatus = structFactory.Create <RASCONNSTATUS>(); var ret = api.RasGetConnectStatus(handle, ref rasConnStatus); if (ret != SUCCESS) { throw exceptionPolicy.Create(ret); } return(rasConnStatus); }
private RAS_STATS GetConnectionStatisticsByHandle(IntPtr handle) { var statistics = structFactory.Create <RAS_STATS>(); var ret = api.RasGetConnectionStatistics(handle, ref statistics); if (ret != SUCCESS) { throw exceptionPolicy.Create(ret); } return(statistics); }
public RASDIALPARAMS Build(RasDialContext context) { var rasDialParams = structFactory.Create <RASDIALPARAMS>(); rasDialParams.szEntryName = context.EntryName; var ret = api.RasGetEntryDialParams(context.PhoneBookPath, ref rasDialParams, out _); if (ret != SUCCESS) { throw exceptionPolicy.Create(ret); } ConfigureOptions(context.Options, ref rasDialParams); ConfigureCredentials(context.Credentials, ref rasDialParams); return(rasDialParams); }
public RASDIALEXTENSIONS Build(RasDialContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var rasDialExtensions = structFactory.Create <RASDIALEXTENSIONS>(); RasDialerOptions options; if ((options = context.Options) != null) { if (options.Owner != IntPtr.Zero) { rasDialExtensions.hwndParent = options.Owner; } rasDialExtensions.dwfOptions = BuildOptions(options); } return(rasDialExtensions); }