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 _RAS_H_
      7 #define _RAS_H_
      8 
      9 #include <_mingw_unicode.h>
     10 
     11 #include <inaddr.h>
     12 #include <in6addr.h>
     13 #include <naptypes.h>
     14 
     15 #ifdef __cplusplus
     16 extern "C" {
     17 #endif
     18 
     19 typedef struct in_addr RASIPV4ADDR;
     20 typedef struct in6_addr RASIPV6ADDR;
     21 
     22 
     23 #ifndef UNLEN
     24 #include <lmcons.h>
     25 #endif
     26 
     27 #include <pshpack4.h>
     28 
     29 #define RAS_MaxDeviceType 16
     30 #define RAS_MaxPhoneNumber 128
     31 #define RAS_MaxIpAddress 15
     32 #define RAS_MaxIpxAddress 21
     33 
     34 #define RAS_MaxEntryName 256
     35 #define RAS_MaxDeviceName 128
     36 #define RAS_MaxCallbackNumber RAS_MaxPhoneNumber
     37 #define RAS_MaxAreaCode 10
     38 #define RAS_MaxPadType 32
     39 #define RAS_MaxX25Address 200
     40 #define RAS_MaxFacilities 200
     41 #define RAS_MaxUserData 200
     42 #define RAS_MaxReplyMessage 1024
     43 #define RAS_MaxDnsSuffix 256
     44 
     45   DECLARE_HANDLE(HRASCONN);
     46 #define LPHRASCONN HRASCONN*
     47 
     48 #define RASCF_AllUsers 0x00000001
     49 #define RASCF_GlobalCreds 0x00000002
     50 
     51 #define RASCONNW struct tagRASCONNW
     52   RASCONNW {
     53     DWORD dwSize;
     54     HRASCONN hrasconn;
     55     WCHAR szEntryName[RAS_MaxEntryName + 1 ];
     56 
     57     WCHAR szDeviceType[RAS_MaxDeviceType + 1 ];
     58     WCHAR szDeviceName[RAS_MaxDeviceName + 1 ];
     59     WCHAR szPhonebook [MAX_PATH ];
     60     DWORD dwSubEntry;
     61     GUID guidEntry;
     62     DWORD dwFlags;
     63     LUID luid;
     64   };
     65 
     66 #define RASCONNA struct tagRASCONNA
     67   RASCONNA {
     68     DWORD dwSize;
     69     HRASCONN hrasconn;
     70     CHAR szEntryName[RAS_MaxEntryName + 1 ];
     71     CHAR szDeviceType[RAS_MaxDeviceType + 1 ];
     72     CHAR szDeviceName[RAS_MaxDeviceName + 1 ];
     73     CHAR szPhonebook [MAX_PATH ];
     74     DWORD dwSubEntry;
     75     GUID guidEntry;
     76     DWORD dwFlags;
     77     LUID luid;
     78   };
     79 
     80 #define RASCONN __MINGW_NAME_AW(RASCONN)
     81 
     82 #define LPRASCONNW RASCONNW*
     83 #define LPRASCONNA RASCONNA*
     84 #define LPRASCONN RASCONN*
     85 
     86 #define RASCS_PAUSED 0x1000
     87 #define RASCS_DONE 0x2000
     88 
     89 #define RASCONNSTATE enum tagRASCONNSTATE
     90   RASCONNSTATE {
     91     RASCS_OpenPort = 0,RASCS_PortOpened,RASCS_ConnectDevice,RASCS_DeviceConnected,RASCS_AllDevicesConnected,RASCS_Authenticate,
     92     RASCS_AuthNotify,RASCS_AuthRetry,RASCS_AuthCallback,RASCS_AuthChangePassword,RASCS_AuthProject,RASCS_AuthLinkSpeed,
     93     RASCS_AuthAck,RASCS_ReAuthenticate,RASCS_Authenticated,RASCS_PrepareForCallback,RASCS_WaitForModemReset,RASCS_WaitForCallback,RASCS_Projected,
     94     RASCS_StartAuthentication,RASCS_CallbackComplete,RASCS_LogonNetwork,RASCS_SubEntryConnected,
     95     RASCS_SubEntryDisconnected,RASCS_Interactive = RASCS_PAUSED,RASCS_RetryAuthentication,RASCS_CallbackSetByCaller,RASCS_PasswordExpired,
     96     RASCS_InvokeEapUI,RASCS_Connected = RASCS_DONE,RASCS_Disconnected
     97   };
     98 
     99 #define LPRASCONNSTATE RASCONNSTATE*
    100 
    101 #define RASCONNSTATUSW struct tagRASCONNSTATUSW
    102   RASCONNSTATUSW {
    103     DWORD dwSize;
    104     RASCONNSTATE rasconnstate;
    105     DWORD dwError;
    106     WCHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    107     WCHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    108     WCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    109   };
    110 
    111 #define RASCONNSTATUSA struct tagRASCONNSTATUSA
    112   RASCONNSTATUSA {
    113     DWORD dwSize;
    114     RASCONNSTATE rasconnstate;
    115     DWORD dwError;
    116     CHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    117     CHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    118     CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    119   };
    120 
    121 #define RASCONNSTATUS __MINGW_NAME_AW(RASCONNSTATUS)
    122 
    123 #define LPRASCONNSTATUSW RASCONNSTATUSW*
    124 #define LPRASCONNSTATUSA RASCONNSTATUSA*
    125 #define LPRASCONNSTATUS RASCONNSTATUS*
    126 
    127 #define RASDIALPARAMSW struct tagRASDIALPARAMSW
    128   RASDIALPARAMSW {
    129     DWORD dwSize;
    130     WCHAR szEntryName[RAS_MaxEntryName + 1 ];
    131     WCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    132     WCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1 ];
    133     WCHAR szUserName[UNLEN + 1 ];
    134     WCHAR szPassword[PWLEN + 1 ];
    135     WCHAR szDomain[DNLEN + 1 ];
    136     DWORD dwSubEntry;
    137     ULONG_PTR dwCallbackId;
    138   };
    139 
    140 #define RASDIALPARAMSA struct tagRASDIALPARAMSA
    141   RASDIALPARAMSA {
    142     DWORD dwSize;
    143     CHAR szEntryName[RAS_MaxEntryName + 1 ];
    144     CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    145     CHAR szCallbackNumber[RAS_MaxCallbackNumber + 1 ];
    146     CHAR szUserName[UNLEN + 1 ];
    147     CHAR szPassword[PWLEN + 1 ];
    148     CHAR szDomain[DNLEN + 1 ];
    149     DWORD dwSubEntry;
    150     ULONG_PTR dwCallbackId;
    151   };
    152 
    153 #define RASDIALPARAMS __MINGW_NAME_AW(RASDIALPARAMS)
    154 
    155 #define LPRASDIALPARAMSW RASDIALPARAMSW*
    156 #define LPRASDIALPARAMSA RASDIALPARAMSA*
    157 #define LPRASDIALPARAMS RASDIALPARAMS*
    158 
    159 #define RASEAPINFO struct tagRASEAPINFO
    160   RASEAPINFO {
    161     DWORD dwSizeofEapInfo;
    162     BYTE *pbEapInfo;
    163   };
    164 
    165 #define RASDIALEXTENSIONS struct tagRASDIALEXTENSIONS
    166   RASDIALEXTENSIONS {
    167     DWORD dwSize;
    168     DWORD dwfOptions;
    169     HWND hwndParent;
    170     ULONG_PTR reserved;
    171     ULONG_PTR reserved1;
    172     RASEAPINFO RasEapInfo;
    173   };
    174 
    175 #define LPRASDIALEXTENSIONS RASDIALEXTENSIONS*
    176 
    177 #define RDEOPT_UsePrefixSuffix 0x00000001
    178 #define RDEOPT_PausedStates 0x00000002
    179 #define RDEOPT_IgnoreModemSpeaker 0x00000004
    180 #define RDEOPT_SetModemSpeaker 0x00000008
    181 #define RDEOPT_IgnoreSoftwareCompression 0x00000010
    182 #define RDEOPT_SetSoftwareCompression 0x00000020
    183 #define RDEOPT_DisableConnectedUI 0x00000040
    184 #define RDEOPT_DisableReconnectUI 0x00000080
    185 #define RDEOPT_DisableReconnect 0x00000100
    186 #define RDEOPT_NoUser 0x00000200
    187 #define RDEOPT_PauseOnScript 0x00000400
    188 #define RDEOPT_Router 0x00000800
    189 #define RDEOPT_CustomDial 0x00001000
    190 #define RDEOPT_UseCustomScripting 0x00002000
    191 
    192 #define REN_User 0x00000000
    193 #define REN_AllUsers 0x00000001
    194 
    195 #define RASENTRYNAMEW struct tagRASENTRYNAMEW
    196   RASENTRYNAMEW {
    197     DWORD dwSize;
    198     WCHAR szEntryName[RAS_MaxEntryName + 1 ];
    199     DWORD dwFlags;
    200     WCHAR szPhonebookPath[MAX_PATH + 1];
    201   };
    202 
    203 #define RASENTRYNAMEA struct tagRASENTRYNAMEA
    204   RASENTRYNAMEA {
    205     DWORD dwSize;
    206     CHAR szEntryName[RAS_MaxEntryName + 1 ];
    207     DWORD dwFlags;
    208     CHAR szPhonebookPath[MAX_PATH + 1];
    209   };
    210 
    211 #define RASENTRYNAME __MINGW_NAME_AW(RASENTRYNAME)
    212 
    213 #define LPRASENTRYNAMEW RASENTRYNAMEW*
    214 #define LPRASENTRYNAMEA RASENTRYNAMEA*
    215 #define LPRASENTRYNAME RASENTRYNAME*
    216 
    217 #define RASPROJECTION enum tagRASPROJECTION
    218   RASPROJECTION {
    219     RASP_Amb = 0x10000,RASP_PppNbf = 0x803F,RASP_PppIpx = 0x802B,RASP_PppIp = 0x8021,
    220     RASP_PppCcp = 0x80FD,RASP_PppLcp = 0xC021,RASP_Slip = 0x20000
    221   };
    222 
    223 #define LPRASPROJECTION RASPROJECTION *
    224 
    225 #define RASAMBW struct tagRASAMBW
    226   RASAMBW {
    227     DWORD dwSize;
    228     DWORD dwError;
    229     WCHAR szNetBiosError[NETBIOS_NAME_LEN + 1 ];
    230     BYTE bLana;
    231   };
    232 
    233 #define RASAMBA struct tagRASAMBA
    234   RASAMBA {
    235     DWORD dwSize;
    236     DWORD dwError;
    237     CHAR szNetBiosError[NETBIOS_NAME_LEN + 1 ];
    238     BYTE bLana;
    239   };
    240 
    241 #define RASAMB __MINGW_NAME_AW(RASAMB)
    242 
    243 #define LPRASAMBW RASAMBW*
    244 #define LPRASAMBA RASAMBA*
    245 #define LPRASAMB RASAMB*
    246 
    247 #define RASPPPNBFW struct tagRASPPPNBFW
    248   RASPPPNBFW {
    249     DWORD dwSize;
    250     DWORD dwError;
    251     DWORD dwNetBiosError;
    252     WCHAR szNetBiosError[NETBIOS_NAME_LEN + 1 ];
    253     WCHAR szWorkstationName[NETBIOS_NAME_LEN + 1 ];
    254     BYTE bLana;
    255   };
    256 
    257 #define RASPPPNBFA struct tagRASPPPNBFA
    258   RASPPPNBFA {
    259     DWORD dwSize;
    260     DWORD dwError;
    261     DWORD dwNetBiosError;
    262     CHAR szNetBiosError[NETBIOS_NAME_LEN + 1 ];
    263     CHAR szWorkstationName[NETBIOS_NAME_LEN + 1 ];
    264     BYTE bLana;
    265   };
    266 
    267 #define RASPPPNBF __MINGW_NAME_AW(RASPPPNBF)
    268 
    269 #define LPRASPPPNBFW RASPPPNBFW*
    270 #define LPRASPPPNBFA RASPPPNBFA*
    271 #define LPRASPPPNBF RASPPPNBF*
    272 
    273 #define RASPPPIPXW struct tagRASIPXW
    274   RASPPPIPXW {
    275     DWORD dwSize;
    276     DWORD dwError;
    277     WCHAR szIpxAddress[RAS_MaxIpxAddress + 1 ];
    278   };
    279 
    280 #define RASPPPIPXA struct tagRASPPPIPXA
    281   RASPPPIPXA {
    282     DWORD dwSize;
    283     DWORD dwError;
    284     CHAR szIpxAddress[RAS_MaxIpxAddress + 1 ];
    285   };
    286 
    287 #define RASPPPIPX __MINGW_NAME_AW(RASPPPIPX)
    288 
    289 #define LPRASPPPIPXW RASPPPIPXW *
    290 #define LPRASPPPIPXA RASPPPIPXA *
    291 #define LPRASPPPIPX RASPPPIPX *
    292 
    293 #define RASIPO_VJ 0x00000001
    294 
    295 #define RASPPPIPW struct tagRASPPPIPW
    296   RASPPPIPW {
    297     DWORD dwSize;
    298     DWORD dwError;
    299     WCHAR szIpAddress[RAS_MaxIpAddress + 1 ];
    300 
    301 #ifndef WINNT35COMPATIBLE
    302 
    303     WCHAR szServerIpAddress[RAS_MaxIpAddress + 1 ];
    304 #endif
    305     DWORD dwOptions;
    306     DWORD dwServerOptions;
    307   };
    308 
    309 #define RASPPPIPA struct tagRASPPPIPA
    310   RASPPPIPA {
    311     DWORD dwSize;
    312     DWORD dwError;
    313     CHAR szIpAddress[RAS_MaxIpAddress + 1 ];
    314 #ifndef WINNT35COMPATIBLE
    315     CHAR szServerIpAddress[RAS_MaxIpAddress + 1 ];
    316 #endif
    317     DWORD dwOptions;
    318     DWORD dwServerOptions;
    319   };
    320 
    321 #define RASPPPIP __MINGW_NAME_AW(RASPPPIP)
    322 
    323 #define LPRASPPPIPW RASPPPIPW*
    324 #define LPRASPPPIPA RASPPPIPA*
    325 #define LPRASPPPIP RASPPPIP*
    326 
    327 #define RASLCPAP_PAP 0xC023
    328 #define RASLCPAP_SPAP 0xC027
    329 #define RASLCPAP_CHAP 0xC223
    330 #define RASLCPAP_EAP 0xC227
    331 
    332 #define RASLCPAD_CHAP_MD5 0x05
    333 #define RASLCPAD_CHAP_MS 0x80
    334 #define RASLCPAD_CHAP_MSV2 0x81
    335 
    336 #define RASLCPO_PFC 0x00000001
    337 #define RASLCPO_ACFC 0x00000002
    338 #define RASLCPO_SSHF 0x00000004
    339 #define RASLCPO_DES_56 0x00000008
    340 #define RASLCPO_3_DES 0x00000010
    341 
    342 #define RASPPPLCPW struct tagRASPPPLCPW
    343   RASPPPLCPW {
    344     DWORD dwSize;
    345     WINBOOL fBundled;
    346     DWORD dwError;
    347     DWORD dwAuthenticationProtocol;
    348     DWORD dwAuthenticationData;
    349     DWORD dwEapTypeId;
    350     DWORD dwServerAuthenticationProtocol;
    351     DWORD dwServerAuthenticationData;
    352     DWORD dwServerEapTypeId;
    353     WINBOOL fMultilink;
    354     DWORD dwTerminateReason;
    355     DWORD dwServerTerminateReason;
    356     WCHAR szReplyMessage[RAS_MaxReplyMessage];
    357     DWORD dwOptions;
    358     DWORD dwServerOptions;
    359   };
    360 
    361 #define RASPPPLCPA struct tagRASPPPLCPA
    362   RASPPPLCPA {
    363     DWORD dwSize;
    364     WINBOOL fBundled;
    365     DWORD dwError;
    366     DWORD dwAuthenticationProtocol;
    367     DWORD dwAuthenticationData;
    368     DWORD dwEapTypeId;
    369     DWORD dwServerAuthenticationProtocol;
    370     DWORD dwServerAuthenticationData;
    371     DWORD dwServerEapTypeId;
    372     WINBOOL fMultilink;
    373     DWORD dwTerminateReason;
    374     DWORD dwServerTerminateReason;
    375     CHAR szReplyMessage[RAS_MaxReplyMessage];
    376     DWORD dwOptions;
    377     DWORD dwServerOptions;
    378   };
    379 
    380 #define RASPPPLCP __MINGW_NAME_AW(RASPPPLCP)
    381 
    382 #define LPRASPPPLCPW RASPPPLCPW *
    383 #define LPRASPPPLCPA RASPPPLCPA *
    384 #define LPRASPPPLCP RASPPPLCP *
    385 
    386 #define RASSLIPW struct tagRASSLIPW
    387   RASSLIPW {
    388     DWORD dwSize;
    389     DWORD dwError;
    390     WCHAR szIpAddress[RAS_MaxIpAddress + 1 ];
    391   };
    392 
    393 #define RASSLIPA struct tagRASSLIPA
    394   RASSLIPA {
    395     DWORD dwSize;
    396     DWORD dwError;
    397     CHAR szIpAddress[RAS_MaxIpAddress + 1 ];
    398   };
    399 
    400 #define RASSLIP __MINGW_NAME_AW(RASSLIP)
    401 
    402 #define LPRASSLIPW RASSLIPW*
    403 #define LPRASSLIPA RASSLIPA*
    404 #define LPRASSLIP RASSLIP*
    405 
    406 #define RASCCPCA_MPPC 0x00000006
    407 #define RASCCPCA_STAC 0x00000005
    408 
    409 #define RASCCPO_Compression 0x00000001
    410 #define RASCCPO_HistoryLess 0x00000002
    411 #define RASCCPO_Encryption56bit 0x00000010
    412 #define RASCCPO_Encryption40bit 0x00000020
    413 #define RASCCPO_Encryption128bit 0x00000040
    414 
    415 #define RASPPPCCP struct tagRASPPPCCP
    416   RASPPPCCP {
    417     DWORD dwSize;
    418     DWORD dwError;
    419     DWORD dwCompressionAlgorithm;
    420     DWORD dwOptions;
    421     DWORD dwServerCompressionAlgorithm;
    422     DWORD dwServerOptions;
    423   };
    424 
    425 #define LPRASPPPCCP RASPPPCCP *
    426 
    427 #define RASDIALEVENT "RasDialEvent"
    428 #define WM_RASDIALEVENT 0xCCCD
    429 
    430   typedef VOID (WINAPI *RASDIALFUNC)(UINT,RASCONNSTATE,DWORD);
    431   typedef VOID (WINAPI *RASDIALFUNC1)(HRASCONN,UINT,RASCONNSTATE,DWORD,DWORD);
    432   typedef DWORD (WINAPI *RASDIALFUNC2)(ULONG_PTR,DWORD,HRASCONN,UINT,RASCONNSTATE,DWORD,DWORD);
    433 
    434 #define RASDEVINFOW struct tagRASDEVINFOW
    435   RASDEVINFOW {
    436     DWORD dwSize;
    437     WCHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    438     WCHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    439   };
    440 
    441 #define RASDEVINFOA struct tagRASDEVINFOA
    442   RASDEVINFOA {
    443     DWORD dwSize;
    444     CHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    445     CHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    446   };
    447 
    448 #define RASDEVINFO __MINGW_NAME_AW(RASDEVINFO)
    449 
    450 #define LPRASDEVINFOW RASDEVINFOW*
    451 #define LPRASDEVINFOA RASDEVINFOA*
    452 #define LPRASDEVINFO RASDEVINFO*
    453 
    454 #define RASCTRYINFO struct RASCTRYINFO
    455   RASCTRYINFO {
    456     DWORD dwSize;
    457     DWORD dwCountryID;
    458     DWORD dwNextCountryID;
    459     DWORD dwCountryCode;
    460     DWORD dwCountryNameOffset;
    461   };
    462 
    463 #define RASCTRYINFOW RASCTRYINFO
    464 #define RASCTRYINFOA RASCTRYINFO
    465 
    466 #define LPRASCTRYINFOW RASCTRYINFOW*
    467 #define LPRASCTRYINFOA RASCTRYINFOW*
    468 #define LPRASCTRYINFO RASCTRYINFO*
    469 
    470 #define RASIPADDR struct RASIPADDR
    471   RASIPADDR {
    472     BYTE a;
    473     BYTE b;
    474     BYTE c;
    475     BYTE d;
    476   };
    477 
    478 #define ET_None 0
    479 #define ET_Require 1
    480 #define ET_RequireMax 2
    481 #define ET_Optional 3
    482 
    483 #define VS_Default 0
    484 #define VS_PptpOnly 1
    485 #define VS_PptpFirst 2
    486 #define VS_L2tpOnly 3
    487 #define VS_L2tpFirst 4
    488 
    489 #define RASENTRYA struct tagRASENTRYA
    490   RASENTRYA {
    491     DWORD dwSize;
    492     DWORD dwfOptions;
    493     DWORD dwCountryID;
    494     DWORD dwCountryCode;
    495     CHAR szAreaCode[RAS_MaxAreaCode + 1 ];
    496     CHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    497     DWORD dwAlternateOffset;
    498     RASIPADDR ipaddr;
    499     RASIPADDR ipaddrDns;
    500     RASIPADDR ipaddrDnsAlt;
    501     RASIPADDR ipaddrWins;
    502     RASIPADDR ipaddrWinsAlt;
    503     DWORD dwFrameSize;
    504     DWORD dwfNetProtocols;
    505     DWORD dwFramingProtocol;
    506     CHAR szScript[MAX_PATH ];
    507     CHAR szAutodialDll[MAX_PATH ];
    508     CHAR szAutodialFunc[MAX_PATH ];
    509     CHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    510     CHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    511     CHAR szX25PadType[RAS_MaxPadType + 1 ];
    512     CHAR szX25Address[RAS_MaxX25Address + 1 ];
    513     CHAR szX25Facilities[RAS_MaxFacilities + 1 ];
    514     CHAR szX25UserData[RAS_MaxUserData + 1 ];
    515     DWORD dwChannels;
    516     DWORD dwReserved1;
    517     DWORD dwReserved2;
    518     DWORD dwSubEntries;
    519     DWORD dwDialMode;
    520     DWORD dwDialExtraPercent;
    521     DWORD dwDialExtraSampleSeconds;
    522     DWORD dwHangUpExtraPercent;
    523     DWORD dwHangUpExtraSampleSeconds;
    524     DWORD dwIdleDisconnectSeconds;
    525     DWORD dwType;
    526     DWORD dwEncryptionType;
    527     DWORD dwCustomAuthKey;
    528     GUID guidId;
    529     CHAR szCustomDialDll[MAX_PATH];
    530     DWORD dwVpnStrategy;
    531     DWORD dwfOptions2;
    532     DWORD dwfOptions3;
    533     CHAR szDnsSuffix[RAS_MaxDnsSuffix];
    534     DWORD dwTcpWindowSize;
    535     CHAR szPrerequisitePbk[MAX_PATH];
    536     CHAR szPrerequisiteEntry[RAS_MaxEntryName + 1];
    537     DWORD dwRedialCount;
    538     DWORD dwRedialPause;
    539   };
    540 
    541 #define RASENTRYW struct tagRASENTRYW
    542   RASENTRYW {
    543     DWORD dwSize;
    544     DWORD dwfOptions;
    545     DWORD dwCountryID;
    546     DWORD dwCountryCode;
    547     WCHAR szAreaCode[RAS_MaxAreaCode + 1 ];
    548     WCHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    549     DWORD dwAlternateOffset;
    550     RASIPADDR ipaddr;
    551     RASIPADDR ipaddrDns;
    552     RASIPADDR ipaddrDnsAlt;
    553     RASIPADDR ipaddrWins;
    554     RASIPADDR ipaddrWinsAlt;
    555     DWORD dwFrameSize;
    556     DWORD dwfNetProtocols;
    557     DWORD dwFramingProtocol;
    558     WCHAR szScript[MAX_PATH ];
    559     WCHAR szAutodialDll[MAX_PATH ];
    560     WCHAR szAutodialFunc[MAX_PATH ];
    561     WCHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    562     WCHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    563     WCHAR szX25PadType[RAS_MaxPadType + 1 ];
    564     WCHAR szX25Address[RAS_MaxX25Address + 1 ];
    565     WCHAR szX25Facilities[RAS_MaxFacilities + 1 ];
    566     WCHAR szX25UserData[RAS_MaxUserData + 1 ];
    567     DWORD dwChannels;
    568     DWORD dwReserved1;
    569     DWORD dwReserved2;
    570     DWORD dwSubEntries;
    571     DWORD dwDialMode;
    572     DWORD dwDialExtraPercent;
    573     DWORD dwDialExtraSampleSeconds;
    574     DWORD dwHangUpExtraPercent;
    575     DWORD dwHangUpExtraSampleSeconds;
    576     DWORD dwIdleDisconnectSeconds;
    577     DWORD dwType;
    578     DWORD dwEncryptionType;
    579     DWORD dwCustomAuthKey;
    580     GUID guidId;
    581     WCHAR szCustomDialDll[MAX_PATH];
    582     DWORD dwVpnStrategy;
    583     DWORD dwfOptions2;
    584     DWORD dwfOptions3;
    585     WCHAR szDnsSuffix[RAS_MaxDnsSuffix];
    586     DWORD dwTcpWindowSize;
    587     WCHAR szPrerequisitePbk[MAX_PATH];
    588     WCHAR szPrerequisiteEntry[RAS_MaxEntryName + 1];
    589     DWORD dwRedialCount;
    590     DWORD dwRedialPause;
    591   };
    592 
    593 #define RASENTRY __MINGW_NAME_AW(RASENTRY)
    594 
    595 #define LPRASENTRYW RASENTRYW*
    596 #define LPRASENTRYA RASENTRYA*
    597 #define LPRASENTRY RASENTRY*
    598 
    599 #define RASEO_UseCountryAndAreaCodes 0x00000001
    600 #define RASEO_SpecificIpAddr 0x00000002
    601 #define RASEO_SpecificNameServers 0x00000004
    602 #define RASEO_IpHeaderCompression 0x00000008
    603 #define RASEO_RemoteDefaultGateway 0x00000010
    604 #define RASEO_DisableLcpExtensions 0x00000020
    605 #define RASEO_TerminalBeforeDial 0x00000040
    606 #define RASEO_TerminalAfterDial 0x00000080
    607 #define RASEO_ModemLights 0x00000100
    608 #define RASEO_SwCompression 0x00000200
    609 #define RASEO_RequireEncryptedPw 0x00000400
    610 #define RASEO_RequireMsEncryptedPw 0x00000800
    611 #define RASEO_RequireDataEncryption 0x00001000
    612 #define RASEO_NetworkLogon 0x00002000
    613 #define RASEO_UseLogonCredentials 0x00004000
    614 #define RASEO_PromoteAlternates 0x00008000
    615 #define RASEO_SecureLocalFiles 0x00010000
    616 #define RASEO_RequireEAP 0x00020000
    617 #define RASEO_RequirePAP 0x00040000
    618 #define RASEO_RequireSPAP 0x00080000
    619 #define RASEO_Custom 0x00100000
    620 #define RASEO_PreviewPhoneNumber 0x00200000
    621 #define RASEO_SharedPhoneNumbers 0x00800000
    622 #define RASEO_PreviewUserPw 0x01000000
    623 #define RASEO_PreviewDomain 0x02000000
    624 #define RASEO_ShowDialingProgress 0x04000000
    625 #define RASEO_RequireCHAP 0x08000000
    626 #define RASEO_RequireMsCHAP 0x10000000
    627 #define RASEO_RequireMsCHAP2 0x20000000
    628 #define RASEO_RequireW95MSCHAP 0x40000000
    629 #define RASEO_CustomScript 0x80000000
    630 
    631 #define RASEO2_SecureFileAndPrint 0x00000001
    632 #define RASEO2_SecureClientForMSNet 0x00000002
    633 #define RASEO2_DontNegotiateMultilink 0x00000004
    634 #define RASEO2_DontUseRasCredentials 0x00000008
    635 #define RASEO2_UsePreSharedKey 0x00000010
    636 #define RASEO2_Internet 0x00000020
    637 #define RASEO2_DisableNbtOverIP 0x00000040
    638 #define RASEO2_UseGlobalDeviceSettings 0x00000080
    639 #define RASEO2_ReconnectIfDropped 0x00000100
    640 #define RASEO2_SharePhoneNumbers 0x00000200
    641 
    642 #define RASNP_NetBEUI 0x00000001
    643 #define RASNP_Ipx 0x00000002
    644 #define RASNP_Ip 0x00000004
    645 
    646 #define RASFP_Ppp 0x00000001
    647 #define RASFP_Slip 0x00000002
    648 #define RASFP_Ras 0x00000004
    649 
    650 #define RASDT_Modem TEXT("modem")
    651 #define RASDT_Isdn TEXT("isdn")
    652 #define RASDT_X25 TEXT("x25")
    653 #define RASDT_Vpn TEXT("vpn")
    654 #define RASDT_Pad TEXT("pad")
    655 #define RASDT_Generic TEXT("GENERIC")
    656 #define RASDT_Serial TEXT("SERIAL")
    657 #define RASDT_FrameRelay TEXT("FRAMERELAY")
    658 #define RASDT_Atm TEXT("ATM")
    659 #define RASDT_Sonet TEXT("SONET")
    660 #define RASDT_SW56 TEXT("SW56")
    661 #define RASDT_Irda TEXT("IRDA")
    662 #define RASDT_Parallel TEXT("PARALLEL")
    663 #define RASDT_PPPoE TEXT("PPPoE")
    664 
    665 #define RASET_Phone 1
    666 #define RASET_Vpn 2
    667 #define RASET_Direct 3
    668 #define RASET_Internet 4
    669 #define RASET_Broadband 5
    670 
    671   typedef WINBOOL (WINAPI *ORASADFUNC)(HWND,LPSTR,DWORD,LPDWORD);
    672 
    673 #define RASCN_Connection 0x00000001
    674 #define RASCN_Disconnection 0x00000002
    675 #define RASCN_BandwidthAdded 0x00000004
    676 #define RASCN_BandwidthRemoved 0x00000008
    677 
    678 #define RASEDM_DialAll 1
    679 #define RASEDM_DialAsNeeded 2
    680 
    681 #define RASIDS_Disabled 0xffffffff
    682 #define RASIDS_UseGlobalValue 0
    683 
    684 #define RASADPARAMS struct tagRASADPARAMS
    685   RASADPARAMS {
    686     DWORD dwSize;
    687     HWND hwndOwner;
    688     DWORD dwFlags;
    689     LONG xDlg;
    690     LONG yDlg;
    691   };
    692 
    693 #define LPRASADPARAMS RASADPARAMS*
    694 
    695 #define RASADFLG_PositionDlg 0x00000001
    696 
    697   typedef WINBOOL (WINAPI *RASADFUNCA)(LPSTR,LPSTR,LPRASADPARAMS,LPDWORD);
    698   typedef WINBOOL (WINAPI *RASADFUNCW)(LPWSTR,LPWSTR,LPRASADPARAMS,LPDWORD);
    699 
    700 #define RASADFUNC __MINGW_NAME_AW(RASADFUNC)
    701 
    702 #define RASSUBENTRYA struct tagRASSUBENTRYA
    703   RASSUBENTRYA {
    704     DWORD dwSize;
    705     DWORD dwfFlags;
    706     CHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    707     CHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    708     CHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    709     DWORD dwAlternateOffset;
    710   };
    711 
    712 #define RASSUBENTRYW struct tagRASSUBENTRYW
    713   RASSUBENTRYW {
    714     DWORD dwSize;
    715     DWORD dwfFlags;
    716     WCHAR szDeviceType[RAS_MaxDeviceType + 1 ];
    717     WCHAR szDeviceName[RAS_MaxDeviceName + 1 ];
    718     WCHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1 ];
    719     DWORD dwAlternateOffset;
    720   };
    721 
    722 #define RASSUBENTRY __MINGW_NAME_AW(RASSUBENTRY)
    723 
    724 #define LPRASSUBENTRYW RASSUBENTRYW*
    725 #define LPRASSUBENTRYA RASSUBENTRYA*
    726 #define LPRASSUBENTRY RASSUBENTRY*
    727 
    728 #define RASCREDENTIALSA struct tagRASCREDENTIALSA
    729   RASCREDENTIALSA {
    730     DWORD dwSize;
    731     DWORD dwMask;
    732     CHAR szUserName[UNLEN + 1 ];
    733     CHAR szPassword[PWLEN + 1 ];
    734     CHAR szDomain[DNLEN + 1 ];
    735   };
    736 
    737 #define RASCREDENTIALSW struct tagRASCREDENTIALSW
    738   RASCREDENTIALSW {
    739     DWORD dwSize;
    740     DWORD dwMask;
    741     WCHAR szUserName[UNLEN + 1 ];
    742     WCHAR szPassword[PWLEN + 1 ];
    743     WCHAR szDomain[DNLEN + 1 ];
    744   };
    745 
    746 #define RASCREDENTIALS __MINGW_NAME_AW(RASCREDENTIALS)
    747 
    748 #define LPRASCREDENTIALSW RASCREDENTIALSW*
    749 #define LPRASCREDENTIALSA RASCREDENTIALSA*
    750 #define LPRASCREDENTIALS RASCREDENTIALS*
    751 
    752 #define RASCM_UserName 0x00000001
    753 #define RASCM_Password 0x00000002
    754 #define RASCM_Domain 0x00000004
    755 #define RASCM_DefaultCreds 0x00000008
    756 #define RASCM_PreSharedKey 0x00000010
    757 #define RASCM_ServerPreSharedKey 0x00000020
    758 #define RASCM_DDMPreSharedKey 0x00000040
    759 
    760 #define RASAUTODIALENTRYA struct tagRASAUTODIALENTRYA
    761   RASAUTODIALENTRYA {
    762     DWORD dwSize;
    763     DWORD dwFlags;
    764     DWORD dwDialingLocation;
    765     CHAR szEntry[RAS_MaxEntryName + 1];
    766   };
    767 
    768 #define RASAUTODIALENTRYW struct tagRASAUTODIALENTRYW
    769   RASAUTODIALENTRYW {
    770     DWORD dwSize;
    771     DWORD dwFlags;
    772     DWORD dwDialingLocation;
    773     WCHAR szEntry[RAS_MaxEntryName + 1];
    774   };
    775 
    776 #define RASAUTODIALENTRY __MINGW_NAME_AW(RASAUTODIALENTRY)
    777 
    778 #define LPRASAUTODIALENTRYW RASAUTODIALENTRYW*
    779 #define LPRASAUTODIALENTRYA RASAUTODIALENTRYA*
    780 #define LPRASAUTODIALENTRY RASAUTODIALENTRY*
    781 
    782 #define RASADP_DisableConnectionQuery 0
    783 #define RASADP_LoginSessionDisable 1
    784 #define RASADP_SavedAddressesLimit 2
    785 #define RASADP_FailedConnectionTimeout 3
    786 #define RASADP_ConnectionQueryTimeout 4
    787 
    788 #define RASEAPF_NonInteractive 0x00000002
    789 #define RASEAPF_Logon 0x00000004
    790 #define RASEAPF_Preview 0x00000008
    791 
    792 #define RASEAPUSERIDENTITYA struct tagRASEAPUSERIDENTITYA
    793   RASEAPUSERIDENTITYA {
    794     CHAR szUserName[UNLEN + 1 ];
    795     DWORD dwSizeofEapInfo;
    796     BYTE pbEapInfo[1 ];
    797   };
    798 
    799 #define RASEAPUSERIDENTITYW struct tagRASEAPUSERIDENTITYW
    800   RASEAPUSERIDENTITYW {
    801     WCHAR szUserName[UNLEN + 1 ];
    802     DWORD dwSizeofEapInfo;
    803     BYTE pbEapInfo[1 ];
    804   };
    805 
    806 #define RASEAPUSERIDENTITY __MINGW_NAME_AW(RASEAPUSERIDENTITY)
    807 
    808 #define LPRASEAPUSERIDENTITYW RASEAPUSERIDENTITYW*
    809 #define LPRASEAPUSERIDENTITYA RASEAPUSERIDENTITYA*
    810 
    811   typedef DWORD (WINAPI *PFNRASGETBUFFER) (PBYTE *ppBuffer,PDWORD pdwSize);
    812   typedef DWORD (WINAPI *PFNRASFREEBUFFER) (PBYTE pBufer);
    813   typedef DWORD (WINAPI *PFNRASSENDBUFFER) (HANDLE hPort,PBYTE pBuffer,DWORD dwSize);
    814   typedef DWORD (WINAPI *PFNRASRECEIVEBUFFER) (HANDLE hPort,PBYTE pBuffer,PDWORD pdwSize,DWORD dwTimeOut,HANDLE hEvent);
    815   typedef DWORD (WINAPI *PFNRASRETRIEVEBUFFER) (HANDLE hPort,PBYTE pBuffer,PDWORD pdwSize);
    816   typedef DWORD (WINAPI *RasCustomScriptExecuteFn) (HANDLE hPort,LPCWSTR lpszPhonebook,LPCWSTR lpszEntryName,PFNRASGETBUFFER pfnRasGetBuffer,PFNRASFREEBUFFER pfnRasFreeBuffer,PFNRASSENDBUFFER pfnRasSendBuffer,PFNRASRECEIVEBUFFER pfnRasReceiveBuffer,PFNRASRETRIEVEBUFFER pfnRasRetrieveBuffer,HWND hWnd,RASDIALPARAMS *pRasDialParams,PVOID pvReserved);
    817 
    818 #define RASCOMMSETTINGS struct tagRASCOMMSETTINGS
    819   RASCOMMSETTINGS {
    820     DWORD dwSize;
    821     BYTE bParity;
    822     BYTE bStop;
    823     BYTE bByteSize;
    824     BYTE bAlign;
    825   };
    826 
    827   typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved);
    828 
    829 #define RASCUSTOMSCRIPTEXTENSIONS struct tagRASCUSTOMSCRIPTEXTENSIONS
    830   RASCUSTOMSCRIPTEXTENSIONS {
    831     DWORD dwSize;
    832     PFNRASSETCOMMSETTINGS pfnRasSetCommSettings;
    833   };
    834 
    835   DWORD WINAPI RasDialA(LPRASDIALEXTENSIONS,LPCSTR,LPRASDIALPARAMSA,DWORD,LPVOID,LPHRASCONN);
    836   DWORD WINAPI RasDialW(LPRASDIALEXTENSIONS,LPCWSTR,LPRASDIALPARAMSW,DWORD,LPVOID,LPHRASCONN);
    837   DWORD WINAPI RasEnumConnectionsA(LPRASCONNA,LPDWORD,LPDWORD);
    838   DWORD WINAPI RasEnumConnectionsW(LPRASCONNW,LPDWORD,LPDWORD);
    839   DWORD WINAPI RasEnumEntriesA(LPCSTR,LPCSTR,LPRASENTRYNAMEA,LPDWORD,LPDWORD);
    840   DWORD WINAPI RasEnumEntriesW(LPCWSTR,LPCWSTR,LPRASENTRYNAMEW,LPDWORD,LPDWORD);
    841   DWORD WINAPI RasGetConnectStatusA(HRASCONN,LPRASCONNSTATUSA);
    842   DWORD WINAPI RasGetConnectStatusW(HRASCONN,LPRASCONNSTATUSW);
    843   DWORD WINAPI RasGetErrorStringA(UINT,LPSTR,DWORD);
    844   DWORD WINAPI RasGetErrorStringW(UINT,LPWSTR,DWORD);
    845   DWORD WINAPI RasHangUpA(HRASCONN);
    846   DWORD WINAPI RasHangUpW(HRASCONN);
    847   DWORD WINAPI RasGetProjectionInfoA(HRASCONN,RASPROJECTION,LPVOID,LPDWORD);
    848   DWORD WINAPI RasGetProjectionInfoW(HRASCONN,RASPROJECTION,LPVOID,LPDWORD);
    849   DWORD WINAPI RasCreatePhonebookEntryA(HWND,LPCSTR);
    850   DWORD WINAPI RasCreatePhonebookEntryW(HWND,LPCWSTR);
    851   DWORD WINAPI RasEditPhonebookEntryA(HWND,LPCSTR,LPCSTR);
    852   DWORD WINAPI RasEditPhonebookEntryW(HWND,LPCWSTR,LPCWSTR);
    853   DWORD WINAPI RasSetEntryDialParamsA(LPCSTR,LPRASDIALPARAMSA,WINBOOL);
    854   DWORD WINAPI RasSetEntryDialParamsW(LPCWSTR,LPRASDIALPARAMSW,WINBOOL);
    855   DWORD WINAPI RasGetEntryDialParamsA(LPCSTR,LPRASDIALPARAMSA,LPBOOL);
    856   DWORD WINAPI RasGetEntryDialParamsW(LPCWSTR,LPRASDIALPARAMSW,LPBOOL);
    857   DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA,LPDWORD,LPDWORD);
    858   DWORD WINAPI RasEnumDevicesW(LPRASDEVINFOW,LPDWORD,LPDWORD);
    859   DWORD WINAPI RasGetCountryInfoA(LPRASCTRYINFOA,LPDWORD);
    860   DWORD WINAPI RasGetCountryInfoW(LPRASCTRYINFOW,LPDWORD);
    861   DWORD WINAPI RasGetEntryPropertiesA(LPCSTR,LPCSTR,LPRASENTRYA,LPDWORD,LPBYTE,LPDWORD);
    862   DWORD WINAPI RasGetEntryPropertiesW(LPCWSTR,LPCWSTR,LPRASENTRYW,LPDWORD,LPBYTE,LPDWORD);
    863   DWORD WINAPI RasSetEntryPropertiesA(LPCSTR,LPCSTR,LPRASENTRYA,DWORD,LPBYTE,DWORD);
    864   DWORD WINAPI RasSetEntryPropertiesW(LPCWSTR,LPCWSTR,LPRASENTRYW,DWORD,LPBYTE,DWORD);
    865   DWORD WINAPI RasRenameEntryA(LPCSTR,LPCSTR,LPCSTR);
    866   DWORD WINAPI RasRenameEntryW(LPCWSTR,LPCWSTR,LPCWSTR);
    867   DWORD WINAPI RasDeleteEntryA(LPCSTR,LPCSTR);
    868   DWORD WINAPI RasDeleteEntryW(LPCWSTR,LPCWSTR);
    869   DWORD WINAPI RasValidateEntryNameA(LPCSTR,LPCSTR);
    870   DWORD WINAPI RasValidateEntryNameW(LPCWSTR,LPCWSTR);
    871   DWORD WINAPI RasConnectionNotificationA(HRASCONN,HANDLE,DWORD);
    872   DWORD WINAPI RasConnectionNotificationW(HRASCONN,HANDLE,DWORD);
    873   DWORD WINAPI RasGetSubEntryHandleA(HRASCONN,DWORD,LPHRASCONN);
    874   DWORD WINAPI RasGetSubEntryHandleW(HRASCONN,DWORD,LPHRASCONN);
    875   DWORD WINAPI RasGetCredentialsA(LPCSTR,LPCSTR,LPRASCREDENTIALSA);
    876   DWORD WINAPI RasGetCredentialsW(LPCWSTR,LPCWSTR,LPRASCREDENTIALSW);
    877   DWORD WINAPI RasSetCredentialsA(LPCSTR,LPCSTR,LPRASCREDENTIALSA,WINBOOL);
    878   DWORD WINAPI RasSetCredentialsW(LPCWSTR,LPCWSTR,LPRASCREDENTIALSW,WINBOOL);
    879   DWORD WINAPI RasGetSubEntryPropertiesA(LPCSTR,LPCSTR,DWORD,LPRASSUBENTRYA,LPDWORD,LPBYTE,LPDWORD);
    880   DWORD WINAPI RasGetSubEntryPropertiesW(LPCWSTR,LPCWSTR,DWORD,LPRASSUBENTRYW,LPDWORD,LPBYTE,LPDWORD);
    881   DWORD WINAPI RasSetSubEntryPropertiesA(LPCSTR,LPCSTR,DWORD,LPRASSUBENTRYA,DWORD,LPBYTE,DWORD);
    882   DWORD WINAPI RasSetSubEntryPropertiesW(LPCWSTR,LPCWSTR,DWORD,LPRASSUBENTRYW,DWORD,LPBYTE,DWORD);
    883   DWORD WINAPI RasGetAutodialAddressA(LPCSTR,LPDWORD,LPRASAUTODIALENTRYA,LPDWORD,LPDWORD);
    884   DWORD WINAPI RasGetAutodialAddressW(LPCWSTR,LPDWORD,LPRASAUTODIALENTRYW,LPDWORD,LPDWORD);
    885   DWORD WINAPI RasSetAutodialAddressA(LPCSTR,DWORD,LPRASAUTODIALENTRYA,DWORD,DWORD);
    886   DWORD WINAPI RasSetAutodialAddressW(LPCWSTR,DWORD,LPRASAUTODIALENTRYW,DWORD,DWORD);
    887   DWORD WINAPI RasEnumAutodialAddressesA(LPSTR *,LPDWORD,LPDWORD);
    888   DWORD WINAPI RasEnumAutodialAddressesW(LPWSTR *,LPDWORD,LPDWORD);
    889   DWORD WINAPI RasGetAutodialEnableA(DWORD,LPBOOL);
    890   DWORD WINAPI RasGetAutodialEnableW(DWORD,LPBOOL);
    891   DWORD WINAPI RasSetAutodialEnableA(DWORD,WINBOOL);
    892   DWORD WINAPI RasSetAutodialEnableW(DWORD,WINBOOL);
    893   DWORD WINAPI RasGetAutodialParamA(DWORD,LPVOID,LPDWORD);
    894   DWORD WINAPI RasGetAutodialParamW(DWORD,LPVOID,LPDWORD);
    895   DWORD WINAPI RasSetAutodialParamA(DWORD,LPVOID,DWORD);
    896   DWORD WINAPI RasSetAutodialParamW(DWORD,LPVOID,DWORD);
    897 
    898   typedef struct _RAS_STATS {
    899     DWORD dwSize;
    900     DWORD dwBytesXmited;
    901     DWORD dwBytesRcved;
    902     DWORD dwFramesXmited;
    903     DWORD dwFramesRcved;
    904     DWORD dwCrcErr;
    905     DWORD dwTimeoutErr;
    906     DWORD dwAlignmentErr;
    907     DWORD dwHardwareOverrunErr;
    908     DWORD dwFramingErr;
    909     DWORD dwBufferOverrunErr;
    910     DWORD dwCompressionRatioIn;
    911     DWORD dwCompressionRatioOut;
    912     DWORD dwBps;
    913     DWORD dwConnectDuration;
    914   } RAS_STATS,*PRAS_STATS;
    915 
    916   typedef DWORD (WINAPI *RasCustomHangUpFn)(HRASCONN hRasConn);
    917   typedef DWORD (WINAPI *RasCustomDialFn)(HINSTANCE hInstDll,LPRASDIALEXTENSIONS lpRasDialExtensions,LPCWSTR lpszPhonebook,LPRASDIALPARAMS lpRasDialParams,DWORD dwNotifierType,LPVOID lpvNotifier,LPHRASCONN lphRasConn,DWORD dwFlags);
    918   typedef DWORD (WINAPI *RasCustomDeleteEntryNotifyFn)(LPCWSTR lpszPhonebook,LPCWSTR lpszEntry,DWORD dwFlags);
    919 
    920 #define RCD_SingleUser 0
    921 #define RCD_AllUsers 0x00000001
    922 #define RCD_Eap 0x00000002
    923 #define RCD_Logon 0x00000004
    924 
    925   DWORD WINAPI RasInvokeEapUI(HRASCONN,DWORD,LPRASDIALEXTENSIONS,HWND);
    926   DWORD WINAPI RasGetLinkStatistics(HRASCONN hRasConn,DWORD dwSubEntry,RAS_STATS *lpStatistics);
    927   DWORD WINAPI RasGetConnectionStatistics(HRASCONN hRasConn,RAS_STATS *lpStatistics);
    928   DWORD WINAPI RasClearLinkStatistics(HRASCONN hRasConn,DWORD dwSubEntry);
    929   DWORD WINAPI RasClearConnectionStatistics(HRASCONN hRasConn);
    930   DWORD WINAPI RasGetEapUserDataA(HANDLE hToken,LPCSTR pszPhonebook,LPCSTR pszEntry,BYTE *pbEapData,DWORD *pdwSizeofEapData);
    931   DWORD WINAPI RasGetEapUserDataW(HANDLE hToken,LPCWSTR pszPhonebook,LPCWSTR pszEntry,BYTE *pbEapData,DWORD *pdwSizeofEapData);
    932   DWORD WINAPI RasSetEapUserDataA(HANDLE hToken,LPCSTR pszPhonebook,LPCSTR pszEntry,BYTE *pbEapData,DWORD dwSizeofEapData);
    933   DWORD WINAPI RasSetEapUserDataW(HANDLE hToken,LPCWSTR pszPhonebook,LPCWSTR pszEntry,BYTE *pbEapData,DWORD dwSizeofEapData);
    934   DWORD WINAPI RasGetCustomAuthDataA(LPCSTR pszPhonebook,LPCSTR pszEntry,BYTE *pbCustomAuthData,DWORD *pdwSizeofCustomAuthData);
    935   DWORD WINAPI RasGetCustomAuthDataW(LPCWSTR pszPhonebook,LPCWSTR pszEntry,BYTE *pbCustomAuthData,DWORD *pdwSizeofCustomAuthData);
    936   DWORD WINAPI RasSetCustomAuthDataA(LPCSTR pszPhonebook,LPCSTR pszEntry,BYTE *pbCustomAuthData,DWORD dwSizeofCustomAuthData);
    937   DWORD WINAPI RasSetCustomAuthDataW(LPCWSTR pszPhonebook,LPCWSTR pszEntry,BYTE *pbCustomAuthData,DWORD dwSizeofCustomAuthData);
    938   DWORD WINAPI RasGetEapUserIdentityW(LPCWSTR pszPhonebook,LPCWSTR pszEntry,DWORD dwFlags,HWND hwnd,LPRASEAPUSERIDENTITYW *ppRasEapUserIdentity);
    939   DWORD WINAPI RasGetEapUserIdentityA(LPCSTR pszPhonebook,LPCSTR pszEntry,DWORD dwFlags,HWND hwnd,LPRASEAPUSERIDENTITYA *ppRasEapUserIdentity);
    940   VOID WINAPI RasFreeEapUserIdentityW(LPRASEAPUSERIDENTITYW pRasEapUserIdentity);
    941   VOID WINAPI RasFreeEapUserIdentityA(LPRASEAPUSERIDENTITYA pRasEapUserIdentity);
    942   DWORD WINAPI RasDeleteSubEntryA(LPCSTR pszPhonebook,LPCSTR pszEntry,DWORD dwSubentryId);
    943   DWORD WINAPI RasDeleteSubEntryW(LPCWSTR pszPhonebook,LPCWSTR pszEntry,DWORD dwSubEntryId);
    944 
    945 #define RasDial __MINGW_NAME_AW(RasDial)
    946 #define RasEnumConnections __MINGW_NAME_AW(RasEnumConnections)
    947 #define RasEnumEntries __MINGW_NAME_AW(RasEnumEntries)
    948 #define RasGetConnectStatus __MINGW_NAME_AW(RasGetConnectStatus)
    949 #define RasGetErrorString __MINGW_NAME_AW(RasGetErrorString)
    950 #define RasHangUp __MINGW_NAME_AW(RasHangUp)
    951 #define RasGetProjectionInfo __MINGW_NAME_AW(RasGetProjectionInfo)
    952 #define RasCreatePhonebookEntry __MINGW_NAME_AW(RasCreatePhonebookEntry)
    953 #define RasEditPhonebookEntry __MINGW_NAME_AW(RasEditPhonebookEntry)
    954 #define RasSetEntryDialParams __MINGW_NAME_AW(RasSetEntryDialParams)
    955 #define RasGetEntryDialParams __MINGW_NAME_AW(RasGetEntryDialParams)
    956 #define RasEnumDevices __MINGW_NAME_AW(RasEnumDevices)
    957 #define RasGetCountryInfo __MINGW_NAME_AW(RasGetCountryInfo)
    958 #define RasGetEntryProperties __MINGW_NAME_AW(RasGetEntryProperties)
    959 #define RasSetEntryProperties __MINGW_NAME_AW(RasSetEntryProperties)
    960 #define RasRenameEntry __MINGW_NAME_AW(RasRenameEntry)
    961 #define RasDeleteEntry __MINGW_NAME_AW(RasDeleteEntry)
    962 #define RasValidateEntryName __MINGW_NAME_AW(RasValidateEntryName)
    963 #define RasGetSubEntryHandle __MINGW_NAME_AW(RasGetSubEntryHandle)
    964 #define RasConnectionNotification __MINGW_NAME_AW(RasConnectionNotification)
    965 #define RasGetSubEntryProperties __MINGW_NAME_AW(RasGetSubEntryProperties)
    966 #define RasSetSubEntryProperties __MINGW_NAME_AW(RasSetSubEntryProperties)
    967 #define RasGetCredentials __MINGW_NAME_AW(RasGetCredentials)
    968 #define RasSetCredentials __MINGW_NAME_AW(RasSetCredentials)
    969 #define RasGetAutodialAddress __MINGW_NAME_AW(RasGetAutodialAddress)
    970 #define RasSetAutodialAddress __MINGW_NAME_AW(RasSetAutodialAddress)
    971 #define RasEnumAutodialAddresses __MINGW_NAME_AW(RasEnumAutodialAddresses)
    972 #define RasGetAutodialEnable __MINGW_NAME_AW(RasGetAutodialEnable)
    973 #define RasSetAutodialEnable __MINGW_NAME_AW(RasSetAutodialEnable)
    974 #define RasGetAutodialParam __MINGW_NAME_AW(RasGetAutodialParam)
    975 #define RasSetAutodialParam __MINGW_NAME_AW(RasSetAutodialParam)
    976 #define RasGetEapUserData __MINGW_NAME_AW(RasGetEapUserData)
    977 #define RasSetEapUserData __MINGW_NAME_AW(RasSetEapUserData)
    978 #define RasGetCustomAuthData __MINGW_NAME_AW(RasGetCustomAuthData)
    979 #define RasSetCustomAuthData __MINGW_NAME_AW(RasSetCustomAuthData)
    980 #define RasGetEapUserIdentity __MINGW_NAME_AW(RasGetEapUserIdentity)
    981 #define RasFreeEapUserIdentity __MINGW_NAME_AW(RasFreeEapUserIdentity)
    982 #define RasDeleteSubEntry __MINGW_NAME_AW(RasDeleteSubEntry)
    983 
    984 #if (_WIN32_WINNT >= 0x0600)
    985 
    986 typedef struct _tagRasNapState {
    987   DWORD          dwSize;
    988   DWORD          dwFlags;
    989   IsolationState isolationState;
    990   ProbationTime  probationTime;
    991 } RASNAPSTATE, *LPRASNAPSTATE;
    992 
    993 typedef struct _RASPPPIPV6 {
    994   DWORD dwSize;
    995   DWORD dwError;
    996   BYTE  bLocalInterfaceIdentifier[8];
    997   BYTE  bPeerInterfaceIdentifier[8];
    998   BYTE  bLocalCompressionProtocol[2];
    999   BYTE  bPeerCompressionProtocol[2];
   1000 } RASPPPIPV6, *LPRASPPPIPV6;
   1001 
   1002 DWORD rasgetnapstatus(
   1003   HRASCONN hRasConn,
   1004   LPRASNAPSTATE pNapState
   1005 );
   1006 
   1007 #endif /*(_WIN32_WINNT >= 0x0600)*/
   1008 
   1009 #if (_WIN32_WINNT >= 0x0601)
   1010 typedef enum  {
   1011   RASAPIVERSION_500   = 1,
   1012   RASAPIVERSION_501   = 2,
   1013   RASAPIVERSION_600   = 3,
   1014   RASAPIVERSION_601   = 4
   1015 } RASAPIVERSION;
   1016 
   1017 typedef struct _RASTUNNELENDPOINT {
   1018   DWORD dwType;
   1019   __C89_NAMELESS union {
   1020     RASIPV4ADDR ipv4;
   1021     RASIPV6ADDR ipv6;
   1022   } DUMMYUNIONNAME;
   1023 } RASTUNNELENDPOINT, *PRASTUNNELENDPOINT;
   1024 
   1025 typedef struct _RASUPDATECONN {
   1026   RASAPIVERSION     version;
   1027   DWORD             dwSize;
   1028   DWORD             dwFlags;
   1029   DWORD             dwIfIndex;
   1030   RASTUNNELENDPOINT  localEndPoint;
   1031   RASTUNNELENDPOINT  remoteEndPoint;
   1032 } RASUPDATECONN, *LPRASUPDATECONN;
   1033 #endif /*(_WIN32_WINNT >= 0x0601)*/
   1034 
   1035 #ifdef __cplusplus
   1036 }
   1037 #endif
   1038 
   1039 #include <poppack.h>
   1040 #endif
   1041