Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef __ROUTING_MPRADMIN_H__
      7 #define __ROUTING_MPRADMIN_H__
      8 
      9 #include <lmcons.h>
     10 #include <ras.h>
     11 
     12 #ifdef __cplusplus
     13 extern "C" {
     14 #endif
     15 
     16 #ifndef CALLBACK
     17 #define CALLBACK WINAPI
     18 #endif
     19 
     20 #define RRAS_SERVICE_NAME TEXT("RemoteAccess")
     21 
     22 #define PID_IPX 0x0000002B
     23 #define PID_IP 0x00000021
     24 #define PID_NBF 0x0000003F
     25 #define PID_ATALK 0x00000029
     26 
     27 #define MAX_INTERFACE_NAME_LEN 256
     28 #define MAX_TRANSPORT_NAME_LEN 40
     29 #define MAX_MEDIA_NAME 16
     30 #define MAX_PORT_NAME 16
     31 #define MAX_DEVICE_NAME 128
     32 #define MAX_PHONE_NUMBER_LEN 128
     33 #define MAX_DEVICETYPE_NAME 16
     34 
     35   typedef enum _ROUTER_INTERFACE_TYPE {
     36     ROUTER_IF_TYPE_CLIENT,ROUTER_IF_TYPE_HOME_ROUTER,ROUTER_IF_TYPE_FULL_ROUTER,ROUTER_IF_TYPE_DEDICATED,ROUTER_IF_TYPE_INTERNAL,
     37     ROUTER_IF_TYPE_LOOPBACK,ROUTER_IF_TYPE_TUNNEL1,ROUTER_IF_TYPE_DIALOUT
     38   } ROUTER_INTERFACE_TYPE;
     39 
     40   typedef enum _ROUTER_CONNECTION_STATE {
     41     ROUTER_IF_STATE_UNREACHABLE,ROUTER_IF_STATE_DISCONNECTED,ROUTER_IF_STATE_CONNECTING,ROUTER_IF_STATE_CONNECTED
     42   } ROUTER_CONNECTION_STATE;
     43 
     44 #define MPR_INTERFACE_OUT_OF_RESOURCES 0x00000001
     45 #define MPR_INTERFACE_ADMIN_DISABLED 0x00000002
     46 #define MPR_INTERFACE_CONNECTION_FAILURE 0x00000004
     47 #define MPR_INTERFACE_SERVICE_PAUSED 0x00000008
     48 #define MPR_INTERFACE_DIALOUT_HOURS_RESTRICTION 0x00000010
     49 #define MPR_INTERFACE_NO_MEDIA_SENSE 0x00000020
     50 #define MPR_INTERFACE_NO_DEVICE 0x00000040
     51 
     52   typedef struct _MPR_INTERFACE_0 {
     53     WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
     54     HANDLE hInterface;
     55     WINBOOL fEnabled;
     56     ROUTER_INTERFACE_TYPE dwIfType;
     57     ROUTER_CONNECTION_STATE dwConnectionState;
     58     DWORD fUnReachabilityReasons;
     59     DWORD dwLastError;
     60   } MPR_INTERFACE_0,*PMPR_INTERFACE_0;
     61 
     62   typedef struct _MPR_IPINIP_INTERFACE_0 {
     63     WCHAR wszFriendlyName[MAX_INTERFACE_NAME_LEN+1];
     64     GUID Guid;
     65   } MPR_IPINIP_INTERFACE_0,*PMPR_IPINIP_INTERFACE_0;
     66 
     67   typedef struct _MPR_INTERFACE_1 {
     68     WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
     69     HANDLE hInterface;
     70     WINBOOL fEnabled;
     71     ROUTER_INTERFACE_TYPE dwIfType;
     72     ROUTER_CONNECTION_STATE dwConnectionState;
     73     DWORD fUnReachabilityReasons;
     74     DWORD dwLastError;
     75     LPWSTR lpwsDialoutHoursRestriction;
     76 
     77   } MPR_INTERFACE_1,*PMPR_INTERFACE_1;
     78 
     79 #define MPR_MaxDeviceType RAS_MaxDeviceType
     80 #define MPR_MaxPhoneNumber RAS_MaxPhoneNumber
     81 #define MPR_MaxIpAddress RAS_MaxIpAddress
     82 #define MPR_MaxIpxAddress RAS_MaxIpxAddress
     83 
     84 #define MPR_MaxEntryName RAS_MaxEntryName
     85 #define MPR_MaxDeviceName RAS_MaxDeviceName
     86 #define MPR_MaxCallbackNumber RAS_MaxCallbackNumber
     87 
     88 #define MPR_MaxAreaCode RAS_MaxAreaCode
     89 #define MPR_MaxPadType RAS_MaxPadType
     90 #define MPR_MaxX25Address RAS_MaxX25Address
     91 #define MPR_MaxFacilities RAS_MaxFacilities
     92 #define MPR_MaxUserData RAS_MaxUserData
     93 
     94 #define MPRIO_SpecificIpAddr RASEO_SpecificIpAddr
     95 #define MPRIO_SpecificNameServers RASEO_SpecificNameServers
     96 #define MPRIO_IpHeaderCompression RASEO_IpHeaderCompression
     97 #define MPRIO_RemoteDefaultGateway RASEO_RemoteDefaultGateway
     98 #define MPRIO_DisableLcpExtensions RASEO_DisableLcpExtensions
     99 #define MPRIO_SwCompression RASEO_SwCompression
    100 #define MPRIO_RequireEncryptedPw RASEO_RequireEncryptedPw
    101 #define MPRIO_RequireMsEncryptedPw RASEO_RequireMsEncryptedPw
    102 #define MPRIO_RequireDataEncryption RASEO_RequireDataEncryption
    103 #define MPRIO_NetworkLogon RASEO_NetworkLogon
    104 #define MPRIO_PromoteAlternates RASEO_PromoteAlternates
    105 #define MPRIO_SecureLocalFiles RASEO_SecureLocalFiles
    106 #define MPRIO_RequireEAP RASEO_RequireEAP
    107 #define MPRIO_RequirePAP RASEO_RequirePAP
    108 #define MPRIO_RequireSPAP RASEO_RequireSPAP
    109 #define MPRIO_SharedPhoneNumbers RASEO_SharedPhoneNumbers
    110 #define MPRIO_RequireCHAP RASEO_RequireCHAP
    111 #define MPRIO_RequireMsCHAP RASEO_RequireMsCHAP
    112 #define MPRIO_RequireMsCHAP2 RASEO_RequireMsCHAP2
    113 #define MPRIO_IpSecPreSharedKey 0x80000000
    114 
    115 #define MPRNP_Ipx RASNP_Ipx
    116 #define MPRNP_Ip RASNP_Ip
    117 
    118 #define MPRDT_Modem RASDT_Modem
    119 #define MPRDT_Isdn RASDT_Isdn
    120 #define MPRDT_X25 RASDT_X25
    121 #define MPRDT_Vpn RASDT_Vpn
    122 #define MPRDT_Pad RASDT_Pad
    123 #define MPRDT_Generic RASDT_Generic
    124 #define MPRDT_Serial RASDT_Serial
    125 #define MPRDT_FrameRelay RASDT_FrameRelay
    126 #define MPRDT_Atm RASDT_Atm
    127 #define MPRDT_Sonet RASDT_Sonet
    128 #define MPRDT_SW56 RASDT_SW56
    129 #define MPRDT_Irda RASDT_Irda
    130 #define MPRDT_Parallel RASDT_Parallel
    131 
    132 #define MPRET_Phone RASET_Phone
    133 #define MPRET_Vpn RASET_Vpn
    134 #define MPRET_Direct RASET_Direct
    135 
    136 #define MPRDM_DialFirst 0
    137 #define MPRDM_DialAll RASEDM_DialAll
    138 #define MPRDM_DialAsNeeded RASEDM_DialAsNeeded
    139 
    140 #define MPRIDS_Disabled RASIDS_Disabled
    141 #define MPRIDS_UseGlobalValue RASIDS_UseGlobalValue
    142 
    143 #define MPR_ET_None ET_None
    144 #define MPR_ET_Require ET_Require
    145 #define MPR_ET_RequireMax ET_RequireMax
    146 #define MPR_ET_Optional ET_Optional
    147 
    148 #define MPR_VS_Default VS_Default
    149 #define MPR_VS_PptpOnly VS_PptpOnly
    150 #define MPR_VS_PptpFirst VS_PptpFirst
    151 #define MPR_VS_L2tpOnly VS_L2tpOnly
    152 #define MPR_VS_L2tpFirst VS_L2tpFirst
    153 
    154   typedef struct _MPR_INTERFACE_2 {
    155     WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
    156     HANDLE hInterface;
    157     WINBOOL fEnabled;
    158     ROUTER_INTERFACE_TYPE dwIfType;
    159     ROUTER_CONNECTION_STATE dwConnectionState;
    160     DWORD fUnReachabilityReasons;
    161     DWORD dwLastError;
    162     DWORD dwfOptions;
    163     WCHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    164     PWCHAR szAlternates;
    165     DWORD ipaddr;
    166     DWORD ipaddrDns;
    167     DWORD ipaddrDnsAlt;
    168     DWORD ipaddrWins;
    169     DWORD ipaddrWinsAlt;
    170     DWORD dwfNetProtocols;
    171     WCHAR szDeviceType[MPR_MaxDeviceType + 1 ];
    172     WCHAR szDeviceName[MPR_MaxDeviceName + 1 ];
    173     WCHAR szX25PadType[MPR_MaxPadType + 1 ];
    174     WCHAR szX25Address[MPR_MaxX25Address + 1 ];
    175     WCHAR szX25Facilities[MPR_MaxFacilities + 1 ];
    176     WCHAR szX25UserData[MPR_MaxUserData + 1 ];
    177     DWORD dwChannels;
    178     DWORD dwSubEntries;
    179     DWORD dwDialMode;
    180     DWORD dwDialExtraPercent;
    181     DWORD dwDialExtraSampleSeconds;
    182     DWORD dwHangUpExtraPercent;
    183     DWORD dwHangUpExtraSampleSeconds;
    184     DWORD dwIdleDisconnectSeconds;
    185     DWORD dwType;
    186     DWORD dwEncryptionType;
    187     DWORD dwCustomAuthKey;
    188     DWORD dwCustomAuthDataSize;
    189     LPBYTE lpbCustomAuthData;
    190     GUID guidId;
    191     DWORD dwVpnStrategy;
    192   } MPR_INTERFACE_2,*PMPR_INTERFACE_2;
    193 
    194 #if (_WIN32_WINNT >= 0x0600)
    195   typedef struct _MPR_INTERFACE_3 {
    196     WCHAR                   wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
    197     HANDLE                  hInterface;
    198     WINBOOL                 fEnabled;
    199     ROUTER_INTERFACE_TYPE   dwIfType;
    200     ROUTER_CONNECTION_STATE dwConnectionState;
    201     DWORD                   fUnReachabilityReasons;
    202     DWORD                   dwLastError;
    203     DWORD                   dwfOptions;
    204     WCHAR                   szLocalPhoneNumber[RAS_MaxPhoneNumber + 1];
    205     PWCHAR                  szAlternates;
    206     DWORD                   ipaddr;
    207     DWORD                   ipaddrDns;
    208     DWORD                   ipaddrDnsAlt;
    209     DWORD                   ipaddrWins;
    210     DWORD                   ipaddrWinsAlt;
    211     DWORD                   dwfNetProtocols;
    212     WCHAR                   szDeviceType[MPR_MaxDeviceType + 1];
    213     WCHAR                   szDeviceName[MPR_MaxDeviceName + 1];
    214     WCHAR                   szX25PadType[MPR_MaxPadType + 1];
    215     WCHAR                   szX25Address[MPR_MaxX25Address + 1];
    216     WCHAR                   szX25Facilities[MPR_MaxFacilities + 1];
    217     WCHAR                   szX25UserData[MPR_MaxUserData + 1];
    218     DWORD                   dwChannels;
    219     DWORD                   dwSubEntries;
    220     DWORD                   dwDialMode;
    221     DWORD                   dwDialExtraPercent;
    222     DWORD                   dwDialExtraSampleSeconds;
    223     DWORD                   dwHangUpExtraPercent;
    224     DWORD                   dwHangUpExtraSampleSeconds;
    225     DWORD                   dwIdleDisconnectSeconds;
    226     DWORD                   dwType;
    227     DWORD                   dwEncryptionType;
    228     DWORD                   dwCustomAuthKey;
    229     DWORD                   dwCustomAuthDataSize;
    230     LPBYTE                  lpbCustomAuthData;
    231     GUID                    guidId;
    232     DWORD                   dwVpnStrategy;
    233     ULONG                   AddressCount;
    234     IN6_ADDR                ipv6addrDns;
    235     IN6_ADDR                ipv6addrDnsAlt;
    236     IN6_ADDR *              ipv6addr;
    237   } MPR_INTERFACE_3, *PMPR_INTERFACE_3;
    238 #endif
    239 
    240   typedef struct _MPR_DEVICE_0 {
    241     WCHAR szDeviceType[MPR_MaxDeviceType + 1 ];
    242     WCHAR szDeviceName[MPR_MaxDeviceName + 1 ];
    243   } MPR_DEVICE_0,*PMPR_DEVICE_0;
    244 
    245   typedef struct _MPR_DEVICE_1 {
    246     WCHAR szDeviceType[MPR_MaxDeviceType + 1 ];
    247     WCHAR szDeviceName[MPR_MaxDeviceName + 1 ];
    248     WCHAR szLocalPhoneNumber[MPR_MaxPhoneNumber + 1 ];
    249     PWCHAR szAlternates;
    250   } MPR_DEVICE_1,*PMPR_DEVICE_1;
    251 
    252   typedef struct _MPR_CREDENTIALSEX_0 {
    253     DWORD dwSize;
    254     LPBYTE lpbCredentialsInfo;
    255   } MPR_CREDENTIALSEX_0,*PMPR_CREDENTIALSEX_0;
    256 
    257   typedef struct _MPR_CREDENTIALSEX_1 {
    258     DWORD dwSize;
    259     LPBYTE lpbCredentialsInfo;
    260   } MPR_CREDENTIALSEX_1,*PMPR_CREDENTIALSEX_1;
    261 
    262   typedef struct _MPR_TRANSPORT_0 {
    263     DWORD dwTransportId;
    264     HANDLE hTransport;
    265     WCHAR wszTransportName[MAX_TRANSPORT_NAME_LEN+1];
    266   } MPR_TRANSPORT_0,*PMPR_TRANSPORT_0;
    267 
    268   typedef struct _MPR_IFTRANSPORT_0
    269   {
    270     DWORD dwTransportId;
    271     HANDLE hIfTransport;
    272     WCHAR wszIfTransportName[MAX_TRANSPORT_NAME_LEN+1];
    273 
    274   }
    275   MPR_IFTRANSPORT_0,*PMPR_IFTRANSPORT_0;
    276 
    277   typedef struct _MPR_SERVER_0
    278   {
    279     WINBOOL fLanOnlyMode;
    280     DWORD dwUpTime;
    281     DWORD dwTotalPorts;
    282     DWORD dwPortsInUse;
    283 
    284   }
    285   MPR_SERVER_0,*PMPR_SERVER_0;
    286 
    287 #define MPR_ENABLE_RAS_ON_DEVICE 0x00000001
    288 #define MPR_ENABLE_ROUTING_ON_DEVICE 0x00000002
    289 
    290   typedef struct _MPR_SERVER_1 {
    291     DWORD dwNumPptpPorts;
    292     DWORD dwPptpPortFlags;
    293     DWORD dwNumL2tpPorts;
    294     DWORD dwL2tpPortFlags;
    295   } MPR_SERVER_1,*PMPR_SERVER_1;
    296 
    297   typedef enum _RAS_PORT_CONDITION {
    298     RAS_PORT_NON_OPERATIONAL,RAS_PORT_DISCONNECTED,RAS_PORT_CALLING_BACK,RAS_PORT_LISTENING,RAS_PORT_AUTHENTICATING,RAS_PORT_AUTHENTICATED,
    299     RAS_PORT_INITIALIZING
    300   } RAS_PORT_CONDITION;
    301 
    302   typedef enum _RAS_HARDWARE_CONDITION {
    303     RAS_HARDWARE_OPERATIONAL,RAS_HARDWARE_FAILURE
    304   } RAS_HARDWARE_CONDITION;
    305 
    306   typedef struct _RAS_PORT_0 {
    307     HANDLE hPort;
    308     HANDLE hConnection;
    309     RAS_PORT_CONDITION dwPortCondition;
    310     DWORD dwTotalNumberOfCalls;
    311     DWORD dwConnectDuration;
    312     WCHAR wszPortName[MAX_PORT_NAME + 1 ];
    313     WCHAR wszMediaName[MAX_MEDIA_NAME + 1 ];
    314     WCHAR wszDeviceName[MAX_DEVICE_NAME + 1 ];
    315     WCHAR wszDeviceType[MAX_DEVICETYPE_NAME + 1 ];
    316   } RAS_PORT_0,*PRAS_PORT_0;
    317 
    318   typedef struct _RAS_PORT_1 {
    319     HANDLE hPort;
    320     HANDLE hConnection;
    321     RAS_HARDWARE_CONDITION dwHardwareCondition;
    322     DWORD dwLineSpeed;
    323     DWORD dwBytesXmited;
    324     DWORD dwBytesRcved;
    325     DWORD dwFramesXmited;
    326     DWORD dwFramesRcved;
    327     DWORD dwCrcErr;
    328     DWORD dwTimeoutErr;
    329     DWORD dwAlignmentErr;
    330     DWORD dwHardwareOverrunErr;
    331     DWORD dwFramingErr;
    332     DWORD dwBufferOverrunErr;
    333     DWORD dwCompressionRatioIn;
    334     DWORD dwCompressionRatioOut;
    335   } RAS_PORT_1,*PRAS_PORT_1;
    336 
    337 #define IPADDRESSLEN 15
    338 #define IPXADDRESSLEN 22
    339 #define ATADDRESSLEN 32
    340 #define MAXIPADRESSLEN 64
    341 
    342   typedef struct _PPP_NBFCP_INFO {
    343     DWORD dwError;
    344     WCHAR wszWksta[NETBIOS_NAME_LEN + 1 ];
    345   } PPP_NBFCP_INFO;
    346 
    347   typedef struct _PPP_IPCP_INFO {
    348     DWORD dwError;
    349     WCHAR wszAddress[IPADDRESSLEN + 1 ];
    350     WCHAR wszRemoteAddress[IPADDRESSLEN + 1 ];
    351   } PPP_IPCP_INFO;
    352 
    353 #define PPP_IPCP_VJ 0x00000001
    354 
    355   typedef struct _PPP_IPCP_INFO2 {
    356     DWORD dwError;
    357     WCHAR wszAddress[IPADDRESSLEN + 1 ];
    358     WCHAR wszRemoteAddress[IPADDRESSLEN + 1 ];
    359     DWORD dwOptions;
    360     DWORD dwRemoteOptions;
    361   } PPP_IPCP_INFO2;
    362 
    363   typedef struct _PPP_IPXCP_INFO {
    364     DWORD dwError;
    365     WCHAR wszAddress[IPXADDRESSLEN + 1 ];
    366   } PPP_IPXCP_INFO;
    367 
    368   typedef struct _PPP_ATCP_INFO {
    369     DWORD dwError;
    370     WCHAR wszAddress[ATADDRESSLEN + 1 ];
    371   } PPP_ATCP_INFO;
    372 
    373   typedef struct _PPP_INFO {
    374     PPP_NBFCP_INFO nbf;
    375     PPP_IPCP_INFO ip;
    376     PPP_IPXCP_INFO ipx;
    377     PPP_ATCP_INFO at;
    378   } PPP_INFO;
    379 
    380 #define RASCCPCA_MPPC 0x00000006
    381 #define RASCCPCA_STAC 0x00000005
    382 
    383 #define PPP_CCP_COMPRESSION 0x00000001
    384 #define PPP_CCP_ENCRYPTION40BITOLD 0x00000010
    385 #define PPP_CCP_ENCRYPTION40BIT 0x00000020
    386 #define PPP_CCP_ENCRYPTION128BIT 0x00000040
    387 #define PPP_CCP_ENCRYPTION56BIT 0x00000080
    388 #define PPP_CCP_HISTORYLESS 0x01000000
    389 
    390   typedef struct _PPP_CCP_INFO {
    391     DWORD dwError;
    392     DWORD dwCompressionAlgorithm;
    393     DWORD dwOptions;
    394     DWORD dwRemoteCompressionAlgorithm;
    395     DWORD dwRemoteOptions;
    396   } PPP_CCP_INFO;
    397 
    398 #define PPP_LCP_PAP 0xC023
    399 #define PPP_LCP_SPAP 0xC027
    400 #define PPP_LCP_CHAP 0xC223
    401 #define PPP_LCP_EAP 0xC227
    402 
    403 #define PPP_LCP_CHAP_MD5 0x05
    404 #define PPP_LCP_CHAP_MS 0x80
    405 #define PPP_LCP_CHAP_MSV2 0x81
    406 
    407 #define PPP_LCP_MULTILINK_FRAMING 0x00000001
    408 #define PPP_LCP_PFC 0x00000002
    409 #define PPP_LCP_ACFC 0x00000004
    410 #define PPP_LCP_SSHF 0x00000008
    411 #define PPP_LCP_DES_56 0x00000010
    412 #define PPP_LCP_3_DES 0x00000020
    413 
    414   typedef struct _PPP_LCP_INFO {
    415     DWORD dwError;
    416     DWORD dwAuthenticationProtocol;
    417     DWORD dwAuthenticationData;
    418     DWORD dwRemoteAuthenticationProtocol;
    419     DWORD dwRemoteAuthenticationData;
    420     DWORD dwTerminateReason;
    421     DWORD dwRemoteTerminateReason;
    422     DWORD dwOptions;
    423     DWORD dwRemoteOptions;
    424     DWORD dwEapTypeId;
    425     DWORD dwRemoteEapTypeId;
    426   } PPP_LCP_INFO;
    427 
    428   typedef struct _PPP_INFO_2 {
    429     PPP_NBFCP_INFO nbf;
    430     PPP_IPCP_INFO2 ip;
    431     PPP_IPXCP_INFO ipx;
    432     PPP_ATCP_INFO at;
    433     PPP_CCP_INFO ccp;
    434     PPP_LCP_INFO lcp;
    435   } PPP_INFO_2;
    436 
    437 #define RAS_FLAGS_PPP_CONNECTION 0x00000001
    438 #define RAS_FLAGS_MESSENGER_PRESENT 0x00000002
    439 #define RAS_FLAGS_QUARANTINE_PRESENT 0x00000008
    440 
    441   typedef struct _RAS_CONNECTION_0 {
    442     HANDLE hConnection;
    443     HANDLE hInterface;
    444     DWORD dwConnectDuration;
    445     ROUTER_INTERFACE_TYPE dwInterfaceType;
    446     DWORD dwConnectionFlags;
    447     WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN + 1 ];
    448     WCHAR wszUserName[UNLEN + 1 ];
    449     WCHAR wszLogonDomain[DNLEN + 1 ];
    450     WCHAR wszRemoteComputer[NETBIOS_NAME_LEN + 1 ];
    451   } RAS_CONNECTION_0,*PRAS_CONNECTION_0;
    452 
    453   typedef struct _RAS_CONNECTION_1 {
    454     HANDLE hConnection;
    455     HANDLE hInterface;
    456     PPP_INFO PppInfo;
    457     DWORD dwBytesXmited;
    458     DWORD dwBytesRcved;
    459     DWORD dwFramesXmited;
    460     DWORD dwFramesRcved;
    461     DWORD dwCrcErr;
    462     DWORD dwTimeoutErr;
    463     DWORD dwAlignmentErr;
    464     DWORD dwHardwareOverrunErr;
    465     DWORD dwFramingErr;
    466     DWORD dwBufferOverrunErr;
    467     DWORD dwCompressionRatioIn;
    468     DWORD dwCompressionRatioOut;
    469   } RAS_CONNECTION_1,*PRAS_CONNECTION_1;
    470 
    471   typedef struct _RAS_CONNECTION_2 {
    472     HANDLE hConnection;
    473     WCHAR wszUserName[UNLEN + 1 ];
    474     ROUTER_INTERFACE_TYPE dwInterfaceType;
    475     GUID guid;
    476     PPP_INFO_2 PppInfo2;
    477   } RAS_CONNECTION_2,*PRAS_CONNECTION_2;
    478 
    479 #define RASPRIV_NoCallback 0x01
    480 #define RASPRIV_AdminSetCallback 0x02
    481 #define RASPRIV_CallerSetCallback 0x04
    482 #define RASPRIV_DialinPrivilege 0x08
    483 
    484 #define RASPRIV2_DialinPolicy 0x1
    485 
    486 #define RASPRIV_CallbackType (RASPRIV_AdminSetCallback | RASPRIV_CallerSetCallback | RASPRIV_NoCallback)
    487 
    488   typedef struct _RAS_USER_0 {
    489     BYTE bfPrivilege;
    490     WCHAR wszPhoneNumber[MAX_PHONE_NUMBER_LEN + 1];
    491   } RAS_USER_0,*PRAS_USER_0;
    492 
    493   typedef struct _RAS_USER_1 {
    494     BYTE bfPrivilege;
    495     WCHAR wszPhoneNumber[MAX_PHONE_NUMBER_LEN + 1];
    496     BYTE bfPrivilege2;
    497   } RAS_USER_1,*PRAS_USER_1;
    498 
    499   typedef HANDLE RAS_SERVER_HANDLE;
    500   typedef HANDLE MPR_SERVER_HANDLE;
    501   typedef HANDLE MIB_SERVER_HANDLE;
    502 
    503   DWORD WINAPI MprAdminConnectionEnum(RAS_SERVER_HANDLE hRasServer,DWORD dwLevel,LPBYTE *lplpbBuffer,DWORD dwPrefMaxLen,LPDWORD lpdwEntriesRead,LPDWORD lpdwTotalEntries,LPDWORD lpdwResumeHandle);
    504   DWORD WINAPI MprAdminPortEnum(RAS_SERVER_HANDLE hRasServer,DWORD dwLevel,HANDLE hConnection,LPBYTE *lplpbBuffer,DWORD dwPrefMaxLen,LPDWORD lpdwEntriesRead,LPDWORD lpdwTotalEntries,LPDWORD lpdwResumeHandle);
    505   DWORD WINAPI MprAdminConnectionGetInfo(RAS_SERVER_HANDLE hRasServer,DWORD dwLevel,HANDLE hConnection,LPBYTE *lplpbBuffer);
    506   DWORD WINAPI MprAdminPortGetInfo(RAS_SERVER_HANDLE hRasServer,DWORD dwLevel,HANDLE hPort,LPBYTE *lplpbBuffer);
    507   DWORD WINAPI MprAdminConnectionClearStats(RAS_SERVER_HANDLE hRasServer,HANDLE hConnection);
    508   DWORD WINAPI MprAdminPortClearStats(RAS_SERVER_HANDLE hRasServer,HANDLE hPort);
    509   DWORD WINAPI MprAdminPortReset(RAS_SERVER_HANDLE hRasServer,HANDLE hPort);
    510   DWORD WINAPI MprAdminPortDisconnect(RAS_SERVER_HANDLE hRasServer,HANDLE hPort);
    511   WINBOOL WINAPI MprAdminAcceptNewConnection(RAS_CONNECTION_0 *pRasConnection0,RAS_CONNECTION_1 *pRasConnection1);
    512   WINBOOL WINAPI MprAdminAcceptNewConnection2(RAS_CONNECTION_0 *pRasConnection0,RAS_CONNECTION_1 *pRasConnection1,RAS_CONNECTION_2 *pRasConnection2);
    513   WINBOOL WINAPI MprAdminAcceptNewLink (RAS_PORT_0 *pRasPort0,RAS_PORT_1 *pRasPort1);
    514   VOID WINAPI MprAdminConnectionHangupNotification(RAS_CONNECTION_0 *pRasConnection0,RAS_CONNECTION_1 *pRasConnection1);
    515   VOID WINAPI MprAdminConnectionHangupNotification2(RAS_CONNECTION_0 *pRasConnection0,RAS_CONNECTION_1 *pRasConnection1,RAS_CONNECTION_2 *pRasConnection2);
    516   DWORD WINAPI MprAdminConnectionRemoveQuarantine(HANDLE hRasServer,HANDLE hRasConnection,WINBOOL fIsIpAddress);
    517   VOID WINAPI MprAdminLinkHangupNotification (RAS_PORT_0 *pRasPort0,RAS_PORT_1 *pRasPort1);
    518   DWORD WINAPI MprAdminGetIpAddressForUser (WCHAR *lpwszUserName,WCHAR *lpwszPortName,DWORD *lpdwIpAddress,WINBOOL *bNotifyRelease);
    519   VOID WINAPI MprAdminReleaseIpAddress (WCHAR *lpszUserName,WCHAR *lpszPortName,DWORD *lpdwIpAddress);
    520   DWORD WINAPI MprAdminInitializeDll(VOID);
    521   DWORD WINAPI MprAdminTerminateDll(VOID);
    522   DWORD WINAPI MprAdminUserGetInfo(const WCHAR *lpszServer,const WCHAR *lpszUser,DWORD dwLevel,LPBYTE lpbBuffer);
    523   DWORD WINAPI MprAdminUserSetInfo(const WCHAR *lpszServer,const WCHAR *lpszUser,DWORD dwLevel,const LPBYTE lpbBuffer);
    524   DWORD WINAPI MprAdminSendUserMessage(MPR_SERVER_HANDLE hMprServer,HANDLE hConnection,LPWSTR lpwszMessage);
    525   DWORD WINAPI MprAdminGetPDCServer(const WCHAR *lpszDomain,const WCHAR *lpszServer,LPWSTR lpszPDCServer);
    526   WINBOOL WINAPI MprAdminIsServiceRunning(LPWSTR lpwsServerName);
    527   DWORD WINAPI MprAdminServerConnect(LPWSTR lpwsServerName,MPR_SERVER_HANDLE *phMprServer);
    528   VOID WINAPI MprAdminServerDisconnect(MPR_SERVER_HANDLE hMprServer);
    529   DWORD WINAPI MprAdminServerGetCredentials(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE *lplpbBuffer);
    530   DWORD WINAPI MprAdminServerSetCredentials(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE lpbBuffer);
    531   DWORD WINAPI MprAdminBufferFree(LPVOID pBuffer);
    532   DWORD WINAPI MprAdminGetErrorString(DWORD dwError,LPWSTR *lpwsErrorString);
    533   DWORD WINAPI MprAdminServerGetInfo(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE *lplpbBuffer);
    534   DWORD WINAPI MprAdminServerSetInfo(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE lpbBuffer);
    535   DWORD WINAPI MprAdminEstablishDomainRasServer (PWCHAR pszDomain,PWCHAR pszMachine,WINBOOL bEnable);
    536   DWORD WINAPI MprAdminIsDomainRasServer (PWCHAR pszDomain,PWCHAR pszMachine,PBOOL pbIsRasServer);
    537   DWORD WINAPI MprAdminTransportCreate(MPR_SERVER_HANDLE hMprServer,DWORD dwTransportId,LPWSTR lpwsTransportName,LPBYTE pGlobalInfo,DWORD dwGlobalInfoSize,LPBYTE pClientInterfaceInfo,DWORD dwClientInterfaceInfoSize,LPWSTR lpwsDLLPath);
    538   DWORD WINAPI MprAdminTransportSetInfo(MPR_SERVER_HANDLE hMprServer,DWORD dwTransportId,LPBYTE pGlobalInfo,DWORD dwGlobalInfoSize,LPBYTE pClientInterfaceInfo,DWORD dwClientInterfaceInfoSize);
    539   DWORD WINAPI MprAdminTransportGetInfo(MPR_SERVER_HANDLE hMprServer,DWORD dwTransportId,LPBYTE *ppGlobalInfo,LPDWORD lpdwGlobalInfoSize,LPBYTE *ppClientInterfaceInfo,LPDWORD lpdwClientInterfaceInfoSize);
    540   DWORD WINAPI MprAdminDeviceEnum(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE *lplpbBuffer,LPDWORD lpdwTotalEntries);
    541   DWORD WINAPI MprAdminInterfaceGetHandle(MPR_SERVER_HANDLE hMprServer,LPWSTR lpwsInterfaceName,HANDLE *phInterface,WINBOOL fIncludeClientInterfaces);
    542   DWORD WINAPI MprAdminInterfaceCreate(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE lpbBuffer,HANDLE *phInterface);
    543   DWORD WINAPI MprAdminInterfaceGetInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwLevel,LPBYTE *lplpbBuffer);
    544   DWORD WINAPI MprAdminInterfaceSetInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwLevel,LPBYTE lpbBuffer);
    545   DWORD WINAPI MprAdminInterfaceDelete(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface);
    546   DWORD WINAPI MprAdminInterfaceDeviceGetInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwIndex,DWORD dwLevel,LPBYTE *lplpBuffer);
    547   DWORD WINAPI MprAdminInterfaceDeviceSetInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwIndex,DWORD dwLevel,LPBYTE lplpBuffer);
    548   DWORD WINAPI MprAdminInterfaceTransportRemove(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwTransportId);
    549   DWORD WINAPI MprAdminInterfaceTransportAdd(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwTransportId,LPBYTE pInterfaceInfo,DWORD dwInterfaceInfoSize);
    550   DWORD WINAPI MprAdminInterfaceTransportGetInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwTransportId,LPBYTE *ppInterfaceInfo,LPDWORD lpdwpInterfaceInfoSize);
    551   DWORD WINAPI MprAdminInterfaceTransportSetInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwTransportId,LPBYTE pInterfaceInfo,DWORD dwInterfaceInfoSize);
    552   DWORD WINAPI MprAdminInterfaceEnum(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE *lplpbBuffer,DWORD dwPrefMaxLen,LPDWORD lpdwEntriesRead,LPDWORD lpdwTotalEntries,LPDWORD lpdwResumeHandle);
    553   DWORD WINAPI MprSetupIpInIpInterfaceFriendlyNameEnum(PWCHAR pwszMachineName,LPBYTE *lplpBuffer,LPDWORD lpdwEntriesRead);
    554   DWORD WINAPI MprSetupIpInIpInterfaceFriendlyNameFree(LPVOID lpBuffer);
    555   DWORD WINAPI MprSetupIpInIpInterfaceFriendlyNameCreate(PWCHAR pwszMachineName,PMPR_IPINIP_INTERFACE_0 pNameInformation);
    556   DWORD WINAPI MprSetupIpInIpInterfaceFriendlyNameDelete(PWCHAR pwszMachineName,GUID *pGuid);
    557   DWORD WINAPI MprAdminInterfaceSetCredentials(LPWSTR lpwsServer,LPWSTR lpwsInterfaceName,LPWSTR lpwsUserName,LPWSTR lpwsDomainName,LPWSTR lpwsPassword);
    558   DWORD WINAPI MprAdminInterfaceGetCredentials(LPWSTR lpwsServer,LPWSTR lpwsInterfaceName,LPWSTR lpwsUserName,LPWSTR lpwsPassword,LPWSTR lpwsDomainName);
    559   DWORD WINAPI MprAdminInterfaceSetCredentialsEx(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwLevel,LPBYTE lpbBuffer);
    560   DWORD WINAPI MprAdminInterfaceGetCredentialsEx(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwLevel,LPBYTE *lplpbBuffer);
    561   DWORD WINAPI MprAdminInterfaceConnect(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,HANDLE hEvent,WINBOOL fSynchronous);
    562   DWORD WINAPI MprAdminInterfaceDisconnect(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface);
    563   DWORD WINAPI MprAdminInterfaceUpdateRoutes(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwProtocolId,HANDLE hEvent);
    564   DWORD WINAPI MprAdminInterfaceQueryUpdateResult(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface,DWORD dwProtocolId,LPDWORD lpdwUpdateResult);
    565   DWORD WINAPI MprAdminInterfaceUpdatePhonebookInfo(MPR_SERVER_HANDLE hMprServer,HANDLE hInterface);
    566   DWORD WINAPI MprAdminRegisterConnectionNotification(MPR_SERVER_HANDLE hMprServer,HANDLE hEventNotification);
    567   DWORD WINAPI MprAdminDeregisterConnectionNotification(MPR_SERVER_HANDLE hMprServer,HANDLE hEventNotification);
    568   DWORD WINAPI MprAdminMIBServerConnect(LPWSTR lpwsServerName,MIB_SERVER_HANDLE *phMibServer);
    569   VOID WINAPI MprAdminMIBServerDisconnect(MIB_SERVER_HANDLE hMibServer);
    570   DWORD WINAPI MprAdminMIBEntryCreate(MIB_SERVER_HANDLE hMibServer,DWORD dwPid,DWORD dwRoutingPid,LPVOID lpEntry,DWORD dwEntrySize);
    571   DWORD WINAPI MprAdminMIBEntryDelete(MIB_SERVER_HANDLE hMibServer,DWORD dwProtocolId,DWORD dwRoutingPid,LPVOID lpEntry,DWORD dwEntrySize);
    572   DWORD WINAPI MprAdminMIBEntrySet(MIB_SERVER_HANDLE hMibServer,DWORD dwProtocolId,DWORD dwRoutingPid,LPVOID lpEntry,DWORD dwEntrySize);
    573   DWORD WINAPI MprAdminMIBEntryGet(MIB_SERVER_HANDLE hMibServer,DWORD dwProtocolId,DWORD dwRoutingPid,LPVOID lpInEntry,DWORD dwInEntrySize,LPVOID *lplpOutEntry,LPDWORD lpOutEntrySize);
    574   DWORD WINAPI MprAdminMIBEntryGetFirst(MIB_SERVER_HANDLE hMibServer,DWORD dwProtocolId,DWORD dwRoutingPid,LPVOID lpInEntry,DWORD dwInEntrySize,LPVOID *lplpOutEntry,LPDWORD lpOutEntrySize);
    575   DWORD WINAPI MprAdminMIBEntryGetNext(MIB_SERVER_HANDLE hMibServer,DWORD dwProtocolId,DWORD dwRoutingPid,LPVOID lpInEntry,DWORD dwInEntrySize,LPVOID *lplpOutEntry,LPDWORD lpOutEntrySize);
    576   DWORD WINAPI MprAdminMIBGetTrapInfo(MIB_SERVER_HANDLE hMibServer,DWORD dwProtocolId,DWORD dwRoutingPid,LPVOID lpInData,DWORD dwInDataSize,LPVOID *lplpOutData,LPDWORD lpOutDataSize);
    577   DWORD WINAPI MprAdminMIBSetTrapInfo(DWORD dwProtocolId,DWORD dwRoutingPid,HANDLE hEvent,LPVOID lpInData,DWORD dwInDataSize,LPVOID *lplpOutData,LPDWORD lpOutDataSize);
    578   DWORD WINAPI MprAdminMIBBufferFree(LPVOID pBuffer);
    579   DWORD WINAPI MprConfigServerInstall(DWORD dwLevel,PVOID pBuffer);
    580   DWORD WINAPI MprConfigServerConnect(LPWSTR lpwsServerName,HANDLE *phMprConfig);
    581   VOID WINAPI MprConfigServerDisconnect(HANDLE hMprConfig);
    582   DWORD WINAPI MprConfigServerRefresh(HANDLE hMprConfig);
    583   DWORD WINAPI MprConfigBufferFree(LPVOID pBuffer);
    584   DWORD WINAPI MprConfigServerGetInfo(HANDLE hMprConfig,DWORD dwLevel,LPBYTE *lplpbBuffer);
    585   DWORD WINAPI MprConfigServerSetInfo(MPR_SERVER_HANDLE hMprServer,DWORD dwLevel,LPBYTE lpbBuffer);
    586   DWORD WINAPI MprConfigServerBackup(HANDLE hMprConfig,LPWSTR lpwsPath);
    587   DWORD WINAPI MprConfigServerRestore(HANDLE hMprConfig,LPWSTR lpwsPath);
    588   DWORD WINAPI MprConfigTransportCreate(HANDLE hMprConfig,DWORD dwTransportId,LPWSTR lpwsTransportName,LPBYTE pGlobalInfo,DWORD dwGlobalInfoSize,LPBYTE pClientInterfaceInfo,DWORD dwClientInterfaceInfoSize,LPWSTR lpwsDLLPath,HANDLE *phRouterTransport);
    589   DWORD WINAPI MprConfigTransportDelete(HANDLE hMprConfig,HANDLE hRouterTransport);
    590   DWORD WINAPI MprConfigTransportGetHandle(HANDLE hMprConfig,DWORD dwTransportId,HANDLE *phRouterTransport);
    591   DWORD WINAPI MprConfigTransportSetInfo(HANDLE hMprConfig,HANDLE hRouterTransport,LPBYTE pGlobalInfo,DWORD dwGlobalInfoSize,LPBYTE pClientInterfaceInfo,DWORD dwClientInterfaceInfoSize,LPWSTR lpwsDLLPath);
    592   DWORD WINAPI MprConfigTransportGetInfo(HANDLE hMprConfig,HANDLE hRouterTransport,LPBYTE *ppGlobalInfo,LPDWORD lpdwGlobalInfoSize,LPBYTE *ppClientInterfaceInfo,LPDWORD lpdwClientInterfaceInfoSize,LPWSTR *lplpwsDLLPath);
    593   DWORD WINAPI MprConfigTransportEnum(HANDLE hMprConfig,DWORD dwLevel,LPBYTE *lplpBuffer,DWORD dwPrefMaxLen,LPDWORD lpdwEntriesRead,LPDWORD lpdwTotalEntries,LPDWORD lpdwResumeHandle);
    594   DWORD WINAPI MprConfigInterfaceCreate(HANDLE hMprConfig,DWORD dwLevel,LPBYTE lpbBuffer,HANDLE *phRouterInterface);
    595   DWORD WINAPI MprConfigInterfaceDelete(HANDLE hMprConfig,HANDLE hRouterInterface);
    596   DWORD WINAPI MprConfigInterfaceGetHandle(HANDLE hMprConfig,LPWSTR lpwsInterfaceName,HANDLE *phRouterInterface);
    597   DWORD WINAPI MprConfigInterfaceGetInfo(HANDLE hMprConfig,HANDLE hRouterInterface,DWORD dwLevel,LPBYTE *lplpBuffer,LPDWORD lpdwBufferSize);
    598   DWORD WINAPI MprConfigInterfaceSetInfo(HANDLE hMprConfig,HANDLE hRouterInterface,DWORD dwLevel,LPBYTE lpbBuffer);
    599   DWORD WINAPI MprConfigInterfaceEnum(HANDLE hMprConfig,DWORD dwLevel,LPBYTE *lplpBuffer,DWORD dwPrefMaxLen,LPDWORD lpdwEntriesRead,LPDWORD lpdwTotalEntries,LPDWORD lpdwResumeHandle);
    600   DWORD WINAPI MprConfigInterfaceTransportAdd(HANDLE hMprConfig,HANDLE hRouterInterface,DWORD dwTransportId,LPWSTR lpwsTransportName,LPBYTE pInterfaceInfo,DWORD dwInterfaceInfoSize,HANDLE *phRouterIfTransport);
    601   DWORD WINAPI MprConfigInterfaceTransportRemove(HANDLE hMprConfig,HANDLE hRouterInterface,HANDLE hRouterIfTransport);
    602   DWORD WINAPI MprConfigInterfaceTransportGetHandle(HANDLE hMprConfig,HANDLE hRouterInterface,DWORD dwTransportId,HANDLE *phRouterIfTransport);
    603   DWORD WINAPI MprConfigInterfaceTransportGetInfo(HANDLE hMprConfig,HANDLE hRouterInterface,HANDLE hRouterIfTransport,LPBYTE *ppInterfaceInfo,LPDWORD lpdwInterfaceInfoSize);
    604   DWORD WINAPI MprConfigInterfaceTransportSetInfo(HANDLE hMprConfig,HANDLE hRouterInterface,HANDLE hRouterIfTransport,LPBYTE pInterfaceInfo,DWORD dwInterfaceInfoSize);
    605   DWORD WINAPI MprConfigInterfaceTransportEnum(HANDLE hMprConfig,HANDLE hRouterInterface,DWORD dwLevel,LPBYTE *lplpBuffer,DWORD dwPrefMaxLen,LPDWORD lpdwEntriesRead,LPDWORD lpdwTotalEntries,LPDWORD lpdwResumeHandle);
    606   DWORD WINAPI MprConfigGetFriendlyName(HANDLE hMprConfig,PWCHAR pszGuidName,PWCHAR pszBuffer,DWORD dwBufferSize);
    607   DWORD WINAPI MprConfigGetGuidName(HANDLE hMprConfig,PWCHAR pszFriendlyName,PWCHAR pszBuffer,DWORD dwBufferSize);
    608   DWORD WINAPI MprInfoCreate(DWORD dwVersion,LPVOID *lplpNewHeader);
    609   DWORD WINAPI MprInfoDelete(LPVOID lpHeader);
    610   DWORD WINAPI MprInfoRemoveAll(LPVOID lpHeader,LPVOID *lplpNewHeader);
    611   DWORD WINAPI MprInfoDuplicate(LPVOID lpHeader,LPVOID *lplpNewHeader);
    612   DWORD WINAPI MprInfoBlockAdd(LPVOID lpHeader,DWORD dwInfoType,DWORD dwItemSize,DWORD dwItemCount,LPBYTE lpItemData,LPVOID *lplpNewHeader);
    613   DWORD WINAPI MprInfoBlockRemove(LPVOID lpHeader,DWORD dwInfoType,LPVOID *lplpNewHeader);
    614   DWORD WINAPI MprInfoBlockSet(LPVOID lpHeader,DWORD dwInfoType,DWORD dwItemSize,DWORD dwItemCount,LPBYTE lpItemData,LPVOID *lplpNewHeader);
    615   DWORD WINAPI MprInfoBlockFind(LPVOID lpHeader,DWORD dwInfoType,LPDWORD lpdwItemSize,LPDWORD lpdwItemCount,LPBYTE *lplpItemData);
    616   DWORD WINAPI MprInfoBlockQuerySize(LPVOID lpHeader);
    617 
    618 #define MprInfoBlockExists(h,t) (MprInfoBlockFind((h),(t),NULL,NULL,NULL)==NO_ERROR)
    619 
    620 #if (_WIN32_WINNT >= 0x0600)
    621 typedef enum _RAS_QUARANTINE_STATE {
    622   RAS_QUAR_STATE_NORMAL,
    623   RAS_QUAR_STATE_QUARANTINE,
    624   RAS_QUAR_STATE_PROBATION,
    625   RAS_QUAR_STATE_NOT_CAPABLE
    626 } RAS_QUARANTINE_STATE;
    627 
    628 typedef struct _MPR_FILTER_0 {
    629   WINBOOL fEnabled;
    630 } MPR_FILTER_0, *PMPR_FILTER_0;
    631 
    632 typedef struct _MPR_SERVER_2 {
    633   DWORD dwNumPptpPorts;
    634   DWORD dwPptpPortFlags;
    635   DWORD dwNumL2tpPorts;
    636   DWORD dwL2tpPortFlags;
    637   DWORD dwNumSstpPorts;
    638   DWORD dwSstpPortFlags;
    639 } MPR_SERVER_2, *PMPR_SERVER_2;
    640 
    641 typedef struct _PPP_IPV6CP_INFO {
    642   DWORD dwVersion;
    643   DWORD dwSize;
    644   DWORD dwError;
    645   BYTE  bInterfaceIdentifier[8];
    646   BYTE  bRemoteInterfaceIdentifier[8];
    647   DWORD dwOptions;
    648   DWORD dwRemoteOptions;
    649   BYTE  bPrefix[8];
    650   DWORD dwPrefixLength;
    651 } PPP_IPV6_CP_INFO, *PPPP_IPV6_CP_INFO;
    652 
    653 typedef struct _PPP_INFO_3 {
    654   PPP_NBFCP_INFO   nbf;
    655   PPP_IPCP_INFO2   ip;
    656   PPP_IPV6_CP_INFO ipv6;
    657   PPP_CCP_INFO     ccp;
    658   PPP_LCP_INFO     lcp;
    659 } PPP_INFO_3;
    660 
    661 typedef struct _RAS_CONNECTION_3 {
    662   DWORD                 dwVersion;
    663   DWORD                 dwSize;
    664   HANDLE                hConnection;
    665   WCHAR                 wszUserName[UNLEN + 1];
    666   ROUTER_INTERFACE_TYPE dwInterfaceType;
    667   GUID                  guid;
    668   PPP_INFO_3            PppInfo3;
    669   RAS_QUARANTINE_STATE  rasQuarState;
    670   FILETIME              timer;
    671 } RAS_CONNECTION_3, *PRAS_CONNECTION_3;
    672 
    673 WINBOOL CALLBACK MprAdminAcceptNewConnection3(
    674   RAS_CONNECTION_0 *pRasConnection0,
    675   RAS_CONNECTION_1 *pRasConnection1,
    676   RAS_CONNECTION_2 *pRasConnection2,
    677   RAS_CONNECTION_3 *pRasConnection3
    678 );
    679 
    680 WINBOOL CALLBACK MprAdminAcceptReauthentication(
    681   RAS_CONNECTION_0 *pRasConnection0,
    682   RAS_CONNECTION_1 *pRasConnection1,
    683   RAS_CONNECTION_2 *pRasConnection2,
    684   RAS_CONNECTION_3 *pRasConnection3
    685 );
    686 
    687 void CALLBACK MprAdminConnectionHangupNotification3(
    688   RAS_CONNECTION_0 *pRasConnection0,
    689   RAS_CONNECTION_1 *pRasConnection1,
    690   RAS_CONNECTION_2 *pRasConnection2,
    691   RAS_CONNECTION_3 *pRasConnection3
    692 );
    693 
    694 DWORD CALLBACK MprAdminGetIpv6AddressForUser(
    695   WCHAR *lpwszUserName,
    696   WCHAR *lpwszPortName,
    697   IN6_ADDR *lpdwIpv6Address,
    698   WINBOOL *bNotifyRelease
    699 );
    700 
    701 DWORD CALLBACK MprAdminReleaseIpv6AddressForUser(
    702   WCHAR *lpwszUserName,
    703   WCHAR *lpwszPortName,
    704   IN6_ADDR *lpdwIpv6Address
    705 );
    706 
    707 DWORD WINAPI MprConfigFilterGetInfo(
    708   HANDLE hMprConfig,
    709   DWORD dwLevel,
    710   DWORD dwTransportId,
    711   LPBYTE lpBuffer
    712 );
    713 
    714 DWORD WINAPI MprConfigFilterSetInfo(
    715   HANDLE hMprConfig,
    716   DWORD dwLevel,
    717   DWORD dwTransportId,
    718   LPBYTE lpBuffer
    719 );
    720 
    721 #endif /*(_WIN32_WINNT >= 0x0600)*/
    722 
    723 #if (_WIN32_WINNT >= 0x0601)
    724 #define MPRAPI_RAS_CONNECTION_OBJECT_REVISION_1 0x01
    725 #define MPRAPI_MPR_SERVER_OBJECT_REVISION_1 0x01
    726 #define MPRAPI_MPR_SERVER_SET_CONFIG_OBJECT_REVISION_1 0x01
    727 
    728 typedef enum  {
    729   MPRAPI_OBJECT_TYPE_RAS_CONNECTION_OBJECT          = 0x1,
    730   MPRAPI_OBJECT_TYPE_MPR_SERVER_OBJECT              = 0x2,
    731   MPRAPI_OBJECT_TYPE_MPR_SERVER_SET_CONFIG_OBJECT   = 0x3,
    732   MPRAPI_OBJECT_TYPE_AUTH_VALIDATION_OBJECT         = 0x4,
    733   MPRAPI_OBJECT_TYPE_UPDATE_CONNECTION_OBJECT       = 0x5
    734 } MPRAPI_OBJECT_TYPE;
    735 
    736 typedef struct _MPRAPI_OBJECT_HEADER {
    737   UCHAR revision;
    738   UCHAR  type;
    739   USHORT size;
    740 } MPRAPI_OBJECT_HEADER, *PMPRAPI_OBJECT_HEADER;
    741 
    742 typedef struct _AUTH_VALIDATION_EX {
    743   MPRAPI_OBJECT_HEADER         Header;
    744   HANDLE                       hRasConnection;
    745   WCHAR                        wszUserName[UNLEN + 1 ];
    746   WCHAR                        wszLogonDomain[DNLEN + 1 ];
    747   DWORD                        AuthInfoSize;
    748   BYTE                         AuthInfo[1];
    749 } AUTH_VALIDATION_EX, *PAUTH_VALIDATION_EX;
    750 
    751 #define RAS_FLAGS_PPP_CONNECTION 0x00000001
    752 #define RAS_FLAGS_MESSENGER_PRESENT 0x00000002
    753 #define RAS_FLAGS_QUARANTINE_PRESENT 0x00000008
    754 #define RAS_FLAGS_ARAP_CONNECTION 0x00000010
    755 #define RAS_FLAGS_IKEV2_CONNECTION 0x00000010
    756 #define RAS_FLAGS_DORMANT 0x00000020
    757 
    758 #define IPADDRESSLEN 15
    759 
    760 typedef struct _PPP_PROJECTION_INFO {
    761   DWORD   dwIPv4NegotiationError;
    762   WCHAR   wszAddress[IPADDRESSLEN + 1];
    763   WCHAR   wszRemoteAddress[IPADDRESSLEN + 1];
    764   DWORD   dwIPv4Options;
    765   DWORD   dwIPv4RemoteOptions;
    766   ULONG64 IPv4SubInterfaceIndex;
    767   DWORD   dwIPv6NegotiationError;
    768   BYTE    bInterfaceIdentifier[8];
    769   BYTE    bRemoteInterfaceIdentifier[8];
    770   BYTE    bPrefix[8];
    771   DWORD   dwPrefixLength;
    772   ULONG64 IPv6SubInterfaceIndex;
    773   DWORD   dwLcpError;
    774   DWORD   dwAuthenticationProtocol;
    775   DWORD   dwAuthenticationData;
    776   DWORD   dwRemoteAuthenticationProtocol;
    777   DWORD   dwRemoteAuthenticationData;
    778   DWORD   dwLcpTerminateReason;
    779   DWORD   dwLcpRemoteTerminateReason;
    780   DWORD   dwLcpOptions;
    781   DWORD   dwLcpRemoteOptions;
    782   DWORD   dwEapTypeId;
    783   DWORD   dwRemoteEapTypeId;
    784   DWORD   dwCcpError;
    785   DWORD   dwCompressionAlgorithm;
    786   DWORD   dwCcpOptions;
    787   DWORD   dwRemoteCompressionAlgorithm;
    788   DWORD   dwCcpRemoteOptions;
    789 } PPP_PROJECTION_INFO, *PPPP_PROJECTION_INFO;
    790 
    791 typedef struct _IKEV2_PROJECTION_INFO {
    792   DWORD   dwIPv4NegotiationError;
    793   WCHAR   wszAddress[IPADDRESSLEN  + 1];
    794   WCHAR   wszRemoteAddress[IPADDRESSLEN  + 1];
    795   ULONG64 IPv4SubInterfaceIndex;
    796   DWORD   dwIPv6NegotiationError;
    797   BYTE    bInterfaceIdentifier[8];
    798   BYTE    bRemoteInterfaceIdentifier[8];
    799   BYTE    bPrefix[8];
    800   DWORD   dwPrefixLength;
    801   ULONG64 IPv6SubInterfaceIndex;
    802   DWORD   dwOptions;
    803   DWORD   dwAuthenticationProtocol;
    804   DWORD   dwEapTypeId;
    805   DWORD   dwCompressionAlgorithm;
    806   DWORD   dwEncryptionMethod;
    807 } IKEV2_PROJECTION_INFO, *PIKEV2_PROJECTION_INFO;
    808 
    809 typedef struct _PROJECTION_INFO {
    810   UCHAR projectionInfoType;
    811   __C89_NAMELESS union {
    812     IKEV2_PROJECTION_INFO Ikev2ProjectionInfo;
    813     PPP_PROJECTION_INFO   PppProjectionInfo;
    814   } DUMMYUNIONNAME;
    815 } PROJECTION_INFO, *PPROJECTION_INFO;
    816 
    817 typedef struct _RAS_CONNECTION_EX {
    818   MPRAPI_OBJECT_HEADER  Header;
    819   DWORD                 dwConnectDuration;
    820   ROUTER_INTERFACE_TYPE dwInterfaceType;
    821   DWORD                 dwConnectionFlags;
    822   WCHAR                 wszInterfaceName[MAX_INTERFACE_NAME_LEN + 1];
    823   WCHAR                 wszUserName[UNLEN + 1];
    824   WCHAR                 wszLogonDomain[DNLEN + 1];
    825   WCHAR                 wszRemoteComputer[NETBIOS_NAME_LEN + 1];
    826   GUID                  guid;
    827   RAS_QUARANTINE_STATE  rasQuarState;
    828   FILETIME              probationTime;
    829   DWORD                 dwBytesXmited;
    830   DWORD                 dwBytesRcved;
    831   DWORD                 dwFramesXmited;
    832   DWORD                 dwFramesRcved;
    833   DWORD                 dwCrcErr;
    834   DWORD                 dwTimeoutErr;
    835   DWORD                 dwAlignmentErr;
    836   DWORD                 dwHardwareOverrunErr;
    837   DWORD                 dwFramingErr;
    838   DWORD                 dwBufferOverrunErr;
    839   DWORD                 dwCompressionRatioIn;
    840   DWORD                 dwCompressionRatioOut;
    841   DWORD                 dwNumSwitchOvers;
    842   WCHAR                 wszRemoteEndpointAddress[MAXIPADRESSLEN+1];
    843   WCHAR                 wszLocalEndpointAddress[MAXIPADRESSLEN+1];
    844   PROJECTION_INFO       ProjectionInfo;
    845   HANDLE                hConnection;
    846   HANDLE                hInterface;
    847 } RAS_CONNECTION_EX, *PRAS_CONNECTION_EX;
    848 
    849 typedef struct _RAS_UPDATE_CONNECTION {
    850   MPRAPI_OBJECT_HEADER Header;
    851   DWORD                dwIfIndex;
    852   WCHAR                wszLocalEndpointAddress[MAXIPADRESSLEN+1];
    853   WCHAR                wszRemoteEndpointAddress[MAXIPADRESSLEN+1];
    854 } RAS_UPDATE_CONNECTION, *PRAS_UPDATE_CONNECTION;
    855 
    856 #define MPRAPI_IKEV2_SET_TUNNEL_CONFIG_PARAMS 0x01
    857 
    858 typedef struct _IKEV2_TUNNEL_CONFIG_PARAMS {
    859   DWORD          dwIdleTimeout;
    860   DWORD          dwNetworkBlackoutTime;
    861   DWORD          dwSaLifeTime;
    862   DWORD          dwSaDataSizeForRenegotiation;
    863   DWORD          dwConfigOptions;
    864   DWORD          dwTotalCertificates;
    865   CERT_NAME_BLOB *certificateNames;
    866 } IKEV2_TUNNEL_CONFIG_PARAMS, *PIKEV2_TUNNEL_CONFIG_PARAMS;
    867 
    868 typedef struct _IKEV2_CONFIG_PARAMS {
    869   DWORD                      dwNumPorts;
    870   DWORD                      dwPortFlags;
    871   DWORD                      dwTunnelConfigParamFlags;
    872   IKEV2_TUNNEL_CONFIG_PARAMS TunnelConfigParams;
    873 } IKEV2_CONFIG_PARAMS, *PIKEV2_CONFIG_PARAMS;
    874 
    875 typedef struct _PPTP_CONFIG_PARAMS {
    876   DWORD dwNumPorts;
    877   DWORD dwPortFlags;
    878 } PPTP_CONFIG_PARAMS, *PPPTP_CONFIG_PARAMS;
    879 
    880 typedef struct _L2TP_CONFIG_PARAMS {
    881   DWORD dwNumPorts;
    882   DWORD dwPortFlags;
    883 } L2TP_CONFIG_PARAMS, *PL2TP_CONFIG_PARAMS;
    884 
    885 typedef struct _SSTP_CERT_INFO {
    886   BOOL            isDefault;
    887   CRYPT_HASH_BLOB certBlob;
    888 } SSTP_CERT_INFO, *PSSTP_CERT_INFO;
    889 
    890 typedef struct _SSTP_CONFIG_PARAMS {
    891   DWORD          dwNumPorts;
    892   DWORD          dwPortFlags;
    893   BOOL           isUseHttps;
    894   DWORD          certAlgorithm;
    895   SSTP_CERT_INFO sstpCertDetails;
    896 } SSTP_CONFIG_PARAMS, *PSSTP_CONFIG_PARAMS;
    897 
    898 typedef struct _MPRAPI_TUNNEL_CONFIG_PARAMS {
    899   IKEV2_CONFIG_PARAMS IkeConfigParams;
    900   PPTP_CONFIG_PARAMS  PptpConfigParams;
    901   L2TP_CONFIG_PARAMS  L2tpConfigParams;
    902   SSTP_CONFIG_PARAMS  SstpConfigParams;
    903 } MPRAPI_TUNNEL_CONFIG_PARAMS, *PMPRAPI_TUNNEL_CONFIG_PARAMS;
    904 
    905 typedef struct _MPR_SERVER_SET_CONFIG_EX {
    906   MPRAPI_OBJECT_HEADER        Header;
    907   DWORD                       setConfigForProtocols;
    908   MPRAPI_TUNNEL_CONFIG_PARAMS ConfigParams;
    909 } MPR_SERVER_SET_CONFIG_EX, *PMPR_SERVER_SET_CONFIG_EX;
    910 
    911 typedef struct _MPR_SERVER_EX {
    912   MPRAPI_OBJECT_HEADER        Header;
    913   DWORD                       fLanOnlyMode;
    914   DWORD                       dwUpTime;
    915   DWORD                       dwTotalPorts;
    916   DWORD                       dwPortsInUse;
    917   DWORD                       Reserved;
    918   MPRAPI_TUNNEL_CONFIG_PARAMS ConfigParams;
    919 } MPR_SERVER_EX, *PMPR_SERVER_EX;
    920 
    921 typedef DWORD (APIENTRY * PMPRADMINGETIPADDRESSFORUSER)(WCHAR *, WCHAR *, DWORD *, WINBOOL *);
    922 typedef VOID  (APIENTRY * PMPRADMINRELEASEIPADRESS)(WCHAR *, WCHAR *, DWORD *);
    923 typedef DWORD (APIENTRY * PMPRADMINGETIPV6ADDRESSFORUSER)(WCHAR *, WCHAR *, IN6_ADDR *, WINBOOL *);
    924 typedef VOID  (APIENTRY * PMPRADMINRELEASEIPV6ADDRESSFORUSER)(WCHAR *, WCHAR *, IN6_ADDR *);
    925 typedef WINBOOL (APIENTRY * PMPRADMINACCEPTNEWLINK)(RAS_PORT_0 *, RAS_PORT_1 *);
    926 typedef VOID  (APIENTRY * PMPRADMINLINKHANGUPNOTIFICATION)(RAS_PORT_0 *, RAS_PORT_1 *);
    927 typedef DWORD (APIENTRY * PMPRADMINTERMINATEDLL)();
    928 typedef BOOL  (APIENTRY * PMPRADMINACCEPTNEWCONNECTIONEX)(RAS_CONNECTION_EX *);
    929 typedef BOOL  (APIENTRY * PMPRADMINACCEPTREAUTHENTICATIONEX)(RAS_CONNECTION_EX *);
    930 typedef VOID  (APIENTRY * PMPRADMINCONNECTIONHANGUPNOTIFICATIONEX)(RAS_CONNECTION_EX *);
    931 
    932 typedef struct _MPRAPI_ADMIN_DLL_CALLBACKS {
    933   UCHAR                                   revision;
    934   PMPRADMINGETIPADDRESSFORUSER            lpfnMprAdminGetIpAddressForUser;
    935   PMPRADMINRELEASEIPADRESS                lpfnMprAdminReleaseIpAddress;
    936   PMPRADMINGETIPV6ADDRESSFORUSER          lpfnMprAdminGetIpv6AddressForUser;
    937   PMPRADMINRELEASEIPV6ADDRESSFORUSER      lpfnMprAdminReleaseIpV6AddressForUser;
    938   PMPRADMINACCEPTNEWLINK                  lpfnRasAdminAcceptNewLink;
    939   PMPRADMINLINKHANGUPNOTIFICATION         lpfnRasAdminLinkHangupNotification;
    940   PMPRADMINTERMINATEDLL                   lpfnRasAdminTerminateDll;
    941   PMPRADMINACCEPTNEWCONNECTIONEX          lpfnRasAdminAcceptNewConnectionEx;
    942   PMPRADMINACCEPTREAUTHENTICATIONEX       lpfnRasAdminAcceptReauthenticationEx;
    943   PMPRADMINCONNECTIONHANGUPNOTIFICATIONEX lpfnRasAdminConnectionHangupNotificationEx;
    944 } MPRAPI_ADMIN_DLL_CALLBACKS, *PMPRAPI_ADMIN_DLL_CALLBACKS;
    945 
    946 DWORD APIENTRY MprConfigServerSetInfoEx(HANDLE hMprConfig,MPR_SERVER_SET_CONFIG_EX *pSetServerConfig);
    947 
    948 DWORD APIENTRY MprConfigServerGetInfoEx(
    949   HANDLE hMprConfig,
    950   MPR_SERVER_EX *pServerInfo
    951 );
    952 
    953 DWORD APIENTRY MprAdminConnectionEnumEx(
    954   RAS_SERVER_HANDLE hRasServer,
    955   PMPRAPI_OBJECT_HEADER pObjectHeader,
    956   DWORD dwPreferedMaxLen,
    957   LPDWORD lpdwEntriesRead,
    958   LPDWORD lpdwTotalEntries,
    959   PRAS_CONNECTION_EX *ppRasConn,
    960   LPDWORD lpdwResumeHandle
    961 );
    962 
    963 DWORD APIENTRY MprAdminConnectionGetInfoEx(
    964   RAS_SERVER_HANDLE hRasServer,
    965   HANDLE hConnection,
    966   PRAS_CONNECTION_EX pRasConnection
    967 );
    968 
    969 DWORD APIENTRY MprAdminInitializeDllEx(
    970   PMPRAPI_ADMIN_DLL_CALLBACKS pAdminCallbacks
    971 );
    972 
    973 DWORD APIENTRY MprAdminIsServiceInitialized(
    974   LPWSTR   lpwsServerName,
    975   WINBOOL  *fIsServiceInitialized
    976 );
    977 
    978 DWORD APIENTRY MprAdminServerGetInfoEx(
    979   MPR_SERVER_HANDLE hMprServer,
    980   MPR_SERVER_EX *pServerInfo
    981 );
    982 
    983 DWORD APIENTRY MprAdminServerSetInfoEx(
    984   MPR_SERVER_HANDLE hMprServer,
    985   MPR_SERVER_SET_CONFIG_EX *pServerInfo
    986 );
    987 
    988 #endif /*(_WIN32_WINNT >= 0x0601)*/
    989 
    990 #ifdef __cplusplus
    991 }
    992 #endif
    993 
    994 #endif /* __ROUTING_MPRADMIN_H__ */
    995