'**********************************
'* User Defined Type Declarations *
'**********************************
'As a note VB subscripts are already +1 over C
Public Type RASDIALEXTENSIONS
'set dwsize to 16
dwSize As Long
dwfOptions As Long
hwndParent As Long
reserved As Long
End Type

Public Type RASDIALPARAMS
'set dwsize to 736 unless winver >= 400 then set to 1052
dwSize As Long
szEntryName(RAS_MaxEntryName) As Byte
szPhoneNumber(RAS_MaxPhoneNumber) As Byte
szCallbackNumber(RAS_MaxCallbackNumber) As Byte
szUserName(UNLEN) As Byte
szPassword(PWLEN) As Byte
szDomain(DNLEN) As Byte
End Type

Public Type RASDIALPARAMS95
'set dwsize to 1052
dwSize As Long
szEntryName(RAS95_MaxEntryName) As Byte
szPhoneNumber(RAS_MaxPhoneNumber) As Byte
szCallbackNumber(RAS95_MaxCallbackNumber) As Byte
szUserName(UNLEN) As Byte
szPassword(PWLEN) As Byte
szDomain(DNLEN) As Byte
End Type

Public Type RASCONN
'set dwsize to 32
dwSize As Long
hRasConn As Long
szEntryName(RAS_MaxEntryName) As Byte
End Type

Public Type RASCONN95
'set dwsize to 412
dwSize As Long
hRasConn As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type

Public Type RASENTRYNAME
'set dwsize to 28 unless winver >= 400 then set to 264
dwSize As Long
szEntryName(RAS_MaxEntryName) As Byte
End Type

Public Type RASENTRYNAME95
'set dwsize to 264
dwSize As Long
szEntryName(RAS95_MaxEntryName) As Byte
End Type

Public Type RASCONNSTATUS
'set dwsize to 64 unless winver >= 400 then set to 288
dwSize As Long
rasconnstate As Long 'RASCONNSTATE Enumeration
dwError As Long
szDeviceType(RAS_MaxDeviceType) As Byte
szDeviceName(RAS_MaxDeviceName) As Byte
End Type

Public Type RASCONNSTATUS95
'set dwsize to 160
dwSize As Long
rasconnstate As Long 'RASCONNSTATE Enumeration
dwError As Long
szDeviceType(RAS_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type

Public Type RASAMB
'set dwsize to 28
dwSize As Long
dwError As Long
szNetBiosError(NETBIOS_NAME_LEN) As Byte
bLana As Byte
End Type

Public Type RASPPPNBF
'set dwsize to 48
dwSize As Long
dwError As Long
dwNetBiosError As Long
szNetBiosError(NETBIOS_NAME_LEN) As Byte
szWorkstationName(NETBIOS_NAME_LEN) As Byte
bLana As Byte
End Type

Public Type RASPPPIPX
'set dwsize to 32
dwSize As Long
dwError As Long
szIpxAddress(RAS_MaxIpxAddress) As Byte
End Type

Public Type RASPPPIP
'set dwsize to 40
dwSize As Long
dwError As Long
szIpAddress(RAS_MaxIpAddress) As Byte
szServerAddress(RAS_MaxIpAddress) As Byte
End Type

'**********************************
'* WIN32 Type Declarations *
'**********************************
'We have to determine the OS version
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type

'**********************************
'* Public Variable Declarations *
'**********************************
'I hate to do it, but this is the OS version variable. No client can touch it here and it saves a lot of code.
Public lngWindowVersion As Long
'I have to protect it, yet see it everywhere. Array for PhoneEntry Objects
Public arrPEntry() As PhoneEntry
Public arrConnection() As Connection
'Same goes for these
'set up variables for other objects
'They are not that big so we will keep them initialized
Public lpConnections As Connections
Public lpRASError As RASError
Public lpPhoneEntries As PhoneEntries
'Error object
'ErrorNumber property
Public lngRASErrorNumber As Long
'Description property
Public strRASDescription As String

'Flag so that I can stop client from updating
Public boolAllowUpdate As Boolean

Public Sub Main()

End Sub

Public Function fcnTrimNulls(ByVal strFullofNulls As String) As String

'This function just gets rid of the Nulls that StrConv leaves on 95
'passing like this is odd, but it works in the fewest lines
'I had to add this to handle 95 after the fact
If (InStr(strFullofNulls, Chr$(0))) Then fcnTrimNulls = Left$(strFullofNulls, InStr(strFullofNulls, Chr$(0)) - 1)