home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / ras.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  45.2 KB  |  1,677 lines

  1. /* Copyright (c) 1992-1999, Microsoft Corporation, all rights reserved
  2. **
  3. ** ras.h
  4. ** Remote Access external API
  5. ** Public header for external API clients
  6. **
  7. ** WINVER values in this file:
  8. **      WINVER < 0x400 = Windows NT 3.5, Windows NT 3.51
  9. **      WINVER = 0x400 = Windows 95, Windows98, Windows NT4 (default)
  10. **      WINVER > 0x400 = Windows NT4 enhancements
  11. **      WINVER = 0x500 = Windows 2000
  12. */
  13.  
  14. #ifndef _RAS_H_
  15. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  16. #define _RAS_H_
  17.  
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. #ifndef UNLEN
  27. #include <lmcons.h>
  28. #endif
  29.  
  30. #include <pshpack4.h>
  31.  
  32. #define RAS_MaxDeviceType     16
  33. #define RAS_MaxPhoneNumber    128
  34. #define RAS_MaxIpAddress      15
  35. #define RAS_MaxIpxAddress     21
  36.  
  37. #if (WINVER >= 0x400)
  38. #define RAS_MaxEntryName      256
  39. #define RAS_MaxDeviceName     128
  40. #define RAS_MaxCallbackNumber RAS_MaxPhoneNumber
  41. #else
  42. #define RAS_MaxEntryName      20
  43. #define RAS_MaxDeviceName     32
  44. #define RAS_MaxCallbackNumber 48
  45. #endif
  46.  
  47. #define RAS_MaxAreaCode       10
  48. #define RAS_MaxPadType        32
  49. #define RAS_MaxX25Address     200
  50. #define RAS_MaxFacilities     200
  51. #define RAS_MaxUserData       200
  52. #define RAS_MaxReplyMessage   1024
  53.  
  54. DECLARE_HANDLE( HRASCONN );
  55. #define LPHRASCONN HRASCONN*
  56.  
  57.  
  58. /* Identifies an active RAS connection.  (See RasEnumConnections)
  59. */
  60. #define RASCONNW struct tagRASCONNW
  61. RASCONNW
  62. {
  63.     DWORD    dwSize;
  64.     HRASCONN hrasconn;
  65.     WCHAR    szEntryName[ RAS_MaxEntryName + 1 ];
  66.  
  67. #if (WINVER >= 0x400)
  68.     WCHAR    szDeviceType[ RAS_MaxDeviceType + 1 ];
  69.     WCHAR    szDeviceName[ RAS_MaxDeviceName + 1 ];
  70. #endif
  71. #if (WINVER >= 0x401)
  72.     WCHAR    szPhonebook [ MAX_PATH ];
  73.     DWORD    dwSubEntry;
  74. #endif
  75. #if (WINVER >= 0x500)
  76.     GUID    guidEntry;
  77. #endif
  78. };
  79.  
  80. #define RASCONNA struct tagRASCONNA
  81. RASCONNA
  82. {
  83.     DWORD    dwSize;
  84.     HRASCONN hrasconn;
  85.     CHAR     szEntryName[ RAS_MaxEntryName + 1 ];
  86.  
  87. #if (WINVER >= 0x400)
  88.     CHAR     szDeviceType[ RAS_MaxDeviceType + 1 ];
  89.     CHAR     szDeviceName[ RAS_MaxDeviceName + 1 ];
  90. #endif
  91. #if (WINVER >= 0x401)
  92.     CHAR     szPhonebook [ MAX_PATH ];
  93.     DWORD    dwSubEntry;
  94. #endif
  95. #if (WINVER >= 0x500)
  96.     GUID     guidEntry;
  97. #endif
  98. };
  99.  
  100. #ifdef UNICODE
  101. #define RASCONN RASCONNW
  102. #else
  103. #define RASCONN RASCONNA
  104. #endif
  105.  
  106. #define LPRASCONNW RASCONNW*
  107. #define LPRASCONNA RASCONNA*
  108. #define LPRASCONN  RASCONN*
  109.  
  110.  
  111. /* Enumerates intermediate states to a connection.  (See RasDial)
  112. */
  113. #define RASCS_PAUSED 0x1000
  114. #define RASCS_DONE   0x2000
  115.  
  116. #define RASCONNSTATE enum tagRASCONNSTATE
  117. RASCONNSTATE
  118. {
  119.     RASCS_OpenPort = 0,
  120.     RASCS_PortOpened,
  121.     RASCS_ConnectDevice,
  122.     RASCS_DeviceConnected,
  123.     RASCS_AllDevicesConnected,
  124.     RASCS_Authenticate,
  125.     RASCS_AuthNotify,
  126.     RASCS_AuthRetry,
  127.     RASCS_AuthCallback,
  128.     RASCS_AuthChangePassword,
  129.     RASCS_AuthProject,
  130.     RASCS_AuthLinkSpeed,
  131.     RASCS_AuthAck,
  132.     RASCS_ReAuthenticate,
  133.     RASCS_Authenticated,
  134.     RASCS_PrepareForCallback,
  135.     RASCS_WaitForModemReset,
  136.     RASCS_WaitForCallback,
  137.     RASCS_Projected,
  138.  
  139. #if (WINVER >= 0x400)
  140.     RASCS_StartAuthentication,
  141.     RASCS_CallbackComplete,
  142.     RASCS_LogonNetwork,
  143. #endif
  144.     RASCS_SubEntryConnected,
  145.     RASCS_SubEntryDisconnected,
  146.  
  147.     RASCS_Interactive = RASCS_PAUSED,
  148.     RASCS_RetryAuthentication,
  149.     RASCS_CallbackSetByCaller,
  150.     RASCS_PasswordExpired,
  151. #if (WINVER >= 0x500)
  152.     RASCS_InvokeEapUI,
  153. #endif
  154.  
  155.     RASCS_Connected = RASCS_DONE,
  156.     RASCS_Disconnected
  157. };
  158.  
  159. #define LPRASCONNSTATE RASCONNSTATE*
  160.  
  161.  
  162. /* Describes the status of a RAS connection.  (See RasConnectionStatus)
  163. */
  164. #define RASCONNSTATUSW struct tagRASCONNSTATUSW
  165. RASCONNSTATUSW
  166. {
  167.     DWORD        dwSize;
  168.     RASCONNSTATE rasconnstate;
  169.     DWORD        dwError;
  170.     WCHAR        szDeviceType[ RAS_MaxDeviceType + 1 ];
  171.     WCHAR        szDeviceName[ RAS_MaxDeviceName + 1 ];
  172. #if (WINVER >= 0x401)
  173.     WCHAR        szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  174. #endif
  175. };
  176.  
  177. #define RASCONNSTATUSA struct tagRASCONNSTATUSA
  178. RASCONNSTATUSA
  179. {
  180.     DWORD        dwSize;
  181.     RASCONNSTATE rasconnstate;
  182.     DWORD        dwError;
  183.     CHAR         szDeviceType[ RAS_MaxDeviceType + 1 ];
  184.     CHAR         szDeviceName[ RAS_MaxDeviceName + 1 ];
  185. #if (WINVER >= 0x401)
  186.     CHAR         szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  187. #endif
  188. };
  189.  
  190. #ifdef UNICODE
  191. #define RASCONNSTATUS RASCONNSTATUSW
  192. #else
  193. #define RASCONNSTATUS RASCONNSTATUSA
  194. #endif
  195.  
  196. #define LPRASCONNSTATUSW RASCONNSTATUSW*
  197. #define LPRASCONNSTATUSA RASCONNSTATUSA*
  198. #define LPRASCONNSTATUS  RASCONNSTATUS*
  199.  
  200. /* Describes connection establishment parameters.  (See RasDial)
  201. */
  202. #define RASDIALPARAMSW struct tagRASDIALPARAMSW
  203. RASDIALPARAMSW
  204. {
  205.     DWORD dwSize;
  206.     WCHAR szEntryName[ RAS_MaxEntryName + 1 ];
  207.     WCHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  208.     WCHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
  209.     WCHAR szUserName[ UNLEN + 1 ];
  210.     WCHAR szPassword[ PWLEN + 1 ];
  211.     WCHAR szDomain[ DNLEN + 1 ];
  212. #if (WINVER >= 0x401)
  213.     DWORD dwSubEntry;
  214.     ULONG_PTR dwCallbackId;
  215. #endif
  216. };
  217.  
  218. #define RASDIALPARAMSA struct tagRASDIALPARAMSA
  219. RASDIALPARAMSA
  220. {
  221.     DWORD dwSize;
  222.     CHAR  szEntryName[ RAS_MaxEntryName + 1 ];
  223.     CHAR  szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  224.     CHAR  szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
  225.     CHAR  szUserName[ UNLEN + 1 ];
  226.     CHAR  szPassword[ PWLEN + 1 ];
  227.     CHAR  szDomain[ DNLEN + 1 ];
  228. #if (WINVER >= 0x401)
  229.     DWORD dwSubEntry;
  230.     ULONG_PTR dwCallbackId;
  231. #endif
  232. };
  233.  
  234. #ifdef UNICODE
  235. #define RASDIALPARAMS RASDIALPARAMSW
  236. #else
  237. #define RASDIALPARAMS RASDIALPARAMSA
  238. #endif
  239.  
  240. #define LPRASDIALPARAMSW RASDIALPARAMSW*
  241. #define LPRASDIALPARAMSA RASDIALPARAMSA*
  242. #define LPRASDIALPARAMS  RASDIALPARAMS*
  243.  
  244. #if (WINVER >= 0x500)
  245.  
  246. #define RASEAPINFO struct tagRASEAPINFO
  247. RASEAPINFO
  248. {
  249.     DWORD dwSizeofEapInfo;
  250.     BYTE  *pbEapInfo;
  251. };
  252.  
  253. #endif
  254.  
  255. /* Describes extended connection establishment options.  (See RasDial)
  256. */
  257. #define RASDIALEXTENSIONS struct tagRASDIALEXTENSIONS
  258. RASDIALEXTENSIONS
  259. {
  260.     DWORD     dwSize;
  261.     DWORD     dwfOptions;
  262.     HWND      hwndParent;
  263.     ULONG_PTR reserved;
  264. #if (WINVER >= 0x500)
  265.     ULONG_PTR reserved1;
  266.     RASEAPINFO RasEapInfo;
  267. #endif
  268. };
  269.  
  270. #define LPRASDIALEXTENSIONS RASDIALEXTENSIONS*
  271.  
  272. /* 'dwfOptions' bit flags.
  273. */
  274. #define RDEOPT_UsePrefixSuffix           0x00000001
  275. #define RDEOPT_PausedStates              0x00000002
  276. #define RDEOPT_IgnoreModemSpeaker        0x00000004
  277. #define RDEOPT_SetModemSpeaker           0x00000008
  278. #define RDEOPT_IgnoreSoftwareCompression 0x00000010
  279. #define RDEOPT_SetSoftwareCompression    0x00000020
  280. #define RDEOPT_DisableConnectedUI        0x00000040
  281. #define RDEOPT_DisableReconnectUI        0x00000080
  282. #define RDEOPT_DisableReconnect          0x00000100
  283. #define RDEOPT_NoUser                    0x00000200
  284. #define RDEOPT_PauseOnScript             0x00000400
  285. #define RDEOPT_Router                    0x00000800
  286.  
  287. #if (WINVER >= 0x500)
  288. #define RDEOPT_CustomDial                0x00001000
  289. #endif
  290.  
  291. //
  292. // This flag when set in the RASENTRYNAME structure
  293. // indicates that the phonebook to which this entry
  294. // belongs is a system phonebook.
  295. //
  296. #define REN_User                         0x00000000
  297. #define REN_AllUsers                     0x00000001
  298.  
  299.  
  300. /* Describes an enumerated RAS phone book entry name.  (See RasEntryEnum)
  301. */
  302. #define RASENTRYNAMEW struct tagRASENTRYNAMEW
  303. RASENTRYNAMEW
  304. {
  305.     DWORD dwSize;
  306.     WCHAR szEntryName[ RAS_MaxEntryName + 1 ];
  307.  
  308. #if (WINVER >= 0x500)
  309.     //
  310.     // If this flag is REN_AllUsers then its a
  311.     // system phonebook.
  312.     //
  313.     DWORD dwFlags;
  314.     WCHAR szPhonebookPath[MAX_PATH + 1];
  315. #endif
  316. };
  317.  
  318. #define RASENTRYNAMEA struct tagRASENTRYNAMEA
  319. RASENTRYNAMEA
  320. {
  321.     DWORD dwSize;
  322.     CHAR  szEntryName[ RAS_MaxEntryName + 1 ];
  323.  
  324. #if (WINVER >= 0x500)
  325.     DWORD dwFlags;
  326.     CHAR  szPhonebookPath[MAX_PATH + 1];
  327. #endif
  328.  
  329. };
  330.  
  331. #ifdef UNICODE
  332. #define RASENTRYNAME RASENTRYNAMEW
  333. #else
  334. #define RASENTRYNAME RASENTRYNAMEA
  335. #endif
  336.  
  337. #define LPRASENTRYNAMEW RASENTRYNAMEW*
  338. #define LPRASENTRYNAMEA RASENTRYNAMEA*
  339. #define LPRASENTRYNAME  RASENTRYNAME*
  340.  
  341.  
  342. /* Protocol code to projection data structure mapping.
  343. */
  344. #define RASPROJECTION enum tagRASPROJECTION
  345. RASPROJECTION
  346. {
  347.     RASP_Amb = 0x10000,
  348.     RASP_PppNbf = 0x803F,
  349.     RASP_PppIpx = 0x802B,
  350.     RASP_PppIp = 0x8021,
  351. #if (WINVER >= 0x500)
  352.     RASP_PppCcp = 0x80FD,
  353. #endif
  354.     RASP_PppLcp = 0xC021,
  355.     RASP_Slip = 0x20000
  356. };
  357.  
  358. #define LPRASPROJECTION RASPROJECTION*
  359.  
  360.  
  361. /* Describes the result of a RAS AMB (Authentication Message Block)
  362. ** projection.  This protocol is used with NT 3.1 and OS/2 1.3 downlevel
  363. ** RAS servers.
  364. */
  365. #define RASAMBW struct tagRASAMBW
  366. RASAMBW
  367. {
  368.     DWORD dwSize;
  369.     DWORD dwError;
  370.     WCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ];
  371.     BYTE  bLana;
  372. };
  373.  
  374. #define RASAMBA struct tagRASAMBA
  375. RASAMBA
  376. {
  377.     DWORD dwSize;
  378.     DWORD dwError;
  379.     CHAR  szNetBiosError[ NETBIOS_NAME_LEN + 1 ];
  380.     BYTE  bLana;
  381. };
  382.  
  383. #ifdef UNICODE
  384. #define RASAMB RASAMBW
  385. #else
  386. #define RASAMB RASAMBA
  387. #endif
  388.  
  389. #define LPRASAMBW RASAMBW*
  390. #define LPRASAMBA RASAMBA*
  391. #define LPRASAMB  RASAMB*
  392.  
  393.  
  394. /* Describes the result of a PPP NBF (NetBEUI) projection.
  395. */
  396. #define RASPPPNBFW struct tagRASPPPNBFW
  397. RASPPPNBFW
  398. {
  399.     DWORD dwSize;
  400.     DWORD dwError;
  401.     DWORD dwNetBiosError;
  402.     WCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ];
  403.     WCHAR szWorkstationName[ NETBIOS_NAME_LEN + 1 ];
  404.     BYTE  bLana;
  405. };
  406.  
  407. #define RASPPPNBFA struct tagRASPPPNBFA
  408. RASPPPNBFA
  409. {
  410.     DWORD dwSize;
  411.     DWORD dwError;
  412.     DWORD dwNetBiosError;
  413.     CHAR  szNetBiosError[ NETBIOS_NAME_LEN + 1 ];
  414.     CHAR  szWorkstationName[ NETBIOS_NAME_LEN + 1 ];
  415.     BYTE  bLana;
  416. };
  417.  
  418. #ifdef UNICODE
  419. #define RASPPPNBF RASPPPNBFW
  420. #else
  421. #define RASPPPNBF RASPPPNBFA
  422. #endif
  423.  
  424. #define LPRASPPPNBFW RASPPPNBFW*
  425. #define LPRASPPPNBFA RASPPPNBFA*
  426. #define LPRASPPPNBF  RASPPPNBF*
  427.  
  428.  
  429. /* Describes the results of a PPP IPX (Internetwork Packet Exchange)
  430. ** projection.
  431. */
  432. #define RASPPPIPXW struct tagRASIPXW
  433. RASPPPIPXW
  434. {
  435.     DWORD dwSize;
  436.     DWORD dwError;
  437.     WCHAR szIpxAddress[ RAS_MaxIpxAddress + 1 ];
  438. };
  439.  
  440.  
  441. #define RASPPPIPXA struct tagRASPPPIPXA
  442. RASPPPIPXA
  443. {
  444.     DWORD dwSize;
  445.     DWORD dwError;
  446.     CHAR  szIpxAddress[ RAS_MaxIpxAddress + 1 ];
  447. };
  448.  
  449. #ifdef UNICODE
  450. #define RASPPPIPX RASPPPIPXW
  451. #else
  452. #define RASPPPIPX RASPPPIPXA
  453. #endif
  454.  
  455. #define LPRASPPPIPXW RASPPPIPXW*
  456. #define LPRASPPPIPXA RASPPPIPXA*
  457. #define LPRASPPPIPX  RASPPPIPX*
  458.  
  459.  
  460. /* Describes the results of a PPP IP (Internet) projection.
  461. */
  462.  
  463. #if (WINVER >= 0x500)
  464.  
  465. /* RASPPPIP 'dwOptions' and 'dwServerOptions' flags.
  466. */
  467. #define RASIPO_VJ       0x00000001
  468.  
  469. #endif
  470.  
  471. #define RASPPPIPW struct tagRASPPPIPW
  472. RASPPPIPW
  473. {
  474.     DWORD dwSize;
  475.     DWORD dwError;
  476.     WCHAR szIpAddress[ RAS_MaxIpAddress + 1 ];
  477.  
  478. #ifndef WINNT35COMPATIBLE
  479.  
  480.     /* This field was added between Windows NT 3.51 beta and Windows NT 3.51
  481.     ** final, and between Windows 95 M8 beta and Windows 95 final.  If you do
  482.     ** not require the server address and wish to retrieve PPP IP information
  483.     ** from Windows NT 3.5 or early Windows NT 3.51 betas, or on early Windows
  484.     ** 95 betas, define WINNT35COMPATIBLE.
  485.     **
  486.     ** The server IP address is not provided by all PPP implementations,
  487.     ** though Windows NT server's do provide it.
  488.     */
  489.     WCHAR szServerIpAddress[ RAS_MaxIpAddress + 1 ];
  490.  
  491. #endif
  492. #if (WINVER >= 0x500)
  493.     DWORD dwOptions;
  494.     DWORD dwServerOptions;
  495. #endif
  496. };
  497.  
  498. #define RASPPPIPA struct tagRASPPPIPA
  499. RASPPPIPA
  500. {
  501.     DWORD dwSize;
  502.     DWORD dwError;
  503.     CHAR  szIpAddress[ RAS_MaxIpAddress + 1 ];
  504.  
  505. #ifndef WINNT35COMPATIBLE
  506.  
  507.     /* See RASPPPIPW comment.
  508.     */
  509.     CHAR  szServerIpAddress[ RAS_MaxIpAddress + 1 ];
  510.  
  511. #endif
  512. #if (WINVER >= 0x500)
  513.     DWORD dwOptions;
  514.     DWORD dwServerOptions;
  515. #endif
  516. };
  517.  
  518. #ifdef UNICODE
  519. #define RASPPPIP RASPPPIPW
  520. #else
  521. #define RASPPPIP RASPPPIPA
  522. #endif
  523.  
  524. #define LPRASPPPIPW RASPPPIPW*
  525. #define LPRASPPPIPA RASPPPIPA*
  526. #define LPRASPPPIP  RASPPPIP*
  527.  
  528.  
  529. /* Describes the results of a PPP LCP/multi-link negotiation.
  530. */
  531.  
  532. #if (WINVER >= 0x500)
  533.  
  534. /* RASPPPLCP 'dwAuthenticatonProtocol' values.
  535. */
  536. #define RASLCPAP_PAP          0xC023
  537. #define RASLCPAP_SPAP         0xC027
  538. #define RASLCPAP_CHAP         0xC223
  539. #define RASLCPAP_EAP          0xC227
  540.  
  541. /* RASPPPLCP 'dwAuthenticatonData' values.
  542. */
  543. #define RASLCPAD_CHAP_MD5     0x05
  544. #define RASLCPAD_CHAP_MS      0x80
  545. #define RASLCPAD_CHAP_MSV2    0x81
  546.  
  547. /* RASPPPLCP 'dwOptions' and 'dwServerOptions' flags.
  548. */
  549. #define RASLCPO_PFC           0x00000001
  550. #define RASLCPO_ACFC          0x00000002
  551. #define RASLCPO_SSHF          0x00000004
  552. #define RASLCPO_DES_56        0x00000008
  553. #define RASLCPO_3_DES         0x00000010
  554.  
  555. #endif
  556.  
  557.  
  558. #define RASPPPLCPW struct tagRASPPPLCPW
  559. RASPPPLCPW
  560. {
  561.     DWORD dwSize;
  562.     BOOL  fBundled;
  563.  
  564. #if (WINVER >= 0x500)
  565.     DWORD dwError;
  566.     DWORD dwAuthenticationProtocol;
  567.     DWORD dwAuthenticationData;
  568.     DWORD dwEapTypeId;
  569.     DWORD dwServerAuthenticationProtocol;
  570.     DWORD dwServerAuthenticationData;
  571.     DWORD dwServerEapTypeId;
  572.     BOOL  fMultilink;
  573.     DWORD dwTerminateReason;
  574.     DWORD dwServerTerminateReason;
  575.     WCHAR szReplyMessage[RAS_MaxReplyMessage];
  576.     DWORD dwOptions;
  577.     DWORD dwServerOptions;
  578. #endif
  579.  
  580. };
  581.  
  582. #define RASPPPLCPA struct tagRASPPPLCPA
  583. RASPPPLCPA
  584. {
  585.     DWORD dwSize;
  586.     BOOL  fBundled;
  587.  
  588. #if (WINVER >= 0x500)
  589.     DWORD dwError;
  590.     DWORD dwAuthenticationProtocol;
  591.     DWORD dwAuthenticationData;
  592.     DWORD dwEapTypeId;
  593.     DWORD dwServerAuthenticationProtocol;
  594.     DWORD dwServerAuthenticationData;
  595.     DWORD dwServerEapTypeId;
  596.     BOOL  fMultilink;
  597.     DWORD dwTerminateReason;
  598.     DWORD dwServerTerminateReason;
  599.     CHAR  szReplyMessage[RAS_MaxReplyMessage];
  600.     DWORD dwOptions;
  601.     DWORD dwServerOptions;
  602. #endif
  603.  
  604. };
  605.  
  606.  
  607. #ifdef UNICODE
  608. #define RASPPPLCP RASPPPLCPW
  609. #else
  610. #define RASPPPLCP RASPPPLCPA
  611. #endif
  612.  
  613. #define LPRASPPPLCPW RASPPPLCPW*
  614. #define LPRASPPPLCPA RASPPPLCPA*
  615. #define LPRASPPPLCP  RASPPPLCP*
  616.  
  617.  
  618. /* Describes the results of a SLIP (Serial Line IP) projection.
  619. */
  620. #define RASSLIPW struct tagRASSLIPW
  621. RASSLIPW
  622. {
  623.     DWORD dwSize;
  624.     DWORD dwError;
  625.     WCHAR szIpAddress[ RAS_MaxIpAddress + 1 ];
  626. };
  627.  
  628.  
  629. #define RASSLIPA struct tagRASSLIPA
  630. RASSLIPA
  631. {
  632.     DWORD dwSize;
  633.     DWORD dwError;
  634.     CHAR  szIpAddress[ RAS_MaxIpAddress + 1 ];
  635. };
  636.  
  637. #ifdef UNICODE
  638. #define RASSLIP RASSLIPW
  639. #else
  640. #define RASSLIP RASSLIPA
  641. #endif
  642.  
  643. #define LPRASSLIPW RASSLIPW*
  644. #define LPRASSLIPA RASSLIPA*
  645. #define LPRASSLIP  RASSLIP*
  646.  
  647. #if (WINVER >= 0x500)
  648.  
  649. /* Describes the results of a PPP CCP (Compression Control Protocol)
  650. projection.
  651. */
  652.  
  653. /* RASPPPCCP 'dwCompressionAlgorithm' values.
  654. */
  655. #define RASCCPCA_MPPC         0x00000006
  656. #define RASCCPCA_STAC         0x00000005
  657.  
  658. /* RASPPPCCP 'dwOptions' values.
  659. */
  660. #define RASCCPO_Compression       0x00000001
  661. #define RASCCPO_HistoryLess       0x00000002
  662. #define RASCCPO_Encryption56bit   0x00000010
  663. #define RASCCPO_Encryption40bit   0x00000020
  664. #define RASCCPO_Encryption128bit  0x00000040
  665.  
  666. #define RASPPPCCP struct tagRASPPPCCP
  667. RASPPPCCP
  668. {
  669.     DWORD dwSize;
  670.     DWORD dwError;
  671.     DWORD dwCompressionAlgorithm;
  672.     DWORD dwOptions;
  673.     DWORD dwServerCompressionAlgorithm;
  674.     DWORD dwServerOptions;
  675. };
  676.  
  677. #define LPRASPPPCCP  RASPPPCCP*
  678.  
  679. #endif
  680.  
  681. /* If using RasDial message notifications, get the notification message code
  682. ** by passing this string to the RegisterWindowMessageA() API.
  683. ** WM_RASDIALEVENT is used only if a unique message cannot be registered.
  684. */
  685. #define RASDIALEVENT    "RasDialEvent"
  686. #define WM_RASDIALEVENT 0xCCCD
  687.  
  688. /* Prototypes for caller's RasDial callback handler.  Arguments are the
  689. ** message ID (currently always WM_RASDIALEVENT), the current RASCONNSTATE and
  690. ** the error that has occurred (or 0 if none).  Extended arguments are the
  691. ** handle of the RAS connection and an extended error code.
  692. **
  693. ** For RASDIALFUNC2, subsequent callback notifications for all
  694. ** subentries can be cancelled by returning FALSE.
  695. */
  696. typedef VOID (WINAPI *RASDIALFUNC)( UINT, RASCONNSTATE, DWORD );
  697. typedef VOID (WINAPI *RASDIALFUNC1)( HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD );
  698. typedef DWORD (WINAPI *RASDIALFUNC2)( ULONG_PTR, DWORD, HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD );
  699.  
  700.  
  701. /* Information describing a RAS-capable device.
  702. */
  703. #define RASDEVINFOW struct tagRASDEVINFOW
  704. RASDEVINFOW
  705. {
  706.     DWORD    dwSize;
  707.     WCHAR    szDeviceType[ RAS_MaxDeviceType + 1 ];
  708.     WCHAR    szDeviceName[ RAS_MaxDeviceName + 1 ];
  709. };
  710.  
  711. #define RASDEVINFOA struct tagRASDEVINFOA
  712. RASDEVINFOA
  713. {
  714.     DWORD    dwSize;
  715.     CHAR     szDeviceType[ RAS_MaxDeviceType + 1 ];
  716.     CHAR     szDeviceName[ RAS_MaxDeviceName + 1 ];
  717. };
  718.  
  719. #ifdef UNICODE
  720. #define RASDEVINFO RASDEVINFOW
  721. #else
  722. #define RASDEVINFO RASDEVINFOA
  723. #endif
  724.  
  725. #define LPRASDEVINFOW RASDEVINFOW*
  726. #define LPRASDEVINFOA RASDEVINFOA*
  727. #define LPRASDEVINFO  RASDEVINFO*
  728.  
  729. /* RAS country information (currently retrieved from TAPI).
  730. */
  731. #define RASCTRYINFO struct RASCTRYINFO
  732. RASCTRYINFO
  733. {
  734.     DWORD   dwSize;
  735.     DWORD   dwCountryID;
  736.     DWORD   dwNextCountryID;
  737.     DWORD   dwCountryCode;
  738.     DWORD   dwCountryNameOffset;
  739. };
  740.  
  741. /* There is currently no difference between
  742. ** RASCTRYINFOA and RASCTRYINFOW.  This may
  743. ** change in the future.
  744. */
  745. #define RASCTRYINFOW   RASCTRYINFO
  746. #define RASCTRYINFOA   RASCTRYINFO
  747.  
  748. #define LPRASCTRYINFOW RASCTRYINFOW*
  749. #define LPRASCTRYINFOA RASCTRYINFOW*
  750. #define LPRASCTRYINFO  RASCTRYINFO*
  751.  
  752. /* A RAS IP address.
  753. */
  754. #define RASIPADDR struct RASIPADDR
  755. RASIPADDR
  756. {
  757.     BYTE a;
  758.     BYTE b;
  759.     BYTE c;
  760.     BYTE d;
  761. };
  762.  
  763. #if (WINVER >= 0x500)
  764.  
  765. #define ET_40Bit        1
  766. #define ET_128Bit       2
  767.  
  768. #define ET_None         0  // No encryption
  769. #define ET_Require      1  // Require Encryption
  770. #define ET_RequireMax   2  // Require max encryption
  771. #define ET_Optional     3  // Do encryption if possible. None Ok.
  772.  
  773. #endif
  774.  
  775. #define VS_Default        0   // default (PPTP for now)
  776. #define VS_PptpOnly        1    // Only PPTP is attempted.
  777. #define VS_PptpFirst    2   // PPTP is tried first.
  778. #define VS_L2tpOnly     3    // Only L2TP is attempted.
  779. #define VS_L2tpFirst    4    // L2TP is tried first.
  780.  
  781. /* A RAS phone book entry.
  782. */
  783. #define RASENTRYA struct tagRASENTRYA
  784. RASENTRYA
  785. {
  786.     DWORD       dwSize;
  787.     DWORD       dwfOptions;
  788.     //
  789.     // Location/phone number.
  790.     //
  791.     DWORD       dwCountryID;
  792.     DWORD       dwCountryCode;
  793.     CHAR        szAreaCode[ RAS_MaxAreaCode + 1 ];
  794.     CHAR        szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  795.     DWORD       dwAlternateOffset;
  796.     //
  797.     // PPP/Ip
  798.     //
  799.     RASIPADDR   ipaddr;
  800.     RASIPADDR   ipaddrDns;
  801.     RASIPADDR   ipaddrDnsAlt;
  802.     RASIPADDR   ipaddrWins;
  803.     RASIPADDR   ipaddrWinsAlt;
  804.     //
  805.     // Framing
  806.     //
  807.     DWORD       dwFrameSize;
  808.     DWORD       dwfNetProtocols;
  809.     DWORD       dwFramingProtocol;
  810.     //
  811.     // Scripting
  812.     //
  813.     CHAR        szScript[ MAX_PATH ];
  814.     //
  815.     // AutoDial
  816.     //
  817.     CHAR        szAutodialDll[ MAX_PATH ];
  818.     CHAR        szAutodialFunc[ MAX_PATH ];
  819.     //
  820.     // Device
  821.     //
  822.     CHAR        szDeviceType[ RAS_MaxDeviceType + 1 ];
  823.     CHAR        szDeviceName[ RAS_MaxDeviceName + 1 ];
  824.     //
  825.     // X.25
  826.     //
  827.     CHAR        szX25PadType[ RAS_MaxPadType + 1 ];
  828.     CHAR        szX25Address[ RAS_MaxX25Address + 1 ];
  829.     CHAR        szX25Facilities[ RAS_MaxFacilities + 1 ];
  830.     CHAR        szX25UserData[ RAS_MaxUserData + 1 ];
  831.     DWORD       dwChannels;
  832.     //
  833.     // Reserved
  834.     //
  835.     DWORD       dwReserved1;
  836.     DWORD       dwReserved2;
  837. #if (WINVER >= 0x401)
  838.     //
  839.     // Multilink
  840.     //
  841.     DWORD       dwSubEntries;
  842.     DWORD       dwDialMode;
  843.     DWORD       dwDialExtraPercent;
  844.     DWORD       dwDialExtraSampleSeconds;
  845.     DWORD       dwHangUpExtraPercent;
  846.     DWORD       dwHangUpExtraSampleSeconds;
  847.     //
  848.     // Idle timeout
  849.     //
  850.     DWORD       dwIdleDisconnectSeconds;
  851. #endif
  852.  
  853. #if (WINVER >= 0x500)
  854.  
  855.     //
  856.     // Entry Type
  857.     //
  858.     DWORD       dwType;
  859.  
  860.     //
  861.     // Encryption type
  862.     //
  863.     DWORD       dwEncryptionType;
  864.  
  865.     //
  866.     // CustomAuthKey to be used for EAP
  867.     //
  868.     DWORD       dwCustomAuthKey;
  869.  
  870.     //
  871.     // Guid of the connection
  872.     //
  873.     GUID        guidId;
  874.  
  875.     //
  876.     // Custom Dial Dll
  877.     //
  878.     CHAR        szCustomDialDll[MAX_PATH];
  879.  
  880.     //
  881.     // DwVpnStrategy
  882.     //
  883.     DWORD       dwVpnStrategy;
  884. #endif
  885.  
  886. };
  887.  
  888. #define RASENTRYW struct tagRASENTRYW
  889. RASENTRYW
  890. {
  891.     DWORD       dwSize;
  892.     DWORD       dwfOptions;
  893.     //
  894.     // Location/phone number
  895.     //
  896.     DWORD       dwCountryID;
  897.     DWORD       dwCountryCode;
  898.     WCHAR       szAreaCode[ RAS_MaxAreaCode + 1 ];
  899.     WCHAR       szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  900.     DWORD       dwAlternateOffset;
  901.     //
  902.     // PPP/Ip
  903.     //
  904.     RASIPADDR   ipaddr;
  905.     RASIPADDR   ipaddrDns;
  906.     RASIPADDR   ipaddrDnsAlt;
  907.     RASIPADDR   ipaddrWins;
  908.     RASIPADDR   ipaddrWinsAlt;
  909.     //
  910.     // Framing
  911.     //
  912.     DWORD       dwFrameSize;
  913.     DWORD       dwfNetProtocols;
  914.     DWORD       dwFramingProtocol;
  915.     //
  916.     // Scripting
  917.     //
  918.     WCHAR       szScript[ MAX_PATH ];
  919.     //
  920.     // AutoDial
  921.     //
  922.     WCHAR       szAutodialDll[ MAX_PATH ];
  923.     WCHAR       szAutodialFunc[ MAX_PATH ];
  924.     //
  925.     // Device
  926.     //
  927.     WCHAR       szDeviceType[ RAS_MaxDeviceType + 1 ];
  928.     WCHAR       szDeviceName[ RAS_MaxDeviceName + 1 ];
  929.     //
  930.     // X.25
  931.     //
  932.     WCHAR       szX25PadType[ RAS_MaxPadType + 1 ];
  933.     WCHAR       szX25Address[ RAS_MaxX25Address + 1 ];
  934.     WCHAR       szX25Facilities[ RAS_MaxFacilities + 1 ];
  935.     WCHAR       szX25UserData[ RAS_MaxUserData + 1 ];
  936.     DWORD       dwChannels;
  937.     //
  938.     // Reserved
  939.     //
  940.     DWORD       dwReserved1;
  941.     DWORD       dwReserved2;
  942. #if (WINVER >= 0x401)
  943.     //
  944.     // Multilink
  945.     //
  946.     DWORD       dwSubEntries;
  947.     DWORD       dwDialMode;
  948.     DWORD       dwDialExtraPercent;
  949.     DWORD       dwDialExtraSampleSeconds;
  950.     DWORD       dwHangUpExtraPercent;
  951.     DWORD       dwHangUpExtraSampleSeconds;
  952.     //
  953.     // Idle timeout
  954.     //
  955.     DWORD       dwIdleDisconnectSeconds;
  956. #endif
  957.  
  958. #if (WINVER >= 0x500)
  959.     //
  960.     // Entry Type
  961.     //
  962.     DWORD       dwType;
  963.  
  964.     //
  965.     // EncryptionType
  966.     //
  967.     DWORD       dwEncryptionType;
  968.  
  969.     //
  970.     // CustomAuthKey to be used for EAP
  971.     //
  972.     DWORD       dwCustomAuthKey;
  973.  
  974.     //
  975.     // Guid of the connection
  976.     //
  977.     GUID        guidId;
  978.  
  979.     //
  980.     // Custom Dial Dll
  981.     //
  982.     WCHAR       szCustomDialDll[MAX_PATH];
  983.  
  984.     //
  985.     // Vpn Strategy
  986.     //
  987.     DWORD       dwVpnStrategy;
  988. #endif
  989. };
  990.  
  991. #ifdef UNICODE
  992. #define RASENTRY RASENTRYW
  993. #else
  994. #define RASENTRY RASENTRYA
  995. #endif
  996.  
  997. #define LPRASENTRYW RASENTRYW*
  998. #define LPRASENTRYA RASENTRYA*
  999. #define LPRASENTRY  RASENTRY*
  1000.  
  1001. /* RASENTRY 'dwfOptions' bit flags.
  1002. */
  1003. #define RASEO_UseCountryAndAreaCodes    0x00000001
  1004. #define RASEO_SpecificIpAddr            0x00000002
  1005. #define RASEO_SpecificNameServers       0x00000004
  1006. #define RASEO_IpHeaderCompression       0x00000008
  1007. #define RASEO_RemoteDefaultGateway      0x00000010
  1008. #define RASEO_DisableLcpExtensions      0x00000020
  1009. #define RASEO_TerminalBeforeDial        0x00000040
  1010. #define RASEO_TerminalAfterDial         0x00000080
  1011. #define RASEO_ModemLights               0x00000100
  1012. #define RASEO_SwCompression             0x00000200
  1013. #define RASEO_RequireEncryptedPw        0x00000400
  1014. #define RASEO_RequireMsEncryptedPw      0x00000800
  1015. #define RASEO_RequireDataEncryption     0x00001000
  1016. #define RASEO_NetworkLogon              0x00002000
  1017. #define RASEO_UseLogonCredentials       0x00004000
  1018. #define RASEO_PromoteAlternates         0x00008000
  1019. #if (WINVER >= 0x401)
  1020. #define RASEO_SecureLocalFiles          0x00010000
  1021. #endif
  1022. #if (WINVER >= 0x500)
  1023. #define RASEO_RequireEAP                0x00020000
  1024. #define RASEO_RequirePAP                0x00040000
  1025. #define RASEO_RequireSPAP               0x00080000
  1026. #define RASEO_Custom                    0x00100000
  1027.  
  1028. #define RASEO_PreviewPhoneNumber        0x00200000
  1029. #define RASEO_SharedPhoneNumbers        0x00800000
  1030. #define RASEO_PreviewUserPw             0x01000000
  1031. #define RASEO_PreviewDomain             0x02000000
  1032. #define RASEO_ShowDialingProgress       0x04000000
  1033. #define RASEO_RequireCHAP               0x08000000
  1034. #define RASEO_RequireMsCHAP             0x10000000
  1035. #define RASEO_RequireMsCHAP2            0x20000000
  1036. #define RASEO_RequireW95MSCHAP          0x40000000
  1037. #define RASEO_CustomScript              0x80000000
  1038.  
  1039. #endif
  1040.  
  1041. /* RASENTRY 'dwProtocols' bit flags.
  1042. */
  1043. #define RASNP_NetBEUI                   0x00000001
  1044. #define RASNP_Ipx                       0x00000002
  1045. #define RASNP_Ip                        0x00000004
  1046.  
  1047. /* RASENTRY 'dwFramingProtocols' bit flags.
  1048. */
  1049. #define RASFP_Ppp                       0x00000001
  1050. #define RASFP_Slip                      0x00000002
  1051. #define RASFP_Ras                       0x00000004
  1052.  
  1053. /* RASENTRY 'szDeviceType' default strings.
  1054. */
  1055. #define RASDT_Modem                     TEXT("modem")
  1056. #define RASDT_Isdn                      TEXT("isdn")
  1057. #define RASDT_X25                       TEXT("x25")
  1058. #define RASDT_Vpn                       TEXT("vpn")
  1059. #define RASDT_Pad                       TEXT("pad")
  1060. #define RASDT_Generic                   TEXT("GENERIC")
  1061. #define RASDT_Serial                    TEXT("SERIAL")
  1062. #define RASDT_FrameRelay                TEXT("FRAMERELAY")
  1063. #define RASDT_Atm                       TEXT("ATM")
  1064. #define RASDT_Sonet                     TEXT("SONET")
  1065. #define RASDT_SW56                      TEXT("SW56")
  1066. #define RASDT_Irda                      TEXT("IRDA")
  1067. #define RASDT_Parallel                  TEXT("PARALLEL")
  1068.  
  1069.  
  1070. // The entry type used to determine which UI properties
  1071. // are to be presented to user.  This generally corresponds
  1072. // to a Connections "add" wizard selection.
  1073. //
  1074. #define RASET_Phone    1  // Phone lines: modem, ISDN, X.25, etc
  1075. #define RASET_Vpn      2  // Virtual private network
  1076. #define RASET_Direct   3  // Direct connect: serial, parallel
  1077. #define RASET_Internet 4  // BaseCamp internet
  1078.  
  1079. /* Old AutoDial DLL function prototype.
  1080. **
  1081. ** This prototype is documented for backward-compatibility
  1082. ** purposes only.  It is superceded by the RASADFUNCA
  1083. ** and RASADFUNCW definitions below.  DO NOT USE THIS
  1084. ** PROTOTYPE IN NEW CODE.  SUPPORT FOR IT MAY BE REMOVED
  1085. ** IN FUTURE VERSIONS OF RAS.
  1086. */
  1087. typedef BOOL (WINAPI *ORASADFUNC)( HWND, LPSTR, DWORD, LPDWORD );
  1088.  
  1089. #if (WINVER >= 0x401)
  1090. /* Flags for RasConnectionNotification().
  1091. */
  1092. #define RASCN_Connection        0x00000001
  1093. #define RASCN_Disconnection     0x00000002
  1094. #define RASCN_BandwidthAdded    0x00000004
  1095. #define RASCN_BandwidthRemoved  0x00000008
  1096.  
  1097. /* RASENTRY 'dwDialMode' values.
  1098. */
  1099. #define RASEDM_DialAll                  1
  1100. #define RASEDM_DialAsNeeded             2
  1101.  
  1102. /* RASENTRY 'dwIdleDisconnectSeconds' constants.
  1103. */
  1104. #define RASIDS_Disabled                 0xffffffff
  1105. #define RASIDS_UseGlobalValue           0
  1106.  
  1107. /* AutoDial DLL function parameter block.
  1108. */
  1109. #define RASADPARAMS struct tagRASADPARAMS
  1110. RASADPARAMS
  1111. {
  1112.     DWORD       dwSize;
  1113.     HWND        hwndOwner;
  1114.     DWORD       dwFlags;
  1115.     LONG        xDlg;
  1116.     LONG        yDlg;
  1117. };
  1118.  
  1119. #define LPRASADPARAMS RASADPARAMS*
  1120.  
  1121. /* AutoDial DLL function parameter block 'dwFlags.'
  1122. */
  1123. #define RASADFLG_PositionDlg            0x00000001
  1124.  
  1125. /* Prototype AutoDial DLL function.
  1126. */
  1127. typedef BOOL (WINAPI *RASADFUNCA)( LPSTR, LPSTR, LPRASADPARAMS, LPDWORD );
  1128. typedef BOOL (WINAPI *RASADFUNCW)( LPWSTR, LPWSTR, LPRASADPARAMS, LPDWORD );
  1129.  
  1130. #ifdef UNICODE
  1131. #define RASADFUNC RASADFUNCW
  1132. #else
  1133. #define RASADFUNC RASADFUNCA
  1134. #endif
  1135.  
  1136. /* A RAS phone book multilinked sub-entry.
  1137. */
  1138. #define RASSUBENTRYA struct tagRASSUBENTRYA
  1139. RASSUBENTRYA
  1140. {
  1141.     DWORD       dwSize;
  1142.     DWORD       dwfFlags;
  1143.     //
  1144.     // Device
  1145.     //
  1146.     CHAR        szDeviceType[ RAS_MaxDeviceType + 1 ];
  1147.     CHAR        szDeviceName[ RAS_MaxDeviceName + 1 ];
  1148.     //
  1149.     // Phone numbers
  1150.     //
  1151.     CHAR        szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  1152.     DWORD       dwAlternateOffset;
  1153. };
  1154.  
  1155. #define RASSUBENTRYW struct tagRASSUBENTRYW
  1156. RASSUBENTRYW
  1157. {
  1158.     DWORD       dwSize;
  1159.     DWORD       dwfFlags;
  1160.     //
  1161.     // Device
  1162.     //
  1163.     WCHAR       szDeviceType[ RAS_MaxDeviceType + 1 ];
  1164.     WCHAR       szDeviceName[ RAS_MaxDeviceName + 1 ];
  1165.     //
  1166.     // Phone numbers
  1167.     //
  1168.     WCHAR       szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  1169.     DWORD       dwAlternateOffset;
  1170. };
  1171.  
  1172. #ifdef UNICODE
  1173. #define RASSUBENTRY RASSUBENTRYW
  1174. #else
  1175. #define RASSUBENTRY RASSUBENTRYA
  1176. #endif
  1177.  
  1178. #define LPRASSUBENTRYW RASSUBENTRYW*
  1179. #define LPRASSUBENTRYA RASSUBENTRYA*
  1180. #define LPRASSUBENTRY  RASSUBENTRY*
  1181.  
  1182. /* Ras{Get,Set}Credentials structure.  These calls
  1183. ** supercede Ras{Get,Set}EntryDialParams.
  1184. */
  1185. #define RASCREDENTIALSA struct tagRASCREDENTIALSA
  1186. RASCREDENTIALSA
  1187. {
  1188.     DWORD dwSize;
  1189.     DWORD dwMask;
  1190.     CHAR szUserName[ UNLEN + 1 ];
  1191.     CHAR szPassword[ PWLEN + 1 ];
  1192.     CHAR szDomain[ DNLEN + 1 ];
  1193. };
  1194.  
  1195. #define RASCREDENTIALSW struct tagRASCREDENTIALSW
  1196. RASCREDENTIALSW
  1197. {
  1198.     DWORD dwSize;
  1199.     DWORD dwMask;
  1200.     WCHAR szUserName[ UNLEN + 1 ];
  1201.     WCHAR szPassword[ PWLEN + 1 ];
  1202.     WCHAR szDomain[ DNLEN + 1 ];
  1203. };
  1204.  
  1205. #ifdef UNICODE
  1206. #define RASCREDENTIALS RASCREDENTIALSW
  1207. #else
  1208. #define RASCREDENTIALS RASCREDENTIALSA
  1209. #endif
  1210.  
  1211. #define LPRASCREDENTIALSW RASCREDENTIALSW*
  1212. #define LPRASCREDENTIALSA RASCREDENTIALSA*
  1213. #define LPRASCREDENTIALS  RASCREDENTIALS*
  1214.  
  1215. /* RASCREDENTIALS 'dwMask' values.
  1216. */
  1217. #define RASCM_UserName       0x00000001
  1218. #define RASCM_Password       0x00000002
  1219. #define RASCM_Domain         0x00000004
  1220.  
  1221. /* AutoDial address properties.
  1222. */
  1223. #define RASAUTODIALENTRYA struct tagRASAUTODIALENTRYA
  1224. RASAUTODIALENTRYA
  1225. {
  1226.     DWORD dwSize;
  1227.     DWORD dwFlags;
  1228.     DWORD dwDialingLocation;
  1229.     CHAR szEntry[ RAS_MaxEntryName + 1];
  1230. };
  1231.  
  1232. #define RASAUTODIALENTRYW struct tagRASAUTODIALENTRYW
  1233. RASAUTODIALENTRYW
  1234. {
  1235.     DWORD dwSize;
  1236.     DWORD dwFlags;
  1237.     DWORD dwDialingLocation;
  1238.     WCHAR szEntry[ RAS_MaxEntryName + 1];
  1239. };
  1240.  
  1241. #ifdef UNICODE
  1242. #define RASAUTODIALENTRY RASAUTODIALENTRYW
  1243. #else
  1244. #define RASAUTODIALENTRY RASAUTODIALENTRYA
  1245. #endif
  1246.  
  1247. #define LPRASAUTODIALENTRYW RASAUTODIALENTRYW*
  1248. #define LPRASAUTODIALENTRYA RASAUTODIALENTRYA*
  1249. #define LPRASAUTODIALENTRY  RASAUTODIALENTRY*
  1250.  
  1251. /* AutoDial control parameter values for
  1252. ** Ras{Get,Set}AutodialParam.
  1253. */
  1254. #define RASADP_DisableConnectionQuery           0
  1255. #define RASADP_LoginSessionDisable              1
  1256. #define RASADP_SavedAddressesLimit              2
  1257. #define RASADP_FailedConnectionTimeout          3
  1258. #define RASADP_ConnectionQueryTimeout           4
  1259.  
  1260. #endif // (WINVER >= 0x401)
  1261.  
  1262. #if (WINVER >= 0x500)
  1263.  
  1264. /* RasGetEapUserIdentity bit flags.
  1265. ** These have the same values as the RAS_EAP_FLAG_ flags in raseapif.h
  1266. */
  1267. #define RASEAPF_NonInteractive          0x00000002
  1268. #define RASEAPF_Logon                   0x00000004
  1269. #define RASEAPF_Preview                 0x00000008
  1270.  
  1271. /* RasGetEapUserIdentity structure.
  1272. */
  1273. #define RASEAPUSERIDENTITYA struct tagRASEAPUSERIDENTITYA
  1274. RASEAPUSERIDENTITYA
  1275. {
  1276.     CHAR        szUserName[ UNLEN + 1 ];
  1277.     DWORD       dwSizeofEapInfo;
  1278.     BYTE        pbEapInfo[ 1 ];
  1279. };
  1280.  
  1281. #define RASEAPUSERIDENTITYW struct tagRASEAPUSERIDENTITYW
  1282. RASEAPUSERIDENTITYW
  1283. {
  1284.     WCHAR       szUserName[ UNLEN + 1 ];
  1285.     DWORD       dwSizeofEapInfo;
  1286.     BYTE        pbEapInfo[ 1 ];
  1287. };
  1288.  
  1289. #ifdef UNICODE
  1290. #define RASEAPUSERIDENTITY RASEAPUSERIDENTITYW
  1291. #else
  1292. #define RASEAPUSERIDENTITY RASEAPUSERIDENTITYA
  1293. #endif
  1294.  
  1295. #define LPRASEAPUSERIDENTITYW RASEAPUSERIDENTITYW*
  1296. #define LPRASEAPUSERIDENTITYA RASEAPUSERIDENTITYA*
  1297.  
  1298. #endif // (WINVER >= 0x500)
  1299.  
  1300.  
  1301. /* External RAS API function prototypes.
  1302. */
  1303. DWORD APIENTRY RasDialA( LPRASDIALEXTENSIONS, LPCSTR, LPRASDIALPARAMSA, DWORD,
  1304.                    LPVOID, LPHRASCONN );
  1305.  
  1306. DWORD APIENTRY RasDialW( LPRASDIALEXTENSIONS, LPCWSTR, LPRASDIALPARAMSW, DWORD,
  1307.                    LPVOID, LPHRASCONN );
  1308.  
  1309. DWORD APIENTRY RasEnumConnectionsA( LPRASCONNA, LPDWORD, LPDWORD );
  1310.  
  1311. DWORD APIENTRY RasEnumConnectionsW( LPRASCONNW, LPDWORD, LPDWORD );
  1312.  
  1313. DWORD APIENTRY RasEnumEntriesA( LPCSTR, LPCSTR, LPRASENTRYNAMEA, LPDWORD,
  1314.                    LPDWORD );
  1315.  
  1316. DWORD APIENTRY RasEnumEntriesW( LPCWSTR, LPCWSTR, LPRASENTRYNAMEW, LPDWORD,
  1317.                    LPDWORD );
  1318.  
  1319. DWORD APIENTRY RasGetConnectStatusA( HRASCONN, LPRASCONNSTATUSA );
  1320.  
  1321. DWORD APIENTRY RasGetConnectStatusW( HRASCONN, LPRASCONNSTATUSW );
  1322.  
  1323. DWORD APIENTRY RasGetErrorStringA( UINT, LPSTR, DWORD );
  1324.  
  1325. DWORD APIENTRY RasGetErrorStringW( UINT, LPWSTR, DWORD );
  1326.  
  1327. DWORD APIENTRY RasHangUpA( HRASCONN );
  1328.  
  1329. DWORD APIENTRY RasHangUpW( HRASCONN );
  1330.  
  1331. DWORD APIENTRY RasGetProjectionInfoA( HRASCONN, RASPROJECTION, LPVOID,
  1332.                    LPDWORD );
  1333.  
  1334. DWORD APIENTRY RasGetProjectionInfoW( HRASCONN, RASPROJECTION, LPVOID,
  1335.                    LPDWORD );
  1336.  
  1337. DWORD APIENTRY RasCreatePhonebookEntryA( HWND, LPCSTR );
  1338.  
  1339. DWORD APIENTRY RasCreatePhonebookEntryW( HWND, LPCWSTR );
  1340.  
  1341. DWORD APIENTRY RasEditPhonebookEntryA( HWND, LPCSTR, LPCSTR );
  1342.  
  1343. DWORD APIENTRY RasEditPhonebookEntryW( HWND, LPCWSTR, LPCWSTR );
  1344.  
  1345. DWORD APIENTRY RasSetEntryDialParamsA( LPCSTR, LPRASDIALPARAMSA, BOOL );
  1346.  
  1347. DWORD APIENTRY RasSetEntryDialParamsW( LPCWSTR, LPRASDIALPARAMSW, BOOL );
  1348.  
  1349. DWORD APIENTRY RasGetEntryDialParamsA( LPCSTR, LPRASDIALPARAMSA, LPBOOL );
  1350.  
  1351. DWORD APIENTRY RasGetEntryDialParamsW( LPCWSTR, LPRASDIALPARAMSW, LPBOOL );
  1352.  
  1353. DWORD APIENTRY RasEnumDevicesA( LPRASDEVINFOA, LPDWORD, LPDWORD );
  1354.  
  1355. DWORD APIENTRY RasEnumDevicesW( LPRASDEVINFOW, LPDWORD, LPDWORD );
  1356.  
  1357. DWORD APIENTRY RasGetCountryInfoA( LPRASCTRYINFOA, LPDWORD );
  1358.  
  1359. DWORD APIENTRY RasGetCountryInfoW( LPRASCTRYINFOW, LPDWORD );
  1360.  
  1361. DWORD APIENTRY RasGetEntryPropertiesA( LPCSTR, LPCSTR, LPRASENTRYA, LPDWORD, LPBYTE, LPDWORD );
  1362.  
  1363. DWORD APIENTRY RasGetEntryPropertiesW( LPCWSTR, LPCWSTR, LPRASENTRYW, LPDWORD, LPBYTE, LPDWORD );
  1364.  
  1365. DWORD APIENTRY RasSetEntryPropertiesA( LPCSTR, LPCSTR, LPRASENTRYA, DWORD, LPBYTE, DWORD );
  1366.  
  1367. DWORD APIENTRY RasSetEntryPropertiesW( LPCWSTR, LPCWSTR, LPRASENTRYW, DWORD, LPBYTE, DWORD );
  1368.  
  1369. DWORD APIENTRY RasRenameEntryA( LPCSTR, LPCSTR, LPCSTR );
  1370.  
  1371. DWORD APIENTRY RasRenameEntryW( LPCWSTR, LPCWSTR, LPCWSTR );
  1372.  
  1373. DWORD APIENTRY RasDeleteEntryA( LPCSTR, LPCSTR );
  1374.  
  1375. DWORD APIENTRY RasDeleteEntryW( LPCWSTR, LPCWSTR );
  1376.  
  1377. DWORD APIENTRY RasValidateEntryNameA( LPCSTR, LPCSTR );
  1378.  
  1379. DWORD APIENTRY RasValidateEntryNameW( LPCWSTR, LPCWSTR );
  1380.  
  1381. #if (WINVER >= 0x401)
  1382. DWORD APIENTRY RasGetSubEntryHandleA( HRASCONN, DWORD, LPHRASCONN );
  1383.  
  1384. DWORD APIENTRY RasGetSubEntryHandleW( HRASCONN, DWORD, LPHRASCONN );
  1385.  
  1386. DWORD APIENTRY RasGetCredentialsA( LPCSTR, LPCSTR, LPRASCREDENTIALSA);
  1387.  
  1388. DWORD APIENTRY RasGetCredentialsW( LPCWSTR, LPCWSTR, LPRASCREDENTIALSW );
  1389.  
  1390. DWORD APIENTRY RasSetCredentialsA( LPCSTR, LPCSTR, LPRASCREDENTIALSA, BOOL );
  1391.  
  1392. DWORD APIENTRY RasSetCredentialsW( LPCWSTR, LPCWSTR, LPRASCREDENTIALSW, BOOL );
  1393.  
  1394. DWORD APIENTRY RasConnectionNotificationA( HRASCONN, HANDLE, DWORD );
  1395.  
  1396. DWORD APIENTRY RasConnectionNotificationW( HRASCONN, HANDLE, DWORD );
  1397.  
  1398. DWORD APIENTRY RasGetSubEntryPropertiesA( LPCSTR, LPCSTR, DWORD,
  1399.                     LPRASSUBENTRYA, LPDWORD, LPBYTE, LPDWORD );
  1400.  
  1401. DWORD APIENTRY RasGetSubEntryPropertiesW( LPCWSTR, LPCWSTR, DWORD,
  1402.                     LPRASSUBENTRYW, LPDWORD, LPBYTE, LPDWORD );
  1403.  
  1404. DWORD APIENTRY RasSetSubEntryPropertiesA( LPCSTR, LPCSTR, DWORD,
  1405.                     LPRASSUBENTRYA, DWORD, LPBYTE, DWORD );
  1406.  
  1407. DWORD APIENTRY RasSetSubEntryPropertiesW( LPCWSTR, LPCWSTR, DWORD,
  1408.                     LPRASSUBENTRYW, DWORD, LPBYTE, DWORD );
  1409.  
  1410. DWORD APIENTRY RasGetAutodialAddressA( LPCSTR, LPDWORD, LPRASAUTODIALENTRYA,
  1411.                     LPDWORD, LPDWORD );
  1412.  
  1413. DWORD APIENTRY RasGetAutodialAddressW( LPCWSTR, LPDWORD, LPRASAUTODIALENTRYW,
  1414.                     LPDWORD, LPDWORD);
  1415.  
  1416. DWORD APIENTRY RasSetAutodialAddressA( LPCSTR, DWORD, LPRASAUTODIALENTRYA,
  1417.                     DWORD, DWORD );
  1418.  
  1419. DWORD APIENTRY RasSetAutodialAddressW( LPCWSTR, DWORD, LPRASAUTODIALENTRYW,
  1420.                     DWORD, DWORD );
  1421.  
  1422. DWORD APIENTRY RasEnumAutodialAddressesA( LPSTR *, LPDWORD, LPDWORD );
  1423.  
  1424. DWORD APIENTRY RasEnumAutodialAddressesW( LPWSTR *, LPDWORD, LPDWORD );
  1425.  
  1426. DWORD APIENTRY RasGetAutodialEnableA( DWORD, LPBOOL );
  1427.  
  1428. DWORD APIENTRY RasGetAutodialEnableW( DWORD, LPBOOL );
  1429.  
  1430. DWORD APIENTRY RasSetAutodialEnableA( DWORD, BOOL );
  1431.  
  1432. DWORD APIENTRY RasSetAutodialEnableW( DWORD, BOOL );
  1433.  
  1434. DWORD APIENTRY RasGetAutodialParamA( DWORD, LPVOID, LPDWORD );
  1435.  
  1436. DWORD APIENTRY RasGetAutodialParamW( DWORD, LPVOID, LPDWORD );
  1437.  
  1438. DWORD APIENTRY RasSetAutodialParamA( DWORD, LPVOID, DWORD );
  1439.  
  1440. DWORD APIENTRY RasSetAutodialParamW( DWORD, LPVOID, DWORD );
  1441. #endif
  1442.  
  1443. #if (WINVER >= 0x500)
  1444.  
  1445. typedef struct _RAS_STATS
  1446. {
  1447.     DWORD   dwSize;
  1448.     DWORD   dwBytesXmited;
  1449.     DWORD   dwBytesRcved;
  1450.     DWORD   dwFramesXmited;
  1451.     DWORD   dwFramesRcved;
  1452.     DWORD   dwCrcErr;
  1453.     DWORD   dwTimeoutErr;
  1454.     DWORD   dwAlignmentErr;
  1455.     DWORD   dwHardwareOverrunErr;
  1456.     DWORD   dwFramingErr;
  1457.     DWORD   dwBufferOverrunErr;
  1458.     DWORD   dwCompressionRatioIn;
  1459.     DWORD   dwCompressionRatioOut;
  1460.     DWORD   dwBps;
  1461.     DWORD   dwConnectDuration;
  1462.  
  1463. } RAS_STATS, *PRAS_STATS;
  1464.  
  1465.  
  1466. typedef DWORD (WINAPI *RasCustomHangUpFn) (
  1467.                             HRASCONN hRasConn
  1468.                             );
  1469.  
  1470. typedef DWORD (WINAPI *RasCustomDialFn) (
  1471.         HINSTANCE           hInstDll,
  1472.         LPRASDIALEXTENSIONS lpRasDialExtensions,
  1473.         LPCTSTR              lpszPhonebook,
  1474.         LPRASDIALPARAMS     lpRasDialParams,
  1475.         DWORD               dwNotifierType,
  1476.         LPVOID              lpvNotifier,
  1477.         LPHRASCONN          lphRasConn,
  1478.         DWORD               dwFlags
  1479.         );
  1480.  
  1481. typedef DWORD (WINAPI *RasCustomDeleteEntryNotifyFn) (
  1482.         LPCTSTR             lpszPhonebook,
  1483.         LPCTSTR             lpszEntry,
  1484.         DWORD               dwFlags);
  1485.  
  1486.  
  1487. #define RCD_SingleUser  0
  1488. #define RCD_AllUsers    0x00000001
  1489. #define RCD_Eap         0x00000002
  1490.  
  1491. DWORD APIENTRY RasInvokeEapUI( HRASCONN, DWORD, LPRASDIALEXTENSIONS, HWND);
  1492.  
  1493. DWORD APIENTRY RasGetLinkStatistics(HRASCONN hRasConn,
  1494.                                     DWORD dwSubEntry,
  1495.                                     RAS_STATS *lpStatistics);
  1496.  
  1497. DWORD APIENTRY RasGetConnectionStatistics(HRASCONN hRasConn,
  1498.                                           RAS_STATS *lpStatistics);
  1499.  
  1500. DWORD APIENTRY RasClearLinkStatistics(HRASCONN hRasConn,
  1501.                                       DWORD dwSubEntry);
  1502.  
  1503.  
  1504. DWORD APIENTRY RasClearConnectionStatistics(HRASCONN hRasConn);
  1505.  
  1506. DWORD APIENTRY RasGetEapUserDataA(
  1507.                    HANDLE hToken,
  1508.                    LPCSTR pszPhonebook,
  1509.                    LPCSTR pszEntry,
  1510.                    BYTE   *pbEapData,
  1511.                    DWORD  *pdwSizeofEapData);
  1512.  
  1513.  
  1514. DWORD APIENTRY RasGetEapUserDataW(
  1515.                    HANDLE  hToken,
  1516.                    LPCWSTR pszPhonebook,
  1517.                    LPCWSTR pszEntry,
  1518.                    BYTE    *pbEapData,
  1519.                    DWORD   *pdwSizeofEapData);
  1520.  
  1521. DWORD APIENTRY RasSetEapUserDataA(
  1522.                    HANDLE hToken,
  1523.                    LPCSTR pszPhonebook,
  1524.                    LPCSTR pszEntry,
  1525.                    BYTE   *pbEapData,
  1526.                    DWORD  dwSizeofEapData);
  1527.  
  1528. DWORD APIENTRY RasSetEapUserDataW(
  1529.                    HANDLE  hToken,
  1530.                    LPCWSTR pszPhonebook,
  1531.                    LPCWSTR pszEntry,
  1532.                    BYTE    *pbEapData,
  1533.                    DWORD   dwSizeofEapData);
  1534.  
  1535. DWORD APIENTRY RasGetCustomAuthDataA(
  1536.                    LPCSTR pszPhonebook,
  1537.                    LPCSTR pszEntry,
  1538.                    BYTE   *pbCustomAuthData,
  1539.                    DWORD  *pdwSizeofCustomAuthData);
  1540.  
  1541.  
  1542. DWORD APIENTRY RasGetCustomAuthDataW(
  1543.                    LPCWSTR pszPhonebook,
  1544.                    LPCWSTR pszEntry,
  1545.                    BYTE    *pbCustomAuthData,
  1546.                    DWORD   *pdwSizeofCustomAuthData);
  1547.  
  1548. DWORD APIENTRY RasSetCustomAuthDataA(
  1549.                    LPCSTR pszPhonebook,
  1550.                    LPCSTR pszEntry,
  1551.                    BYTE   *pbCustomAuthData,
  1552.                    DWORD  dwSizeofCustomAuthData
  1553.                    );
  1554.  
  1555. DWORD APIENTRY RasSetCustomAuthDataW(
  1556.                    LPCWSTR pszPhonebook,
  1557.                    LPCWSTR pszEntry,
  1558.                    BYTE    *pbCustomAuthData,
  1559.                    DWORD   dwSizeofCustomAuthData
  1560.                    );
  1561. DWORD APIENTRY RasGetEapUserIdentityW(
  1562.                    LPCWSTR                  pszPhonebook,
  1563.                    LPCWSTR                  pszEntry,
  1564.                    DWORD                    dwFlags,
  1565.                    HWND                     hwnd,
  1566.                    LPRASEAPUSERIDENTITYW*   ppRasEapUserIdentity
  1567. );
  1568. DWORD APIENTRY RasGetEapUserIdentityA(
  1569.                    LPCSTR                   pszPhonebook,
  1570.                    LPCSTR                   pszEntry,
  1571.                    DWORD                    dwFlags,
  1572.                    HWND                     hwnd,
  1573.                    LPRASEAPUSERIDENTITYA*   ppRasEapUserIdentity
  1574. );
  1575. VOID APIENTRY RasFreeEapUserIdentityW(
  1576.                    LPRASEAPUSERIDENTITYW    pRasEapUserIdentity
  1577. );
  1578. VOID APIENTRY RasFreeEapUserIdentityA(
  1579.                    LPRASEAPUSERIDENTITYA    pRasEapUserIdentity
  1580. );
  1581. #endif
  1582.  
  1583. #ifdef UNICODE
  1584. #define RasDial                 RasDialW
  1585. #define RasEnumConnections      RasEnumConnectionsW
  1586. #define RasEnumEntries          RasEnumEntriesW
  1587. #define RasGetConnectStatus     RasGetConnectStatusW
  1588. #define RasGetErrorString       RasGetErrorStringW
  1589. #define RasHangUp               RasHangUpW
  1590. #define RasGetProjectionInfo    RasGetProjectionInfoW
  1591. #define RasCreatePhonebookEntry RasCreatePhonebookEntryW
  1592. #define RasEditPhonebookEntry   RasEditPhonebookEntryW
  1593. #define RasSetEntryDialParams   RasSetEntryDialParamsW
  1594. #define RasGetEntryDialParams   RasGetEntryDialParamsW
  1595. #define RasEnumDevices          RasEnumDevicesW
  1596. #define RasGetCountryInfo       RasGetCountryInfoW
  1597. #define RasGetEntryProperties   RasGetEntryPropertiesW
  1598. #define RasSetEntryProperties   RasSetEntryPropertiesW
  1599. #define RasRenameEntry          RasRenameEntryW
  1600. #define RasDeleteEntry          RasDeleteEntryW
  1601. #define RasValidateEntryName    RasValidateEntryNameW
  1602. #if (WINVER >= 0x401)
  1603. #define RasGetSubEntryHandle        RasGetSubEntryHandleW
  1604. #define RasConnectionNotification   RasConnectionNotificationW
  1605. #define RasGetSubEntryProperties    RasGetSubEntryPropertiesW
  1606. #define RasSetSubEntryProperties    RasSetSubEntryPropertiesW
  1607. #define RasGetCredentials           RasGetCredentialsW
  1608. #define RasSetCredentials           RasSetCredentialsW
  1609. #define RasGetAutodialAddress       RasGetAutodialAddressW
  1610. #define RasSetAutodialAddress       RasSetAutodialAddressW
  1611. #define RasEnumAutodialAddresses    RasEnumAutodialAddressesW
  1612. #define RasGetAutodialEnable        RasGetAutodialEnableW
  1613. #define RasSetAutodialEnable        RasSetAutodialEnableW
  1614. #define RasGetAutodialParam         RasGetAutodialParamW
  1615. #define RasSetAutodialParam         RasSetAutodialParamW
  1616. #endif
  1617. #if (WINVER >= 0x500)
  1618. #define RasGetEapUserData           RasGetEapUserDataW
  1619. #define RasSetEapUserData           RasSetEapUserDataW
  1620. #define RasGetCustomAuthData        RasGetCustomAuthDataW
  1621. #define RasSetCustomAuthData        RasSetCustomAuthDataW
  1622. #define RasGetEapUserIdentity       RasGetEapUserIdentityW
  1623. #define RasFreeEapUserIdentity      RasFreeEapUserIdentityW
  1624. #endif
  1625. #else
  1626. #define RasDial                 RasDialA
  1627. #define RasEnumConnections      RasEnumConnectionsA
  1628. #define RasEnumEntries          RasEnumEntriesA
  1629. #define RasGetConnectStatus     RasGetConnectStatusA
  1630. #define RasGetErrorString       RasGetErrorStringA
  1631. #define RasHangUp               RasHangUpA
  1632. #define RasGetProjectionInfo    RasGetProjectionInfoA
  1633. #define RasCreatePhonebookEntry RasCreatePhonebookEntryA
  1634. #define RasEditPhonebookEntry   RasEditPhonebookEntryA
  1635. #define RasSetEntryDialParams   RasSetEntryDialParamsA
  1636. #define RasGetEntryDialParams   RasGetEntryDialParamsA
  1637. #define RasEnumDevices          RasEnumDevicesA
  1638. #define RasGetCountryInfo       RasGetCountryInfoA
  1639. #define RasGetEntryProperties   RasGetEntryPropertiesA
  1640. #define RasSetEntryProperties   RasSetEntryPropertiesA
  1641. #define RasRenameEntry          RasRenameEntryA
  1642. #define RasDeleteEntry          RasDeleteEntryA
  1643. #define RasValidateEntryName    RasValidateEntryNameA
  1644. #if (WINVER >= 0x401)
  1645. #define RasGetSubEntryHandle        RasGetSubEntryHandleA
  1646. #define RasConnectionNotification   RasConnectionNotificationA
  1647. #define RasGetSubEntryProperties    RasGetSubEntryPropertiesA
  1648. #define RasSetSubEntryProperties    RasSetSubEntryPropertiesA
  1649. #define RasGetCredentials           RasGetCredentialsA
  1650. #define RasSetCredentials           RasSetCredentialsA
  1651. #define RasGetAutodialAddress       RasGetAutodialAddressA
  1652. #define RasSetAutodialAddress       RasSetAutodialAddressA
  1653. #define RasEnumAutodialAddresses    RasEnumAutodialAddressesA
  1654. #define RasGetAutodialEnable        RasGetAutodialEnableA
  1655. #define RasSetAutodialEnable        RasSetAutodialEnableA
  1656. #define RasGetAutodialParam         RasGetAutodialParamA
  1657. #define RasSetAutodialParam         RasSetAutodialParamA
  1658. #endif
  1659. #if (WINVER >= 0x500)
  1660. #define RasGetEapUserData           RasGetEapUserDataA
  1661. #define RasSetEapUserData           RasSetEapUserDataA
  1662. #define RasGetCustomAuthData        RasGetCustomAuthDataA
  1663. #define RasSetCustomAuthData        RasSetCustomAuthDataA
  1664. #define RasGetEapUserIdentity       RasGetEapUserIdentityA
  1665. #define RasFreeEapUserIdentity      RasFreeEapUserIdentityA
  1666. #endif
  1667. #endif
  1668.  
  1669. #ifdef __cplusplus
  1670. }
  1671. #endif
  1672.  
  1673. #include <poppack.h>
  1674.  
  1675. #pragma option pop /*P_O_Pop*/
  1676. #endif // _RAS_H_
  1677.