' ########################################################################################
' Microsoft Windows
' File: Mprapi.inc
' Copyright (c) 2011 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_Mprapi_PBI)
#DEFINE PBX_Mprapi_PBI
%EQUATE `MPRAPI_INC = 1
'/*++
'Copyright (c) Microsoft Corporation. All rights reserved.
'Module Name:
' mpradmin.h
'Abstract:
' This file contains the structures, defines and function prototypes for the
' following APIs:
' MprAdminIsServiceRunning
' MprAdminServerConnect
' MprAdminServerDisconnect
' MprAdminBufferFree
' MprAdminPortEnum
' MprAdminConnectionEnum
' MprAdminPortGetInfo
' MprAdminConnectionGetInfo
' MprAdminPortClearStats
' MprAdminPortReset
' MprAdminConnectionClearStats
' MprAdminPortDisconnect
' MprAdminGetErrorString
' MprAdminAcceptNewConnection
' MprAdminAcceptNewLink
' MprAdminConnectionHangupNotification
' MprAdminLinkHangupNotification
' MprAdminGetIpAddressForUser
' MprAdminReleaseIpAddress
' MprAdminInitializeDll
' MprAdminTerminateDll
' MprAdminAcceptNewConnection2
' MprAdminConnectionHangupNotification2
' MprAdminAcceptReauthentication
' MprAdminUserGetInfo
' MprAdminUserSetInfo
' MprAdminSendUserMessage
' MprAdminGetPDCServer
' MprAdminRegisterConnectionNotification
' MprAdminDeregisterConnectionNotification
' MprAdminIsServiceRunning
' MprAdminServerConnect
' MprAdminServerDisconnect
' MprAdminBufferFree
' MprAdminServerSetInfo
' MprAdminServerGetInfo
' MprAdminGetErrorString
' MprAdminTransportCreate
' MprAdminTransportSetInfo
' MprAdminTransportGetInfo
' MprAdminInterfaceCreate
' MprAdminInterfaceDelete
' MprAdminInterfaceGetInfo
' MprAdminInterfaceTransportAdd
' MprAdminInterfaceTransportGetInfo
' MprAdminInterfaceTransportSetInfo
' MprAdminInterfaceTransportRemove
' MprAdminInterfaceGetHandle
' MprAdminInterfaceSetCredentials
' MprAdminInterfaceGetCredentials
' MprAdminInterfaceEnum
' MprAdminInterfaceConnect
' MprAdminInterfaceDisconnect
' MprAdminInterfaceUpdateRoutes
' MprAdminInterfaceQueryUpdateResult
' MprAdminInterfaceUpdatePhonebookInfo
' MprAdminEstablishDomainRasServer
' MprAdminIsDomainRasServer
' MprAdminMIBServerConnect
' MprAdminMIBServerDisconnect
' MprAdminMIBBufferFree
' MprAdminMIBEntryCreate
' MprAdminMIBEntryDelete
' MprAdminMIBEntryGet
' MprAdminMIBEntrySet
' MprAdminMIBEntryGetFirst
' MprAdminMIBEntryGetNext
' MprAdminMIBSetTrapInfo
' MprAdminMIBGetTrapInfo
' All MIB APIs operate with the conceptual MIB row.
' MprConfigServerConnect
' MprConfigServerDisconnect
' MprConfigBufferFree
' MprConfigServerSetInfo
' MprConfigServerGetInfo
' MprConfigServerBackup
' MprConfigServerRestore
' MprConfigTransportCreate
' MprConfigTransportDelete
' MprConfigTransportGetHandle
' MprConfigTransportSetInfo
' MprConfigTransportGetInfo
' MprConfigTransportEnum
' MprConfigInterfaceCreate
' MprConfigInterfaceDelete
' MprConfigInterfaceGetHandle
' MprConfigInterfaceGetInfo
' MprConfigInterfaceEnum
' MprConfigInterfaceTransportAdd
' MprConfigInterfaceTransportRemove
' MprConfigInterfaceTransportGetHandle
' MprConfigInterfaceTransportGetInfo
' MprConfigInterfaceTransportSetInfo
' MprConfigInterfaceTransportEnum
' MprConfigFilterGetInfo
' MprConfigFilterSetInfo
' MprSetupIpInIpInterfaceFriendlyNameEnum
' MprSetupIpInIpInterfaceFriendlyNameFree
' MprSetupIpInIpInterfaceFriendlyNameCreate
' MprSetupIpInIpInterfaceFriendlyNameDelete
'--*/
#INCLUDE ONCE "Legacy/Platform/LMCons.inc"
#INCLUDE ONCE "Legacy/System/Ras.inc"
#INCLUDE ONCE "Legacy/System/in6addr.inc"
#INCLUDE ONCE "Legacy/System/MprError.inc"
#INCLUDE ONCE "Legacy/Platform/WinCrypt.inc"
'//
'// Name of the Routing and RemoteAccess Service
'//
$RRAS_SERVICE_NAME = "RemoteAccess"
'//
'// Protocol IDs
'//
%EQUATE `PID_IPX = &H0000002B
%EQUATE `PID_IP = &H00000021
%EQUATE `PID_IPV6 = &H00000057
%EQUATE `PID_NBF = &H0000003F
%EQUATE `PID_ATALK = &H00000029
%EQUATE `MAX_INTERFACE_NAME_LEN = 256
%EQUATE `MAX_TRANSPORT_NAME_LEN = 40
%EQUATE `MAX_MEDIA_NAME = 16
%EQUATE `MAX_PORT_NAME = 16
%EQUATE `MAX_DEVICE_NAME = 128
%EQUATE `MAX_PHONE_NUMBER_LEN = 128
%EQUATE `MAX_DEVICETYPE_NAME = 16
'//
'// MPR Interface structures and definitions.
'//
'//
'// MPR Interface types
'//
' ROUTER_INTERFACE_TYPE enum
%EQUATE `ROUTER_IF_TYPE_CLIENT = 0
%EQUATE `ROUTER_IF_TYPE_HOME_ROUTER = 1
%EQUATE `ROUTER_IF_TYPE_FULL_ROUTER = 2
%EQUATE `ROUTER_IF_TYPE_DEDICATED = 3
%EQUATE `ROUTER_IF_TYPE_INTERNAL = 4
%EQUATE `ROUTER_IF_TYPE_LOOPBACK = 5
%EQUATE `ROUTER_IF_TYPE_TUNNEL1 = 6
%EQUATE `ROUTER_IF_TYPE_DIALOUT = 7
'%ROUTER_IF_TYPE_MAX = 7 ' // do not use.Illegal
' ROUTER_CONNECTION_STATE enum
%EQUATE `ROUTER_IF_STATE_UNREACHABLE = 0
%EQUATE `ROUTER_IF_STATE_DISCONNECTED = 1
%EQUATE `ROUTER_IF_STATE_CONNECTING = 2
%EQUATE `ROUTER_IF_STATE_CONNECTED = 3
%EQUATE `MPR_INTERFACE_OUT_OF_RESOURCES = &H00000001
%EQUATE `MPR_INTERFACE_ADMIN_DISABLED = &H00000002
%EQUATE `MPR_INTERFACE_CONNECTION_FAILURE = &H00000004
%EQUATE `MPR_INTERFACE_SERVICE_PAUSED = &H00000008
%EQUATE `MPR_INTERFACE_DIALOUT_HOURS_RESTRICTION = &H00000010
%EQUATE `MPR_INTERFACE_NO_MEDIA_SENSE = &H00000020
%EQUATE `MPR_INTERFACE_NO_DEVICE = &H00000040
' // Size = 540 bytes
TYPE MPR_INTERFACE_0 DWORD FILL
 wszInterfaceName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1
 hInterface AS DWORD
 fEnabled AS LONG
 dwIfType AS DWORD
 dwConnectionState AS DWORD
 fUnReachabilityReasons AS DWORD
 dwLastError AS DWORD
END TYPE
' // Size = 532 bytes
UNION MPR_IPINIP_INTERFACE_0_UNION ' // For compability with PN includes
 guidX AS GUID ' GUID Guid
 Guid AS GUID ' GUID Guid
END UNION
TYPE MPR_IPINIP_INTERFACE_0 DWORD FILL
 wszFriendlyName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1 ' WCHAR wszFriendlyName[MAX_INTERFACE_NAME_LEN+1]
 MPR_IPINIP_INTERFACE_0_UNION
END TYPE
'#if(WINVER >= 0x0500)
' // Size = 544 bytes
TYPE MPR_INTERFACE_1 DWORD FILL
 wszInterfaceName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1
 hInterface AS DWORD
 fEnabled AS LONG
 dwIfType AS DWORD
 dwConnectionState AS DWORD
 fUnReachabilityReasons AS DWORD
 dwLastError AS DWORD
 lpwsDialoutHoursRestriction AS WSTRINGZ PTR
END TYPE
'//
'// MPR_INTERFACE_2 definitions
'//
%EQUATE `MPR_MaxDeviceType = %RAS_MaxDeviceType
%EQUATE `MPR_MaxPhoneNumber = %RAS_MaxPhoneNumber
%EQUATE `MPR_MaxIpAddress = %RAS_MaxIpAddress
%EQUATE `MPR_MaxIpxAddress = %RAS_MaxIpxAddress
%EQUATE `MPR_MaxEntryName = %RAS_MaxEntryName
%EQUATE `MPR_MaxDeviceName = %RAS_MaxDeviceName
%EQUATE `MPR_MaxCallbackNumber = %RAS_MaxCallbackNumber
%EQUATE `MPR_MaxAreaCode = %RAS_MaxAreaCode
%EQUATE `MPR_MaxPadType = %RAS_MaxPadType
%EQUATE `MPR_MaxX25Address = %RAS_MaxX25Address
%EQUATE `MPR_MaxFacilities = %RAS_MaxFacilities
%EQUATE `MPR_MaxUserData = %RAS_MaxUserData
'//
'// MPR_INTERFACE_2 'dwfOptions' bit flags.
'//
%EQUATE `MPRIO_SpecificIpAddr = %RASEO_SpecificIpAddr
%EQUATE `MPRIO_SpecificNameServers = %RASEO_SpecificNameServers
%EQUATE `MPRIO_IpHeaderCompression = %RASEO_IpHeaderCompression
%EQUATE `MPRIO_RemoteDefaultGateway = %RASEO_RemoteDefaultGateway
%EQUATE `MPRIO_DisableLcpExtensions = %RASEO_DisableLcpExtensions
%EQUATE `MPRIO_SwCompression = %RASEO_SwCompression
%EQUATE `MPRIO_RequireEncryptedPw = %RASEO_RequireEncryptedPw
%EQUATE `MPRIO_RequireMsEncryptedPw = %RASEO_RequireMsEncryptedPw
%EQUATE `MPRIO_RequireDataEncryption = %RASEO_RequireDataEncryption
%EQUATE `MPRIO_NetworkLogon = %RASEO_NetworkLogon
%EQUATE `MPRIO_PromoteAlternates = %RASEO_PromoteAlternates
%EQUATE `MPRIO_SecureLocalFiles = %RASEO_SecureLocalFiles
%EQUATE `MPRIO_RequireEAP = %RASEO_RequireEAP
%EQUATE `MPRIO_RequirePAP = %RASEO_RequirePAP
%EQUATE `MPRIO_RequireSPAP = %RASEO_RequireSPAP
%EQUATE `MPRIO_SharedPhoneNumbers = %RASEO_SharedPhoneNumbers
%EQUATE `MPRIO_RequireCHAP = %RASEO_RequireCHAP
%EQUATE `MPRIO_RequireMsCHAP = %RASEO_RequireMsCHAP
%EQUATE `MPRIO_RequireMsCHAP2 = %RASEO_RequireMsCHAP2
'#if (WINVER >= 0x501)
%EQUATE `MPRIO_IpSecPreSharedKey = &H80000000
'#endif
'//
'// MPR_INTERFACE_2 'dwProtocols' bit flags.
'//
%EQUATE `MPRNP_Ipx = %RASNP_Ipx
%EQUATE `MPRNP_Ip = %RASNP_Ip
'#if (WINVER >= 0x600)
%EQUATE `MPRNP_Ipv6 = %RASNP_Ipv6
'#endif
'//
'// MPR_INTERFACE_2 'szDeviceType' default strings.
'//
$MPRDT_Modem = $RASDT_Modem
$MPRDT_Isdn = $RASDT_Isdn
$MPRDT_X25 = $RASDT_X25
$MPRDT_Vpn = $RASDT_Vpn
$MPRDT_Pad = $RASDT_Pad
$MPRDT_Generic = $RASDT_Generic
$MPRDT_Serial = $RASDT_Serial
$MPRDT_FrameRelay = $RASDT_FrameRelay
$MPRDT_Atm = $RASDT_Atm
$MPRDT_Sonet = $RASDT_Sonet
$MPRDT_SW56 = $RASDT_SW56
$MPRDT_Irda = $RASDT_Irda
$MPRDT_Parallel = $RASDT_Parallel
$$MPRDT_Modem = $$RASDT_Modem
$$MPRDT_Isdn = $$RASDT_Isdn
$$MPRDT_X25 = $$RASDT_X25
$$MPRDT_Vpn = $$RASDT_Vpn
$$MPRDT_Pad = $$RASDT_Pad
$$MPRDT_Generic = $$RASDT_Generic
$$MPRDT_Serial = $$RASDT_Serial
$$MPRDT_FrameRelay = $$RASDT_FrameRelay
$$MPRDT_Atm = $$RASDT_Atm
$$MPRDT_Sonet = $$RASDT_Sonet
$$MPRDT_SW56 = $$RASDT_SW56
$$MPRDT_Irda = $$RASDT_Irda
$$MPRDT_Parallel = $$RASDT_Parallel
'//
'// MPR_INTERFACE_2 'dwType' settings
'//
%EQUATE `MPRET_Phone = %RASET_Phone
%EQUATE `MPRET_Vpn = %RASET_Vpn
%EQUATE `MPRET_Direct = %RASET_Direct
'//
'// MPR_INTERFACE_2 'dwDialMode' values.
'//
%EQUATE `MPRDM_DialFirst = 0
%EQUATE `MPRDM_DialAll = %RASEDM_DialAll
%EQUATE `MPRDM_DialAsNeeded = %RASEDM_DialAsNeeded
'//
'// MPR_INTERFACE_2 'dwIdleDisconnectSeconds' constants.
'//
%EQUATE `MPRIDS_Disabled = %RASIDS_Disabled
%EQUATE `MPRIDS_UseGlobalValue = %RASIDS_UseGlobalValue
'//
'// MPR_INTERFACE_2 encryption types.
'//
%EQUATE `MPR_ET_None = %ET_None
%EQUATE `MPR_ET_Require = %ET_Require
%EQUATE `MPR_ET_RequireMax = %ET_RequireMax
%EQUATE `MPR_ET_Optional = %ET_Optional
'//
'// MPR_INTERFACE_2 Vpn strategies
'//
%EQUATE `MPR_VS_Default = %VS_Default
%EQUATE `MPR_VS_PptpOnly = %VS_PptpOnly
%EQUATE `MPR_VS_PptpFirst = %VS_PptpFirst
%EQUATE `MPR_VS_L2tpOnly = %VS_L2tpOnly
%EQUATE `MPR_VS_L2tpFirst = %VS_L2tpFirst
'//
'// Used to create/get/set a demand dial interface plus its
'// ras configuration.
'//
' // Size = 2468 bytes
TYPE MPR_INTERFACE_2 DWORD FILL
 wszInterfaceName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1
 hInterface AS DWORD
 fEnabled AS LONG
 dwIfType AS DWORD
 dwConnectionState AS DWORD
 fUnReachabilityReasons AS DWORD
 dwLastError AS DWORD
 dwfOptions AS DWORD ' DWORD dwfOptions
 szLocalPhoneNumber AS WSTRINGZ * %RAS_MaxPhoneNumber + 1 ' WCHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ]
 szAlternates AS WSTRINGZ PTR ' PWCHAR szAlternates
 ipaddr AS DWORD ' DWORD ipaddr
 ipaddrDns AS DWORD ' DWORD ipaddrDns
 ipaddrDnsAlt AS DWORD ' DWORD ipaddrDnsAlt
 ipaddrWins AS DWORD ' DWORD ipaddrWins
 ipaddrWinsAlt AS DWORD ' DWORD ipaddrWinsAlt
 dwfNetProtocols AS DWORD ' DWORD dwfNetProtocols
 szDeviceType AS WSTRINGZ * %MPR_MaxDeviceType + 1 ' WCHAR szDeviceType[ MPR_MaxDeviceType + 1 ]
 szDeviceName AS WSTRINGZ * %MPR_MaxDeviceName + 1 ' WCHAR szDeviceName[ MPR_MaxDeviceName + 1 ]
 szX25PadType AS WSTRINGZ * %MPR_MaxPadType + 1 ' WCHAR szX25PadType[ MPR_MaxPadType + 1 ]
 szX25Address AS WSTRINGZ * %MPR_MaxX25Address + 1 ' WCHAR szX25Address[ MPR_MaxX25Address + 1 ]
 szX25Facilities AS WSTRINGZ * %MPR_MaxFacilities + 1 ' WCHAR szX25Facilities[ MPR_MaxFacilities + 1 ]
 szX25UserData AS WSTRINGZ * %MPR_MaxUserData + 1 ' WCHAR szX25UserData[ MPR_MaxUserData + 1 ]
 dwChannels AS DWORD ' DWORD dwChannels
 dwSubEntries AS DWORD ' DWORD dwSubEntries
 dwDialMode AS DWORD ' DWORD dwDialMode
 dwDialExtraPercent AS DWORD ' DWORD dwDialExtraPercent
 dwDialExtraSampleSeconds AS DWORD ' DWORD dwDialExtraSampleSeconds
 dwHangUpExtraPercent AS DWORD ' DWORD dwHangUpExtraPercent
 dwHangUpExtraSampleSeconds AS DWORD ' DWORD dwHangUpExtraSampleSeconds
 dwIdleDisconnectSeconds AS DWORD ' DWORD dwIdleDisconnectSeconds
 dwType AS DWORD ' DWORD dwType
 dwEncryptionType AS DWORD ' DWORD dwEncryptionType
 dwCustomAuthKey AS DWORD ' DWORD dwCustomAuthKey
 dwCustomAuthDataSize AS DWORD ' DWORD dwCustomAuthDataSize
 lpbCustomAuthData AS BYTE PTR ' LPBYTE lpbCustomAuthData
 guidId AS GUID ' GUID guidId
 dwVpnStrategy AS DWORD ' DWORD dwVpnStrategy
END TYPE
'#if(WINVER >= 0x0600)
' // Size = 2508 bytes
TYPE MPR_INTERFACE_3 DWORD FILL
 wszInterfaceName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1 ' WCHAR[MAX_INTERFACE_NAME_LEN+1]
 hInterface AS DWORD
 fEnabled AS LONG
 dwIfType AS LONG ' ROUTER_INTERFACE_TYPE
 dwConnectionState AS LONG ' ROUTER_CONNECTION_STATE
 fUnReachabilityReasons AS DWORD
 dwLastError AS DWORD
 ' // Demand dial-specific properties
 dwfOptions AS DWORD
 ' // Location/phone number
 szLocalPhoneNumber AS WSTRINGZ * %RAS_MaxPhoneNumber + 1 ' WCHAR[RAS_MaxPhoneNumber + 1]
 szAlternates AS WSTRINGZ PTR
 ' // PPP/Ip
 ipaddr AS DWORD
 ipaddrDns AS DWORD
 ipaddrDnsAlt AS DWORD
 ipaddrWins AS DWORD
 ipaddrWinsAlt AS DWORD
 ' // NetProtocols
 dwfNetProtocols AS DWORD
 ' // Device
 szDeviceType AS WSTRINGZ * %MPR_MaxDeviceType + 1 ' WCHAR[MPR_MaxDeviceType + 1]
 szDeviceName AS WSTRINGZ * %MPR_MaxDeviceName + 1 ' WCHAR[MPR_MaxDeviceName + 1]
 ' // X.25
 szX25PadType AS WSTRINGZ * %MPR_MaxPadType + 1 ' WCHAR[MPR_MaxPadType + 1]
 szX25Address AS WSTRINGZ * %MPR_MaxX25Address + 1 ' WCHAR[MPR_MaxX25Address + 1]
 szX25Facilities AS WSTRINGZ * %MPR_MaxFacilities + 1 ' WCHAR[MPR_MaxFacilities + 1]
 szX25UserData AS WSTRINGZ * %MPR_MaxUserData + 1 ' WCHAR[MPR_MaxUserData + 1]
 dwChannels AS DWORD
 ' // Multilink
 dwSubEntries AS DWORD
 dwDialMode AS DWORD
 dwDialExtraPercent AS DWORD
 dwDialExtraSampleSeconds AS DWORD
 dwHangUpExtraPercent AS DWORD
 dwHangUpExtraSampleSeconds AS DWORD
 ' // Idle timeout
 dwIdleDisconnectSeconds AS DWORD
 ' // Entry Type
 dwType AS DWORD
 ' // EncryptionType
 dwEncryptionType AS DWORD
 ' // EAP information
 dwCustomAuthKey AS DWORD
 dwCustomAuthDataSize AS DWORD
 lpbCustomAuthData AS BYTE PTR
 ' // Guid of the connection
 guidId AS GUID ' GUID
 ' // Vpn Strategy
 dwVpnStrategy AS DWORD
 AddressCount AS DWORD ' ULONG
 ipv6addrDns AS IN6_ADDR ' IN6_ADDR *
 ipv6addrDnsAlt AS IN6_ADDR ' IN6_ADDR *
 ipv6addr AS IN6_ADDR PTR ' IN6_ADDR *
END TYPE
'#endif /* WINVER >= 0x0600 */
'//
'// Used to set/get per-link information for multilinked demand
'// dial interfaces.
'//
' // Size = 292 bytes
TYPE MPR_DEVICE_0 DWORD FILL
 szDeviceType AS WSTRINGZ * %MPR_MaxDeviceType + 1 ' WCHAR szDeviceType[ MPR_MaxDeviceType + 1 ]
 szDeviceName AS WSTRINGZ * %MPR_MaxDeviceName + 1 ' WCHAR szDeviceName[ MPR_MaxDeviceName + 1 ]
END TYPE
' // Size = 556 bytes
TYPE MPR_DEVICE_1 DWORD FILL
 szDeviceType AS WSTRINGZ * %MPR_MaxDeviceType + 1 ' WCHAR szDeviceType[ MPR_MaxDeviceType + 1 ]
 szDeviceName AS WSTRINGZ * %MPR_MaxDeviceName + 1 ' WCHAR szDeviceName[ MPR_MaxDeviceName + 1 ]
 szLocalPhoneNumber AS WSTRINGZ * %MPR_MaxPhoneNumber + 1 ' WCHAR szLocalPhoneNumber[ MPR_MaxPhoneNumber + 1 ]
 szAlternates AS WSTRINGZ PTR ' PWCHAR szAlternates
END TYPE
'//
'// Used to get/set extended credentials information such as
'// eap credentials info.
'//
' // Size = 8 bytes
TYPE MPR_CREDENTIALSEX_0 DWORD FILL
 dwSize AS DWORD ' DWORD dwSize
 lpbCredentialsInfo AS BYTE PTR ' LPBYTE lpbCredentialsInfo
END TYPE
' // Size = 8 bytes
TYPE MPR_CREDENTIALSEX_1 DWORD FILL
 dwSize AS DWORD ' DWORD dwSize
 lpbCredentialsInfo AS BYTE PTR ' LPBYTE lpbCredentialsInfo
END TYPE
'#endif /* WINVER >= 0x0500 */
' // Size = 92 bytes
TYPE MPR_TRANSPORT_0 DWORD
 dwTransportId AS DWORD
 hTransport AS DWORD
 wszTransportName AS WSTRINGZ * %MAX_TRANSPORT_NAME_LEN + 1
END TYPE
' // Size = 92 bytes
TYPE MPR_IFTRANSPORT_0 DWORD
 dwTransportId AS DWORD
 hIfTransport AS DWORD
 wszIfTransportName AS WSTRINGZ * %MAX_TRANSPORT_NAME_LEN + 1
END TYPE
' // Size = 16 bytes
TYPE MPR_SERVER_0 DWORD
 fLanOnlyMode AS LONG
 dwUpTime AS DWORD
 dwTotalPorts AS DWORD
 dwPortsInUse AS DWORD
END TYPE
'#if (WINVER >= 0x501)
'//
'// values for dwFlags in MPR_SERVER_1. This enables the ports for Ras or Routing.
'//
%EQUATE `MPR_ENABLE_RAS_ON_DEVICE = &H00000001
%EQUATE `MPR_ENABLE_ROUTING_ON_DEVICE = &H00000002
' // Size = 16 bytes
TYPE MPR_SERVER_1 DWORD
 dwNumPptpPorts AS DWORD
 dwPptpPortFlags AS DWORD
 dwNumL2tpPorts AS DWORD
 dwL2tpPortFlags AS DWORD
END TYPE
'#endif
'#if (WINVER >= 0x600)
'//
'// MPR_SERVER_2 structure.
'//
' // Size = 24 bytes
TYPE MPR_SERVER_2 DWORD
 dwNumPptpPorts AS DWORD
 dwPptpPortFlags AS DWORD
 dwNumL2tpPorts AS DWORD
 dwL2tpPortFlags AS DWORD
 dwNumSstpPorts AS DWORD
 dwSstpPortFlags AS DWORD
END TYPE
'#endif
'//
'// Port condition codes
'//
' RAS_PORT_CONDITION enum
%EQUATE `RAS_PORT_NON_OPERATIONAL = 0
%EQUATE `RAS_PORT_DISCONNECTED = 1
%EQUATE `RAS_PORT_CALLING_BACK = 2
%EQUATE `RAS_PORT_LISTENING = 3
%EQUATE `RAS_PORT_AUTHENTICATING = 4
%EQUATE `RAS_PORT_AUTHENTICATED = 5
%EQUATE `RAS_PORT_INITIALIZING = 6
'//
'// Hardware condition codes
'//
' RAS_HARDWARE_CONDITION enum
%EQUATE `RAS_HARDWARE_OPERATIONAL = 0
%EQUATE `RAS_HARDWARE_FAILURE = 1
' // Size = 380 bytes
TYPE RAS_PORT_0 DWORD FILL
 hPort AS DWORD
 hConnection AS DWORD
 dwPortCondition AS DWORD
 dwTotalNumberOfCalls AS DWORD
 dwConnectDuration AS DWORD
 wszPortName AS WSTRINGZ * %MAX_PORT_NAME + 1
 wszMediaName AS WSTRINGZ * %MAX_MEDIA_NAME + 1
 wszDeviceName AS WSTRINGZ * %MAX_DEVICE_NAME + 1
 wszDeviceType AS WSTRINGZ * %MAX_DEVICETYPE_NAME + 1
END TYPE
' // Size = 64 bytes
TYPE RAS_PORT_1 DWORD
 hPort AS DWORD
 hConnection AS DWORD
 dwHardwareCondition AS DWORD
 dwLineSpeed 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
END TYPE
'//
'// Maximum length of address string, e.g. "255.255.255.255" for IP.
'//
%EQUATE `IPADDRESSLEN = 15
%EQUATE `IPXADDRESSLEN = 22
%EQUATE `ATADDRESSLEN = 32
%EQUATE `MAXIPADRESSLEN = 64
' // Size = 40 bytes
TYPE PPP_NBFCP_INFO DWORD
 dwError AS DWORD
 wszWksta AS WSTRINGZ * %NETBIOS_NAME_LEN + 1
END TYPE
' // Size = 68 bytes
TYPE PPP_IPCP_INFO DWORD
 dwError AS DWORD
 wszAddress AS WSTRINGZ * %IPADDRESSLEN + 1
 wszRemoteAddress AS WSTRINGZ * %IPADDRESSLEN + 1
END TYPE
'//
'// PPP_IPCP_INFO2 dwOptions values.
'//
%EQUATE `PPP_IPCP_VJ = &H00000001
' // Size = 76 bytes
TYPE PPP_IPCP_INFO2 DWORD FILL
 dwError AS DWORD
 wszAddress AS WSTRINGZ * %IPADDRESSLEN + 1
 wszRemoteAddress AS WSTRINGZ * %IPADDRESSLEN + 1
 dwOptions AS DWORD
 dwRemoteOptions AS DWORD
END TYPE
' // Size = 52 bytes
TYPE PPP_IPXCP_INFO DWORD
 dwError AS DWORD
 wszAddress AS WSTRINGZ * %IPXADDRESSLEN + 1
END TYPE
' // Size = 72 bytes
TYPE PPP_ATCP_INFO DWORD
 dwError AS DWORD
 wszAddress AS WSTRINGZ * %ATADDRESSLEN + 1
END TYPE
'#if(WINVER >= 0x0600)
' // Size = 48 bytes
TYPE PPP_IPV6_CP_INFO DWORD
 dwVersion AS DWORD
 dwSize AS DWORD
 dwError AS DWORD
 bInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 bRemoteInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 dwOptions AS DWORD
 dwRemoteOptions AS DWORD
 bPrefix(7) AS BYTE ' BYTE[8]
 dwPrefixLength AS DWORD
END TYPE
'#endif /* WINVER >= 0x0600 */
' // Size = 232 bytes
TYPE PPP_INFO DWORD
 nbf AS PPP_NBFCP_INFO
 ip AS PPP_IPCP_INFO
 ipx AS PPP_IPXCP_INFO
 at AS PPP_ATCP_INFO
END TYPE
'#if(WINVER >= 0x0500)
'//
'// PPP_CCP dwCompressionAlgorithm values.
'//
%EQUATE `RASCCPCA_MPPC = &H00000006
%EQUATE `RASCCPCA_STAC = &H00000005
'//
'// PPP_CCP dwOptions values.
'//
%EQUATE `PPP_CCP_COMPRESSION = &H00000001
%EQUATE `PPP_CCP_ENCRYPTION40BITOLD = &H00000010
%EQUATE `PPP_CCP_ENCRYPTION40BIT = &H00000020
%EQUATE `PPP_CCP_ENCRYPTION128BIT = &H00000040
%EQUATE `PPP_CCP_ENCRYPTION56BIT = &H00000080
%EQUATE `PPP_CCP_HISTORYLESS = &H01000000
' // Size = 20 bytes
TYPE PPP_CCP_INFO DWORD
 dwError AS DWORD
 dwCompressionAlgorithm AS DWORD
 dwOptions AS DWORD
 dwRemoteCompressionAlgorithm AS DWORD
 dwRemoteOptions AS DWORD
END TYPE
'//
'// PPP_LCP dwAuthenticatonProtocol values.
'//
%EQUATE `PPP_LCP_PAP = &HC023
%EQUATE `PPP_LCP_SPAP = &HC027
%EQUATE `PPP_LCP_CHAP = &HC223
%EQUATE `PPP_LCP_EAP = &HC227
'//
'// PPP_LCP dwAuthenticatonData values.
'//
%EQUATE `PPP_LCP_CHAP_MD5 = &H05
%EQUATE `PPP_LCP_CHAP_MS = &H80
%EQUATE `PPP_LCP_CHAP_MSV2 = &H81
'//
'// PPP_LCP dwOption values
'//
%EQUATE `PPP_LCP_MULTILINK_FRAMING = &H00000001
%EQUATE `PPP_LCP_PFC = &H00000002
%EQUATE `PPP_LCP_ACFC = &H00000004
%EQUATE `PPP_LCP_SSHF = &H00000008
%EQUATE `PPP_LCP_DES_56 = &H00000010
%EQUATE `PPP_LCP_3_DES = &H00000020
'#if(WINVER >= 0x0600)
%EQUATE `PPP_LCP_AES_128 = &H00000040
%EQUATE `PPP_LCP_AES_256 = &H00000080
'#endif /* WINVER >= 0x0600 */
' // Size = 44 bytes
TYPE PPP_LCP_INFO DWORD
 dwError AS DWORD
 dwAuthenticationProtocol AS DWORD
 dwAuthenticationData AS DWORD
 dwRemoteAuthenticationProtocol AS DWORD
 dwRemoteAuthenticationData AS DWORD
 dwTerminateReason AS DWORD
 dwRemoteTerminateReason AS DWORD
 dwOptions AS DWORD
 dwRemoteOptions AS DWORD
 dwEapTypeId AS DWORD
 dwRemoteEapTypeId AS DWORD
END TYPE
' // Size = 304 bytes
TYPE PPP_INFO_2 DWORD
 nbf AS PPP_NBFCP_INFO
 ip AS PPP_IPCP_INFO2
 ipx AS PPP_IPXCP_INFO
 at AS PPP_ATCP_INFO
 ccp AS PPP_CCP_INFO
 lcp AS PPP_LCP_INFO
END TYPE
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0600)
' // Size = 228 bytes
TYPE PPP_INFO_3 DWORD
 nbf AS PPP_NBFCP_INFO
 ip AS PPP_IPCP_INFO2
 ipv6 AS PPP_IPV6_CP_INFO
 ccp AS PPP_CCP_INFO
 lcp AS PPP_LCP_INFO
END TYPE
'#endif /* WINVER >= 0x0600 */
'//
'// Possible bits set in Connection Flags field
'//
%EQUATE `RAS_FLAGS_PPP_CONNECTION = &H00000001
%EQUATE `RAS_FLAGS_MESSENGER_PRESENT = &H00000002
'#if(WINVER < = &H0501)
%EQUATE `RAS_FLAGS_RAS_CONNECTION = &H00000004
'#endif
%EQUATE `RAS_FLAGS_QUARANTINE_PRESENT = &H00000008
'#if(WINVER >= 0x0601)
%EQUATE `RAS_FLAGS_DORMANT = &H00000020
'#endif
' // Size = 1116 bytes
TYPE RAS_CONNECTION_0 BYTE
 hConnection AS DWORD
 hInterface AS DWORD
 dwConnectDuration AS DWORD
 dwInterfaceType AS DWORD
 dwConnectionFlags AS DWORD
 wszInterfaceName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1
 wszUserName AS WSTRINGZ * %UNLEN + 1
 wszLogonDomain AS WSTRINGZ * %DNLEN + 1
 wszRemoteComputer AS WSTRINGZ * %NETBIOS_NAME_LEN + 1
 alignment__ AS WORD
END TYPE
' // Size = 288 bytes
TYPE RAS_CONNECTION_1 DWORD
 hConnection AS DWORD
 hInterface AS DWORD
 PppInfo AS PPP_INFO
 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
END TYPE
'#if(WINVER >= 0x0500)
' // Size = 844 bytes
UNION RAS_CONNECTION_2_UNION ' // For compability with PN includes
 guidX AS GUID ' GUID Guid
 Guid AS GUID ' GUID Guid
END UNION
TYPE RAS_CONNECTION_2 DWORD
 hConnection AS DWORD
 wszUserName AS WSTRINGZ * %UNLEN + 1
 dwInterfaceType AS DWORD
 RAS_CONNECTION_2_UNION
 PppInfo2 AS PPP_INFO_2
END TYPE
'// indicates quarantine state of a client connection
' enum RAS_QUARANTINE_STATE
%EQUATE `RAS_QUAR_STATE_NORMAL = 0
%EQUATE `RAS_QUAR_STATE_QUARANTINE = 1
%EQUATE `RAS_QUAR_STATE_PROBATION = 2
%EQUATE `RAS_QUAR_STATE_NOT_CAPABLE = 3
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0600)
' // Size = 788 bytes
UNION RAS_CONNECTION_3_UNION ' // For compability with PN includes
 guidX AS GUID ' GUID Guid
 Guid AS GUID ' GUID Guid
END UNION
TYPE RAS_CONNECTION_3 DWORD FILL
 dwVersion AS DWORD
 dwSize AS DWORD
 hConnection AS DWORD ' HANDLE //connection handle
 wszUserName AS WSTRINGZ * %UNLEN + 1 ' WCHAR[UNLEN + 1]
 dwInterfaceType AS LONG ' ROUTER_INTERFACE_TYPE
 RAS_CONNECTION_3_UNION
 PppInfo3 AS PPP_INFO_3
 rasQuarState AS LONG ' RAS_QUARANTINE_STATE //Quarantine state of the connection
 timer AS FILETIME ' //Probation timer in UTC
END TYPE
'#endif /* WINVER >= 0x0600 */
'//
'// Structures used by the MPRADMIN USER APIs. Use level 0 to get/set this
'// structure.
'//
'//
'// Bits indicating user's Remote Access privileges and mask to isolate
'// call back privilege.
'//
'// Note: Bit 0 MUST represent NoCallback due to a quirk of the "userparms"
'// storage method. When a new LAN Manager user is created, bit 0 of the
'// userparms field is set to 1 and all other bits are 0. These bits are
'// arranged so this "no Dial-In info" state maps to the "default Dial-In
'// privilege" state.
%EQUATE `RASPRIV_NoCallback = &H01
%EQUATE `RASPRIV_AdminSetCallback = &H02
%EQUATE `RASPRIV_CallerSetCallback = &H04
%EQUATE `RASPRIV_DialinPrivilege = &H08
'//
'// The following are flags for the bfPrivilege2 member of RAS_USER_1
'// structure
'//
%EQUATE `RASPRIV2_DialinPolicy = &H1
%EQUATE `RASPRIV_CallbackType = %RASPRIV_AdminSetCallback OR %RASPRIV_CallerSetCallback OR %RASPRIV_NoCallback
' // Size = 260 bytes
TYPE RAS_USER_0 BYTE
 bfPrivilege AS BYTE
 wszPhoneNumber AS WSTRINGZ * %MAX_PHONE_NUMBER_LEN + 1
 alignment__ AS BYTE
END TYPE
' // Size = 262 bytes
TYPE RAS_USER_1 BYTE
 bfPrivilege AS BYTE
 wszPhoneNumber AS WSTRINGZ * %MAX_PHONE_NUMBER_LEN + 1
 bfPrivilege2 AS BYTE
 alignment__(1) AS BYTE
END TYPE
'#if(WINVER >= 0x0600)
' // Size = 4 bytes
TYPE MPR_FILTER_0 BYTE
 fEnable AS LONG
END TYPE
'#endif /* WINVER >= 0x0600 */
'//
'// Used as RPC binding handle to server
'//
'typedef HANDLE RAS_SERVER_HANDLE;
'typedef HANDLE MPR_SERVER_HANDLE;
'typedef HANDLE MIB_SERVER_HANDLE;
'#if(WINVER >= 0x0601)
' // Size = 4 bytes
TYPE MPRAPI_OBJECT_HEADER BYTE
 revision AS BYTE ' UCHAR
 type AS BYTE ' UCHAR
 size AS WORD ' USHORT
END TYPE
' enum MPRAPI_OBJECT_TYPE
%EQUATE `MPRAPI_OBJECT_TYPE_RAS_CONNECTION_OBJECT = 1
%EQUATE `MPRAPI_OBJECT_TYPE_MPR_SERVER_OBJECT = 2
%EQUATE `MPRAPI_OBJECT_TYPE_MPR_SERVER_SET_CONFIG_OBJECT = 3
%EQUATE `MPRAPI_OBJECT_TYPE_AUTH_VALIDATION_OBJECT = 4
%EQUATE `MPRAPI_OBJECT_TYPE_UPDATE_CONNECTION_OBJECT = 5
' // Size = 192 bytes
TYPE PPP_PROJECTION_INFO ' Must be 8 byte aligned
 ' // IPv4 Projection Parameters
 dwIPv4NegotiationError AS DWORD
 wszAddress AS WSTRINGZ * %IPADDRESSLEN + 1 ' WCHAR(IPADDRESSLEN + 1]
 wszRemoteAddress AS WSTRINGZ * %IPADDRESSLEN + 1 ' WCHAR(IPADDRESSLEN + 1]
 dwIPv4Options AS DWORD
 dwIPv4RemoteOptions AS DWORD
 IPv4SubInterfaceIndex AS QUAD ' ULONG64
 ' // IPv6 Projection Parameters
 dwIPv6NegotiationError AS DWORD
 bInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 bRemoteInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 bPrefix(7) AS BYTE ' BYTE[8]
 dwPrefixLength AS DWORD
 alignment__ AS DWORD ' To keep 8 byte alignment
 IPv6SubInterfaceIndex AS QUAD ' ULONG64
 ' // LCP Options
 dwLcpError AS DWORD
 dwAuthenticationProtocol AS DWORD
 dwAuthenticationData AS DWORD
 dwRemoteAuthenticationProtocol AS DWORD
 dwRemoteAuthenticationData AS DWORD
 dwLcpTerminateReason AS DWORD
 dwLcpRemoteTerminateReason AS DWORD
 dwLcpOptions AS DWORD
 dwLcpRemoteOptions AS DWORD
 dwEapTypeId AS DWORD
 dwRemoteEapTypeId AS DWORD
 ' // CCP options:
 dwCcpError AS DWORD
 dwCompressionAlgorithm AS DWORD
 dwCcpOptions AS DWORD
 dwRemoteCompressionAlgorithm AS DWORD
 dwCcpRemoteOptions AS DWORD
END TYPE
%EQUATE `MPRAPI_IKEV2_AUTH_USING_CERT = 1
%EQUATE `MPRAPI_IKEV2_AUTH_USING_EAP = 2
' // Size = 144 bytes
TYPE IKEV2_PROJECTION_INFO ' Must be 8 byte aligned
 dwIPv4NegotiationError AS DWORD
 wszAddress AS WSTRINGZ * %IPADDRESSLEN + 1 ' WCHAR[IPADDRESSLEN + 1]
 wszRemoteAddress AS WSTRINGZ * %IPADDRESSLEN + 1 ' WCHAR[IPADDRESSLEN + 1]
 IPv4SubInterfaceIndex AS QUAD ' ULONG64
 dwIPv6NegotiationError AS DWORD
 bInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 bRemoteInterfaceIdentifier(7) AS BYTE ' BYTE[8]
 bPrefix(7) AS BYTE ' BYTE[8]
 dwPrefixLength AS DWORD
 alignment1__ AS DWORD ' To keep 8 byte alignment
 IPv6SubInterfaceIndex AS QUAD ' ULONG64
 dwOptions AS DWORD
 dwAuthenticationProtocol AS DWORD
 dwEapTypeId AS DWORD
 dwCompressionAlgorithm AS DWORD
 dwEncryptionMethod AS DWORD
 alignment2__ AS DWORD ' To keep 8 byte alignment
END TYPE
%EQUATE `MPRAPI_PPP_PROJECTION_INFO_TYPE = 1
%EQUATE `MPRAPI_IKEV2_PROJECTION_INFO_TYPE = 2
' // Size = 192 bytes
UNION PROJECTION_INFO_UNION ' Must be 8 byte aligned
 PppProjectionInfo AS PPP_PROJECTION_INFO
 Ikev2ProjectionInfo AS IKEV2_PROJECTION_INFO
END UNION
' // Size = 200 bytes
TYPE PROJECTION_INFO QWORD FILL ' Must be 8 byte aligned
 projectionInfoType AS BYTE ' UCHAR
 ' // Based on the connectionFlags, it should use appropriate projection info
 PROJECTION_INFO_UNION
END TYPE
%EQUATE `MPRAPI_RAS_CONNECTION_OBJECT_REVISION_1 = &H1
' // Size = 1664 bytes
UNION RAS_CONNECTION_EX_UNION ' // For compability with PN includes
 guidX AS GUID ' GUID Guid
 Guid AS GUID ' GUID Guid
END UNION
TYPE RAS_CONNECTION_EX QWORD FILL ' Must be 8 byte aligned
 Header AS MPRAPI_OBJECT_HEADER
 dwConnectDuration AS DWORD
 dwInterfaceType AS LONG ' ROUTER_INTERFACE_TYPE
 dwConnectionFlags AS DWORD
 wszInterfaceName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN + 1 ' WCHAR[MAX_INTERFACE_NAME_LEN + 1]
 wszUserName AS WSTRINGZ * %UNLEN + 1 ' WCHAR[UNLEN + 1]
 wszLogonDomain AS WSTRINGZ * %DNLEN + 1 ' WCHAR[DNLEN + 1]
 wszRemoteComputer AS WSTRINGZ * %NETBIOS_NAME_LEN + 1 ' WCHAR[NETBIOS_NAME_LEN + 1]
 RAS_CONNECTION_EX_UNION
 rasQuarState AS LONG ' RAS_QUARANTINE_STATE
 probationTime AS FILETIME
 ' // Statistics:
 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
 ' // Currently valid only for IKEV2:
 dwNumSwitchOvers AS DWORD
 ' // Endpoint Information:
 wszRemoteEndpointAddress AS WSTRINGZ * %MAXIPADRESSLEN + 1 ' WCHAR[MAXIPADRESSLEN+1]
 wszLocalEndpointAddress AS WSTRINGZ * %MAXIPADRESSLEN + 1 ' WCHAR[MAXIPADRESSLEN+1]
 ' //Projection result:
 ProjectionInfo AS PROJECTION_INFO
 hConnection AS DWORD
 hInterface AS DWORD
END TYPE
'//----------- MPR_SERVER_EX object
' // Size = 28 bytes
TYPE IKEV2_TUNNEL_CONFIG_PARAMS DWORD
 dwIdleTimeout AS DWORD
 dwNetworkBlackoutTime AS DWORD
 dwSaLifeTime AS DWORD
 dwSaDataSizeForRenegotiation AS DWORD
 dwConfigOptions AS DWORD
 dwTotalCertificates AS DWORD
 certificateNames AS CERT_NAME_BLOB PTR ' CERT_NAME_BLOB *
END TYPE
%EQUATE `MPRAPI_IKEV2_SET_TUNNEL_CONFIG_PARAMS = &H1
' // Size = 40 bytes
TYPE IKEV2_CONFIG_PARAMS DWORD
 dwNumPorts AS DWORD
 dwPortFlags AS DWORD
 dwTunnelConfigParamFlags AS DWORD
 TunnelConfigParams AS IKEV2_TUNNEL_CONFIG_PARAMS
END TYPE
' // Size = 8 bytes
TYPE PPTP_CONFIG_PARAMS DWORD
 dwNumPorts AS DWORD
 dwPortFlags AS DWORD
END TYPE
' // Size = 8 bytes
TYPE L2TP_CONFIG_PARAMS DWORD
 dwNumPorts AS DWORD
 dwPortFlags AS DWORD
END TYPE
%EQUATE `MAX_SSTP_HASH_SIZE = 32 ' // SHA-256 Certificate hash size
' // Size = 12 bytes
TYPE SSTP_CERT_INFO DWORD
 ' // Whether it is the default node [no cert config]
 isDefault AS LONG
 certBlob AS CRYPT_HASH_BLOB
END TYPE
' // Size = 28 bytes
TYPE SSTP_CONFIG_PARAMS DWORD
 dwNumPorts AS DWORD
 dwPortFlags AS DWORD
 isUseHttps AS LONG
 certAlgorithm AS DWORD ' DWORD // Should always be CALG_SHA_256
 sstpCertDetails AS SSTP_CERT_INFO
END TYPE
' // Size = 84 bytes
TYPE MPRAPI_TUNNEL_CONFIG_PARAMS DWORD
 IkeConfigParams AS IKEV2_CONFIG_PARAMS
 PptpConfigParams AS PPTP_CONFIG_PARAMS
 L2tpConfigParams AS L2TP_CONFIG_PARAMS
 SstpConfigParams AS SSTP_CONFIG_PARAMS
END TYPE
%EQUATE `MPRAPI_MPR_SERVER_OBJECT_REVISION_1 = &H1
' // Size = 108 bytes
TYPE MPR_SERVER_EX DWORD
 Header AS MPRAPI_OBJECT_HEADER
 fLanOnlyMode AS DWORD
 dwUpTime AS DWORD
 dwTotalPorts AS DWORD
 dwPortsInUse AS DWORD
 Reserved AS DWORD ' DWORD // Added so that the structure is 8 byte aligned
 ConfigParams AS MPRAPI_TUNNEL_CONFIG_PARAMS
END TYPE
%EQUATE `MPRAPI_MPR_SERVER_SET_CONFIG_OBJECT_REVISION_1 = &H1
%EQUATE `MPRAPI_SET_CONFIG_PROTOCOL_FOR_PPTP = &H1
%EQUATE `MPRAPI_SET_CONFIG_PROTOCOL_FOR_L2TP = &H2
%EQUATE `MPRAPI_SET_CONFIG_PROTOCOL_FOR_SSTP = &H4
%EQUATE `MPRAPI_SET_CONFIG_PROTOCOL_FOR_IKEV2 = &H8
' // Size = 92 bytes
TYPE MPR_SERVER_SET_CONFIG_EX DWORD
 Header AS MPRAPI_OBJECT_HEADER
 setConfigForProtocols AS DWORD
 ConfigParams AS MPRAPI_TUNNEL_CONFIG_PARAMS
END TYPE
%EQUATE `ALLOW_NO_AUTH = 1
%EQUATE `DO_NOT_ALLOW_NO_AUTH = 0
' // Size = 564 bytes
TYPE AUTH_VALIDATION_EX DWORD
 Header AS MPRAPI_OBJECT_HEADER
 hRasConnection AS DWORD
 wszUserName AS WSTRINGZ * %UNLEN + 1 ' [UNLEN + 1]
 wszLogonDomain AS WSTRINGZ * %DNLEN + 1 ' [DNLEN + 1]
 AuthInfoSize AS DWORD
 AuthInfo(0) AS BYTE ' BYTE[1]
END TYPE
%EQUATE `MPRAPI_RAS_UPDATE_CONNECTION_OBJECT_REVISION_1 = &H1
' // Size = 268 bytes
TYPE RAS_UPDATE_CONNECTION BYTE
 Header AS MPRAPI_OBJECT_HEADER
 dwIfIndex AS DWORD
 wszLocalEndpointAddress AS WSTRINGZ * %MAXIPADRESSLEN + 1 ' WCHAR[MAXIPADRESSLEN+1]
 wszRemoteEndpointAddress AS WSTRINGZ * %MAXIPADRESSLEN + 1 ' WCHAR[MAXIPADRESSLEN+1]
END TYPE
'// RAS Admin Functions:
DECLARE FUNCTION MprAdminConnectionEnumEx LIB "mprapi.dll" ALIAS "MprAdminConnectionEnumEx" ( BYVAL hRasServer AS QUAD , BYREF pObjectHeader AS MPRAPI_OBJECT_HEADER , BYVAL dwPreferedMaxLen AS QUAD , BYREF lpdwEntriesRead AS QUAD , BYREF lpdwTotalEntries AS QUAD , BYREF ppRasConn AS ANY , BYREF MprAdminConnectionEnumEx AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminConnectionGetInfoEx LIB "mprapi.dll" ALIAS "MprAdminConnectionGetInfoEx" ( BYVAL hRasServer AS QUAD
 , BYVAL hRasConnection AS DWORD
 , BYREF pRasConnection AS RAS_CONNECTION_EX
 ) AS DWORD
' // Use MprAdminBufferFree for freeing pRASCONN
'// Router Admin Functions:
DECLARE FUNCTION MprAdminServerGetInfoEx LIB "mprapi.dll" ALIAS "MprAdminServerGetInfoEx" ( BYVAL hMprServer AS QUAD , BYREF pServerInfo AS MPR_SERVER_EX ) AS QUAD
DECLARE FUNCTION MprAdminServerSetInfoEx LIB "mprapi.dll" ALIAS "MprAdminServerSetInfoEx" ( BYVAL hMprServer AS QUAD
 , BYREF pServerInfo AS MPR_SERVER_SET_CONFIG_EX
 ) AS DWORD
'// Router Config Functions:
DECLARE FUNCTION MprConfigServerGetInfoEx LIB "mprapi.dll" ALIAS "MprConfigServerGetInfoEx" ( BYVAL hMprConfig AS QUAD , BYREF pServerInfo AS MPR_SERVER_EX ) AS QUAD
DECLARE FUNCTION MprConfigServerSetInfoEx LIB "mprapi.dll" ALIAS "MprConfigServerSetInfoEx" ( BYVAL hMprConfig AS QUAD
 , BYREF pSetServerConfig AS MPR_SERVER_SET_CONFIG_EX
 ) AS DWORD
DECLARE FUNCTION MprAdminUpdateConnection LIB "mprapi.dll" ALIAS "MprAdminUpdateConnection" ( BYVAL hRasServer AS DWORD
 , BYVAL hRasConnection AS DWORD
 , BYREF pRasUpdateConnection AS RAS_UPDATE_CONNECTION
 ) AS DWORD
'// Admin DLL's:
%EQUATE `MPRAPI_ADMIN_DLL_VERSION_1 = &H1
%EQUATE `MPRAPI_ADMIN_DLL_VERSION_2 = &H2 ' // If the version is 2: it can use RAS_CONNECTION_EX supported in Windows 7.0
'typedef DWORD (APIENTRY * PMPRADMINGETIPADDRESSFORUSER)(WCHAR *, WCHAR *, DWORD *, BOOL *);
'typedef VOID (APIENTRY * PMPRADMINRELEASEIPADRESS)(WCHAR *, WCHAR *, DWORD *);
'typedef DWORD (APIENTRY * PMPRADMINGETIPV6ADDRESSFORUSER)(WCHAR *, WCHAR *, IN6_ADDR *, BOOL *);
'typedef VOID (APIENTRY * PMPRADMINRELEASEIPV6ADDRESSFORUSER)(WCHAR *, WCHAR *, IN6_ADDR *);
'typedef BOOL (APIENTRY * PMPRADMINACCEPTNEWCONNECTION)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *);
'typedef BOOL (APIENTRY * PMPRADMINACCEPTNEWCONNECTION2)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *, RAS_CONNECTION_2 *);
'typedef BOOL (APIENTRY * PMPRADMINACCEPTNEWCONNECTION3)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *, RAS_CONNECTION_2 *, RAS_CONNECTION_3 *);
'typedef BOOL (APIENTRY * PMPRADMINACCEPTNEWLINK)(RAS_PORT_0 *, RAS_PORT_1 *);
'typedef VOID (APIENTRY * PMPRADMINCONNECTIONHANGUPNOTIFICATION)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *);
'typedef VOID (APIENTRY * PMPRADMINCONNECTIONHANGUPNOTIFICATION2)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *, RAS_CONNECTION_2 *);
'typedef VOID (APIENTRY * PMPRADMINCONNECTIONHANGUPNOTIFICATION3)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *, RAS_CONNECTION_2 *, RAS_CONNECTION_3);
'typedef VOID (APIENTRY * PMPRADMINLINKHANGUPNOTIFICATION)(RAS_PORT_0 *, RAS_PORT_1 *);
'typedef DWORD (APIENTRY * PMPRADMINTERMINATEDLL)();
'typedef BOOL (APIENTRY * PMPRADMINACCEPTREAUTHENTICATION)(RAS_CONNECTION_0 *, RAS_CONNECTION_1 *, RAS_CONNECTION_2 *, RAS_CONNECTION_3 *);
'typedef BOOL (APIENTRY *PMPRADMINACCEPTNEWCONNECTIONEX)(RAS_CONNECTION_EX*);
'typedef BOOL (APIENTRY *PMPRADMINACCEPTREAUTHENTICATIONEX)(RAS_CONNECTION_EX*);
'typedef BOOL (APIENTRY *PMPRADMINACCEPTTUNNELENDPOINTCHANGEEX)(RAS_CONNECTION_EX*);
'typedef VOID (APIENTRY *PMPRADMINCONNECTIONHANGUPNOTIFICATIONEX)(RAS_CONNECTION_EX*);
'typedef DWORD (APIENTRY *PMPRADMINRASVALIDATEPREAUTHENTICATEDCONNECTIONEX) (AUTH_VALIDATION_EX *);
' // Size = 52 bytes
TYPE MPRAPI_ADMIN_DLL_CALLBACKS DWORD FILL
 revision AS BYTE ' UCHAR
 lpfnMprAdminGetIpAddressForUser AS DWORD
 lpfnMprAdminReleaseIpAddress AS DWORD
 lpfnMprAdminGetIpv6AddressForUser AS DWORD ' PMPRADMINGETIPV6ADDRESSFORUSER
 lpfnMprAdminReleaseIpV6AddressForUser AS DWORD ' PMPRADMINRELEASEIPV6ADDRESSFORUSER
 lpfnRasAdminAcceptNewLink AS DWORD
 lpfnRasAdminLinkHangupNotification AS DWORD
 lpfnRasAdminTerminateDll AS DWORD
 lpfnRasAdminAcceptNewConnectionEx AS DWORD
 lpfnRasAdminAcceptEndpointChangeEx AS DWORD
 lpfnRasAdminAcceptReauthenticationEx AS DWORD
 lpfnRasAdminConnectionHangupNotificationEx AS DWORD
 lpfnRASValidatePreAuthenticatedConnectionEx AS DWORD
END TYPE
DECLARE FUNCTION MprAdminAcceptNewConnectionEx LIB "mprapi.dll" ALIAS "MprAdminAcceptNewConnectionEx" ( BYREF pRasConn AS RAS_CONNECTION_EX ) AS LONG
DECLARE FUNCTION MprAdminAcceptReauthenticationEx LIB "mprapi.dll" ALIAS "MprAdminAcceptReauthenticationEx" ( BYREF pRasConn AS RAS_CONNECTION_EX
 ) AS LONG
DECLARE SUB MprAdminConnectionHangupNotificationEx LIB "mprapi.dll" ALIAS "MprAdminConnectionHangupNotificationEx" ( BYREF pRasConn AS RAS_CONNECTION_EX
 ) ' void
DECLARE FUNCTION MprAdminInitializeDllEx LIB "mprapi.dll" ALIAS "MprAdminInitializeDllEx" ( BYREF pAdminCallbacks AS MPRAPI_ADMIN_DLL_CALLBACKS ) AS QUAD
DECLARE FUNCTION MprAdminIsServiceInitialized LIB "mprapi.dll" ALIAS "MprAdminIsServiceInitialized" ( BYREF lpwsServerName AS WSTRINGZ
 , BYREF fIsServiceInitialized AS LONG
 ) AS DWORD
'#endif /* WINVER >= 0x0601 */
'//
'// RAS ADMIN APIs
'//
DECLARE FUNCTION MprAdminConnectionEnum LIB "mprapi.dll" ALIAS "MprAdminConnectionEnum" ( BYVAL hRasServer AS QUAD , BYVAL dwLevel AS QUAD , BYREF plpbBuffer AS ANY , BYVAL dwPrefMaxLen AS QUAD , BYREF lpdwEntriesRead AS QUAD , BYREF lpdwTotalEntries AS QUAD , OPTIONAL BYREF lpdwResumeHandle AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminPortEnum LIB "mprapi.dll" ALIAS "MprAdminPortEnum" ( BYVAL hRasServer AS QUAD
 , BYVAL dwLevel AS DWORD
 , BYVAL hConnection AS DWORD
 , BYREF plpbBuffer AS ANY
 , BYVAL dwPrefMaxLen AS DWORD
 , BYREF lpdwEntriesRead AS DWORD
 , BYREF lpdwTotalEntries AS DWORD
 , OPTIONAL BYREF lpdwResumeHandle AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminConnectionGetInfo LIB "mprapi.dll" ALIAS "MprAdminConnectionGetInfo" ( BYVAL hRasServer AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYVAL hConnection AS DWORD
 , BYREF plpbBuffer AS ANY
 ) AS DWORD
DECLARE FUNCTION MprAdminPortGetInfo LIB "mprapi.dll" ALIAS "MprAdminPortGetInfo" ( BYVAL hRasServer AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYVAL hPort AS DWORD
 , BYREF plpbBuffer AS ANY
 ) AS DWORD
DECLARE FUNCTION MprAdminConnectionClearStats LIB "mprapi.dll" ALIAS "MprAdminConnectionClearStats" ( BYVAL hRasServer AS DWORD
 , BYVAL hConnection AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminPortClearStats LIB "mprapi.dll" ALIAS "MprAdminPortClearStats" ( BYVAL hRasServer AS DWORD
 , BYVAL hPort AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminPortReset LIB "mprapi.dll" ALIAS "MprAdminPortReset" ( BYVAL hRasServer AS DWORD
 , BYVAL hPort AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminPortDisconnect LIB "mprapi.dll" ALIAS "MprAdminPortDisconnect" ( BYVAL hRasServer AS DWORD
 , BYVAL hPort AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminAcceptNewConnection LIB "mprapi.dll" ALIAS "MprAdminAcceptNewConnection" ( BYREF pRasConnection0 AS RAS_CONNECTION_0
 , BYREF pRasConnection1 AS RAS_CONNECTION_1
 ) AS LONG
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminAcceptNewConnection2 LIB "mprapi.dll" ALIAS "MprAdminAcceptNewConnection2" ( BYREF pRasConnection0 AS RAS_CONNECTION_0 , BYREF pRasConnection1 AS RAS_CONNECTION_1 , BYREF pRasConnection2 AS RAS_CONNECTION_2 ) AS LONG
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0600)
DECLARE FUNCTION MprAdminAcceptNewConnection3 LIB "mprapi.dll" ALIAS "MprAdminAcceptNewConnection3" ( BYREF pRasConnection0 AS RAS_CONNECTION_0 , BYREF pRasConnection1 AS RAS_CONNECTION_1 , BYREF pRasConnection2 AS RAS_CONNECTION_2 , BYREF pRasConnection3 AS RAS_CONNECTION_3 ) AS LONG
DECLARE FUNCTION MprAdminAcceptReauthentication LIB "mprapi.dll" ALIAS "MprAdminAcceptReauthentication" ( BYREF pRasConnection0 AS RAS_CONNECTION_0
 , BYREF pRasConnection1 AS RAS_CONNECTION_1
 , BYREF pRasConnection2 AS RAS_CONNECTION_2
 , BYREF pRasConnection3 AS RAS_CONNECTION_3
 ) AS LONG
'#endif /* WINVER >= 0x0600 */
DECLARE FUNCTION MprAdminAcceptNewLink LIB "mprapi.dll" ALIAS "MprAdminAcceptNewLink" ( BYREF pRasPort0 AS RAS_PORT_0 , BYREF pRasPort1 AS RAS_PORT_1 ) AS LONG
DECLARE SUB MprAdminConnectionHangupNotification LIB "mprapi.dll" ALIAS "MprAdminConnectionHangupNotification" ( BYREF pRasConnection0 AS RAS_CONNECTION_0
 , BYREF pRasConnection1 AS RAS_CONNECTION_1
 ) ' void
'#if(WINVER >= 0x0500)
DECLARE SUB MprAdminConnectionHangupNotification2 LIB "mprapi.dll" ALIAS "MprAdminConnectionHangupNotification2" ( BYREF pRasConnection0 AS RAS_CONNECTION_0 , BYREF pRasConnection1 AS RAS_CONNECTION_1 , BYREF pRasConnection2 AS RAS_CONNECTION_2 ) ' void
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0600)
DECLARE SUB MprAdminConnectionHangupNotification3 LIB "mprapi.dll" ALIAS "MprAdminConnectionHangupNotification3" ( BYREF pRasConnection0 AS RAS_CONNECTION_0 , BYREF pRasConnection1 AS RAS_CONNECTION_1 , BYREF pRasConnection2 AS RAS_CONNECTION_2 , BYREF pRasConnection3 AS RAS_CONNECTION_3 ) ' void
'#endif /* WINVER >= 0x0600 */
'#if (WINVER >= 0x501)
DECLARE FUNCTION MprAdminConnectionRemoveQuarantine LIB "mprapi.dll" ALIAS "MprAdminConnectionRemoveQuarantine" ( BYVAL hRasServer AS QUAD , BYVAL hRasConnection AS QUAD , BYVAL fIsIpAddress AS LONG ) AS QUAD
'#endif
DECLARE SUB MprAdminLinkHangupNotification LIB "mprapi.dll" ALIAS "MprAdminLinkHangupNotification" ( BYREF pRasPort0 AS RAS_PORT_0 , BYREF pRasPort1 AS RAS_PORT_1 ) ' void
DECLARE FUNCTION MprAdminGetIpAddressForUser LIB "mprapi.dll" ALIAS "MprAdminGetIpAddressForUser" ( BYREF lpwszUserName AS WSTRINGZ , BYREF lpwszPortName AS WSTRINGZ , BYREF lpdwIpAddress AS QUAD , BYREF bNotifyRelease AS LONG ) AS QUAD
DECLARE SUB MprAdminReleaseIpAddress LIB "mprapi.dll" ALIAS "MprAdminReleaseIpAddress" ( BYREF lpszUserName AS WSTRINGZ
 , BYREF lpszPortName AS WSTRINGZ
 , BYREF lpdwIpAddress AS DWORD
 ) ' void
'#if(WINVER >= 0x0600)
DECLARE FUNCTION MprAdminGetIpv6AddressForUser LIB "mprapi.dll" ALIAS "MprAdminGetIpv6AddressForUser" ( BYREF lpwszUserName AS WSTRINGZ , BYREF lpwszPortName AS WSTRINGZ , BYREF lpdwIpv6Address AS IN6_ADDR , BYREF bNotifyRelease AS LONG ) AS QUAD
DECLARE SUB MprAdminReleaseIpv6AddressForUser LIB "mprapi.dll" ALIAS "MprAdminReleaseIpv6AddressForUser" ( BYREF lpszUserName AS WSTRINGZ
 , BYREF lpszPortName AS WSTRINGZ
 , BYREF lpdwIpv6Address AS IN6_ADDR
 ) ' void
'#endif /* WINVER >= 0x0600 */
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminInitializeDll LIB "mprapi.dll" ALIAS "MprAdminInitializeDll" ( ) AS QUAD
DECLARE FUNCTION MprAdminTerminateDll LIB "mprapi.dll" ALIAS "MprAdminTerminateDll" ( ) AS QUAD
'#endif
'//
'// MprAdminUser APIs
'//
DECLARE FUNCTION MprAdminUserGetInfo LIB "mprapi.dll" ALIAS "MprAdminUserGetInfo" ( BYREF lpszServer AS WSTRINGZ , BYREF lpszUser AS WSTRINGZ , BYVAL dwLevel AS QUAD , BYREF lpbBuffer AS ANY ) AS QUAD
DECLARE FUNCTION MprAdminUserSetInfo LIB "mprapi.dll" ALIAS "MprAdminUserSetInfo" ( BYREF lpszServer AS WSTRINGZ
 , BYREF lpszUser AS WSTRINGZ
 , BYVAL dwLevel AS DWORD
 , BYREF lpbBuffer AS ANY
 ) AS DWORD
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminSendUserMessage LIB "mprapi.dll" ALIAS "MprAdminSendUserMessage" ( BYVAL hMprServer AS QUAD , BYVAL hConnection AS QUAD , BYREF lpwszMessage AS WSTRINGZ ) AS QUAD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION MprAdminGetPDCServer LIB "mprapi.dll" ALIAS "MprAdminGetPDCServer" ( BYREF lpszDomain AS WSTRINGZ , BYREF lpszServer AS WSTRINGZ , BYREF lpszPDCServer AS WSTRINGZ ) AS QUAD
'//
'// Router APIs
'//
DECLARE FUNCTION MprAdminIsServiceRunning LIB "mprapi.dll" ALIAS "MprAdminIsServiceRunning" ( BYREF lpwsServerName AS WSTRINGZ ) AS LONG
DECLARE FUNCTION MprAdminServerConnect LIB "mprapi.dll" ALIAS "MprAdminServerConnect" ( BYREF lpwsServerName AS WSTRINGZ
 , BYREF phMprServer AS DWORD
 ) AS DWORD
DECLARE SUB MprAdminServerDisconnect LIB "mprapi.dll" ALIAS "MprAdminServerDisconnect" ( BYVAL hMprServer AS DWORD
 ) ' void
'#if (WINVER >= 0x501)
DECLARE FUNCTION MprAdminServerGetCredentials LIB "mprapi.dll" ALIAS "MprAdminServerGetCredentials" ( BYVAL hMprServer AS QUAD , BYVAL dwLevel AS QUAD , BYREF lplpbBuffer AS ANY ) AS QUAD
DECLARE FUNCTION MprAdminServerSetCredentials LIB "mprapi.dll" ALIAS "MprAdminServerSetCredentials" ( BYVAL hMprServer AS QUAD
 , BYVAL dwLevel AS DWORD
 , BYVAL lplpbBuffer AS BYTE PTR
 ) AS DWORD
'#endif
DECLARE FUNCTION MprAdminBufferFree LIB "mprapi.dll" ALIAS "MprAdminBufferFree" ( BYVAL pBuffer AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminGetErrorString LIB "mprapi.dll" ALIAS "MprAdminGetErrorString" ( BYVAL dwError AS QUAD
 , BYREF lpwsErrorString AS ANY
 ) AS DWORD
DECLARE FUNCTION MprAdminServerGetInfo LIB "mprapi.dll" ALIAS "MprAdminServerGetInfo" ( BYVAL hMprServer AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF plpbBuffer AS ANY
 ) AS DWORD
'#if (WINVER >= 0x501)
DECLARE FUNCTION MprAdminServerSetInfo LIB "mprapi.dll" ALIAS "MprAdminServerSetInfo" ( BYVAL hMprServer AS QUAD , BYVAL dwLevel AS QUAD , BYVAL lpbBuffer AS BYTE PTR ) AS QUAD
DECLARE FUNCTION MprAdminEstablishDomainRasServer LIB "mprapi.dll" ALIAS "MprAdminEstablishDomainRasServer" ( BYREF pszDomain AS WSTRINGZ
 , BYREF pszMachine AS WSTRINGZ
 , BYVAL bEnable AS LONG
 ) AS DWORD
DECLARE FUNCTION MprAdminIsDomainRasServer LIB "mprapi.dll" ALIAS "MprAdminIsDomainRasServer" ( BYREF pszDomain AS WSTRINGZ
 , BYREF pszMachine AS WSTRINGZ
 , BYREF pbIsRasServer AS LONG
 ) AS DWORD
'#endif
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminTransportCreate LIB "mprapi.dll" ALIAS "MprAdminTransportCreate" ( BYVAL hMprServer AS QUAD , BYVAL dwTransportId AS QUAD , BYREF lpwsTransportName AS WSTRINGZ , BYVAL pGlobalInfo AS BYTE PTR , BYVAL dwGlobalInfoSize AS QUAD , BYVAL pClientInterfaceInfo AS BYTE PTR , BYVAL dwClientInterfaceInfoSize AS QUAD , BYREF lpwsDLLPath AS WSTRINGZ ) AS QUAD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION MprAdminTransportSetInfo LIB "mprapi.dll" ALIAS "MprAdminTransportSetInfo" ( BYVAL hMprServer AS QUAD , BYVAL dwTransportId AS QUAD , BYVAL pGlobalInfo AS BYTE PTR , BYVAL dwGlobalInfoSize AS QUAD , BYVAL pClientInterfaceInfo AS BYTE PTR , BYVAL dwClientInterfaceInfoSize AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminTransportGetInfo LIB "mprapi.dll" ALIAS "MprAdminTransportGetInfo" ( BYVAL hMprServer AS QUAD
 , BYVAL dwTransportId AS DWORD
 , OPTIONAL BYREF ppGlobalInfo AS ANY
 , OPTIONAL BYREF lpdwGlobalInfoSize AS DWORD
 , OPTIONAL BYREF ppClientInterfaceInfo AS ANY
 , OPTIONAL BYREF lpdwClientInterfaceInfoSize AS DWORD
 ) AS DWORD
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminDeviceEnum LIB "mprapi.dll" ALIAS "MprAdminDeviceEnum" ( BYVAL hMprServer AS QUAD , BYVAL dwLevel AS QUAD , BYREF lplpbBuffer AS ANY , BYREF lpdwTotalEntries AS QUAD ) AS QUAD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION MprAdminInterfaceGetHandle LIB "mprapi.dll" ALIAS "MprAdminInterfaceGetHandle" ( BYVAL hMprServer AS QUAD , BYREF lpwsInterfaceName AS WSTRINGZ , BYREF phInterface AS QUAD , BYVAL fIncludeClientInterfaces AS LONG ) AS QUAD
DECLARE FUNCTION MprAdminInterfaceCreate LIB "mprapi.dll" ALIAS "MprAdminInterfaceCreate" ( BYVAL hMprServer AS QUAD
 , BYVAL dwLevel AS DWORD
 , BYVAL lpbBuffer AS BYTE PTR
 , BYREF phInterface AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceGetInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceGetInfo" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpbBuffer AS ANY
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceSetInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceSetInfo" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYVAL lpbBuffer AS BYTE PTR
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceDelete LIB "mprapi.dll" ALIAS "MprAdminInterfaceDelete" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 ) AS DWORD
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminInterfaceDeviceGetInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceDeviceGetInfo" ( BYVAL hMprServer AS QUAD , BYVAL hInterface AS QUAD , BYVAL dwIndex AS QUAD , BYVAL dwLevel AS QUAD , BYREF lplpBuffer AS ANY ) AS QUAD
DECLARE FUNCTION MprAdminInterfaceDeviceSetInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceDeviceSetInfo" ( BYVAL hMprServer AS QUAD
 , BYVAL hInterface AS DWORD
 , BYVAL dwIndex AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYVAL lplpBuffer AS BYTE PTR
 ) AS DWORD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION MprAdminInterfaceTransportRemove LIB "mprapi.dll" ALIAS "MprAdminInterfaceTransportRemove" ( BYVAL hMprServer AS QUAD , BYVAL hInterface AS QUAD , BYVAL dwTransportId AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminInterfaceTransportAdd LIB "mprapi.dll" ALIAS "MprAdminInterfaceTransportAdd" ( BYVAL hMprServer AS QUAD
 , BYVAL hInterface AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYVAL pInterfaceInfo AS BYTE PTR
 , BYVAL dwInterfaceInfoSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceTransportGetInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceTransportGetInfo" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYREF ppInterfaceInfo AS ANY
 , OPTIONAL BYREF lpdwpInterfaceInfoSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceTransportSetInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceTransportSetInfo" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYVAL pInterfaceInfo AS BYTE PTR
 , BYVAL dwInterfaceInfoSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceEnum LIB "mprapi.dll" ALIAS "MprAdminInterfaceEnum" ( BYVAL hMprServer AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF plpbBuffer AS ANY
 , BYVAL dwPrefMaxLen AS DWORD
 , BYREF lpdwEntriesRead AS DWORD
 , BYREF lpdwTotalEntries AS DWORD
 , OPTIONAL BYREF lpdwResumeHandle AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprSetupIpInIpInterfaceFriendlyNameEnum LIB "mprapi.dll" ALIAS "MprSetupIpInIpInterfaceFriendlyNameEnum" ( BYREF pwszMachineName AS WSTRINGZ
 , BYREF lplpBuffer AS ANY
 , BYREF lpdwEntriesRead AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprSetupIpInIpInterfaceFriendlyNameFree LIB "mprapi.dll" ALIAS "MprSetupIpInIpInterfaceFriendlyNameFree" ( BYVAL lpBuffer AS DWORD
 ) AS DWORD
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION MprSetupIpInIpInterfaceFriendlyNameCreate LIB "MprApi.dll" ALIAS "MprSetupIpInIpInterfaceFriendlyNameCreate" ( pwszMachineName AS WSTRINGZ, BYVAL pNameInformation AS MPR_IPINIP_INTERFACE_0 PTR ) AS QUAD
#ELSE
DECLARE FUNCTION MprSetupIpInIpInterfaceFriendlyNameCreate LIB "mprapi.dll" ALIAS "MprSetupIpInIpInterfaceFriendlyNameCreate" ( BYREF pwszMachineName AS WSTRINGZ , BYREF pNameInformation AS MPR_IPINIP_INTERFACE_0 ) AS QUAD
#ENDIF
DECLARE FUNCTION MprSetupIpInIpInterfaceFriendlyNameDelete LIB "mprapi.dll" ALIAS "MprSetupIpInIpInterfaceFriendlyNameDelete" ( BYREF pwszMachineName AS WSTRINGZ , BYREF pGuid AS GUID ) AS QUAD
DECLARE FUNCTION MprAdminInterfaceSetCredentials LIB "mprapi.dll" ALIAS "MprAdminInterfaceSetCredentials" ( BYREF lpwsServer AS WSTRINGZ
 , BYREF lpwsInterfaceName AS WSTRINGZ
 , OPTIONAL BYREF lpwsUserName AS WSTRINGZ
 , OPTIONAL BYREF lpwsDomainName AS WSTRINGZ
 , OPTIONAL BYREF lpwsPassword AS WSTRINGZ
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceGetCredentials LIB "mprapi.dll" ALIAS "MprAdminInterfaceGetCredentials" ( BYREF lpwsServer AS WSTRINGZ
 , BYREF lpwsInterfaceName AS WSTRINGZ
 , OPTIONAL BYREF lpwsUserName AS WSTRINGZ
 , OPTIONAL BYREF lpwsPassword AS WSTRINGZ
 , OPTIONAL BYREF lpwsDomainName AS WSTRINGZ
 ) AS DWORD
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminInterfaceSetCredentialsEx LIB "mprapi.dll" ALIAS "MprAdminInterfaceSetCredentialsEx" ( BYVAL hMprServer AS QUAD , BYVAL hInterface AS QUAD , BYVAL dwLevel AS QUAD , BYVAL lpbBuffer AS BYTE PTR ) AS QUAD
DECLARE FUNCTION MprAdminInterfaceGetCredentialsEx LIB "mprapi.dll" ALIAS "MprAdminInterfaceGetCredentialsEx" ( BYVAL hMprServer AS QUAD
 , BYVAL hInterface AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpbBuffer AS ANY
 ) AS DWORD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION MprAdminInterfaceConnect LIB "mprapi.dll" ALIAS "MprAdminInterfaceConnect" ( BYVAL hMprServer AS QUAD , BYVAL hInterface AS QUAD , BYVAL hEvent AS QUAD , BYVAL fSynchronous AS LONG ) AS QUAD
DECLARE FUNCTION MprAdminInterfaceDisconnect LIB "mprapi.dll" ALIAS "MprAdminInterfaceDisconnect" ( BYVAL hMprServer AS QUAD
 , BYVAL hInterface AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceUpdateRoutes LIB "mprapi.dll" ALIAS "MprAdminInterfaceUpdateRoutes" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL hEvent AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceQueryUpdateResult LIB "mprapi.dll" ALIAS "MprAdminInterfaceQueryUpdateResult" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYREF lpdwUpdateResult AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminInterfaceUpdatePhonebookInfo LIB "mprapi.dll" ALIAS "MprAdminInterfaceUpdatePhonebookInfo" ( BYVAL hMprServer AS DWORD
 , BYVAL hInterface AS DWORD
 ) AS DWORD
'#if(WINVER >= 0x0500)
DECLARE FUNCTION MprAdminRegisterConnectionNotification LIB "mprapi.dll" ALIAS "MprAdminRegisterConnectionNotification" ( BYVAL hMprServer AS QUAD , BYVAL hEventNotification AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminDeregisterConnectionNotification LIB "mprapi.dll" ALIAS "MprAdminDeregisterConnectionNotification" ( BYVAL hMprServer AS QUAD
 , BYVAL hEventNotification AS DWORD
 ) AS DWORD
'#endif /* WINVER >= 0x0500 */
'//
'// MIB APIs
'//
DECLARE FUNCTION MprAdminMIBServerConnect LIB "mprapi.dll" ALIAS "MprAdminMIBServerConnect" ( BYREF lpwsServerName AS WSTRINGZ , BYREF phMibServer AS QUAD ) AS QUAD
DECLARE SUB MprAdminMIBServerDisconnect LIB "mprapi.dll" ALIAS "MprAdminMIBServerDisconnect" ( BYVAL hMibServer AS QUAD
 ) ' void
DECLARE FUNCTION MprAdminMIBEntryCreate LIB "mprapi.dll" ALIAS "MprAdminMIBEntryCreate" ( BYVAL hMibServer AS QUAD , BYVAL dwPid AS QUAD , BYVAL dwRoutingPid AS QUAD , BYVAL lpEntry AS QUAD , BYVAL dwEntrySize AS QUAD ) AS QUAD
DECLARE FUNCTION MprAdminMIBEntryDelete LIB "mprapi.dll" ALIAS "MprAdminMIBEntryDelete" ( BYVAL hMibServer AS QUAD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL lpEntry AS DWORD
 , BYVAL dwEntrySize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBEntrySet LIB "mprapi.dll" ALIAS "MprAdminMIBEntrySet" ( BYVAL hMibServer AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL lpEntry AS DWORD
 , BYVAL dwEntrySize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBEntryGet LIB "mprapi.dll" ALIAS "MprAdminMIBEntryGet" ( BYVAL hMibServer AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL lpEntry AS DWORD
 , BYVAL dwEntrySize AS DWORD
 , BYREF lplpOutEntry AS ANY
 , BYREF lpOutEntrySize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBEntryGetFirst LIB "mprapi.dll" ALIAS "MprAdminMIBEntryGetFirst" ( BYVAL hMibServer AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL lpEntry AS DWORD
 , BYVAL dwEntrySize AS DWORD
 , BYREF lplpOutEntry AS ANY
 , BYREF lpOutEntrySize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBEntryGetNext LIB "mprapi.dll" ALIAS "MprAdminMIBEntryGetNext" ( BYVAL hMibServer AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL lpEntry AS DWORD
 , BYVAL dwEntrySize AS DWORD
 , BYREF lplpOutEntry AS ANY
 , BYREF lpOutEntrySize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBGetTrapInfo LIB "mprapi.dll" ALIAS "MprAdminMIBGetTrapInfo" ( BYVAL hMibServer AS DWORD
 , BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL lpInData AS DWORD
 , BYVAL dwInDataSize AS DWORD
 , BYREF lplpOutData AS ANY
 , BYREF lpOutDataSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBSetTrapInfo LIB "mprapi.dll" ALIAS "MprAdminMIBSetTrapInfo" ( BYVAL dwProtocolId AS DWORD
 , BYVAL dwRoutingPid AS DWORD
 , BYVAL hEvent AS DWORD
 , BYVAL lpInData AS DWORD
 , BYVAL dwInDataSize AS DWORD
 , BYREF lplpOutData AS ANY
 , BYREF lpOutDataSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprAdminMIBBufferFree LIB "mprapi.dll" ALIAS "MprAdminMIBBufferFree" ( BYVAL pBuffer AS DWORD
 ) AS DWORD
'//
'// Configuration APIs
'//
DECLARE FUNCTION MprConfigServerInstall LIB "mprapi.dll" ALIAS "MprConfigServerInstall" ( BYVAL dwLevel AS QUAD , BYVAL pBuffer AS QUAD ) AS QUAD
DECLARE FUNCTION MprConfigServerConnect LIB "mprapi.dll" ALIAS "MprConfigServerConnect" ( BYREF lpwsServerName AS WSTRINGZ
 , BYREF phMprConfig AS DWORD
 ) AS DWORD
DECLARE SUB MprConfigServerDisconnect LIB "mprapi.dll" ALIAS "MprConfigServerDisconnect" ( BYVAL hMprConfig AS DWORD
 ) ' void
DECLARE FUNCTION MprConfigServerRefresh LIB "mprapi.dll" ALIAS "MprConfigServerRefresh" ( BYVAL hMprConfig AS QUAD ) AS QUAD
DECLARE FUNCTION MprConfigBufferFree LIB "mprapi.dll" ALIAS "MprConfigBufferFree" ( BYVAL pBuffer AS QUAD
 ) AS DWORD
DECLARE FUNCTION MprConfigServerGetInfo LIB "mprapi.dll" ALIAS "MprConfigServerGetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpbBuffer AS ANY
 ) AS DWORD
'#if (WINVER >= 0x501)
DECLARE FUNCTION MprConfigServerSetInfo LIB "mprapi.dll" ALIAS "MprConfigServerSetInfo" ( BYVAL hMprServer AS QUAD , BYVAL dwLevel AS QUAD , BYVAL lpbBuffer AS BYTE PTR ) AS QUAD
'#endif
DECLARE FUNCTION MprConfigServerBackup LIB "mprapi.dll" ALIAS "MprConfigServerBackup" ( BYVAL hMprConfig AS QUAD , BYREF lpwsPath AS WSTRINGZ ) AS QUAD
DECLARE FUNCTION MprConfigServerRestore LIB "mprapi.dll" ALIAS "MprConfigServerRestore" ( BYVAL hMprConfig AS QUAD
 , BYREF lpwsPath AS WSTRINGZ
 ) AS DWORD
DECLARE FUNCTION MprConfigTransportCreate LIB "mprapi.dll" ALIAS "MprConfigTransportCreate" ( BYVAL hMprConfig AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYREF lpwsTransportName AS WSTRINGZ
 , BYVAL pGlobalInfo AS BYTE PTR
 , BYVAL dwGlobalInfoSize AS DWORD
 , BYVAL pClientInterfaceInfo AS BYTE PTR
 , BYVAL dwClientInterfaceInfoSize AS DWORD
 , BYREF lpwsDLLPath AS WSTRINGZ
 , BYREF phRouterTransport AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigTransportDelete LIB "mprapi.dll" ALIAS "MprConfigTransportDelete" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterTransport AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigTransportGetHandle LIB "mprapi.dll" ALIAS "MprConfigTransportGetHandle" ( BYVAL hMprConfig AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYREF phRouterTransport AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigTransportSetInfo LIB "mprapi.dll" ALIAS "MprConfigTransportSetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterTransport AS DWORD
 , OPTIONAL BYVAL pGlobalInfo AS BYTE PTR
 , OPTIONAL BYVAL dwGlobalInfoSize AS DWORD
 , OPTIONAL BYVAL pClientInterfaceInfo AS BYTE PTR
 , OPTIONAL BYVAL dwClientInterfaceInfoSize AS DWORD
 , OPTIONAL BYREF lpwsDLLPath AS WSTRINGZ
 ) AS DWORD
DECLARE FUNCTION MprConfigTransportGetInfo LIB "mprapi.dll" ALIAS "MprConfigTransportGetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterTransport AS DWORD
 , OPTIONAL BYREF ppGlobalInfo AS ANY
 , OPTIONAL BYREF lpdwGlobalInfoSize AS DWORD
 , OPTIONAL BYREF ppClientInterfaceInfo AS ANY
 , OPTIONAL BYREF lpdwClientInterfaceInfoSize AS DWORD
 , OPTIONAL BYREF lplpwsDLLPath AS ANY
 ) AS DWORD
DECLARE FUNCTION MprConfigTransportEnum LIB "mprapi.dll" ALIAS "MprConfigTransportEnum" ( BYVAL hMprConfig AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpBuffer AS ANY
 , BYVAL dwPrefMaxLen AS DWORD
 , BYREF lpdwEntriesRead AS DWORD
 , BYREF lpdwTotalEntries AS DWORD
 , OPTIONAL BYREF lpdwResumeHandle AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceCreate LIB "mprapi.dll" ALIAS "MprConfigInterfaceCreate" ( BYVAL hMprConfig AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYVAL lpbBuffer AS BYTE PTR
 , BYREF phRouterInterface AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceDelete LIB "mprapi.dll" ALIAS "MprConfigInterfaceDelete" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceGetHandle LIB "mprapi.dll" ALIAS "MprConfigInterfaceGetHandle" ( BYVAL hMprConfig AS DWORD
 , BYREF lpwsInterfaceName AS WSTRINGZ
 , BYREF phRouterInterface AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceGetInfo LIB "mprapi.dll" ALIAS "MprConfigInterfaceGetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpBuffer AS ANY
 , BYREF lpdwBufferSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceSetInfo LIB "mprapi.dll" ALIAS "MprConfigInterfaceSetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYVAL lpbBuffer AS BYTE PTR
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceEnum LIB "mprapi.dll" ALIAS "MprConfigInterfaceEnum" ( BYVAL hMprConfig AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpBuffer AS ANY
 , BYVAL dwPrefMaxLen AS DWORD
 , BYREF lpdwEntriesRead AS DWORD
 , BYREF lpdwTotalEntries AS DWORD
 , OPTIONAL BYREF lpdwResumeHandle AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceTransportAdd LIB "mprapi.dll" ALIAS "MprConfigInterfaceTransportAdd" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYREF lpwsTransportName AS WSTRINGZ
 , BYVAL pInterfaceInfo AS BYTE PTR
 , BYVAL dwInterfaceInfoSize AS DWORD
 , BYREF phRouterIfTransport AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceTransportRemove LIB "mprapi.dll" ALIAS "MprConfigInterfaceTransportRemove" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL hRouterIfTransport AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceTransportGetHandle LIB "mprapi.dll" ALIAS "MprConfigInterfaceTransportGetHandle" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYREF phRouterIfTransport AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceTransportGetInfo LIB "mprapi.dll" ALIAS "MprConfigInterfaceTransportGetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL hRouterIfTransport AS DWORD
 , OPTIONAL BYREF ppInterfaceInfo AS ANY
 , OPTIONAL BYREF lpdwInterfaceInfoSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceTransportSetInfo LIB "mprapi.dll" ALIAS "MprConfigInterfaceTransportSetInfo" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL hRouterIfTransport AS DWORD
 , OPTIONAL BYVAL pInterfaceInfo AS BYTE PTR
 , OPTIONAL BYVAL dwInterfaceInfoSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigInterfaceTransportEnum LIB "mprapi.dll" ALIAS "MprConfigInterfaceTransportEnum" ( BYVAL hMprConfig AS DWORD
 , BYVAL hRouterInterface AS DWORD
 , BYVAL dwLevel AS DWORD
 , BYREF lplpBuffer AS ANY
 , BYVAL dwPrefMaxLen AS DWORD
 , BYREF lpdwEntriesRead AS DWORD
 , BYREF lpdwTotalEntries AS DWORD
 , OPTIONAL BYREF lpdwResumeHandle AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigGetFriendlyName LIB "mprapi.dll" ALIAS "MprConfigGetFriendlyName" ( BYVAL hMprConfig AS DWORD
 , BYREF pszGuidName AS WSTRINGZ
 , BYREF pszBuffer AS WSTRINGZ
 , BYVAL dwBufferSize AS DWORD
 ) AS DWORD
DECLARE FUNCTION MprConfigGetGuidName LIB "mprapi.dll" ALIAS "MprConfigGetGuidName" ( BYVAL hMprConfig AS DWORD
 , BYREF pszFriendlyName AS WSTRINGZ
 , BYREF pszBuffer AS WSTRINGZ
 , BYVAL dwBufferSize AS DWORD
 ) AS DWORD
'#if(WINVER >= 0x0600)
DECLARE FUNCTION MprConfigFilterGetInfo LIB "mprapi.dll" ALIAS "MprConfigFilterGetInfo" ( BYVAL hMprConfig AS QUAD , BYVAL dwLevel AS QUAD , BYVAL dwTransportId AS QUAD , BYVAL lpBuffer AS BYTE PTR ) AS QUAD
DECLARE FUNCTION MprConfigFilterSetInfo LIB "mprapi.dll" ALIAS "MprConfigFilterSetInfo" ( BYVAL hMprConfig AS QUAD
 , BYVAL dwLevel AS DWORD
 , BYVAL dwTransportId AS DWORD
 , BYVAL lpBuffer AS BYTE PTR
 ) AS DWORD
'#endif /* WINVER >= 0x0600 */
'//
'// Information block APIs
'//
DECLARE FUNCTION MprInfoCreate LIB "mprapi.dll" ALIAS "MprInfoCreate" ( BYVAL dwVersion AS QUAD , BYREF lplpNewHeader AS ANY ) AS QUAD
DECLARE FUNCTION MprInfoDelete LIB "mprapi.dll" ALIAS "MprInfoDelete" ( BYVAL lpHeader AS QUAD
 ) AS DWORD
DECLARE FUNCTION MprInfoRemoveAll LIB "mprapi.dll" ALIAS "MprInfoRemoveAll" ( BYVAL lpHeader AS DWORD
 , BYREF lplpNewHeader AS ANY
 ) AS DWORD
DECLARE FUNCTION MprInfoDuplicate LIB "mprapi.dll" ALIAS "MprInfoDuplicate" ( BYVAL lpHeader AS DWORD
 , BYREF lplpNewHeader AS ANY
 ) AS DWORD
DECLARE FUNCTION MprInfoBlockAdd LIB "mprapi.dll" ALIAS "MprInfoBlockAdd" ( BYVAL lpHeader AS DWORD
 , BYVAL dwInfoType AS DWORD
 , BYVAL dwItemSize AS DWORD
 , BYVAL dwItemCount AS DWORD
 , BYVAL lpItemData AS BYTE PTR
 , BYREF lplpNewHeader AS ANY
 ) AS DWORD
DECLARE FUNCTION MprInfoBlockRemove LIB "mprapi.dll" ALIAS "MprInfoBlockRemove" ( BYVAL lpHeader AS DWORD
 , BYVAL dwInfoType AS DWORD
 , BYREF lplpNewHeader AS ANY
 ) AS DWORD
DECLARE FUNCTION MprInfoBlockSet LIB "mprapi.dll" ALIAS "MprInfoBlockSet" ( BYVAL lpHeader AS DWORD
 , BYVAL dwInfoType AS DWORD
 , BYVAL dwItemSize AS DWORD
 , BYVAL dwItemCount AS DWORD
 , BYVAL lpItemData AS BYTE PTR
 , BYREF lplpNewHeader AS ANY
 ) AS DWORD
DECLARE FUNCTION MprInfoBlockFind LIB "mprapi.dll" ALIAS "MprInfoBlockFind" ( BYVAL lpHeader AS DWORD
 , BYVAL dwInfoType AS DWORD
 , OPTIONAL BYREF lpdwItemSize AS DWORD
 , OPTIONAL BYREF lpdwItemCount AS DWORD
 , OPTIONAL BYREF lplpItemData AS ANY
 ) AS DWORD
DECLARE FUNCTION MprInfoBlockQuerySize LIB "mprapi.dll" ALIAS "MprInfoBlockQuerySize" ( BYVAL lpHeader AS DWORD
 ) AS DWORD
'//
'// BOOL APIENTRY
'// MprInfoBlockExists(
'// __in LPVOID lpHeader,
'// __in DWORD dwInfoType
'// );
'//
'#define MprInfoBlockExists(h,t) \
' (MprInfoBlockFind((h),(t),NULL,NULL,NULL) == NO_ERROR)
FUNCTION MprInfoBlockExists (BYVAL lpHeader AS DWORD, BYVAL dwInfoType AS DWORD) AS DWORD
 FUNCTION = (MprInfoBlockFind(lpHeader, dwInfoType, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL) = %NOERROR)
END FUNCTION
#ENDIF
