<u>
uses
</u> RASUnit;
var
RE: TRasEntry;
DEV:
array
[
1..100
]
of
TRASDEVINFO;
i, j,cnt:
integer
;
begin
j := sizeof(DEV)*
100
;
DEV[
1
].dwSize := sizeof(TRASDEVINFO);
i := RasEnumDevicesA(@DEV[
1
], j, cnt);
Memo1
.
Lines
.
Add(
'j ='
+IntToStr(j)+
' i='
+IntToStr(i)+
' cnt='
+IntToStr(cnt));
if
i <>
0
then
Memo1
.
Lines
.
Add(
'Ошибка!'
);
For
i :=
1
to
cnt
do
Memo1
.
Lines
.
Add(DEV[i].szDeviceType+
' = '
+DEV[i].szDeviceName);
Fillchar(RE, sizeof(TRasEntry),
0
);
RE
.
dwSize := sizeof(TRasEntry);
RE
.
dwfOptions :=
1024262928
;
RE
.
dwCountryID :=
7
;
RE
.
dwCountryCode :=
7
;
RE
.
szAreaCode :=
''
;
RE
.
szLocalPhoneNumber :=
''
;
RE
.
dwfNetProtocols := RASNP_Ip;
RE
.
dwFramingProtocol := RASFP_Ppp;
RE
.
szDeviceType :=
'pppoe'
;
RE
.
szDeviceName :=
'WAN Miniport (L2PTP)'
;
i := RasSetEntryPropertiesA(
nil
,
'Dom ru service'
, @RE, sizeof(TRasEntry),
nil
,
0
);
if
i = ERROR_BUFFER_INVALID
then
Memo1
.
Lines
.
Add(
'The address or buffer specified by lpRasEntry is invalid'
);
if
i = ERROR_CANNOT_OPEN_PHONEBOOK
then
Memo1
.
Lines
.
Add(
'The phone book is corrupted or missing components'
);
Memo1
.
Lines
.
Add(
'Ошибка'
);