1

Please help me to solve the following problem:

After win10 update Red Stone 4 the following code sequence stops working:

  1. RasPhoneBook pbk = GetUserPhoneBook();
    1. RasEntry entry = RasEntry.CreateVpnEntry(ConnectionName, server, this.VpnStrategy, RasDevice.GetDeviceByName(this.DeviceName, RasDeviceType.Vpn));
    2. pbk.Entries.Add(entry);

the error occurs at the third line 3. pbk.Entries.Add(entry);

The error message is: An incorrect structure size was detected.

and the StakTrace is

at DotRas.Internal.ThrowHelper.ThrowRasException(Int32 errorCode) at DotRas.Internal.RasHelper.SetEntryProperties(RasPhoneBook phoneBook, RasEntry value) at DotRas.RasEntryCollection.InsertItem(Int32 index, RasEntry item) at DotRas.Design.RasCollection`1.Add(TObject item)

Thank you

turdeanu
  • 45
  • 6

1 Answers1

2

There's been a change in the RAS API in RS4 that looks to be screwing up a significant number of VPN products (I was running into the issue with Insider Builds after about release 17025) https://support.f5.com/csp/article/K84747528

I don't know what the actual API changes were or what workarounds are available in the short term (MS knowledge base search is turning up nothing useful) but it does look that MS are finally acknowledging the issue and looking to resolve it in the upcoming RS4 Cumulative Updates.

  • Nice find, this bug has been generating multiple questions over the past few days. Clearly I had to correct the voting on this post, boo. – Hans Passant May 04 '18 at 12:29
  • Thank you very much for your help. – turdeanu May 04 '18 at 12:42
  • This is very interesting, most of their updates contain forward compatible features. This seems to be the first time that they didn’t follow their normal pattern. The “insert” call is where DotRas actually hits the Win32 API. – Jeff Winn Dec 09 '18 at 12:47
  • Just curious, has this been addressed yet by Microsoft? I’ve been rewriting the API (so I can actually maintain it more easily) over on GitHub and I’m about to start on the phone book APIs. – Jeff Winn Mar 14 '19 at 11:02