Compartilhar via


PPTP Code Sample (Windows CE 5.0)

Send Feedback

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

Establishing a PPTP Connection

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.