.386
.MODEL FLAT,STDCALL


UNICODE=0

include w32.inc


extrn lstrcat : proc
extrn lstrcpy :Proc
extrn lstrcatA :Proc
extrn lstrcmpi :Proc
extrn GetPrivateProfileStringA :Proc
extrn RasEnumConnectionsA :Proc
extrn RasGetConnectStatusA :Proc
extrn RasHangUpA :Proc



.DATA

;[--------==========================================================--------];


title1 db 'Dial Up Test by Max', 0



ActiveRAS_Connections dd 0h
H0_ActiveRAS db "Active Modem RAS Connection",0
E0_ActiveRAS db "No Active Modem connection",0
Bu_ActiveRAS db "Active RAS",0

rasstatus_dwSize dd 0A0h
rasstatus_rasconnstate dd 0h

TimerBuffer db 10000h dup(?);buffer
hrascon dd 0h
TimerBufferSize dd 10000h


.CODE

;[--------==========================================================--------];

main:

call GetDevices

call ExitProcess ; Exit the main process
;[--------==========================================================--------];





GetDevices proc
;------------------------------------------------------------------------------
call RasGetConnectStatusA,hrascon, OFFSET rasstatus_dwSize
cmp eax,0h
jne Timer_RasEnumConnections
cmp rasstatus_rasconnstate,2001h
jne Timer_RasEnumConnections
;--if bussy
push hrascon
call RasHangUpA
mov hrascon,0h

Timer_RasEnumConnections:
mov TimerBufferSize,10000h
mov eax,OFFSET TimerBuffer
mov ebx,19Ch
mov ,ebx
push OFFSET ActiveRAS_Connections
push OFFSET TimerBufferSize
push eax
call RasEnumConnectionsA
cmp ActiveRAS_Connections,0h
je Offline
cmp ActiveRAS_Connections,1h
jae Online
ret

Offline:
call MessageBox, 0, offset E0_ActiveRAS, offset title1, 0
ret

Online:
call MessageBox, 0, offset H0_ActiveRAS, offset title1, 0
ret
GetDevices endp


ends
end main
Posted on 2001-12-18 07:14:24 by Max