' ########################################################################################
' Microsoft Windows
' File: Ras.inc
' Contents: Remote Access external API
' Copyright (c) 2010 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_Ras_PBI)
#DEFINE PBX_Ras_PBI
%EQUATE `RAS_INC = 1
' NOTE: The members of the structures are not dword aligned, but the whole
' structure has to fit into a 4-byte bounded memory space, thus the extra
' bytes fillers at the end of the structure.
' This is not the same as using the DWORD specifier in the type declaration
' (that would dword align each member of the structure).
'/*++
'Copyright (c) Microsoft Corporation. All rights reserved.
'Module Name:
' ras.h
'Abstract:
' Remote Access external API
' WINVER values in this file:
' WINVER < 0x400 = Windows NT 3.5, Windows NT 3.51
' WINVER = 0x400 = Windows 95, Windows98, Windows NT4 (default)
' WINVER > 0x400 = Windows NT4 enhancements
' WINVER = 0x500 = Windows 2000
' WINVER = 0x501 = Windows XP
'--*/
#INCLUDE ONCE "Core/Windows.inc"
#INCLUDE ONCE "Legacy/System/RasError.inc"
#IF NOT %DEF(%WINVER)
%EQUATE `WINVER = &H0601 ' Assume Windows 7
#ENDIF
#IF NOT %DEF(%UNLEN)
 #INCLUDE ONCE "Legacy/Platform/LMCons.inc"
#ENDIF
'// To use Quarantine APIs, applications should explicitly
'// define USES_RAS_QUARANTINE_APIS.
#IF %DEF(%USES_RAS_QUARANTINE_APIS)
#INCLUDE ONCE "Legacy/System/naptypes.inc"
%EQUATE `RASNAP_ProbationTime = &H00000001
TYPE RASNAPSTATE DWORD
 dwSize AS DWORD
 dwFlags AS DWORD
 isolationState AS LONG ' IsolationState enum
 probationTime AS FILETIME ' ProbationTime
END TYPE
#ENDIF ' %USES_RAS_QUARANTINE_APIS
'#include <pshpack4.h>
#INCLUDE ONCE "Legacy/System/inaddr.inc"
#INCLUDE ONCE "Legacy/System/in6addr.inc"
'/* RAS API Version
'*/
' enum RASAPIVERSION
%EQUATE `RASAPIVERSION_500 = 1
%EQUATE `RASAPIVERSION_501 = 2
%EQUATE `RASAPIVERSION_600 = 3
%EQUATE `RASAPIVERSION_601 = 4
%EQUATE `RASAPIVERSION_CURRENT = %RASAPIVERSION_601
'/* A RAS IP address.
'*/
' // Size = 4 bytes
TYPE RASIPADDR BYTE
 a AS BYTE
 b AS BYTE
 c AS BYTE
 d AS BYTE
END TYPE
'#if (WINVER >= 0x600)
'/* A RAS IPv4 address.
'*/
'typedef struct in_addr RASIPV4ADDR;
MACRO RASIPV4ADDR = in_addr
'/* A RAS IPv6 address.
'*/
'typedef struct in6_addr RASIPV6ADDR;
MACRO RASIPV6ADDR = in6_addr
'#endif
#IF (%WINVER >= &H600)
%EQUATE `RASTUNNELENDPOINT_UNKNOWN = 0
%EQUATE `RASTUNNELENDPOINT_IPv4 = 1
%EQUATE `RASTUNNELENDPOINT_IPv6 = 2
'/* RAS Tunnel endpoint address
'*/
' // Size = 16 bytes
UNION RASTUNNELENDPOINT_UNION
 ipv4 AS RASIPV4ADDR
 ipv6 AS RASIPV6ADDR
END UNION
' // Size = 20 bytes
TYPE RASTUNNELENDPOINT ' Must be 4 byte aligned
 dwType AS DWORD
 RASTUNNELENDPOINT_UNION
END TYPE
#ENDIF
%EQUATE `RAS_MaxDeviceType = 16
%EQUATE `RAS_MaxPhoneNumber = 128
%EQUATE `RAS_MaxIpAddress = 15
%EQUATE `RAS_MaxIpxAddress = 21
#IF (%WINVER >= &H400)
%EQUATE `RAS_MaxEntryName = 256
%EQUATE `RAS_MaxDeviceName = 128
%EQUATE `RAS_MaxCallbackNumber = %RAS_MaxPhoneNumber
#ELSE
%EQUATE `RAS_MaxEntryName = 20
%EQUATE `RAS_MaxDeviceName = 32
%EQUATE `RAS_MaxCallbackNumber = 48
#ENDIF
%EQUATE `RAS_MaxAreaCode = 10
%EQUATE `RAS_MaxPadType = 32
%EQUATE `RAS_MaxX25Address = 200
%EQUATE `RAS_MaxFacilities = 200
%EQUATE `RAS_MaxUserData = 200
%EQUATE `RAS_MaxReplyMessage = 1024
%EQUATE `RAS_MaxDnsSuffix = 256
'DECLARE_HANDLE( HRASCONN );
'#define LPHRASCONN HRASCONN*
#IF (%WINVER >= &H501)
%EQUATE `RASCF_AllUsers = &H00000001
%EQUATE `RASCF_GlobalCreds = &H00000002
%EQUATE `RASCF_OwnerKnown = &H00000004
%EQUATE `RASCF_OwnerMatch = &H00000008
'#define RASCF_IsOwner(rascFlags) (((rascFlags) & (RASCF_OwnerKnown | RASCF_OwnerMatch)) == (RASCF_OwnerKnown | RASCF_OwnerMatch))
'#define RASCF_IsNotOwner(rascFlags) (((rascFlags) & (RASCF_OwnerKnown | RASCF_OwnerMatch)) == (RASCF_OwnerKnown))
MACRO RASCF_IsOwner(rascFlags) = (((rascFlags) AND (%RASCF_OwnerKnown OR %RASCF_OwnerMatch)) = (%RASCF_OwnerKnown OR %RASCF_OwnerMatch))
MACRO RASCF_IsNotOwner(rascFlags) = (((rascFlags) AND (%RASCF_OwnerKnown OR %RASCF_OwnerMatch)) = (%RASCF_OwnerKnown))
#ENDIF
'/* Identifies an active RAS connection. (See RasEnumConnections)
'*/
' // Size = 1384 bytes
TYPE RASCONNW ' Must be 4 byte aligned
 dwSize AS DWORD
 hRasConn AS DWORD ' HRASCONN
 szEntryName AS WSTRINGZ * %RAS_MaxEntryName + 1 ' WCHAR[RAS_MaxEntryName + 1]
#IF (%WINVER >= &H400)
 szDeviceTYPE AS WSTRINGZ * %RAS_MaxDeviceType + 1 ' WCHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS WSTRINGZ * %RAS_MaxDeviceName + 1 ' WCHAR[RAS_MaxDeviceName + 1]
#ENDIF
#IF (%WINVER >= &H401)
 szPhonebook AS WSTRINGZ * %MAX_PATH ' WCHAR[MAX_PATH]
 dwSubEntry AS DWORD
#ENDIF
#IF (%WINVER >= &H500)
 guidEntry AS GUID ' GUID
#ENDIF
#IF (%WINVER >= &H501)
 dwFlags AS DWORD
 luid AS QUAD ' LUID
#ENDIF
#IF (%WINVER >= &H600)
 guidCorrelationId AS GUID ' GUID
#ENDIF
 alignment__(1) AS BYTE ' // To keep 4 byte alignment
END TYPE
'#define RASCONNA struct tagRASCONNA
'RASCONNA
'{
' DWORD dwSize;
' HRASCONN hrasconn;
' CHAR szEntryName[ RAS_MaxEntryName + 1 ];
'#if (WINVER >= 0x400)
' CHAR szDeviceType[ RAS_MaxDeviceType + 1 ];
' CHAR szDeviceName[ RAS_MaxDeviceName + 1 ];
'#endif
'#if (WINVER >= 0x401)
' CHAR szPhonebook [ MAX_PATH ];
' DWORD dwSubEntry;
'#endif
'#if (WINVER >= 0x500)
' GUID guidEntry;
'#endif
'#if (WINVER >= 0x501)
' DWORD dwFlags;
' LUID luid;
'#endif
'#if (WINVER >= 0x600)
' GUID guidCorrelationId;
'#endif
'};
' // Size = 720 bytes
TYPE RASCONNA ' Must be 4 byte aligned
 dwSize AS DWORD
 hRasConn AS DWORD ' HRASCONN
 szEntryName AS ASCIIZ * %RAS_MaxEntryName + 1 ' CHAR[RAS_MaxEntryName + 1]
#IF (%WINVER >= &H400)
 szDeviceTYPE AS ASCIIZ * %RAS_MaxDeviceType + 1 ' CHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS ASCIIZ * %RAS_MaxDeviceName + 1 ' CHAR[RAS_MaxDeviceName + 1]
#ENDIF
#IF (%WINVER >= &H401)
 szPhonebook AS ASCIIZ * %MAX_PATH ' CHAR[MAX_PATH]
 dwSubEntry AS DWORD
#ENDIF
#IF (%WINVER >= &H500)
 guidEntry AS GUID ' GUID
#ENDIF
#IF (%WINVER >= &H501)
 dwFlags AS DWORD
 luid AS QUAD ' LUID
#ENDIF
#IF (%WINVER >= &H600)
 guidCorrelationId AS GUID ' GUID
#ENDIF
 alignment__(0) AS BYTE ' // To keep 4 byte alignment
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASCONN = RASCONNW
#ELSE
 MACRO RASCONN = RASCONNA
#ENDIF
'/* Enumerates intermediate states to a connection. (See RasDial)
'*/
%EQUATE `RASCS_PAUSED = &H1000
%EQUATE `RASCS_DONE = &H2000
'#define RASCONNSTATE enum tagRASCONNSTATE
%EQUATE `RASCS_OpenPort = 0
%EQUATE `RASCS_PortOpened = 1
%EQUATE `RASCS_ConnectDevice = 2
%EQUATE `RASCS_DeviceConnected = 3
%EQUATE `RASCS_AllDevicesConnected = 4
%EQUATE `RASCS_Authenticate = 5
%EQUATE `RASCS_AuthNotify = 6
%EQUATE `RASCS_AuthRetry = 7
%EQUATE `RASCS_AuthCallback = 8
%EQUATE `RASCS_AuthChangePassword = 9
%EQUATE `RASCS_AuthProject = 10
%EQUATE `RASCS_AuthLinkSpeed = 11
%EQUATE `RASCS_AuthAck = 12
%EQUATE `RASCS_ReAuthenticate = 13
%EQUATE `RASCS_Authenticated = 14
%EQUATE `RASCS_PrepareForCallback = 15
%EQUATE `RASCS_WaitForModemReset = 16
%EQUATE `RASCS_WaitForCallback = 17
%EQUATE `RASCS_Projected = 18
#IF (%WINVER >= &H400)
%EQUATE `RASCS_StartAuthentication = 19
%EQUATE `RASCS_CallbackComplete = 20
%EQUATE `RASCS_LogonNetwork = 21
#ENDIF
%EQUATE `RASCS_SubEntryConnected = 22
%EQUATE `RASCS_SubEntryDisconnected = 23
#IF (%WINVER >= &H601)
%EQUATE `RASCS_ApplySettings = 24
#ENDIF
%EQUATE `RASCS_Interactive = %RASCS_PAUSED
%EQUATE `RASCS_RetryAuthentication = %RASCS_PAUSED + 1
%EQUATE `RASCS_CallbackSetByCaller = %RASCS_PAUSED + 2
%EQUATE `RASCS_PasswordExpired = %RASCS_PAUSED + 3
#IF (%WINVER >= &H500)
%EQUATE `RASCS_InvokeEapUI = %RASCS_PAUSED + 3
#ENDIF
%EQUATE `RASCS_Connected = %RASCS_DONE
%EQUATE `RASCS_Disconnected = %RASCS_DONE + 1
#IF (%WINVER >= &H600)
%EQUATE `RASCSS_DONE = &H2000
' enum RASCONNSUBSTATE
%EQUATE `RASCSS_None = 0
%EQUATE `RASCSS_Dormant = 1
%EQUATE `RASCSS_Reconnecting = 2
%EQUATE `RASCSS_Reconnected = %RASCSS_DONE
#ENDIF
'/* Describes the status of a RAS connection. (See RasConnectionStatus)
'*/
'#define RASCONNSTATUSW struct tagRASCONNSTATUSW
' // Size = 608 bytes
TYPE RASCONNSTATUSW ' Must be 4 byte aligned
 dwSize AS DWORD
 rasconnstate AS LONG ' RASCONNSTATE
 dwError AS DWORD
 szDeviceTYPE AS WSTRINGZ * %RAS_MaxDeviceType + 1 ' WCHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS WSTRINGZ * %RAS_MaxDeviceName + 1 ' WCHAR[RAS_MaxDeviceName + 1]
#IF (%WINVER >= &H401)
 szPhoneNumber AS WSTRINGZ * %RAS_MaxPhoneNumber + 1 ' WCHAR[RAS_MaxPhoneNumber + 1]
#ENDIF
#IF (%WINVER >= &H401)
 alignment__(1) AS BYTE ' // To keep 4 byte alignment
#ENDIF
#IF (%WINVER >= &H601)
 localEndPoint AS RASTUNNELENDPOINT ' RASTUNNELENDPOINT
 remoteEndPoint AS RASTUNNELENDPOINT ' RASTUNNELENDPOINT
 rasconnsubstate AS LONG ' RASCONNSUBSTATE
#ENDIF
END TYPE
'#define RASCONNSTATUSA struct tagRASCONNSTATUSA
' // Size = 332 bytes
TYPE RASCONNSTATUSA ' Must be 4 byte aligned
 dwSize AS DWORD
 rasconnstate AS LONG
 dwError AS DWORD
 szDeviceTYPE AS ASCIIZ * %RAS_MaxDeviceType + 1 ' CHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS ASCIIZ * %RAS_MaxDeviceName + 1 ' CHAR[RAS_MaxDeviceName + 1]
#IF (%WINVER >= &H401)
 szPhoneNumber AS ASCIIZ * %RAS_MaxPhoneNumber + 1 ' CHAR[RAS_MaxPhoneNumber + 1]
#ENDIF
#IF (%WINVER >= &H401)
 alignment__(0) AS BYTE ' // To keep 4 byte alignment
#ELSE
 alignment__(1) AS BYTE ' // To keep 4 byte alignment
#ENDIF
#IF (%WINVER >= &H601)
 localEndPoint AS RASTUNNELENDPOINT ' RASTUNNELENDPOINT
 remoteEndPoint AS RASTUNNELENDPOINT ' RASTUNNELENDPOINT
 rasconnsubstate AS LONG ' RASCONNSUBSTATE
#ENDIF
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASCONNSTATUS = RASCONNSTATUSW
#ELSE
 MACRO RASCONNSTATUS = RASCONNSTATUSA
#ENDIF
'/* Describes connection establishment parameters. (See RasDial)
'*/
'#define RASDIALPARAMSW struct tagRASDIALPARAMSW
' // Size = 2108 bytes
TYPE RASDIALPARAMSW ' Must be 4 byte aligned
 dwSize AS DWORD
 szEntryName AS WSTRINGZ * %RAS_MaxEntryName + 1 ' WCHAR[RAS_MaxEntryName]
 szPhoneNumber AS WSTRINGZ * %RAS_MaxPhoneNumber + 1 ' WCHAR[RAS_MaxPhoneNumber]
 szCallBackNumber AS WSTRINGZ * %RAS_MaxCallbackNumber + 1 ' WCHAR[RAS_MaxCallbackNumber]
 szUserName AS WSTRINGZ * %UNLEN + 1 ' WCHAR[UNLEN + 1]
 szPassword AS WSTRINGZ * %PWLEN + 1 ' WCHAR[PWLEN + 1]
 szDomain AS WSTRINGZ * %DNLEN + 1 ' WCHAR[DNLEN + 1]
#IF (%WINVER >= &H401)
 dwSubEntry AS DWORD
 dwCallbackId AS DWORD ' ULONG_PTR
#ENDIF
 alignment__(1) AS BYTE ' // To keep 4 byte alignment
#IF (%WINVER >= &H601)
 dwIfIndex AS DWORD
#ENDIF
END TYPE
'#define RASDIALPARAMSA struct tagRASDIALPARAMSA
' // Size = 1064 bytes
TYPE RASDIALPARAMSA ' Must be 4 byte aligned
 dwSize AS DWORD
 szEntryName AS ASCIIZ * %RAS_MaxEntryName + 1 ' CHAR[RAS_MaxEntryName + 1]
 szPhoneNumber AS ASCIIZ * %RAS_MaxPhoneNumber + 1 ' CHAR[RAS_MaxPhoneNumber + 1]
 szCallBackNumber AS ASCIIZ * %RAS_MaxCallbackNumber + 1 ' CHAR[RAS_MaxCallbackNumber + 1]
 szUserName AS ASCIIZ * %UNLEN + 1 ' CHAR[UNLEN]
 szPassword AS ASCIIZ * %PWLEN + 1 ' CHAR[PWLEN]
 szDomain AS ASCIIZ * %DNLEN + 1 ' CHAR[DNLEN]
#IF (%WINVER >= &H401)
 dwSubEntry AS DWORD
 dwCallbackId AS DWORD ' ULONG_PTR
#ENDIF
 alignment__(2) AS BYTE ' // To keep 4 byte alignment
#IF (%WINVER >= &H601)
 dwIfIndex AS DWORD
#ENDIF
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASDIALPARAMS = RASDIALPARAMSW
#ELSE
 MACRO RASDIALPARAMS = RASDIALPARAMSA
#ENDIF
'#if (WINVER >= 0x500)
'#define RASEAPINFO struct tagRASEAPINFO
'RASEAPINFO
'{
' DWORD dwSizeofEapInfo;
' BYTE *pbEapInfo;
'};
' // Size = 8 bytes
TYPE RASEAPINFO ' Must be 4 byte aligned
 dwSizeofEapInfo AS DWORD
 pbEapInfo AS BYTE PTR
END TYPE
MACRO RASEAPINFO_type = RASEAPINFO ' // For compatibility with the PB declares
'#endif
'#IF (%WINVER >= &H601)
' // Size = 8 bytes
TYPE RASDEVSPECIFICINFO ' Must be 4 byte aligned
 dwSize AS DWORD
 pbDevSpecificInfo AS BYTE PTR ' BYTE*
END TYPE
MACRO RASDEVSPECIFICINFO_type = RASDEVSPECIFICINFO ' // For compatibility with the PB declares
'#ENDIF
'/* Describes extended connection establishment options. (See RasDial)
'*/
'#define RASDIALEXTENSIONS struct tagRASDIALEXTENSIONS
' // Size = 40 bytes
TYPE RASDIALEXTENSIONS ' Must be 4 byte aligned
 dwSize AS DWORD
 dwfOptions AS DWORD
 hwndParent AS DWORD
 reserved AS DWORD ' ULONG_PTR
#IF (%WINVER >= &H500)
 reserved1 AS DWORD ' ULONG_PTR
 RasEapInfo AS RASEAPINFO ' RASEAPINFO
#ENDIF
#IF (%WINVER >= &H601)
 fSkipPppAuth AS LONG
 RasDevSpecificInfo AS RASDEVSPECIFICINFO ' RASDEVSPECIFICINFO
#ENDIF
END TYPE
'#define LPRASDIALEXTENSIONS RASDIALEXTENSIONS*
'/* 'dwfOptions' bit flags.
'*/
%EQUATE `RDEOPT_UsePrefixSuffix = &H00000001
%EQUATE `RDEOPT_PausedStates = &H00000002
%EQUATE `RDEOPT_IgnoreModemSpeaker = &H00000004
%EQUATE `RDEOPT_SetModemSpeaker = &H00000008
%EQUATE `RDEOPT_IgnoreSoftwareCompression = &H00000010
%EQUATE `RDEOPT_SetSoftwareCompression = &H00000020
%EQUATE `RDEOPT_DisableConnectedUI = &H00000040
%EQUATE `RDEOPT_DisableReconnectUI = &H00000080
%EQUATE `RDEOPT_DisableReconnect = &H00000100
%EQUATE `RDEOPT_NoUser = &H00000200
%EQUATE `RDEOPT_PauseOnScript = &H00000400
%EQUATE `RDEOPT_Router = &H00000800
#IF (%WINVER >= &H500)
%EQUATE `RDEOPT_CustomDial = &H00001000
#ENDIF
#IF (%WINVER >= &H501)
%EQUATE `RDEOPT_UseCustomScripting = &H00002000
#ENDIF
'//
'// This flag when set in the RASENTRYNAME structure
'// indicates that the phonebook to which this entry
'// belongs is a system phonebook.
'//
%EQUATE `REN_User = &H00000000
%EQUATE `REN_AllUsers = &H00000001
'/* Describes an enumerated RAS phone book entry name. (See RasEntryEnum)
'*/
'#define RASENTRYNAMEW struct tagRASENTRYNAMEW
' // Size = 1048 bytes
TYPE RASENTRYNAMEW ' Must be 4 byte aligned
 dwSize AS DWORD
 szEntryName AS WSTRINGZ * %RAS_MaxEntryName + 1 ' WCHAR[RAS_MaxEntryName + 1]
#IF (%WINVER >= &H500)
 dwFlags AS DWORD
 szPhonebookPath AS WSTRINGZ * %MAX_PATH + 1 ' WCHAR[MAX_PATH + 1]
#ENDIF
#IF (%WINVER >= &H500)
 alignment__(3) AS BYTE
#ELSE
 alignment__(1) AS BYTE
#ENDIF
END TYPE
'#define RASENTRYNAMEA struct tagRASENTRYNAMEA
' // Size = 532 bytes
TYPE RASENTRYNAMEA ' Must be 4 byte aligned
 dwSize AS DWORD
 szEntryName AS ASCIIZ * %RAS_MaxEntryName + 1 ' CHAR[RAS_MaxEntryName + 1]
#IF (%WINVER >= &H500)
 dwFlags AS DWORD
 szPhonebookPath AS ASCIIZ * %MAX_PATH + 1 ' CHAR[MAX_PATH + 1]
#ENDIF
#IF (%WINVER >= &H500)
 alignment__(5) AS BYTE
#ELSE
 alignment__(2) AS BYTE
#ENDIF
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASENTRYNAME = RASENTRYNAMEW
#ELSE
 MACRO RASENTRYNAME = RASENTRYNAMEA
#ENDIF
'/* Protocol code to projection data structure mapping.
'*/
'#define RASPROJECTION enum tagRASPROJECTION
%EQUATE `RASP_Amb = &H10000
%EQUATE `RASP_PppNbf = &H803F
%EQUATE `RASP_PppIpx = &H802B
%EQUATE `RASP_PppIp = &H8021
#IF (%WINVER >= &H500)
%EQUATE `RASP_PppCcp = &H80FD
#ENDIF
%EQUATE `RASP_PppLcp = &HC021
%EQUATE `RASP_Slip = &H20000
'/* Describes the result of a RAS AMB (Authentication Message Block)
'** projection. This protocol is used with NT 3.1 and OS/2 1.3 downlevel
'** RAS servers.
'*/
'#define RASAMBW struct tagRASAMBW
' // Size = 44 bytes
TYPE RASAMBW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szNetBiosError AS WSTRINGZ * %NETBIOS_NAME_LEN + 1 ' WCHAR[NETBIOS_NAME_LEN + 1]
 bLana AS BYTE ' BYTE
 alignment__(0) AS BYTE
END TYPE
'#define RASAMBA struct tagRASAMBA
' // Size = 28 bytes
TYPE RASAMBA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szNetBiosError AS ASCIIZ * %NETBIOS_NAME_LEN + 1 ' CHAR[NETBIOS_NAME_LEN + 1]
 bLana AS BYTE ' BYTE
 alignment__(1) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASAMB = RASAMBW
#ELSE
 MACRO RASAMB = RASAMBA
#ENDIF
'/* Describes the result of a PPP NBF (NetBEUI) projection.
'*/
''#define RASPPPNBFW struct tagRASPPPNBFW
' // Size = 84 bytes
TYPE RASPPPNBFW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 dwNetBiosError AS DWORD
 szNetBiosError AS WSTRINGZ * %NETBIOS_NAME_LEN + 1 ' WCHAR[NETBIOS_NAME_LEN + 1]
 szWorkstationName AS WSTRINGZ * %NETBIOS_NAME_LEN + 1 ' WCHAR[NETBIOS_NAME_LEN + 1]
 bLana AS BYTE ' BYTE
 alignment__(2) AS BYTE
END TYPE
'#define RASPPPNBFA struct tagRASPPPNBFA
' // Size = 48 bytes
TYPE RASPPPNBFA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 dwNetBiosError AS DWORD
 szNetBiosError AS ASCIIZ * %NETBIOS_NAME_LEN + 1 ' CHAR[NETBIOS_NAME_LEN + 1]
 szWorkstationName AS ASCIIZ * %NETBIOS_NAME_LEN + 1 ' CHAR[NETBIOS_NAME_LEN + 1]
 bLana AS BYTE ' BYTE
 alignment__(0) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASPPPNBF = RASPPPNBFW
#ELSE
 MACRO RASPPPNBF = RASPPPNBFA
#ENDIF
'/* Describes the results of a PPP IPX (Internetwork Packet Exchange)
'** projection.
'*/
'#define RASPPPIPXW struct tagRASIPXW
' // Size = 52 bytes
TYPE RASPPPIPXW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szIpxAddress AS WSTRINGZ * %RAS_MaxIpxAddress + 1 ' WCHAR[RAS_MaxIpxAddress + 1]
END TYPE
'#define RASPPPIPXA struct tagRASPPPIPXA
' // Size = 32 bytes
TYPE RASPPPIPXA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szIpxAddress AS ASCIIZ * %RAS_MaxIpxAddress + 1 ' CHAR[RAS_MaxIpxAddress + 1]
 alignment__(1) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASPPPIPX = RASPPPIPXW
#ELSE
 MACRO RASPPPIPX = RASPPPIPXA
#ENDIF
'/* Describes the results of a PPP IP (Internet) projection.
'*/
#IF (%WINVER >= &H500)
'/* RASPPPIP 'dwOptions' and 'dwServerOptions' flags.
'*/
%EQUATE `RASIPO_VJ = &H00000001
#ENDIF
''#define RASPPPIPW struct tagRASPPPIPW
' // Size = 80 bytes
TYPE RASPPPIPW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szIpAddress AS WSTRINGZ * %RAS_MaxIpAddress + 1 ' WCHAR[RAS_MaxIpAddress]
#IF NOT %DEF(%WINNT35COMPATIBLE)
 szServerIpAddress AS WSTRINGZ * %RAS_MaxIpAddress + 1 ' WCHAR[RAS_MaxIpAddress]
#ENDIF
#IF (%WINVER >= &H500)
 dwOptions AS DWORD
 dwServerOptions AS DWORD
#ENDIF
END TYPE
'#define RASPPPIPA struct tagRASPPPIPA
' // Size = 48 bytes
TYPE RASPPPIPA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szIpAddress AS ASCIIZ * %RAS_MaxIpAddress + 1 ' CHAR[RAS_MaxIpAddress + 1
#IF NOT %DEF(%WINNT35COMPATIBLE)
 szServerIpAddress AS ASCIIZ * %RAS_MaxIpAddress + 1 ' CHAR[RAS_MaxIpAddress + 1
#ENDIF
#IF (%WINVER >= &H500)
 dwOptions AS DWORD
 dwServerOptions AS DWORD
#ENDIF
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASPPPIP = RASPPPIPW
#ELSE
 MACRO RASPPPIP = RASPPPIPA
#ENDIF
'/* Describes the results of a Ipv6 projection info
'*/
#IF (%WINVER >= &H600)
'#define RASPPPIPV6 struct tagRASPPPIPV6
' // Size = 28 bytes ' Must be 4 byte aligned
TYPE RASPPPIPV6
 dwSize AS DWORD
 dwError AS DWORD
 bLocalInterfaceIdentifier(7) AS BYTE ' BYTE
 bPeerInterfaceIdentifier(7) AS BYTE ' BYTE
 bLocalCompressionProtocol(1) AS BYTE ' BYTE
 bPeerCompressionProtocol(1) AS BYTE ' BYTE
END TYPE
#ENDIF
'/* Describes the results of a PPP LCP/multi-link negotiation.
'*/
#IF (%WINVER >= &H500)
'/* RASPPPLCP 'dwAuthenticatonProtocol' values.
'*/
%EQUATE `RASLCPAP_PAP = &HC023
%EQUATE `RASLCPAP_SPAP = &HC027
%EQUATE `RASLCPAP_CHAP = &HC223
%EQUATE `RASLCPAP_EAP = &HC227
'/* RASPPPLCP 'dwAuthenticatonData' values.
'*/
%EQUATE `RASLCPAD_CHAP_MD5 = &H05
%EQUATE `RASLCPAD_CHAP_MS = &H80
%EQUATE `RASLCPAD_CHAP_MSV2 = &H81
'/* RASPPPLCP 'dwOptions' and 'dwServerOptions' flags.
'*/
%EQUATE `RASLCPO_PFC = &H00000001
%EQUATE `RASLCPO_ACFC = &H00000002
%EQUATE `RASLCPO_SSHF = &H00000004
%EQUATE `RASLCPO_DES_56 = &H00000008
%EQUATE `RASLCPO_3_DES = &H00000010
#IF (%WINVER >= &H600)
%EQUATE `RASLCPO_AES_128 = &H00000020
%EQUATE `RASLCPO_AES_256 = &H00000040
#ENDIF ' /* WINVER >= 0x0600 */
#ENDIF
'#define RASPPPLCPW struct tagRASPPPLCPW
' // Size = 2104 bytes
TYPE RASPPPLCPW ' Must be 4 byte aligned
 dwSize AS DWORD
 fBundled AS LONG
#IF (%WINVER >= &H500)
 dwError AS DWORD
 dwAuthenticationProtocol AS DWORD
 dwAuthenticationData AS DWORD
 dwEapTypeId AS DWORD
 dwServerAuthenticationProtocol AS DWORD
 dwServerAuthenticationData AS DWORD
 dwServerEapTypeId AS DWORD
 fMultilink AS LONG
 dwTerminateReason AS DWORD
 dwServerTerminateReason AS DWORD
 szReplyMessage AS WSTRINGZ * %RAS_MaxReplyMessage ' WCHAR[RAS_MaxReplyMessage]
 dwOptions AS DWORD
 dwServerOptions AS DWORD
#ENDIF
END TYPE
'#define RASPPPLCPA struct tagRASPPPLCPA
' // Size = 1080 bytes
TYPE RASPPPLCPA ' Must be 4 byte aligned
 dwSize AS DWORD
 fBundled AS LONG
#IF (%WINVER >= &H500)
 dwError AS DWORD
 dwAuthenticationProtocol AS DWORD
 dwAuthenticationData AS DWORD
 dwEapTypeId AS DWORD
 dwServerAuthenticationProtocol AS DWORD
 dwServerAuthenticationData AS DWORD
 dwServerEapTypeId AS DWORD
 fMultilink AS LONG
 dwTerminateReason AS DWORD
 dwServerTerminateReason AS DWORD
 szReplyMessage AS ASCIIZ * %RAS_MaxReplyMessage ' CHAR[RAS_MaxReplyMessage]
 dwOptions AS DWORD
 dwServerOptions AS DWORD
#ENDIF
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASPPPLCP = RASPPPLCPW
#ELSE
 MACRO RASPPPLCP = RASPPPLCPA
#ENDIF
#IF (%WINVER < &H600) ' // SLIP
'/* Describes the results of a SLIP (Serial Line IP) projection.
'*/
'#define RASSLIPW struct tagRASSLIPW
' // Size = 40 bytes
TYPE RASSLIPW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szIpAddress AS WSTRINGZ * %RAS_MaxIpAddress + 1 ' WCHAR[RAS_MaxIpAddress + 1]
END TYPE
'#define RASSLIPA struct tagRASSLIPA
' // Size = 24 bytes
TYPE RASSLIPA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 szIpAddress AS ASCIIZ * %RAS_MaxIpAddress + 1 ' CHAR[RAS_MaxIpAddress + 1]
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASSLIP = RASSLIPW
#ELSE
 MACRO RASSLIP = RASSLIPA
#ENDIF
#ENDIF ' // SLIP
#IF (%WINVER >= &H500)
'/* Describes the results of a PPP CCP (Compression Control Protocol)
'projection.
'*/
'/* RASPPPCCP 'dwCompressionAlgorithm' values.
'*/
%EQUATE `RASCCPCA_MPPC = &H00000006
%EQUATE `RASCCPCA_STAC = &H00000005
'/* RASPPPCCP 'dwOptions' values.
'*/
%EQUATE `RASCCPO_Compression = &H00000001
%EQUATE `RASCCPO_HistoryLess = &H00000002
%EQUATE `RASCCPO_Encryption56bit = &H00000010
%EQUATE `RASCCPO_Encryption40bit = &H00000020
%EQUATE `RASCCPO_Encryption128bit = &H00000040
'#define RASPPPCCP struct tagRASPPPCCP
' // Size = 24 bytes
TYPE RASPPPCCP ' Must be 4 byte aligned
 dwSize AS DWORD
 dwError AS DWORD
 dwCompressionAlgorithm AS DWORD
 dwOptions AS DWORD
 dwServerCompressionAlgorithm AS DWORD
 dwServerOptions AS DWORD
END TYPE
#ENDIF
'/*
'** New Projection Information structure for PPP and IKEv2
'**
'*/
'#if (WINVER >= 0x601)
' // Size = 100 bytes
TYPE RASPPP_PROJECTION_INFO ' Must be 4 byte aligned
 ' // IPv4 Projection Parameters
 dwIPv4NegotiationError AS DWORD
 ipv4Address AS RASIPV4ADDR ' RASIPV4ADDR
 ipv4ServerAddress AS RASIPV4ADDR ' RASIPV4ADDR
 dwIPv4Options AS DWORD
 dwIPv4ServerOptions AS DWORD
 ' // IPv6 Projection Parameters
 dwIPv6NegotiationError AS DWORD
 bInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 bServerInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 ' // LCP Options
 fBundled AS LONG
 fMultilink AS LONG
 dwAuthenticationProtocol AS DWORD
 dwAuthenticationData AS DWORD
 dwServerAuthenticationProtocol AS DWORD
 dwServerAuthenticationData AS DWORD
 dwEapTypeId AS DWORD
 dwServerEapTypeId AS DWORD
 dwLcpOptions AS DWORD
 dwLcpServerOptions AS DWORD
 ' // CCP options
 dwCcpError AS DWORD
 dwCcpCompressionAlgorithm AS DWORD
 dwCcpServerCompressionAlgorithm AS DWORD
 dwCcpOptions AS DWORD
 dwCcpServerOptions AS DWORD
END TYPE
'/* RASIKEV2_PROJECTION_INFO 'dwFlags' values.
'*/
%EQUATE `RASIKEv2_FLAGS_MOBIKESUPPORTED = &H00000001
%EQUATE `RASIKEv2_FLAGS_BEHIND_NAT = &H00000002
%EQUATE `RASIKEv2_FLAGS_SERVERBEHIND_NAT = &H00000004
'/* RASIKEV2_PROJECTION_INFO 'dwAuthenticatonProtocol' values.
'*/
%EQUATE `RASIKEv2_AUTH_MACHINECERTIFICATES = 1
%EQUATE `RASIKEv2_AUTH_EAP = 2
' // Size = 84 bytes
TYPE RASIKEV2_PROJECTION_INFO ' Must be 4 byte aligned
 ' // IPv4 Projection Parameters
 dwIPv4NegotiationError AS DWORD
 ipv4Address AS RASIPV4ADDR ' RASIPV4ADDR
 ipv4ServerAddress AS RASIPV4ADDR ' RASIPV4ADDR
 ' // IPv6 Projection Parameters
 dwIPv6NegotiationError AS DWORD
 ipv6Address AS RASIPV6ADDR ' RASIPV6ADDR
 ipv6ServerAddress AS RASIPV6ADDR ' RASIPV6ADDR
 dwPrefixLength AS DWORD
 ' // AUTH
 dwAuthenticationProtocol AS DWORD
 dwEapTypeId AS DWORD
 dwFlags AS DWORD
 dwEncryptionMethod AS DWORD
 numIPv4ServerAddresses AS DWORD
 ipv4ServerAddresses AS RASIPV4ADDR PTR ' RASIPV4ADDR*
 numIPv6ServerAddresses AS DWORD
 ipv6ServerAddresses AS RASIPV6ADDR PTR ' RASIPV6ADDR*
END TYPE
' enum RASPROJECTION_INFO_TYPE
%EQUATE `PROJECTION_INFO_TYPE_PPP = 1
%EQUATE `PROJECTION_INFO_TYPE_IKEv2 = 2
' // Size = 100 bytes
UNION RAS_PROJECTION_INFO_UNION ' Must be 4 byte aligned
 ppp AS RASPPP_PROJECTION_INFO
 ikev2 AS RASIKEV2_PROJECTION_INFO
END UNION
' // Size = 108 bytes
TYPE RAS_PROJECTION_INFO ' Must be 4 byte aligned
 version AS LONG ' RASAPIVERSION
 type AS LONG ' RASPROJECTION_INFO_TYPE
 ' // Based on the connectionFlags, it should use appropriate projection info
 RAS_PROJECTION_INFO_UNION
END TYPE
'#endif
'/* If using RasDial message notifications, get the notification message code
'** by passing this string to the RegisterWindowMessageA() API.
'** WM_RASDIALEVENT is used only if a unique message cannot be registered.
'*/
$RASDIALEVENT = "RasDialEvent"
%EQUATE `WM_RASDIALEVENT = &HCCCD
'/* Prototypes for caller's RasDial callback handler. Arguments are the
'** message ID (currently always WM_RASDIALEVENT), the current RASCONNSTATE and
'** the error that has occurred (or 0 if none). Extended arguments are the
'** handle of the RAS connection and an extended error code.
'**
'** For RASDIALFUNC2, subsequent callback notifications for all
'** subentries can be cancelled by returning FALSE.
'*/
'typedef VOID (WINAPI *RASDIALFUNC)( UINT, RASCONNSTATE, DWORD );
'SUB RASDIALFUNC (BYVAL DWORD, BYVAL LONG, BYVAL DWORD)
'typedef VOID (WINAPI *RASDIALFUNC1)( HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD );
'SUB RASDIALFUNC1 (BYVAL DWORD, BYVAL DWORD, BYVAL LONG, BYVAL DWORD, BYVAL DWORD)
'typedef DWORD (WINAPI *RASDIALFUNC2)( ULONG_PTR, DWORD, HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD );
'SUB RASDIALFUNC2 (BYVAL DWORD, BYVAL DWORD, BYVAL DWORD, BYVAL DWORD, BYVAL LONG, BYVAL DWORD, BYVAL DWIRD)
'/* Information describing a RAS-capable device.
'*/
'#define RASDEVINFOW struct tagRASDEVINFOW
' // Size = 296 bytes
TYPE RASDEVINFOW ' Must be 4 byte aligned
 dwSize AS DWORD
 szDeviceType AS WSTRINGZ * %RAS_MaxDeviceType + 1 ' WCHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS WSTRINGZ * %RAS_MaxDeviceName + 1 ' WCHAR[RAS_MaxDeviceName + 1]
END TYPE
'#define RASDEVINFOA struct tagRASDEVINFOA
' // Size = 152 bytes
TYPE RASDEVINFOA ' Must be 4 byte aligned
 dwSize AS DWORD
 szDeviceType AS ASCIIZ * %RAS_MaxDeviceType + 1 ' CHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS ASCIIZ * %RAS_MaxDeviceName + 1 ' CHAR[RAS_MaxDeviceName + 1]
 alignment__(1) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASDEVINFO = RASDEVINFOW
#ELSE
 MACRO RASDEVINFO = RASDEVINFOA
#ENDIF
'/* RAS country information (currently retrieved from TAPI).
'*/
'#define RASCTRYINFO struct RASCTRYINFO
' // Size = 20 bytes
TYPE RASCTRYINFOA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwCountryID AS DWORD
 dwNextCountryID AS DWORD
 dwCountryCode AS DWORD
 dwCountryNameOffset AS DWORD
END TYPE
' // Size = 20 bytes
TYPE RASCTRYINFOW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwCountryID AS DWORD
 dwNextCountryID AS DWORD
 dwCountryCode AS DWORD
 dwCountryNameOffset AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASCTRYINFO = RASCTRYINFOW
#ELSE
 MACRO RASCTRYINFO = RASCTRYINFOA
#ENDIF
'/* There is currently no difference between
'** RASCTRYINFOA and RASCTRYINFOW. This may
'** change in the future.
'*/
'#define RASCTRYINFOW RASCTRYINFO
'#define RASCTRYINFOA RASCTRYINFO
'#define LPRASCTRYINFOW RASCTRYINFOW*
'#define LPRASCTRYINFOA RASCTRYINFOW*
'#define LPRASCTRYINFO RASCTRYINFO*
#IF (%WINVER >= &H500)
%EQUATE `ET_None = 0 ' // No encryption
%EQUATE `ET_Require = 1 ' // Require Encryption
%EQUATE `ET_RequireMax = 2 ' // Require max encryption
%EQUATE `ET_Optional = 3 ' // Do encryption if possible. None Ok.
#ENDIF
%EQUATE `VS_Default = 0 ' // default (PPTP for now)
%EQUATE `VS_PptpOnly = 1 ' // Only PPTP is attempted.
%EQUATE `VS_PptpFirst = 2 ' // PPTP is tried first.
%EQUATE `VS_L2tpOnly = 3 ' // Only L2TP is attempted.
%EQUATE `VS_L2tpFirst = 4 ' // L2TP is tried first.
#IF %WINVER >= &H600
%EQUATE `VS_SstpOnly = 5 ' // Only SSTP is attempted
%EQUATE `VS_SstpFirst = 6 ' // SSTP is attempted first
#ENDIF
#IF %WINVER >= &H601
%EQUATE `VS_SstpOnly = 5 ' // Only SSTP is attempted
%EQUATE `VS_SstpFirst = 6 ' // SSTP is attempted first
#ENDIF
#IF %WINVER >= &H601
%EQUATE `VS_Ikev2Only = 7 ' // Only VPN Ikev2 is attempted
%EQUATE `VS_Ikev2First = 8 ' // VPN Ikev2 is attempted first
#ENDIF
'/* A RAS phone book entry.
'*/
'#define RASENTRYA struct tagRASENTRYA
' // Size = 2948 bytes
TYPE RASENTRYA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwfOptions AS DWORD
 dwCountryID AS DWORD
 dwCountryCode AS DWORD
 szAreaCode AS ASCIIZ * %RAS_MaxAreaCode + 1 ' CHAR[RAS_MaxAreaCode + 1]
 szLocalPhoneNumber AS ASCIIZ * %RAS_MaxPhoneNumber + 1 ' CHAR[RAS_MaxPhoneNumber + 1]
 dwAlternateOffset AS DWORD
 ipaddr AS RASIPADDR ' RASIPADDR
 ipaddrDns AS RASIPADDR ' RASIPADDR
 ipaddrDnsAlt AS RASIPADDR ' RASIPADDR
 ipaddrWins AS RASIPADDR ' RASIPADDR
 ipaddrWinsAlt AS RASIPADDR ' RASIPADDR
 dwFrameSize AS DWORD
 dwfNetProtocols AS DWORD
 dwFramingProtocol AS DWORD
 szScript AS ASCIIZ * %MAX_PATH ' CHAR[MAX_PATH]
 szAutodialDll AS ASCIIZ * %MAX_PATH ' CHAR[MAX_PATH]
 szAutodialFunc AS ASCIIZ * %MAX_PATH ' CHAR[MAX_PATH]
 szDeviceType AS ASCIIZ * %RAS_MaxDeviceType + 1 ' CHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS ASCIIZ * %RAS_MaxDeviceName + 1 ' CHAR[RAS_MaxDeviceName + 1]
 szX25PadType AS ASCIIZ * %RAS_MaxPadType + 1 ' CHAR[RAS_MaxPadType + 1]
 szX25Address AS ASCIIZ * %RAS_MaxX25Address + 1 ' CHAR[RAS_MaxX25Address + 1]
 szX25Facilities AS ASCIIZ * %RAS_MaxFacilities + 1 ' CHAR[RAS_MaxFacilities + 1]
 szX25UserData AS ASCIIZ * %RAS_MaxUserData + 1 ' CHAR[RAS_MaxUserData + 1]
 dwChannels AS DWORD
 dwReserved1 AS DWORD
 dwReserved2 AS DWORD
#IF (%WINVER >= &H401)
 dwSubEntries AS DWORD
 dwDialMode AS DWORD
 dwDialExtraPercent AS DWORD
 dwDialExtraSampleSeconds AS DWORD
 dwHangUpExtraPercent AS DWORD
 dwHangUpExtraSampleSeconds AS DWORD
 dwIdleDisconnectSeconds AS DWORD
#ENDIF
#IF (%WINVER >= &H500)
 dwType AS DWORD
 dwEncryptionType AS DWORD
 dwCustomAuthKey AS DWORD
 guidId AS GUID ' GUID
 szCustomDialDll AS ASCIIZ * %MAX_PATH ' CHAR[MAX_PATH]
 dwVpnStrategy AS DWORD
#ENDIF
#IF (%WINVER >= &H501)
 dwfOptions2 AS DWORD
 dwfOptions3 AS DWORD
 szDnsSuffix AS ASCIIZ * %RAS_MaxDnsSuffix ' CHAR[RAS_MaxDnsSuffix]
 dwTcpWindowSize AS DWORD
 szPrerequisitePbk AS ASCIIZ * %MAX_PATH ' CHAR[MAX_PATH]
 szPrerequisiteEntry AS ASCIIZ * %RAS_MaxEntryName + 1 ' CHAR[RAS_MaxEntryName + 1]
 dwRedialCount AS DWORD
 dwRedialPause AS DWORD
#ENDIF
#IF (%WINVER >= &H600)
 ipv6addrDns AS RASIPV6ADDR ' RASIPV6ADDR
 ipv6addrDnsAlt AS RASIPV6ADDR ' RASIPV6ADDR
 dwIPv4InterfaceMetric AS DWORD
 dwIPv6InterfaceMetric AS DWORD
#ENDIF
#IF (%WINVER >= &H501)
 alignment__(4) AS BYTE
#ELSE
 alignment__(1) AS BYTE
#ENDIF
#IF (%WINVER >= &H601)
 ipv6addr AS RASIPV6ADDR ' RASIPV6ADDR
 dwIPv6PrefixLength AS DWORD
 dwNetworkOutageTime AS DWORD
#ENDIF
END TYPE
'#define RASENTRYW struct tagRASENTRYW
' // Size = 5680 bytes
TYPE RASENTRYW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwfOptions AS DWORD
 dwCountryID AS DWORD
 dwCountryCode AS DWORD
 szAreaCode AS WSTRINGZ * %RAS_MaxAreaCode + 1 ' WCHAR[RAS_MaxAreaCode + 1]
 szLocalPhoneNumber AS WSTRINGZ * %RAS_MaxPhoneNumber + 1 ' WCHAR[RAS_MaxPhoneNumber + 1]
 dwAlternateOffset AS DWORD
 ipaddr AS RASIPADDR ' RASIPADDR
 ipaddrDns AS RASIPADDR ' RASIPADDR
 ipaddrDnsAlt AS RASIPADDR ' RASIPADDR
 ipaddrWins AS RASIPADDR ' RASIPADDR
 ipaddrWinsAlt AS RASIPADDR ' RASIPADDR
 dwFrameSize AS DWORD
 dwfNetProtocols AS DWORD
 dwFramingProtocol AS DWORD
 szScript AS WSTRINGZ * %MAX_PATH ' WCHAR[MAX_PATH]
 szAutodialDll AS WSTRINGZ * %MAX_PATH ' WCHAR[MAX_PATH]
 szAutodialFunc AS WSTRINGZ * %MAX_PATH ' WCHAR[MAX_PATH]
 szDeviceType AS WSTRINGZ * %RAS_MaxDeviceType + 1 ' WCHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS WSTRINGZ * %RAS_MaxDeviceName + 1 ' WCHAR[RAS_MaxDeviceName + 1]
 szX25PadType AS WSTRINGZ * %RAS_MaxPadType + 1 ' WCHAR[RAS_MaxPadType + 1]
 szX25Address AS WSTRINGZ * %RAS_MaxX25Address + 1 ' WCHAR[RAS_MaxX25Address + 1]
 szX25Facilities AS WSTRINGZ * %RAS_MaxFacilities + 1 ' WCHAR[RAS_MaxFacilities + 1]
 szX25UserData AS WSTRINGZ * %RAS_MaxUserData + 1 ' WCHAR[RAS_MaxUserData + 1]
 dwChannels AS DWORD
 dwReserved1 AS DWORD
 dwReserved2 AS DWORD
#IF (%WINVER >= &H401)
 dwSubEntries AS DWORD
 dwDialMode AS DWORD
 dwDialExtraPercent AS DWORD
 dwDialExtraSampleSeconds AS DWORD
 dwHangUpExtraPercent AS DWORD
 dwHangUpExtraSampleSeconds AS DWORD
 dwIdleDisconnectSeconds AS DWORD
#ENDIF
#IF (%WINVER >= &H500)
 dwType AS DWORD
 dwEncryptionType AS DWORD
 dwCustomAuthKey AS DWORD
 guidId AS GUID ' GUID
 szCustomDialDll AS WSTRINGZ * %MAX_PATH ' WCHAR[MAX_PATH]
 dwVpnStrategy AS DWORD
#ENDIF
#IF (%WINVER >= &H501)
 dwfOptions2 AS DWORD
 dwfOptions3 AS DWORD
 szDnsSuffix AS WSTRINGZ * %RAS_MaxDnsSuffix ' WCHAR[RAS_MaxDnsSuffix]
 dwTcpWindowSize AS DWORD
 szPrerequisitePbk AS WSTRINGZ * %MAX_PATH ' WCHAR[MAX_PATH]
 szPrerequisiteEntry AS WSTRINGZ * %RAS_MaxEntryName + 1 ' WCHAR[RAS_MaxEntryName + 1]
 dwRedialCount AS DWORD
 dwRedialPause AS DWORD
#ENDIF
#IF (%WINVER >= &H600)
 ipv6addrDns AS RASIPV6ADDR ' RASIPV6ADDR
 ipv6addrDnsAlt AS RASIPV6ADDR ' RASIPV6ADDR
 dwIPv4InterfaceMetric AS DWORD
 dwIPv6InterfaceMetric AS DWORD
#ENDIF
#IF (%WINVER >= &H501)
 alignment__(1) AS BYTE
#ENDIF
#IF (%WINVER >= &H601)
 ipv6addr AS RASIPV6ADDR ' RASIPV6ADDR
 dwIPv6PrefixLength AS DWORD
 dwNetworkOutageTime AS DWORD
#ENDIF
END TYPE
MACRO RASENTRY = RASENTRYA
'/* RASENTRY 'dwfOptions' bit flags.
'*/
%EQUATE `RASEO_UseCountryAndAreaCodes = &H00000001
%EQUATE `RASEO_SpecificIpAddr = &H00000002
%EQUATE `RASEO_SpecificNameServers = &H00000004
%EQUATE `RASEO_IpHeaderCompression = &H00000008
%EQUATE `RASEO_RemoteDefaultGateway = &H00000010
%EQUATE `RASEO_DisableLcpExtensions = &H00000020
%EQUATE `RASEO_TerminalBeforeDial = &H00000040
%EQUATE `RASEO_TerminalAfterDial = &H00000080
%EQUATE `RASEO_ModemLights = &H00000100
%EQUATE `RASEO_SwCompression = &H00000200
%EQUATE `RASEO_RequireEncryptedPw = &H00000400
%EQUATE `RASEO_RequireMsEncryptedPw = &H00000800
%EQUATE `RASEO_RequireDataEncryption = &H00001000
%EQUATE `RASEO_NetworkLogon = &H00002000
%EQUATE `RASEO_UseLogonCredentials = &H00004000
%EQUATE `RASEO_PromoteAlternates = &H00008000
#IF (%WINVER >= &H401)
%EQUATE `RASEO_SecureLocalFiles = &H00010000
#ENDIF
#IF (%WINVER >= &H500)
%EQUATE `RASEO_RequireEAP = &H00020000
%EQUATE `RASEO_RequirePAP = &H00040000
%EQUATE `RASEO_RequireSPAP = &H00080000
%EQUATE `RASEO_Custom = &H00100000
%EQUATE `RASEO_PreviewPhoneNumber = &H00200000
%EQUATE `RASEO_SharedPhoneNumbers = &H00800000
%EQUATE `RASEO_PreviewUserPw = &H01000000
%EQUATE `RASEO_PreviewDomain = &H02000000
%EQUATE `RASEO_ShowDialingProgress = &H04000000
%EQUATE `RASEO_RequireCHAP = &H08000000
%EQUATE `RASEO_RequireMsCHAP = &H10000000
%EQUATE `RASEO_RequireMsCHAP2 = &H20000000
%EQUATE `RASEO_RequireW95MSCHAP = &H40000000
%EQUATE `RASEO_CustomScript = &H80000000
#ENDIF
#IF (%WINVER >= &H501)
'//
'// RASENTRY dwfOptions2 bit flags
'//
%EQUATE `RASEO2_SecureFileAndPrint = &H00000001
%EQUATE `RASEO2_SecureClientForMSNet = &H00000002
%EQUATE `RASEO2_DontNegotiateMultilink = &H00000004
%EQUATE `RASEO2_DontUseRasCredentials = &H00000008
%EQUATE `RASEO2_UsePreSharedKey = &H00000010
%EQUATE `RASEO2_Internet = &H00000020
%EQUATE `RASEO2_DisableNbtOverIP = &H00000040
%EQUATE `RASEO2_UseGlobalDeviceSettings = &H00000080
%EQUATE `RASEO2_ReconnectIfDropped = &H00000100
%EQUATE `RASEO2_SharePhoneNumbers = &H00000200
#ENDIF
#IF (%WINVER >= &H600)
%EQUATE `RASEO2_SecureRoutingCompartment = &H00000400
%EQUATE `RASEO2_UseTypicalSettings = &H00000800
%EQUATE `RASEO2_IPv6SpecificNameServers = &H00001000
%EQUATE `RASEO2_IPv6RemoteDefaultGateway = &H00002000
%EQUATE `RASEO2_RegisterIpWithDNS = &H00004000
%EQUATE `RASEO2_UseDNSSuffixForRegistration = &H00008000
%EQUATE `RASEO2_IPv4ExplicitMetric = &H00010000
%EQUATE `RASEO2_IPv6ExplicitMetric = &H00020000
%EQUATE `RASEO2_DisableIKENameEkuCheck = &H00040000
#ENDIF
#IF (%WINVER >= &H601)
%EQUATE `RASEO2_DisableClassBasedStaticRoute = &H00080000
%EQUATE `RASEO2_SpecificIPv6Addr = &H00100000
%EQUATE `RASEO2_DisableMobility = &H00200000
%EQUATE `RASEO2_RequireMachineCertificates = &H00400000
#ENDIF
'/* RASENTRY 'dwProtocols' bit flags.
'*/
%EQUATE `RASNP_NetBEUI = &H00000001
%EQUATE `RASNP_Ipx = &H00000002
%EQUATE `RASNP_Ip = &H00000004
' Note: Removed the condition because this constant is used in an assignment in MPRAPI.inc
'#IF (%WINVER >= &H600)
%EQUATE `RASNP_Ipv6 = &H00000008
'#ENDIF
'/* RASENTRY 'dwFramingProtocols' bit flags.
'*/
%EQUATE `RASFP_Ppp = &H00000001
%EQUATE `RASFP_Slip = &H00000002
%EQUATE `RASFP_Ras = &H00000004
'/* RASENTRY 'szDeviceType' default strings.
'*/
$RASDT_Modem = "modem"
$RASDT_Isdn = "isdn"
$RASDT_X25 = "x25"
$RASDT_Vpn = "vpn"
$RASDT_Pad = "pad"
$RASDT_Generic = "GENERIC"
$RASDT_Serial = "SERIAL"
$RASDT_FrameRelay = "FRAMERELAY"
$RASDT_Atm = "ATM"
$RASDT_Sonet = "SONET"
$RASDT_SW56 = "SW56"
$RASDT_Irda = "IRDA"
$RASDT_Parallel = "PARALLEL"
#IF (%WINVER >= &H501)
$RASDT_PPPoE = "PPPoE"
#ENDIF
$$RASDT_Modem = "modem"$$
$$RASDT_Isdn = "isdn"$$
$$RASDT_X25 = "x25"$$
$$RASDT_Vpn = "vpn"$$
$$RASDT_Pad = "pad"$$
$$RASDT_Generic = "GENERIC"$$
$$RASDT_Serial = "SERIAL"$$
$$RASDT_FrameRelay = "FRAMERELAY"$$
$$RASDT_Atm = "ATM"$$
$$RASDT_Sonet = "SONET"$$
$$RASDT_SW56 = "SW56"$$
$$RASDT_Irda = "IRDA"$$
$$RASDT_Parallel = "PARALLEL"$$
#IF (%WINVER >= &H501)
$$RASDT_PPPoE = "PPPoE"$$
#ENDIF
#IF %DEF(%UNICODE)
MACRO RASDT_Modem = $$RASDT_Modem
MACRO RASDT_Isdn = $$RASDT_Isdn
MACRO RASDT_X25 = $$RASDT_X25
MACRO RASDT_Vpn = $$RASDT_Vpn
MACRO RASDT_Pad = $$RASDT_Pad
MACRO RASDT_Generic = $$RASDT_Generic
MACRO RASDT_Serial = $$RASDT_Serial
MACRO RASDT_FrameRelay = $$RASDT_FrameRelay
MACRO RASDT_Atm = $$RASDT_Atm
MACRO RASDT_Sonet = $$RASDT_Sonet
MACRO RASDT_SW56 = $$RASDT_SW56
MACRO RASDT_Irda = $$RASDT_Irda
MACRO RASDT_Parallel = $$RASDT_Parallel
#IF (%WINVER >= &H501)
MACRO RASDT_PPPoE = $$RASDT_PPPoE
#ENDIF
#ELSE
MACRO RASDT_Modem = $RASDT_Modem
MACRO RASDT_Isdn = $RASDT_Isdn
MACRO RASDT_X25 = $RASDT_X25
MACRO RASDT_Vpn = $RASDT_Vpn
MACRO RASDT_Pad = $RASDT_Pad
MACRO RASDT_Generic = $RASDT_Generic
MACRO RASDT_Serial = $RASDT_Serial
MACRO RASDT_FrameRelay = $RASDT_FrameRelay
MACRO RASDT_Atm = $RASDT_Atm
MACRO RASDT_Sonet = $RASDT_Sonet
MACRO RASDT_SW56 = $RASDT_SW56
MACRO RASDT_Irda = $RASDT_Irda
MACRO RASDT_Parallel = $RASDT_Parallel
#IF (%WINVER >= &H501)
MACRO RASDT_PPPoE = $RASDT_PPPoE
#ENDIF
#ENDIF
'// The entry type used to determine which UI properties
'// are to be presented to user. This generally corresponds
'// to a Connections "add" wizard selection.
'//
%EQUATE `RASET_Phone = 1 ' // Phone lines: modem, ISDN, X.25, etc
%EQUATE `RASET_Vpn = 2 ' // Virtual private network
' Note: Removed the condition because this constant is used in an assignment in MPRAPI.inc
'#IF (%WINVER < &H600)
%EQUATE `RASET_Direct = 3 ' // Direct connect: serial, parallel
'#ENDIF
%EQUATE `RASET_Internet = 4 ' // BaseCamp internet
#IF (%WINVER >= &H501)
%EQUATE `RASET_Broadband = 5 ' // Broadband
#ENDIF
'/* Old AutoDial DLL function prototype.
'**
'** This prototype is documented for backward-compatibility
'** purposes only. It is superceded by the RASADFUNCA
'** and RASADFUNCW definitions below. DO NOT USE THIS
'** PROTOTYPE IN NEW CODE. SUPPORT FOR IT MAY BE REMOVED
'** IN FUTURE VERSIONS OF RAS.
'*/
'typedef BOOL (WINAPI *ORASADFUNC)( HWND, LPSTR, DWORD, LPDWORD );
'FUNCTION ORASADFUNC (BYVAL DWORD, BYREF ASCIIZ, BYVAL DWORD, BYVAL DWORD) AS LONG
#IF (%WINVER >= &H400)
'/* Flags for RasConnectionNotification().
'*/
%EQUATE `RASCN_Connection = &H00000001
%EQUATE `RASCN_Disconnection = &H00000002
%EQUATE `RASCN_BandwidthAdded = &H00000004
%EQUATE `RASCN_BandwidthRemoved = &H00000008
%EQUATE `RASCN_Dormant = &H00000010
%EQUATE `RASCN_ReConnection = &H00000020
#ENDIF
#IF (%WINVER >= &H401)
'/* RASENTRY 'dwDialMode' values.
'*/
%EQUATE `RASEDM_DialAll = 1
%EQUATE `RASEDM_DialAsNeeded = 2
'/* RASENTRY 'dwIdleDisconnectSeconds' constants.
'*/
%EQUATE `RASIDS_Disabled = &Hffffffff
%EQUATE `RASIDS_UseGlobalValue = 0
'/* AutoDial DLL function parameter block.
'*/
'#define RASADPARAMS struct tagRASADPARAMS
' // Size = 20 bytes
TYPE RASADPARAMS ' Must be 4 byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 xDlg AS LONG
 yDlg AS LONG
END TYPE
'/* AutoDial DLL function parameter block 'dwFlags.'
'*/
%EQUATE `RASADFLG_PositionDlg = &H00000001
'/* Prototype AutoDial DLL function.
'*/
'typedef BOOL (WINAPI *RASADFUNCA)( LPSTR, LPSTR, LPRASADPARAMS, LPDWORD );
'FUNCTION RASADFUNCA (BYREF ASCIIZ, BYREF ASCIIZ, BYVAL RASADPARAMS PTR, BYVAL DWORD) AS LONG
'typedef BOOL (WINAPI *RASADFUNCW)( LPWSTR, LPWSTR, LPRASADPARAMS, LPDWORD );
'FUNCTION RASADFUNCW (BYVAL DWORD, BYVAL DWORD, BYVAL RASADPARAMS PTR, BYVAL DWORD) AS LONG
'/* A RAS phone book multilinked sub-entry.
'*/
'#define RASSUBENTRYA struct tagRASSUBENTRYA
' // Size = 288 bytes
TYPE RASSUBENTRYA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwfFlags AS DWORD
 szDeviceType AS ASCIIZ * %RAS_MaxDeviceType + 1 ' CHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS ASCIIZ * %RAS_MaxDeviceName + 1 ' CHAR[RAS_MaxDeviceName + 1]
 szLocalPhoneNumber AS ASCIIZ * %RAS_MaxPhoneNumber + 1 ' CHAR[RAS_MaxPhoneNumber + 1]
 dwAlternateOffset AS DWORD
 alignment__(0) AS BYTE
END TYPE
'#define RASSUBENTRYW struct tagRASSUBENTRYW
' // Size = 564 bytes
TYPE RASSUBENTRYW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwfFlags AS DWORD
 szDeviceType AS WSTRINGZ * %RAS_MaxDeviceType + 1 ' WCHAR[RAS_MaxDeviceType + 1]
 szDeviceName AS WSTRINGZ * %RAS_MaxDeviceName + 1 ' WCHAR[RAS_MaxDeviceName + 1]
 szLocalPhoneNumber AS WSTRINGZ * %RAS_MaxPhoneNumber + 1 ' WCHAR[RAS_MaxPhoneNumber + 1]
 dwAlternateOffset AS DWORD
 alignment__(1) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASSUBENTRY = RASSUBENTRYW
#ELSE
 MACRO RASSUBENTRY = RASSUBENTRYA
#ENDIF
'/* Ras{Get,Set}Credentials structure. These calls
'** supercede Ras{Get,Set}EntryDialParams.
'*/
'#define RASCREDENTIALSA struct tagRASCREDENTIALSA
' // Size = 540 bytes
TYPE RASCREDENTIALSA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwMask AS DWORD
 szUserName AS ASCIIZ * %UNLEN + 1 ' CHAR[UNLEN + 1]
 szPassword AS ASCIIZ * %PWLEN + 1 ' CHAR[PWLEN + 1]
 szDomain AS ASCIIZ * %DNLEN + 1 ' CHAR[DNLEN + 1]
 alignment__(1) AS BYTE
END TYPE
'#define RASCREDENTIALSW struct tagRASCREDENTIALSW
' // Size = 1068 bytes
TYPE RASCREDENTIALSW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwMask AS DWORD
 szUserName AS WSTRINGZ * %UNLEN + 1 ' WCHAR[UNLEN]
 szPassword AS WSTRINGZ * %PWLEN + 1 ' WCHAR[PWLEN]
 szDomain AS WSTRINGZ * %DNLEN + 1 ' WCHAR[DNLEN]
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASCREDENTIALS = RASCREDENTIALSW
#ELSE
 MACRO RASCREDENTIALS = RASCREDENTIALSA
#ENDIF
'/* RASCREDENTIALS 'dwMask' values.
'*/
%EQUATE `RASCM_UserName = &H00000001
%EQUATE `RASCM_Password = &H00000002
%EQUATE `RASCM_Domain = &H00000004
#IF (%WINVER >= &H501)
%EQUATE `RASCM_DefaultCreds = &H00000008
%EQUATE `RASCM_PreSharedKey = &H00000010
%EQUATE `RASCM_ServerPreSharedKey = &H00000020
%EQUATE `RASCM_DDMPreSharedKey = &H00000040
#ENDIF
'/* AutoDial address properties.
'*/
'#define RASAUTODIALENTRYA struct tagRASAUTODIALENTRYA
' // Size = 272 bytes
TYPE RASAUTODIALENTRYA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwFlags AS DWORD
 dwDialingLocation AS DWORD
 szEntry AS ASCIIZ * %RAS_MaxEntryName + 1 ' CHAR[RAS_MaxEntryName + 1]
 alignment__(2) AS BYTE
END TYPE
'#define RASAUTODIALENTRYW struct tagRASAUTODIALENTRYW
' // Size = 528 bytes
TYPE RASAUTODIALENTRYW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwFlags AS DWORD
 dwDialingLocation AS DWORD
 szEntry AS WSTRINGZ * %RAS_MaxEntryName + 1 ' WCHAR[RAS_MaxEntryName + 1]
 alignment__(1) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASAUTODIALENTRY = RASAUTODIALENTRYW
#ELSE
 MACRO RASAUTODIALENTRY = RASAUTODIALENTRYA
#ENDIF
'/* AutoDial control parameter values for
'** Ras{Get,Set}AutodialParam.
'*/
%EQUATE `RASADP_DisableConnectionQuery = 0
%EQUATE `RASADP_LoginSessionDisable = 1
%EQUATE `RASADP_SavedAddressesLimit = 2
%EQUATE `RASADP_FailedConnectionTimeout = 3
%EQUATE `RASADP_ConnectionQueryTimeout = 4
#ENDIF ' // (WINVER >= 0x401)
#IF (%WINVER >= &H500)
'/* RasGetEapUserIdentity bit flags.
'** These have the same values as the RAS_EAP_FLAG_ flags in raseapif.h
'*/
%EQUATE `RASEAPF_NonInteractive = &H00000002
%EQUATE `RASEAPF_Logon = &H00000004
%EQUATE `RASEAPF_Preview = &H00000008
'/* RasGetEapUserIdentity structure.
'*/
'#define RASEAPUSERIDENTITYA struct tagRASEAPUSERIDENTITYA
' // Size = 268 bytes
TYPE RASEAPUSERIDENTITYA ' Must be 4 byte aligned
 szUserName AS ASCIIZ * %UNLEN + 1 ' CHAR[UNLEN + 1]
 dwSizeofEapInfo AS DWORD
 alignment1__(2) AS BYTE
 pbEapInfo(0) AS BYTE ' BYTE[1]
 alignment2__(2) AS BYTE
END TYPE
' // Size = 524 bytes
TYPE RASEAPUSERIDENTITYW ' Must be 4 byte aligned
 szUserName AS WSTRINGZ * %UNLEN + 1 ' WCHAR[UNLEN + 1]
 dwSizeofEapInfo AS DWORD
 alignment1__(1) AS BYTE
 pbEapInfo(0) AS BYTE ' BYTE[1]
 alignment2__(2) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO RASEAPUSERIDENTITY = RASEAPUSERIDENTITYW
#ELSE
 MACRO RASEAPUSERIDENTITY = RASEAPUSERIDENTITYA
#ENDIF
'typedef DWORD (WINAPI *PFNRASGETBUFFER) (
' PBYTE *ppBuffer,
' PDWORD pdwSize
' );
'FUNCTION FNRASGETBUFFER ( ' BYVAL ppBuffer AS DWORD, ' BYREF pdwSize AS DWORD ' ) AS DWORD
'typedef DWORD (WINAPI *PFNRASFREEBUFFER) (
' PBYTE pBufer);
'FUNCTION FNRASFREEBUFFER (BYVAL pBufer AS BYTE PTR) AS DWORD
'typedef DWORD (WINAPI *PFNRASSENDBUFFER) (
' HANDLE hPort,
' PBYTE pBuffer,
' DWORD dwSize
' );
'FUNCTION FNRASSENDBUFFER ( ' BYVAL hPort AS DWORD, ' BYVAL pBuffer AS BYTE PTR, ' BYVAL dwSize AS DWORD ' ) AS DWORD
'typedef DWORD (WINAPI *PFNRASRECEIVEBUFFER) (
' HANDLE hPort,
' PBYTE pBuffer,
' PDWORD pdwSize,
' DWORD dwTimeOut,
' HANDLE hEvent
' );
'FUNCTION FNRASRECEIVEBUFFER ( ' BYVAL hPort AS DWORD, ' BYVAL pBuffer AS BYTE PTR, ' BYREF pdwSize AS DWORD, ' BYVAL dwTimeout AS DWORD, ' BYVAL hEvent AS DWORD ' ) AS DWORD
'typedef DWORD (WINAPI *PFNRASRETRIEVEBUFFER) (
' HANDLE hPort,
' PBYTE pBuffer,
' PDWORD pdwSize
' );
'FUNCTION FNRASRETRIEVEBUFFER (
' BYVAL hPort AS DWORD, ' BYVAL pBuffer AS BYTE PTR, ' BYREF pdwSize AS DWORD ' ) AS DWORD
'typedef DWORD (WINAPI *RasCustomScriptExecuteFn) (
' HANDLE hPort,
' LPCWSTR lpszPhonebook,
' LPCWSTR lpszEntryName,
' PFNRASGETBUFFER pfnRasGetBuffer,
' PFNRASFREEBUFFER pfnRasFreeBuffer,
' PFNRASSENDBUFFER pfnRasSendBuffer,
' PFNRASRECEIVEBUFFER pfnRasReceiveBuffer,
' PFNRASRETRIEVEBUFFER pfnRasRetrieveBuffer,
' HWND hWnd,
' RASDIALPARAMS *pRasDialParams,
' PVOID pvReserved
' );
'FUNCTION RasCustomScriptExecuteFn ( ' BYVAL hPort AS DWORD, ' BYREF lpszPhonebook AS WSTRINGZ, ' BYREF lpszEntryName AS WSTRINGZ, ' BYVAL pfnRasGetBuffer AS DWORD, ' BYVAL pfnRasFreeBuffer AS DWORD, ' BYVAL pfnRasSendBuffer AS DWORD, ' BYVAL pfnRasReceiveBuffer AS DWORD, ' BYVAL pfnRasRetrieveBuffer AS DWORD, ' BYVAL hWnd AS DWORD, ' BYREF pRasDialParams AS RASDIALPARAMS, ' BYVAL pvReserved AS DWORD ' ) AS DWORD
#ENDIF ' // (WINVER >= 0x500)
#IF (%WINVER >= &H0501)
'#define RASCOMMSETTINGS struct tagRASCOMMSETTINGS
' // Size = 8 bytes
TYPE RASCOMMSETTINGS ' Must be 4 byte aligned
 dwSize AS DWORD
 bParity AS BYTE ' BYTE
 bStop AS BYTE ' BYTE
 bByteSize AS BYTE ' BYTE
 bAlign AS BYTE ' BYTE
END TYPE
'typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (
' HANDLE hPort,
' RASCOMMSETTINGS *pRasCommSettings,
' PVOID pvReserved
' );
'FUNCTION FNRASSETCOMMSETTINGS ( ' BYVAL hPort AS DWORD, ' BYREF pRasCommSettings AS RASCOMMSETTINGS, ' BYVAL pReserved AS DWORD ' )
'#define RASCUSTOMSCRIPTEXTENSIONS struct tagRASCUSTOMSCRIPTEXTENSIONS
' // Size = 8 bytes
TYPE RASCUSTOMSCRIPTEXTENSIONS ' Must be 4 byte aligned
 dwSize AS DWORD
 pfnRasSetCommSettings AS DWORD
END TYPE
#ENDIF
'/* External RAS API function prototypes.
'*/
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasDialA LIB "RasApi32.dll" ALIAS "RasDialA" (lpRasDialExtensions AS RASDIALEXTENSIONS, lpszPhoneBook AS ASCIIZ, lpRasDialParams AS RASDIALPARAMSA, BYVAL dwNotiferTYPE AS QUAD, lpvNotifier AS ANY, lphRasConn AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasDialA LIB "rasapi32.dll" ALIAS "RasDialA" ( BYREF lpRasDialExtensions AS RASDIALEXTENSIONS , BYREF lpszPhonebook AS ASCIIZ , BYREF lpRasDialParams AS RASDIALPARAMSA , BYVAL dwNotifierType AS QUAD , BYVAL lpvNotifier AS QUAD , BYREF lphRasConn AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasDialW LIB "RasApi32.dll" ALIAS "RasDialW" (lpRasDialExtensions AS RASDIALEXTENSIONS, lpszPhoneBook AS WSTRINGZ, lpRasDialParams AS RASDIALPARAMSW, BYVAL dwNotiferTYPE AS QUAD, lpvNotifier AS ANY, lphRasConn AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasDialW LIB "rasapi32.dll" ALIAS "RasDialW" ( BYREF lpRasDialExtensions AS RASDIALEXTENSIONS , BYREF lpszPhonebook AS WSTRINGZ , BYREF lpRasDialParams AS RASDIALPARAMSW , BYVAL dwNotifierType AS QUAD , BYVAL lpvNotifier AS QUAD , BYREF lphRasConn AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO RasDial = RasDialW
#ELSE
 MACRO RasDial = RasDialA
#ENDIF
DECLARE FUNCTION RasEnumConnectionsA LIB "rasapi32.dll" ALIAS "RasEnumConnectionsA" ( BYREF lprasconn AS RASCONNA , BYREF lpcb AS QUAD , BYREF lpcConnections AS QUAD ) AS QUAD
DECLARE FUNCTION RasEnumConnectionsW LIB "rasapi32.dll" ALIAS "RasEnumConnectionsW" ( BYREF lprasconn AS RASCONNW
 , BYREF lpcb AS DWORD
 , BYREF lpcConnections AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasEnumConnections = RasEnumConnectionsW
#ELSE
 MACRO RasEnumConnections = RasEnumConnectionsA
#ENDIF
DECLARE FUNCTION RasEnumEntriesA LIB "rasapi32.dll" ALIAS "RasEnumEntriesA" ( BYREF reserved AS ASCIIZ , BYREF lpszPhonebook AS ASCIIZ , BYREF lprasentryname AS RASENTRYNAMEA , BYREF lpcb AS QUAD , BYREF lpcEntries AS QUAD ) AS QUAD
DECLARE FUNCTION RasEnumEntriesW LIB "rasapi32.dll" ALIAS "RasEnumEntriesW" ( BYREF reserved AS WSTRINGZ
 , BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lprasentryname AS RASENTRYNAMEW
 , BYREF lpcb AS DWORD
 , BYREF lpcEntries AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasEnumEntries = RasEnumEntriesW
#ELSE
 MACRO RasEnumEntries = RasEnumEntriesA
#ENDIF
DECLARE FUNCTION RasGetConnectStatusA LIB "rasapi32.dll" ALIAS "RasGetConnectStatusA" ( BYVAL hrasconn AS QUAD , BYREF lprasconnstatus AS RASCONNSTATUSA ) AS QUAD
DECLARE FUNCTION RasGetConnectStatusW LIB "rasapi32.dll" ALIAS "RasGetConnectStatusW" ( BYVAL hrasconn AS QUAD
 , BYREF lprasconnstatus AS RASCONNSTATUSW
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetConnectStatus = RasGetConnectStatusW
#ELSE
 MACRO RasGetConnectStatus = RasGetConnectStatusA
#ENDIF
DECLARE FUNCTION RasGetErrorStringA LIB "rasapi32.dll" ALIAS "RasGetErrorStringA" ( BYVAL uErrorValue AS QUAD , BYREF lpszErrorString AS ASCIIZ , BYVAL cBufSize AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetErrorStringW LIB "rasapi32.dll" ALIAS "RasGetErrorStringW" ( BYVAL uErrorValue AS QUAD
 , BYREF lpszErrorString AS WSTRINGZ
 , BYVAL cBufSize AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetErrorString = RasGetErrorStringW
#ELSE
 MACRO RasGetErrorString = RasGetErrorStringA
#ENDIF
DECLARE FUNCTION RasHangUpA LIB "rasapi32.dll" ALIAS "RasHangUpA" ( BYVAL hrasconn AS QUAD ) AS QUAD
DECLARE FUNCTION RasHangUpW LIB "rasapi32.dll" ALIAS "RasHangUpW" ( BYVAL hrasconn AS QUAD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasHangUp = RasHangUpW
#ELSE
 MACRO RasHangUp = RasHangUpA
#ENDIF
DECLARE FUNCTION RasGetProjectionInfoA LIB "rasapi32.dll" ALIAS "RasGetProjectionInfoA" ( BYVAL hrasconn AS QUAD , BYVAL rasprojection AS LONG , BYREF lpprojection AS ANY , BYREF lpcb AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetProjectionInfoW LIB "rasapi32.dll" ALIAS "RasGetProjectionInfoW" ( BYVAL hrasconn AS QUAD
 , BYVAL rasprojection AS LONG
 , BYREF lpprojection AS ANY
 , BYREF lpcb AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetProjectionInfo = RasGetProjectionInfoW
#ELSE
 MACRO RasGetProjectionInfo = RasGetProjectionInfoA
#ENDIF
DECLARE FUNCTION RasCreatePhonebookEntryA LIB "rasapi32.dll" ALIAS "RasCreatePhonebookEntryA" ( BYVAL hwnd AS QUAD , BYREF lpszPhonebook AS ASCIIZ ) AS QUAD
DECLARE FUNCTION RasCreatePhonebookEntryW LIB "rasapi32.dll" ALIAS "RasCreatePhonebookEntryW" ( BYVAL hwnd AS QUAD
 , BYREF lpszPhonebook AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasCreatePhonebookEntry = RasCreatePhonebookEntryW
#ELSE
 MACRO RasCreatePhonebookEntry = RasCreatePhonebookEntryA
#ENDIF
DECLARE FUNCTION RasEditPhonebookEntryA LIB "rasapi32.dll" ALIAS "RasEditPhonebookEntryA" ( BYVAL hwnd AS QUAD , BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntryName AS ASCIIZ ) AS QUAD
DECLARE FUNCTION RasEditPhonebookEntryW LIB "rasapi32.dll" ALIAS "RasEditPhonebookEntryW" ( BYVAL hwnd AS QUAD
 , BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntryName AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasEditPhonebookEntry = RasEditPhonebookEntryW
#ELSE
 MACRO RasEditPhonebookEntry = RasEditPhonebookEntryA
#ENDIF
DECLARE FUNCTION RasSetEntryDialParamsA LIB "rasapi32.dll" ALIAS "RasSetEntryDialParamsA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lprasdialparams AS RASDIALPARAMSA , BYVAL fRemovePassword AS LONG ) AS QUAD
DECLARE FUNCTION RasSetEntryDialParamsW LIB "rasapi32.dll" ALIAS "RasSetEntryDialParamsW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lprasdialparams AS RASDIALPARAMSW
 , BYVAL fRemovePassword AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetEntryDialParams = RasSetEntryDialParamsW
#ELSE
 MACRO RasSetEntryDialParams = RasSetEntryDialParamsA
#ENDIF
DECLARE FUNCTION RasGetEntryDialParamsA LIB "rasapi32.dll" ALIAS "RasGetEntryDialParamsA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lprasdialparams AS RASDIALPARAMSA , BYREF lpfPassword AS LONG ) AS QUAD
DECLARE FUNCTION RasGetEntryDialParamsW LIB "rasapi32.dll" ALIAS "RasGetEntryDialParamsW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lprasdialparams AS RASDIALPARAMSW
 , BYREF lpfPassword AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetEntryDialParams = RasGetEntryDialParamsW
#ELSE
 MACRO RasGetEntryDialParams = RasGetEntryDialParamsA
#ENDIF
DECLARE FUNCTION RasEnumDevicesA LIB "rasapi32.dll" ALIAS "RasEnumDevicesA" ( BYREF lpRasDevInfo AS RASDEVINFOA , BYREF lpcb AS QUAD , BYREF lpcDevices AS QUAD ) AS QUAD
DECLARE FUNCTION RasEnumDevicesW LIB "rasapi32.dll" ALIAS "RasEnumDevicesW" ( BYREF lpRasDevInfo AS RASDEVINFOW
 , BYREF lpcb AS DWORD
 , BYREF lpcDevices AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasEnumDevices = RasEnumDevicesW
#ELSE
 MACRO RasEnumDevices = RasEnumDevicesA
#ENDIF
DECLARE FUNCTION RasGetCountryInfoA LIB "rasapi32.dll" ALIAS "RasGetCountryInfoA" ( BYREF lpRasCtryInfo AS RASCTRYINFOA , BYREF lpdwSize AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetCountryInfoW LIB "rasapi32.dll" ALIAS "RasGetCountryInfoW" ( BYREF lpRasCtryInfo AS RASCTRYINFOW
 , BYREF lpdwSize AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetCountryInfo = RasGetCountryInfoW
#ELSE
 MACRO RasGetCountryInfo = RasGetCountryInfoA
#ENDIF
DECLARE FUNCTION RasGetEntryPropertiesA LIB "rasapi32.dll" ALIAS "RasGetEntryPropertiesA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpRasEntry AS RASENTRYA , BYREF lpdwEntryInfoSize AS QUAD , OPTIONAL BYVAL lpbDeviceInfo AS BYTE PTR , OPTIONAL BYREF lpdwDeviceInfoSize AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetEntryPropertiesW LIB "rasapi32.dll" ALIAS "RasGetEntryPropertiesW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpRasEntry AS RASENTRYW
 , BYREF lpdwEntryInfoSize AS DWORD
 , OPTIONAL BYVAL lpbDeviceInfo AS BYTE PTR
 , OPTIONAL BYREF lpdwDeviceInfoSize AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetEntryProperties = RasGetEntryPropertiesW
#ELSE
 MACRO RasGetEntryProperties = RasGetEntryPropertiesA
#ENDIF
DECLARE FUNCTION RasSetEntryPropertiesA LIB "rasapi32.dll" ALIAS "RasSetEntryPropertiesA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpRasEntry AS RASENTRYA , BYVAL dwEntryInfoSize AS QUAD , BYVAL lpbDeviceInfo AS BYTE PTR , BYVAL dwDeviceInfoSize AS QUAD ) AS QUAD
DECLARE FUNCTION RasSetEntryPropertiesW LIB "rasapi32.dll" ALIAS "RasSetEntryPropertiesW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpRasEntry AS RASENTRYW
 , BYVAL dwEntryInfoSize AS DWORD
 , BYVAL lpbDeviceInfo AS BYTE PTR
 , BYVAL dwDeviceInfoSize AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetEntryProperties = RasSetEntryPropertiesW
#ELSE
 MACRO RasSetEntryProperties = RasSetEntryPropertiesA
#ENDIF
DECLARE FUNCTION RasRenameEntryA LIB "rasapi32.dll" ALIAS "RasRenameEntryA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszOldEntry AS ASCIIZ , BYREF lpszNewEntry AS ASCIIZ ) AS QUAD
DECLARE FUNCTION RasRenameEntryW LIB "rasapi32.dll" ALIAS "RasRenameEntryW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszOldEntry AS WSTRINGZ
 , BYREF lpszNewEntry AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasRenameEntry = RasRenameEntryW
#ELSE
 MACRO RasRenameEntry = RasRenameEntryA
#ENDIF
DECLARE FUNCTION RasDeleteEntryA LIB "rasapi32.dll" ALIAS "RasDeleteEntryA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ ) AS QUAD
DECLARE FUNCTION RasDeleteEntryW LIB "rasapi32.dll" ALIAS "RasDeleteEntryW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasDeleteEntry = RasDeleteEntryW
#ELSE
 MACRO RasDeleteEntry = RasDeleteEntryA
#ENDIF
DECLARE FUNCTION RasValidateEntryNameA LIB "rasapi32.dll" ALIAS "RasValidateEntryNameA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ ) AS QUAD
DECLARE FUNCTION RasValidateEntryNameW LIB "rasapi32.dll" ALIAS "RasValidateEntryNameW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasValidateEntryName = RasValidateEntryNameW
#ELSE
 MACRO RasValidateEntryName = RasValidateEntryNameA
#ENDIF
DECLARE FUNCTION RasConnectionNotificationA LIB "rasapi32.dll" ALIAS "RasConnectionNotificationA" ( BYVAL hrasconn AS QUAD , BYVAL hEvent AS QUAD , BYVAL dwFlags AS QUAD ) AS QUAD
DECLARE FUNCTION RasConnectionNotificationW LIB "rasapi32.dll" ALIAS "RasConnectionNotificationW" ( BYVAL hrasconn AS QUAD
 , BYVAL hEvent AS DWORD
 , BYVAL dwFlags AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasConnectionNotification = RasConnectionNotificationW
#ELSE
 MACRO RasConnectionNotification = RasConnectionNotificationA
#ENDIF
#IF (%WINVER >= &H401)
DECLARE FUNCTION RasGetSubEntryHandleA LIB "rasapi32.dll" ALIAS "RasGetSubEntryHandleA" ( BYVAL hRasConn AS QUAD , BYVAL dwSubEntry AS QUAD , BYREF lphRasConn AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetSubEntryHandleW LIB "rasapi32.dll" ALIAS "RasGetSubEntryHandleW" ( BYVAL hRasConn AS QUAD
 , BYVAL dwSubEntry AS DWORD
 , BYREF lphRasConn AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetSubEntryHandle = RasGetSubEntryHandleW
#ELSE
 MACRO RasGetSubEntryHandle = RasGetSubEntryHandleA
#ENDIF
DECLARE FUNCTION RasGetCredentialsA LIB "rasapi32.dll" ALIAS "RasGetCredentialsA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpCredentials AS RASCREDENTIALSA ) AS QUAD
DECLARE FUNCTION RasGetCredentialsW LIB "rasapi32.dll" ALIAS "RasGetCredentialsW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpCredentials AS RASCREDENTIALSW
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetCredentials = RasGetCredentialsW
#ELSE
 MACRO RasGetCredentials = RasGetCredentialsA
#ENDIF
DECLARE FUNCTION RasSetCredentialsA LIB "rasapi32.dll" ALIAS "RasSetCredentialsA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpCredentials AS RASCREDENTIALSA , BYVAL fClearCredentials AS LONG ) AS QUAD
DECLARE FUNCTION RasSetCredentialsW LIB "rasapi32.dll" ALIAS "RasSetCredentialsW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpCredentials AS RASCREDENTIALSW
 , BYVAL fClearCredentials AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetCredentials = RasSetCredentialsW
#ELSE
 MACRO RasSetCredentials = RasSetCredentialsA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasGetSubEntryPropertiesA LIB "RasApi32.dll" ALIAS "RasGetSubEntryPropertiesA" (lpszPhonebook AS ASCIIZ, lpszEntry AS ASCIIZ, BYVAL dwSubEntry AS QUAD, lpRasSubEntry AS RASSUBENTRYA, lpdwcb AS QUAD, lpbDeviceConfig AS BYTE, pd2 AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasGetSubEntryPropertiesA LIB "rasapi32.dll" ALIAS "RasGetSubEntryPropertiesA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYVAL dwSubEntry AS QUAD , BYREF lpRasSubEntry AS RASSUBENTRYA , BYREF lpdwcb AS QUAD , OPTIONAL BYVAL lpbDeviceConfig AS BYTE PTR , OPTIONAL BYREF lpcbDeviceConfig AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasGetSubEntryPropertiesW LIB "RasApi32.dll" ALIAS "RasGetSubEntryPropertiesW" (lpszPhonebook AS WSTRINGZ, lpszEntry AS WSTRINGZ, BYVAL dwSubEntry AS QUAD, lpRasSubEntry AS RASSUBENTRYW, lpdwcb AS QUAD, lpbDeviceConfig AS BYTE, pd2 AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasGetSubEntryPropertiesW LIB "rasapi32.dll" ALIAS "RasGetSubEntryPropertiesW" ( BYREF lpszPhonebook AS WSTRINGZ , BYREF lpszEntry AS WSTRINGZ , BYVAL dwSubEntry AS QUAD , BYREF lpRasSubEntry AS RASSUBENTRYW , BYREF lpdwcb AS QUAD , OPTIONAL BYVAL lpbDeviceConfig AS BYTE PTR , OPTIONAL BYREF lpcbDeviceConfig AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO RasGetSubEntryProperties = RasGetSubEntryPropertiesW
#ELSE
 MACRO RasGetSubEntryProperties = RasGetSubEntryPropertiesA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasSetSubEntryPropertiesA LIB "RasApi32.dll" ALIAS "RasSetSubEntryPropertiesA" (lpszPhonebook AS ASCIIZ, lpszEntry AS ASCIIZ, BYVAL dwSubEntry AS QUAD, lpRasSubEntry AS RASSUBENTRYA, BYVAL d1 AS QUAD, lpbDeviceConfig AS BYTE, BYVAL lpcbDeviceConfig AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasSetSubEntryPropertiesA LIB "rasapi32.dll" ALIAS "RasSetSubEntryPropertiesA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYVAL dwSubEntry AS QUAD , BYREF lpRasSubEntry AS RASSUBENTRYA , BYVAL dwcbRasSubEntry AS QUAD , BYVAL lpbDeviceConfig AS BYTE PTR , BYVAL dwcbDeviceConfig AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasSetSubEntryPropertiesW LIB "RasApi32.dll" ALIAS "RasSetSubEntryPropertiesW" (lpszPhonebook AS WSTRINGZ, lpszEntry AS WSTRINGZ, BYVAL dwSubEntry AS QUAD, lpRasSubEntry AS RASSUBENTRYW, BYVAL d1 AS QUAD, lpbDeviceConfig AS BYTE, BYVAL lpcbDeviceConfig AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasSetSubEntryPropertiesW LIB "rasapi32.dll" ALIAS "RasSetSubEntryPropertiesW" ( BYREF lpszPhonebook AS WSTRINGZ , BYREF lpszEntry AS WSTRINGZ , BYVAL dwSubEntry AS QUAD , BYREF lpRasSubEntry AS RASSUBENTRYW , BYVAL dwcbRasSubEntry AS QUAD , BYVAL lpbDeviceConfig AS BYTE PTR , BYVAL dwcbDeviceConfig AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO RasSetSubEntryProperties = RasSetSubEntryPropertiesW
#ELSE
 MACRO RasSetSubEntryProperties = RasSetSubEntryPropertiesA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasGetAutodialAddressA LIB "RasApi32.dll" ALIAS "RasGetAutodialAddressA" (lpszAddress AS ASCIIZ, lpdwReserved AS QUAD, BYVAL lpAutoDialEntries AS RASAUTODIALENTRYA PTR, lpdwcbAutoDialEntries AS QUAD, lpdwcAutoDialEntries AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasGetAutodialAddressA LIB "rasapi32.dll" ALIAS "RasGetAutodialAddressA" ( BYREF lpszAddress AS ASCIIZ , BYVAL lpdwReserved AS QUAD , BYREF lpAutoDialEntries AS RASAUTODIALENTRYA , BYREF lpdwcbAutoDialEntries AS QUAD , BYREF lpdwcAutoDialEntries AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasGetAutodialAddressW LIB "RasApi32.dll" ALIAS "RasGetAutodialAddressW" (lpszAddress AS WSTRINGZ, lpdwReserved AS QUAD, BYVAL lpAutoDialEntries AS RASAUTODIALENTRYW PTR, lpdwcbAutoDialEntries AS QUAD, lpdwcAutoDialEntries AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasGetAutodialAddressW LIB "rasapi32.dll" ALIAS "RasGetAutodialAddressW" ( BYREF lpszAddress AS WSTRINGZ , BYVAL lpdwReserved AS QUAD , BYREF lpAutoDialEntries AS RASAUTODIALENTRYW , BYREF lpdwcbAutoDialEntries AS QUAD , BYREF lpdwcAutoDialEntries AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO RasGetAutodialAddress = RasGetAutodialAddressW
#ELSE
 MACRO RasGetAutodialAddress = RasGetAutodialAddressA
#ENDIF
#IF %DEF(%USEPBDECL)
#ELSE
DECLARE FUNCTION RasSetAutodialAddressA LIB "rasapi32.dll" ALIAS "RasSetAutodialAddressA" ( BYREF lpszAddress AS ASCIIZ , BYVAL dwReserved AS QUAD , BYREF lpAutoDialEntries AS RASAUTODIALENTRYA , BYVAL dwcbAutoDialEntries AS QUAD , BYVAL dwcAutoDialEntries AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RasSetAutodialAddressW LIB "RasApi32.dll" ALIAS "RasSetAutodialAddressW" (lpszAddress AS WSTRINGZ, BYVAL dwReserved AS QUAD, BYVAL lpAutoDialEntries AS RASAUTODIALENTRYW PTR, BYVAL dwcbAutoDialEntries AS QUAD, BYVAL dwcAutoDialEntries AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION RasSetAutodialAddressW LIB "rasapi32.dll" ALIAS "RasSetAutodialAddressW" ( BYREF lpszAddress AS WSTRINGZ , BYVAL dwReserved AS QUAD , BYREF lpAutoDialEntries AS RASAUTODIALENTRYW , BYVAL dwcbAutoDialEntries AS QUAD , BYVAL dwcAutoDialEntries AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO RasSetAutodialAddress = RasSetAutodialAddressW
#ELSE
 MACRO RasSetAutodialAddress = RasSetAutodialAddressA
#ENDIF
DECLARE FUNCTION RasEnumAutodialAddressesA LIB "rasapi32.dll" ALIAS "RasEnumAutodialAddressesA" ( BYREF lppAddresses AS ANY , BYREF lpdwcbAddresses AS QUAD , BYREF lpdwcAddresses AS QUAD ) AS QUAD
DECLARE FUNCTION RasEnumAutodialAddressesW LIB "rasapi32.dll" ALIAS "RasEnumAutodialAddressesW" ( BYREF lppAddresses AS ANY
 , BYREF lpdwcbAddresses AS DWORD
 , BYREF lpdwcAddresses AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasEnumAutodialAddresses = RasEnumAutodialAddressesW
#ELSE
 MACRO RasEnumAutodialAddresses = RasEnumAutodialAddressesA
#ENDIF
DECLARE FUNCTION RasGetAutodialEnableA LIB "rasapi32.dll" ALIAS "RasGetAutodialEnableA" ( BYVAL dwDialingLocation AS QUAD , BYREF lpfEnabled AS LONG ) AS QUAD
DECLARE FUNCTION RasGetAutodialEnableW LIB "rasapi32.dll" ALIAS "RasGetAutodialEnableW" ( BYVAL dwDialingLocation AS QUAD
 , BYREF lpfEnabled AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetAutodialEnable = RasGetAutodialEnableW
#ELSE
 MACRO RasGetAutodialEnable = RasGetAutodialEnableA
#ENDIF
DECLARE FUNCTION RasSetAutodialEnableA LIB "rasapi32.dll" ALIAS "RasSetAutodialEnableA" ( BYVAL dwDialingLocation AS QUAD , BYVAL fEnabled AS LONG ) AS QUAD
DECLARE FUNCTION RasSetAutodialEnableW LIB "rasapi32.dll" ALIAS "RasSetAutodialEnableW" ( BYVAL dwDialingLocation AS QUAD
 , BYVAL fEnabled AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetAutodialEnable = RasSetAutodialEnableW
#ELSE
 MACRO RasSetAutodialEnable = RasSetAutodialEnableA
#ENDIF
DECLARE FUNCTION RasGetAutodialParamA LIB "rasapi32.dll" ALIAS "RasGetAutodialParamA" ( BYVAL dwKey AS QUAD , BYREF lpvValue AS ANY , BYREF lpdwcbValue AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetAutodialParamW LIB "rasapi32.dll" ALIAS "RasGetAutodialParamW" ( BYVAL dwKey AS QUAD
 , BYREF lpvValue AS ANY
 , BYREF lpdwcbValue AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetAutodialParam = RasGetAutodialParamW
#ELSE
 MACRO RasGetAutodialParam = RasGetAutodialParamA
#ENDIF
DECLARE FUNCTION RasSetAutodialParamA LIB "rasapi32.dll" ALIAS "RasSetAutodialParamA" ( BYVAL dwKey AS QUAD , BYREF lpvValue AS ANY , BYVAL dwcbValue AS QUAD ) AS QUAD
DECLARE FUNCTION RasSetAutodialParamW LIB "rasapi32.dll" ALIAS "RasSetAutodialParamW" ( BYVAL dwKey AS QUAD
 , BYREF lpvValue AS ANY
 , BYVAL dwcbValue AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetAutodialParam = RasSetAutodialParamW
#ELSE
 MACRO RasSetAutodialParam = RasSetAutodialParamA
#ENDIF
#ENDIF
#IF (%WINVER >= &H500)
' // Size = 60 bytes
TYPE RAS_STATS ' Must be 4 byte aligned
 dwSize AS DWORD
 dwBytesXmited AS DWORD
 dwBytesRcved AS DWORD
 dwFramesXmited AS DWORD
 dwFramesRcved AS DWORD
 dwCrcErr AS DWORD
 dwTimeoutErr AS DWORD
 dwAlignmentErr AS DWORD
 dwHardwareOverrunErr AS DWORD
 dwFramingErr AS DWORD
 dwBufferOverrunErr AS DWORD
 dwCompressionRatioIn AS DWORD
 dwCompressionRatioOut AS DWORD
 dwBps AS DWORD
 dwConnectDuration AS DWORD
END TYPE
'typedef DWORD (WINAPI *RasCustomHangUpFn) (
' HRASCONN hRasConn
' );
'FUNCTION RasCustomHangUp ( ' BYVAL hRasConn AS DWORD, ' HRASCONN hRasConn
' ) AS DWORD
'typedef DWORD (WINAPI *RasCustomDialFn) (
' HINSTANCE hInstDll,
' LPRASDIALEXTENSIONS lpRasDialExtensions,
' LPCWSTR lpszPhonebook,
' LPRASDIALPARAMS lpRasDialParams,
' DWORD dwNotifierType,
' LPVOID lpvNotifier,
' LPHRASCONN lphRasConn,
' DWORD dwFlags
' );
'FUNCTION RasCustomDial ( ' BYVAL hInstDll AS DWORD, ' HINSTANCE hInstDll
' BYREF lpRasDialExtensions AS RASDIALEXTENSIONS, ' LPRASDIALEXTENSIONS lpRasDialExtensions
' BYREF lpszPhonebook AS WSTRINGZ, ' LPCWSTR lpszPhonebook
' BYREF lpRasDialParams AS RASDIALPARAMS, ' LPRASDIALPARAMS lpRasDialParams
' BYVAL dwNotifierType AS DWORD, ' DWORD dwNotifierType
' BYVAL lpvNotifier AS DWORD, ' LPVOID lpvNotifier
' BYREF lphRasConn AS DWORD, ' LPHRASCONN lphRasConn
' BYVAL dwFlags AS DWORD ' DWORD dwFlags
' ) AS DWORD
'typedef DWORD (WINAPI *RasCustomDeleteEntryNotifyFn) (
' LPCWSTR lpszPhonebook,
' LPCWSTR lpszEntry,
' DWORD dwFlags);
'FUNCTION RasCustomDeleteEntryNotify ( ' BYREF lpszPhonebook AS WSTRINGZ, ' LPCWSTR lpszPhonebook
' BYREF lpszEntry AS WSTRINGZ, ' LPCWSTR lpszEntry
' BYVAL dwFlagsAS DWORD ' DWORD dwFlags)
' ) AS DWORD
%EQUATE `RCD_SingleUser = 0
%EQUATE `RCD_AllUsers = &H00000001
%EQUATE `RCD_Eap = &H00000002
%EQUATE `RCD_Logon = &H00000004
DECLARE FUNCTION RasInvokeEapUI LIB "rasapi32.dll" ALIAS "RasInvokeEapUI" ( BYVAL hRasConn AS QUAD , BYVAL dwSubEntry AS QUAD , BYREF lpExtensions AS RASDIALEXTENSIONS , BYVAL hwnd AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetLinkStatistics LIB "rasapi32.dll" ALIAS "RasGetLinkStatistics" ( BYVAL hRasConn AS QUAD
 , BYVAL dwSubEntry AS DWORD
 , BYREF lpStatistics AS RAS_STATS
 ) AS DWORD
DECLARE FUNCTION RasGetConnectionStatistics LIB "rasapi32.dll" ALIAS "RasGetConnectionStatistics" ( BYVAL hRasConn AS DWORD
 , BYREF lpStatistics AS RAS_STATS
 ) AS DWORD
DECLARE FUNCTION RasClearLinkStatistics LIB "rasapi32.dll" ALIAS "RasClearLinkStatistics" ( BYVAL hRasConn AS DWORD
 , BYVAL dwSubEntry AS DWORD
 ) AS DWORD
DECLARE FUNCTION RasClearConnectionStatistics LIB "rasapi32.dll" ALIAS "RasClearConnectionStatistics" ( BYVAL hRasConn AS DWORD
 ) AS DWORD
DECLARE FUNCTION RasGetEapUserDataA LIB "rasapi32.dll" ALIAS "RasGetEapUserDataA" ( BYVAL hToken AS DWORD
 , BYREF pszPhonebook AS ASCIIZ
 , BYREF pszEntry AS ASCIIZ
 , BYVAL pbEapData AS BYTE PTR
 , BYREF pdwSizeofEapData AS DWORD
 ) AS DWORD
DECLARE FUNCTION RasGetEapUserDataW LIB "rasapi32.dll" ALIAS "RasGetEapUserDataW" ( BYVAL hToken AS DWORD
 , BYREF pszPhonebook AS WSTRINGZ
 , BYREF pszEntry AS WSTRINGZ
 , BYVAL pbEapData AS BYTE PTR
 , BYREF pdwSizeofEapData AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetEapUserData = RasGetEapUserDataW
#ELSE
 MACRO RasGetEapUserData = RasGetEapUserDataA
#ENDIF
DECLARE FUNCTION RasSetEapUserDataA LIB "rasapi32.dll" ALIAS "RasSetEapUserDataA" ( BYVAL hToken AS QUAD , BYREF pszPhonebook AS ASCIIZ , BYREF pszEntry AS ASCIIZ , BYVAL pbEapData AS BYTE PTR , BYVAL dwSizeofEapData AS QUAD ) AS QUAD
DECLARE FUNCTION RasSetEapUserDataW LIB "rasapi32.dll" ALIAS "RasSetEapUserDataW" ( BYVAL hToken AS QUAD
 , BYREF pszPhonebook AS WSTRINGZ
 , BYREF pszEntry AS WSTRINGZ
 , BYVAL pbEapData AS BYTE PTR
 , BYVAL dwSizeofEapData AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetEapUserData = RasSetEapUserDataW
#ELSE
 MACRO RasSetEapUserData = RasSetEapUserDataA
#ENDIF
DECLARE FUNCTION RasGetCustomAuthDataA LIB "rasapi32.dll" ALIAS "RasGetCustomAuthDataA" ( BYREF pszPhonebook AS ASCIIZ , BYREF pszEntry AS ASCIIZ , BYVAL pbCustomAuthData AS BYTE PTR , BYREF pdwSizeofCustomAuthData AS QUAD ) AS QUAD
DECLARE FUNCTION RasGetCustomAuthDataW LIB "rasapi32.dll" ALIAS "RasGetCustomAuthDataW" ( BYREF pszPhonebook AS WSTRINGZ
 , BYREF pszEntry AS WSTRINGZ
 , BYVAL pbCustomAuthData AS BYTE PTR
 , BYREF pdwSizeofCustomAuthData AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetCustomAuthData = RasGetCustomAuthDataW
#ELSE
 MACRO RasGetCustomAuthData = RasGetCustomAuthDataA
#ENDIF
DECLARE FUNCTION RasSetCustomAuthDataA LIB "rasapi32.dll" ALIAS "RasSetCustomAuthDataA" ( BYREF pszPhonebook AS ASCIIZ , BYREF pszEntry AS ASCIIZ , BYVAL pbCustomAuthData AS BYTE PTR , BYVAL dwSizeofCustomAuthData AS QUAD ) AS QUAD
DECLARE FUNCTION RasSetCustomAuthDataW LIB "rasapi32.dll" ALIAS "RasSetCustomAuthDataW" ( BYREF pszPhonebook AS WSTRINGZ
 , BYREF pszEntry AS WSTRINGZ
 , BYVAL pbCustomAuthData AS BYTE PTR
 , BYVAL dwSizeofCustomAuthData AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasSetCustomAuthData = RasSetCustomAuthDataW
#ELSE
 MACRO RasSetCustomAuthData = RasSetCustomAuthDataA
#ENDIF
DECLARE FUNCTION RasGetEapUserIdentityW LIB "rasapi32.dll" ALIAS "RasGetEapUserIdentityW" ( BYREF pszPhonebook AS WSTRINGZ , BYREF pszEntry AS WSTRINGZ , BYVAL dwFlags AS QUAD , BYVAL hwnd AS QUAD , BYREF ppRasEapUserIdentity AS ANY ) AS QUAD
DECLARE FUNCTION RasGetEapUserIdentityA LIB "rasapi32.dll" ALIAS "RasGetEapUserIdentityA" ( BYREF pszPhonebook AS ASCIIZ
 , BYREF pszEntry AS ASCIIZ
 , BYVAL dwFlags AS DWORD
 , BYVAL hwnd AS DWORD
 , BYREF ppRasEapUserIdentity AS ANY
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasGetEapUserIdentity = RasGetEapUserIdentityW
#ELSE
 MACRO RasGetEapUserIdentity = RasGetEapUserIdentityA
#ENDIF
DECLARE SUB RasFreeEapUserIdentityW LIB "rasapi32.dll" ALIAS "RasFreeEapUserIdentityW" ( BYREF pRasEapUserIdentity AS RASEAPUSERIDENTITYW )
DECLARE SUB RasFreeEapUserIdentityA LIB "rasapi32.dll" ALIAS "RasFreeEapUserIdentityA" ( BYREF pRasEapUserIdentity AS RASEAPUSERIDENTITYA )
#IF %DEF(%UNICODE)
 MACRO RasFreeEapUserIdentity = RasFreeEapUserIdentityW
#ELSE
 MACRO RasFreeEapUserIdentity = RasFreeEapUserIdentityA
#ENDIF
#ENDIF
#IF (%WINVER >= &H501)
DECLARE FUNCTION RasDeleteSubEntryA LIB "rasapi32.dll" ALIAS "RasDeleteSubEntryA" ( BYREF pszPhonebook AS ASCIIZ , BYREF pszEntry AS ASCIIZ , BYVAL dwSubentryId AS QUAD ) AS QUAD
DECLARE FUNCTION RasDeleteSubEntryW LIB "rasapi32.dll" ALIAS "RasDeleteSubEntryW" ( BYREF pszPhonebook AS WSTRINGZ
 , BYREF pszEntry AS WSTRINGZ
 , BYVAL dwSubentryId AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RasDeleteSubEntry = RasDeleteSubEntryW
#ELSE
 MACRO RasDeleteSubEntry = RasDeleteSubEntryA
#ENDIF
#ENDIF
' // To use Quarantine APIs, applications should explicitly
' // define USES_RAS_QUARANTINE_APIS.
#IF %DEF(%USES_RAS_QUARANTINE_APIS)
DECLARE FUNCTION RasGetNapStatus LIB "rasapi32.dll" ALIAS "RasGetNapStatus" ( BYVAL hRasConn AS QUAD , BYREF pNapState AS RASNAPSTATE ) AS QUAD
#ENDIF ' %USES_RAS_QUARANTINE_APIS
#IF (%WINVER >= &H601)
'/* Update an active RAS connection.Localendpoint if specified is used for performing
'/ mobike update.If not specified then dwIfIndex value is used for performing mobike.
'/ (See RasUpdateConnection)
'*/
' // Size = 56 bytes
TYPE RASUPDATECONN ' Must be 4 byte aligned
 version AS LONG ' RASAPIVERSION
 dwSize AS DWORD
 dwFlags AS DWORD
 dwIfIndex AS DWORD
 localEndPoint AS RASTUNNELENDPOINT
 remoteEndPoint AS RASTUNNELENDPOINT
END TYPE
DECLARE FUNCTION RasUpdateConnection LIB "rasapi32.dll" ALIAS "RasUpdateConnection" ( BYVAL hrasconn AS QUAD , BYREF lprasupdateconn AS RASUPDATECONN ) AS QUAD
'/* Ras Projection information for PPP or IKEv2
'*/
DECLARE FUNCTION RasGetProjectionInfoEx LIB "rasapi32.dll" ALIAS "RasGetProjectionInfoEx" ( BYVAL hrasconn AS QUAD , BYREF pRasProjection AS RAS_PROJECTION_INFO , BYREF lpdwSize AS QUAD ) AS QUAD
#ENDIF
#ENDIF
