Leaked source code of windows server 2003
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.

219 lines
8.5 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1995 **
  4. //*********************************************************************
  5. //
  6. // INETAPI.H - APIs for system configuration for Internet and phone number
  7. // setting
  8. //
  9. // HISTORY:
  10. //
  11. // 3/3/95 jeremys Created.
  12. // 96/03/21 markdu Use private string sizes (MSN_) for PHONENUM since the
  13. // RAS ones (RAS_) change depending on platform, but MSN does not
  14. // expect this so the structure sizes won't match on existing code.
  15. //
  16. #ifndef _INETAPI_H_
  17. #define _INETAPI_H_
  18. #ifndef _RNAP_H_
  19. // (copied from RNA header file)
  20. #define MSN_MaxAreaCode 10
  21. #define MSN_MaxLocal 36
  22. #define MSN_MaxExtension 5
  23. typedef struct tagPHONENUMA {
  24. DWORD dwCountryID;
  25. DWORD dwCountryCode;
  26. CHAR szAreaCode[MSN_MaxAreaCode+1];
  27. CHAR szLocal[MSN_MaxLocal+1];
  28. CHAR szExtension[MSN_MaxExtension+1];
  29. } PHONENUMA, FAR * LPPHONENUMA;
  30. typedef struct tagPHONENUMW {
  31. DWORD dwCountryID;
  32. DWORD dwCountryCode;
  33. WCHAR szAreaCode[MSN_MaxAreaCode+1];
  34. WCHAR szLocal[MSN_MaxLocal+1];
  35. WCHAR szExtension[MSN_MaxExtension+1];
  36. } PHONENUMW, FAR * LPPHONENUMW;
  37. #ifdef UNICODE
  38. #define PHONENUM PHONENUMW
  39. #define LPPHONENUM LPPHONENUMW
  40. #else
  41. #define PHONENUM PHONENUMA
  42. #define LPPHONENUM LPPHONENUMA
  43. #endif
  44. #endif // ifndef _RNAP_H_
  45. // input flags for APIs
  46. #define ICIF_NOCONFIGURE 0x0001 // for SetInternetPhoneNumber, see comments below
  47. #define ICIF_DONTSETASINTERNETENTRY 0x0002 // if set, phone number will be updated
  48. // but this connectoid will not be set as the internet connectoid
  49. #define ICIF_NODNSCHECK 0x0004 // if set, won't check and warn if static DNS is set
  50. // output flags for APIs
  51. #define ICOF_NEEDREBOOT 0x0001 // indicates that caller must restart system
  52. // structures used to contain API parameters
  53. typedef struct tagINTERNET_CONFIGA
  54. {
  55. DWORD cbSize; // size of this structure in bytes
  56. HWND hwndParent; // parent window handle
  57. LPCSTR pszModemName; // name of modem to use
  58. LPCSTR pszUserName; // user name for RNA connectoid (ignored if NULL)
  59. LPCSTR pszPassword; // password for RNA connectoid (ignored if NULL)
  60. PHONENUMA PhoneNum; // phone number to use
  61. LPCSTR pszEntryName; // title to use for RNA connectoid (default name
  62. // used if NULL)
  63. PHONENUMA PhoneNum2; // backup phone number to use
  64. LPCSTR pszEntryName2; // title to use for RNA connectoid (default name
  65. // used if NULL)
  66. LPCSTR pszDNSServer; // points to string w/IP address (e.g. "108.9.107.4");
  67. // (ignored if NULL)
  68. LPCSTR pszDNSServer2; // points to string w/IP address(e.g. "108.9.107.4");
  69. // (ignored if NULL)
  70. LPCSTR pszAutodialDllName; // optional: name of autodial dll to use (ignored if NULL)
  71. LPCSTR pszAutodialFcnName; // optional: name of function in autodiall dll to use (ignored if NULL)
  72. DWORD dwInputFlags; // at entry, some combination of ICIF_ flags
  73. DWORD dwOutputFlags; // at return, set to some combination of ICOF_ flags
  74. } INTERNET_CONFIGA, FAR * LPINTERNET_CONFIGA;
  75. typedef struct tagINTERNET_CONFIGW
  76. {
  77. DWORD cbSize; // size of this structure in bytes
  78. HWND hwndParent; // parent window handle
  79. LPCWSTR pszModemName; // name of modem to use
  80. LPCWSTR pszUserName; // user name for RNA connectoid (ignored if NULL)
  81. LPCWSTR pszPassword; // password for RNA connectoid (ignored if NULL)
  82. PHONENUMW PhoneNum; // phone number to use
  83. LPCWSTR pszEntryName; // title to use for RNA connectoid (default name
  84. // used if NULL)
  85. PHONENUMW PhoneNum2; // backup phone number to use
  86. LPCWSTR pszEntryName2; // title to use for RNA connectoid (default name
  87. // used if NULL)
  88. LPCWSTR pszDNSServer; // points to string w/IP address (e.g. "108.9.107.4");
  89. // (ignored if NULL)
  90. LPCWSTR pszDNSServer2; // points to string w/IP address(e.g. "108.9.107.4");
  91. // (ignored if NULL)
  92. LPCWSTR pszAutodialDllName; // optional: name of autodial dll to use (ignored if NULL)
  93. LPCWSTR pszAutodialFcnName; // optional: name of function in autodiall dll to use (ignored if NULL)
  94. DWORD dwInputFlags; // at entry, some combination of ICIF_ flags
  95. DWORD dwOutputFlags; // at return, set to some combination of ICOF_ flags
  96. } INTERNET_CONFIGW, FAR * LPINTERNET_CONFIGW;
  97. #ifdef UNICODE
  98. typedef INTERNET_CONFIGW INTERNET_CONFIG;
  99. typedef LPINTERNET_CONFIGW LPINTERNET_CONFIG;
  100. #else
  101. typedef INTERNET_CONFIGA INTERNET_CONFIG;
  102. typedef LPINTERNET_CONFIGA LPINTERNET_CONFIG;
  103. #endif
  104. // function prototypes
  105. /*******************************************************************
  106. NAME: ConfigureSystemForInternet
  107. SYNOPSIS: Performs all necessary configuration to set system up
  108. to use Internet.
  109. ENTRY: lpInternetConfig - pointer to structure with configuration
  110. information.
  111. EXIT: TRUE if successful, or FALSE if fails. Displays its
  112. own error message upon failure.
  113. If the output flag ICOF_NEEDREBOOT is set, the caller
  114. must restart the system before continuing.
  115. NOTES: Will install TCP/IP, RNA, PPPMAC as necessary; will
  116. create or modify an Internet RNA connectoid.
  117. This API displays error messages itself rather than
  118. passing back an error code because there is a wide range of
  119. possible error codes from different families, it is difficult
  120. for the caller to obtain text for all of them.
  121. ********************************************************************/
  122. extern "C" BOOL WINAPI ConfigureSystemForInternetA(LPINTERNET_CONFIGA lpInternetConfig);
  123. extern "C" BOOL WINAPI ConfigureSystemForInternetW(LPINTERNET_CONFIGW lpInternetConfig);
  124. #ifdef UNICODE
  125. #define ConfigureSystemForInternet ConfigureSystemForInternetW
  126. #else
  127. #define ConfigureSystemForInternet ConfigureSystemForInternetA
  128. #endif
  129. /*******************************************************************
  130. NAME: SetInternetPhoneNumber
  131. SYNOPSIS: Sets the phone number used to auto-dial to the Internet.
  132. If the system is not fully configured when this API is called,
  133. this API will do the configuration after checking with the user.
  134. (This step is included for extra robustness, in case the user has
  135. removed something since the system was configured.)
  136. ENTRY: lpPhonenumConfig - pointer to structure with configuration
  137. information.
  138. If the input flag ICIF_NOCONFIGURE is set, then if the system
  139. is not already configured properly, this API will display an
  140. error message and return FALSE. (Otherwise this API will
  141. ask the user if it's OK to configure the system, and do it.)
  142. EXIT: TRUE if successful, or FALSE if fails. Displays its
  143. own error message upon failure.
  144. If the output flag ICOF_NEEDREBOOT is set, the caller
  145. must restart the system before continuing. (
  146. NOTES: Will create a new connectoid if a connectoid for the internet
  147. does not exist yet, otherwise modifies existing internet
  148. connectoid.
  149. This API displays error messages itself rather than
  150. passing back an error code because there is a wide range of
  151. possible error codes from different families, it is difficult
  152. for the caller to obtain text for all of them.
  153. ********************************************************************/
  154. extern "C" BOOL WINAPI SetInternetPhoneNumberA(LPINTERNET_CONFIGA lpInternetConfig);
  155. extern "C" BOOL WINAPI SetInternetPhoneNumberW(LPINTERNET_CONFIGW lpInternetConfig);
  156. #ifdef UNICODE
  157. #define SetInternetPhoneNumber SetInternetPhoneNumberW
  158. #else
  159. #define SetInternetPhoneNumber SetInternetPhoneNumberA
  160. #endif
  161. #endif // _INETAPI_H_