Share via


PPTP Code Sample (Windows Embedded CE 6.0)

1/6/2010

The following code example shows how to establish a PPTP connection.

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);
}

See Also

Tasks

PPTP Samples

Concepts

Establishing a PPTP Connection