其他分享
首页 > 其他分享> > WinCE 创建或者修改拨号连接,可以改APN接入点

WinCE 创建或者修改拨号连接,可以改APN接入点

作者:互联网

#include <ras.h>

#define DIAL_MODIFIER_LEN 256
#define MAX_CFG_BLOB 126
#define MAX_NAME_LENGTH 8
typedef struct tagDEVMINICFG
{
 WORD wVersion;
 WORD wWaitBong; // DevCfgHdr
 DWORD dwCallSetupFailTimer; // CommConfig.ModemSettings
 DWORD dwModemOptions; // CommConfig.ModemSettings
 DWORD dwBaudRate; // DCB
 WORD fwOptions; // DevCfgHdr
 BYTE ByteSize; // DCB
 BYTE StopBits; // DCB
 BYTE Parity; // DCB
 WCHAR szDialModifier[DIAL_MODIFIER_LEN+1]; // Unique to MiniCfg
 // Dynamic devices configuration
 WCHAR wszDriverName[MAX_NAME_LENGTH+1];
 BYTE pConfigBlob[MAX_CFG_BLOB];
 HANDLE hPort;
} DEVMINICFG, *PDEVMINICFG;

DWORD CreateRasEntry() 
{
 RASENTRY EntryInfo;
 memset(&EntryInfo, 0, sizeof(RASENTRY));
 EntryInfo.dwSize=sizeof(RASENTRY);
 DWORD dwSize = sizeof(DEVMINICFG);

 DEVMINICFG *lpCfg = new DEVMINICFG;
 if(RasGetEntryProperties(NULL, TEXT("3gnet"), &EntryInfo, &EntryInfo.dwSize, (BYTE *)lpCfg, &dwSize) == ERROR_SUCCESS)
 return RasSetEntryProperties(NULL, TEXT("liulixiang"), &EntryInfo, EntryInfo.dwSize, (BYTE *)lpCfg, dwSize);
}

 

标签:EntryInfo,接入点,dwSize,DEVMINICFG,DCB,APN,WinCE,DWORD,BYTE
来源: https://blog.51cto.com/u_15298588/3034541