RAS_MaxDeviceType = 16;//设备类型名称长度
{ RAS_MaxParamKey = 32;
RAS_MaxParamValue = 128;}
RAS_MaxPhoneNumber = 128;//电话号码的最大长度
RAS_MaxCallbackNumber = RAS_MaxPhoneNumber;
Type
{UINT = Word;}
PHRASConn = ^HRASConn;
Type
{ 确认一活动的拨号连接. (为RasConnectEnum函数使用) }
PRASConn = ^TRASConn;//拨号连接的句柄类型
TRASConn = record
dwSize: DWORD;//该结构类型所占内存的字节大小
rasConn: HRASConn;//活动连接的句柄
szEntryName: Array[0..RAS_MaxEntryName] Of Char;//
szDeviceType : Array[0..RAS_MaxDeviceType] Of Char;
szDeviceName : Array [0..RAS_MaxDeviceName] of char;
end;
PRASConnStatus = ^TRASConnStatus;
TRASConnStatus = Record
dwSize: LongInt;
rasConnstate: Word;
dwError: LongInt;
szDeviceType: Array[0..RAS_MaxDeviceType] Of Char;
szDeviceName: Array[0..RAS_MaxDeviceName] Of Char;
End;
PRASDIALEXTENSIONS= ^TRASDIALEXTENSIONS;
TRASDIALEXTENSIONS= Record
dwSize: DWORD;
dwfOptions: DWORD;
hwndParent: HWnd;
reserved: DWORD;
end;
PRASDialParams = ^TRASDialParams;
TRASDialParams = Record
dwSize: DWORD;
szEntryName: Array[0..RAS_MaxEntryName] Of Char;
szPhoneNumber: Array[0..RAS_MaxPhoneNumber] Of Char;
szCallbackNumber: Array[0..RAS_MaxCallbackNumber] Of Char;
szUserName: Array[0..UNLEN] Of Char;
szPassword: Array[0..PWLEN] Of Char;
szDomain: Array[0..DNLEN] Of Char;
end;
PRASEntryName = ^TRASEntryName;
TRASEntryName = Record
dwSize: LongInt;
szEntryName: Array[0..RAS_MaxEntryName] Of Char;
{ Reserved: Byte;}
End;
//拨号函数
Function RasDial(
lpRasDialExtensions : PRASDIALEXTENSIONS ; //在WIN9X下无用,可设置为NIL
lpszPhonebook: PChar; //在WIN9X下无用,可设置为NIL
lpRasDialParams : PRASDIALPARAMS; // 拨号参数,类型指针
dwNotifierType : DWORD; { 消息通知方式}
lpvNotifier: DWORD; { 消息处理事件}
var rasConn: HRASConn { 返回成功连接的连接句柄}
): DWORD; stdcall;
function RasEnumConnections(RASConn: PrasConn;
var BufSize: DWord;
var Connections: DWord
): LongInt; stdcall;
Function RasEnumEntries (
reserved: PChar; {保留字段,必须为空}
lpszPhonebook: PChar ; { 电话本名称,在WIN9X下无用,可设置为NIL}
lprasentryname: PRASENTRYNAME ; {接收拨号连接名称的缓冲区,是一类型数组的指针}
var lpcb : DWORD; {接收拨号连接名称的缓冲区的大小}
var lpcEntries : DWORD {实际获得拨号连接 的数目}
) : DWORD; stdcall;
function RasGetConnectStatus(RASConn: hrasConn; { 指定活动连接的句柄 }
RASConnStatus: PRASConnStatus { 获取活动连接状态信息的缓冲区}
): LongInt; stdcall;
function RasGetErrorString(ErrorCode: DWord; { 错误代码