Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
4.0 KiB

  1. /* Copyright (c) 1992, Microsoft Corporation, all rights reserved
  2. **
  3. ** ras.h
  4. ** Remote Access external Win16 API
  5. ** Public header for external Win16 API clients
  6. **
  7. ** Note: The 'dwSize' member of a data structure X must be set to sizeof(X)
  8. ** before calling the associated API, otherwise ERROR_INVALID_SIZE is
  9. ** returned. The value expected by the API is listed next to each
  10. ** 'dwSize' member.
  11. */
  12. #ifndef _RAS_H_
  13. #define _RAS_H_
  14. #ifndef RC_INVOKED
  15. #pragma pack(2)
  16. #endif
  17. #ifndef NETCONS_INCLUDED
  18. #define UNLEN 20
  19. #define PWLEN 14
  20. #define DNLEN 15
  21. #endif
  22. #ifndef APIENTRY
  23. #define APIENTRY FAR PASCAL
  24. #endif
  25. #ifndef CHAR
  26. #define CHAR char
  27. #endif
  28. #ifndef UINT
  29. #define UINT unsigned int
  30. #endif
  31. #define RAS_MaxEntryName 20
  32. #define RAS_MaxDeviceName 32
  33. #define RAS_MaxDeviceType 16
  34. #define RAS_MaxParamKey 32
  35. #define RAS_MaxParamValue 128
  36. #define RAS_MaxPhoneNumber 128
  37. #define RAS_MaxCallbackNumber 48
  38. #define HRASCONN const void far*
  39. #define LPHRASCONN HRASCONN FAR*
  40. /* Pass this string to the RegisterWindowMessage() API to get the message
  41. ** number that will be used for notifications on the hwnd you pass to the
  42. ** RasDial() API. WM_RASDIALEVENT is used only if a unique message cannot be
  43. ** registered.
  44. */
  45. #define RASDIALEVENT "RasDialEvent"
  46. #define WM_RASDIALEVENT 0xCCCD
  47. /* Identifies an active RAS connection. (See RasConnectEnum)
  48. */
  49. #define RASCONN struct tagRASCONN
  50. RASCONN
  51. {
  52. DWORD dwSize; /* 30 */
  53. HRASCONN hrasconn;
  54. CHAR szEntryName[ RAS_MaxEntryName + 1 ];
  55. };
  56. #define LPRASCONN RASCONN FAR*
  57. /* Enumerates intermediate states to a connection. (See RasDial)
  58. */
  59. #define RASCS_PAUSED 0x1000
  60. #define RASCS_DONE 0x2000
  61. #define RASCONNSTATE enum tagRASCONNSTATE
  62. RASCONNSTATE
  63. {
  64. RASCS_OpenPort = 0,
  65. RASCS_PortOpened,
  66. RASCS_ConnectDevice,
  67. RASCS_DeviceConnected,
  68. RASCS_AllDevicesConnected,
  69. RASCS_Authenticate,
  70. RASCS_AuthNotify,
  71. RASCS_AuthRetry,
  72. RASCS_AuthCallback,
  73. RASCS_AuthChangePassword,
  74. RASCS_AuthProject,
  75. RASCS_AuthLinkSpeed,
  76. RASCS_AuthAck,
  77. RASCS_ReAuthenticate,
  78. RASCS_Authenticated,
  79. RASCS_PrepareForCallback,
  80. RASCS_WaitForModemReset,
  81. RASCS_WaitForCallback,
  82. RASCS_Interactive = RASCS_PAUSED,
  83. RASCS_RetryAuthentication,
  84. RASCS_CallbackSetByCaller,
  85. RASCS_PasswordExpired,
  86. RASCS_Connected = RASCS_DONE,
  87. RASCS_Disconnected
  88. };
  89. #define LPRASCONNSTATE RASCONNSTATE FAR*
  90. /* Describes the status of a RAS connection. (See RasConnectionStatus)
  91. */
  92. #define RASCONNSTATUS struct tagRASCONNSTATUS
  93. RASCONNSTATUS
  94. {
  95. DWORD dwSize; /* 60 */
  96. RASCONNSTATE rasconnstate;
  97. DWORD dwError;
  98. CHAR szDeviceType[ RAS_MaxDeviceType + 1 ];
  99. CHAR szDeviceName[ RAS_MaxDeviceName + 1 ];
  100. };
  101. #define LPRASCONNSTATUS RASCONNSTATUS FAR*
  102. /* Describes connection establishment parameters. (See RasDial)
  103. */
  104. #define RASDIALPARAMS struct tagRASDIALPARAMS
  105. RASDIALPARAMS
  106. {
  107. DWORD dwSize; /* 256 */
  108. CHAR szEntryName[ RAS_MaxEntryName + 1 ];
  109. CHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  110. CHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
  111. CHAR szUserName[ UNLEN + 1 ];
  112. CHAR szPassword[ PWLEN + 1 ];
  113. CHAR szDomain[ DNLEN + 1 ];
  114. };
  115. #define LPRASDIALPARAMS RASDIALPARAMS FAR*
  116. /* Describes an enumerated RAS phone book entry name. (See RasEntryEnum)
  117. */
  118. #define RASENTRYNAME struct tagRASENTRYNAME
  119. RASENTRYNAME
  120. {
  121. DWORD dwSize; /* 26 */
  122. CHAR szEntryName[ RAS_MaxEntryName + 1 ];
  123. };
  124. #define LPRASENTRYNAME RASENTRYNAME FAR*
  125. /* External RAS API function prototypes.
  126. */
  127. DWORD APIENTRY RasDial( LPSTR, LPSTR, LPRASDIALPARAMS, LPVOID, HWND,
  128. LPHRASCONN );
  129. DWORD APIENTRY RasEnumConnections( LPRASCONN, LPDWORD, LPDWORD );
  130. DWORD APIENTRY RasEnumEntries( LPSTR, LPSTR, LPRASENTRYNAME, LPDWORD,
  131. LPDWORD );
  132. DWORD APIENTRY RasGetConnectStatus( HRASCONN, LPRASCONNSTATUS );
  133. DWORD APIENTRY RasGetErrorString( UINT, LPSTR, DWORD );
  134. DWORD APIENTRY RasHangUp( HRASCONN );
  135. #ifndef RC_INVOKED
  136. #pragma pack()
  137. #endif
  138. #endif