VC example:
PTCHAR szEntryName = TEXT("My VPN Connection");
RASENTRY rasEntry;
DWORD rasEntrySize;
rasEntrySize = sizeof(rasEntry);
memset(&rasEntry, 0, sizeof(rasEntry));
rasEntry.dwSize = sizeof(rasEntry);
rasEntry.dwfOptions = RASEO_RequireMsEncryptedPw | RASEO_RequireDataEncryption;
_tcscpy(rasEntry.szLocalPhoneNumber, TEXT("MyPPTPServerName"));
_tcscpy(rasEntry.szDeviceType, RASDT_Vpn);
_tcscpy(rasEntry.szDeviceName, TEXT("RAS VPN Line 0"));
dwResult = RasSetEntryProperties(NULL, szEntryName, &rasEntry, sizeof(rasEntry), NULL, 0);
if (dwResult != 0)
{
NKDbgPrintfW(L"RasSetEntryProperties %s failed error=%d/n", szEntryName, dwResult);
}