home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / GENINC32.PAK / RAS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  6.3 KB  |  267 lines

  1. /* Copyright (c) 1992, Microsoft Corporation, all rights reserved
  2. **
  3. ** ras.h
  4. ** Remote Access external API
  5. ** Public header for external API clients
  6. */
  7.  
  8. #ifndef __RAS_H
  9. #define __RAS_H
  10.  
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. #ifndef UNLEN
  16. #include <lmcons.h>
  17. #endif
  18.  
  19.  
  20. #define RAS_MaxEntryName      20
  21. #define RAS_MaxDeviceName     32
  22. #define RAS_MaxDeviceType     16
  23. #define RAS_MaxParamKey       32
  24. #define RAS_MaxParamValue     128
  25. #define RAS_MaxPhoneNumber    128
  26. #define RAS_MaxCallbackNumber 48
  27.  
  28.  
  29. DECLARE_HANDLE( HRASCONN );
  30. #define LPHRASCONN HRASCONN*
  31.  
  32.  
  33. /* Identifies an active RAS connection.  (See RasEnumConnections)
  34. */
  35. #define RASCONNW struct tagRASCONNW
  36.  
  37. RASCONNW
  38. {
  39.     DWORD    dwSize;
  40.     HRASCONN hrasconn;
  41.     WCHAR    szEntryName[ RAS_MaxEntryName + 1 ];
  42. };
  43.  
  44. #define RASCONNA struct tagRASCONNA
  45.  
  46. RASCONNA
  47. {
  48.     DWORD    dwSize;
  49.     HRASCONN hrasconn;
  50.     CHAR     szEntryName[ RAS_MaxEntryName + 1 ];
  51. };
  52.  
  53. #ifdef UNICODE
  54. #define RASCONN RASCONNW
  55. #else
  56. #define RASCONN RASCONNA
  57. #endif
  58.  
  59. #define LPRASCONNW RASCONNW*
  60. #define LPRASCONNA RASCONNA*
  61. #define LPRASCONN  RASCONN*
  62.  
  63.  
  64. /* Enumerates intermediate states to a connection.  (See RasDial)
  65. */
  66. #define RASCS_PAUSED 0x1000
  67. #define RASCS_DONE   0x2000
  68.  
  69. #define RASCONNSTATE enum tagRASCONNSTATE
  70.  
  71. RASCONNSTATE
  72. {
  73.     RASCS_OpenPort = 0,
  74.     RASCS_PortOpened,
  75.     RASCS_ConnectDevice,
  76.     RASCS_DeviceConnected,
  77.     RASCS_AllDevicesConnected,
  78.     RASCS_Authenticate,
  79.     RASCS_AuthNotify,
  80.     RASCS_AuthRetry,
  81.     RASCS_AuthCallback,
  82.     RASCS_AuthChangePassword,
  83.     RASCS_AuthProject,
  84.     RASCS_AuthLinkSpeed,
  85.     RASCS_AuthAck,
  86.     RASCS_ReAuthenticate,
  87.     RASCS_Authenticated,
  88.     RASCS_PrepareForCallback,
  89.     RASCS_WaitForModemReset,
  90.     RASCS_WaitForCallback,
  91.  
  92.     RASCS_Interactive = RASCS_PAUSED,
  93.     RASCS_RetryAuthentication,
  94.     RASCS_CallbackSetByCaller,
  95.     RASCS_PasswordExpired,
  96.  
  97.     RASCS_Connected = RASCS_DONE,
  98.     RASCS_Disconnected
  99. };
  100.  
  101. #define LPRASCONNSTATE RASCONNSTATE*
  102.  
  103.  
  104. /* Describes the status of a RAS connection.  (See RasConnectionStatus)
  105. */
  106. #define RASCONNSTATUSW struct tagRASCONNSTATUSW
  107.  
  108. RASCONNSTATUSW
  109. {
  110.     DWORD        dwSize;
  111.     RASCONNSTATE rasconnstate;
  112.     DWORD        dwError;
  113.     WCHAR        szDeviceType[ RAS_MaxDeviceType + 1 ];
  114.     WCHAR        szDeviceName[ RAS_MaxDeviceName + 1 ];
  115. };
  116.  
  117. #define RASCONNSTATUSA struct tagRASCONNSTATUSA
  118.  
  119. RASCONNSTATUSA
  120. {
  121.     DWORD        dwSize;
  122.     RASCONNSTATE rasconnstate;
  123.     DWORD        dwError;
  124.     CHAR         szDeviceType[ RAS_MaxDeviceType + 1 ];
  125.     CHAR         szDeviceName[ RAS_MaxDeviceName + 1 ];
  126. };
  127.  
  128. #ifdef UNICODE
  129. #define RASCONNSTATUS RASCONNSTATUSW
  130. #else
  131. #define RASCONNSTATUS RASCONNSTATUSA
  132. #endif
  133.  
  134. #define LPRASCONNSTATUSW RASCONNSTATUSW*
  135. #define LPRASCONNSTATUSA RASCONNSTATUSA*
  136. #define LPRASCONNSTATUS  RASCONNSTATUS*
  137.  
  138.  
  139. /* Describes connection establishment parameters.  (See RasDial)
  140. */
  141. #define RASDIALPARAMSW struct tagRASDIALPARAMSW
  142.  
  143. RASDIALPARAMSW
  144. {
  145.     DWORD dwSize;
  146.     WCHAR szEntryName[ RAS_MaxEntryName + 1 ];
  147.     WCHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  148.     WCHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
  149.     WCHAR szUserName[ UNLEN + 1 ];
  150.     WCHAR szPassword[ PWLEN + 1 ];
  151.     WCHAR szDomain[ DNLEN + 1 ];
  152. };
  153.  
  154. #define RASDIALPARAMSA struct tagRASDIALPARAMSA
  155.  
  156. RASDIALPARAMSA
  157. {
  158.     DWORD dwSize;
  159.     CHAR  szEntryName[ RAS_MaxEntryName + 1 ];
  160.     CHAR  szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  161.     CHAR  szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
  162.     CHAR  szUserName[ UNLEN + 1 ];
  163.     CHAR  szPassword[ PWLEN + 1 ];
  164.     CHAR  szDomain[ DNLEN + 1 ];
  165. };
  166.  
  167. #ifdef UNICODE
  168. #define RASDIALPARAMS RASDIALPARAMSW
  169. #else
  170. #define RASDIALPARAMS RASDIALPARAMSA
  171. #endif
  172.  
  173. #define LPRASDIALPARAMSW RASDIALPARAMSW*
  174. #define LPRASDIALPARAMSA RASDIALPARAMSA*
  175. #define LPRASDIALPARAMS  RASDIALPARAMS*
  176.  
  177.  
  178. /* Describes an enumerated RAS phone book entry name.  (See RasEntryEnum)
  179. */
  180. #define RASENTRYNAMEW struct tagRASENTRYNAMEW
  181.  
  182. RASENTRYNAMEW
  183. {
  184.     DWORD dwSize;
  185.     WCHAR szEntryName[ RAS_MaxEntryName + 1 ];
  186. };
  187.  
  188. #define RASENTRYNAMEA struct tagRASENTRYNAMEA
  189.  
  190. RASENTRYNAMEA
  191. {
  192.     DWORD dwSize;
  193.     CHAR  szEntryName[ RAS_MaxEntryName + 1 ];
  194. };
  195.  
  196. #ifdef UNICODE
  197. #define RASENTRYNAME RASENTRYNAMEW
  198. #else
  199. #define RASENTRYNAME RASENTRYNAMEA
  200. #endif
  201.  
  202. #define LPRASENTRYNAMEW RASENTRYNAMEW*
  203. #define LPRASENTRYNAMEA RASENTRYNAMEA*
  204. #define LPRASENTRYNAME  RASENTRYNAME*
  205.  
  206.  
  207. /* Prototype for caller's RasDial callback handler.  Arguments are the message
  208. ** ID (currently always WM_RASDIALEVENT), the current RASCONNSTATE and the
  209. ** error that has occurred (or 0 if none).
  210. */
  211. #define WM_RASDIALEVENT 0xCCCD
  212. typedef VOID (WINAPI *RASDIALFUNC)( UINT, RASCONNSTATE, DWORD );
  213.  
  214.  
  215. /* External RAS API function prototypes.
  216. */
  217. DWORD APIENTRY RasDialA( LPSTR, LPSTR, LPRASDIALPARAMSA, LPVOID, RASDIALFUNC,
  218.                    LPHRASCONN );
  219.  
  220. DWORD APIENTRY RasDialW( LPWSTR, LPWSTR, LPRASDIALPARAMSW, LPVOID, RASDIALFUNC,
  221.                    LPHRASCONN );
  222.  
  223. DWORD APIENTRY RasEnumConnectionsA( LPRASCONNA, LPDWORD, LPDWORD );
  224.  
  225. DWORD APIENTRY RasEnumConnectionsW( LPRASCONNW, LPDWORD, LPDWORD );
  226.  
  227. DWORD APIENTRY RasEnumEntriesA( LPSTR, LPSTR, LPRASENTRYNAMEA, LPDWORD,
  228.                    LPDWORD );
  229.  
  230. DWORD APIENTRY RasEnumEntriesW( LPWSTR, LPWSTR, LPRASENTRYNAMEW, LPDWORD,
  231.                    LPDWORD );
  232.  
  233. DWORD APIENTRY RasGetConnectStatusA( HRASCONN, LPRASCONNSTATUSA );
  234.  
  235. DWORD APIENTRY RasGetConnectStatusW( HRASCONN, LPRASCONNSTATUSW );
  236.  
  237. DWORD APIENTRY RasGetErrorStringA( UINT, LPSTR, DWORD );
  238.  
  239. DWORD APIENTRY RasGetErrorStringW( UINT, LPWSTR, DWORD );
  240.  
  241. DWORD APIENTRY RasHangUpA( HRASCONN );
  242.  
  243. DWORD APIENTRY RasHangUpW( HRASCONN );
  244.  
  245.  
  246. #ifdef UNICODE
  247. #define RasDial             RasDialW
  248. #define RasEnumConnections  RasEnumConnectionsW
  249. #define RasEnumEntries      RasEnumEntriesW
  250. #define RasGetConnectStatus RasGetConnectStatusW
  251. #define RasGetErrorString   RasGetErrorStringW
  252. #define RasHangUp           RasHangUpW
  253. #else
  254. #define RasDial             RasDialA
  255. #define RasEnumConnections  RasEnumConnectionsA
  256. #define RasEnumEntries      RasEnumEntriesA
  257. #define RasGetConnectStatus RasGetConnectStatusA
  258. #define RasGetErrorString   RasGetErrorStringA
  259. #define RasHangUp           RasHangUpA
  260. #endif
  261.  
  262. #ifdef __cplusplus
  263. }
  264. #endif
  265.  
  266. #endif // _RAS_H_
  267.