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.

528 lines
21 KiB

  1. //*******************************************************************
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // *** N O T F O R E X T E R N A L R E L E A S E *******
  6. // This header file is not intended for distribution outside Microsoft.
  7. //
  8. // FILE: INETCFG.H
  9. //
  10. // PURPOSE: Contains API's exported from inetcfg.dll and structures
  11. // required by those functions.
  12. // Note: Definitions in this header file require RAS.H.
  13. //
  14. //*******************************************************************
  15. #ifndef _INETCFG_H_
  16. #define _INETCFG_H_
  17. #ifndef UNLEN
  18. #include <lmcons.h>
  19. #endif
  20. // Generic HRESULT error code
  21. #define ERROR_INETCFG_UNKNOWN 0x20000000L
  22. #define MAX_EMAIL_NAME 64
  23. #define MAX_EMAIL_ADDRESS 128
  24. #define MAX_LOGON_NAME UNLEN
  25. #define MAX_LOGON_PASSWORD PWLEN
  26. #define MAX_SERVER_NAME 64 // max length of DNS name per RFC 1035 +1
  27. // Flags for dwfOptions
  28. // install Internet mail
  29. #define INETCFG_INSTALLMAIL 0x00000001
  30. // Invoke InstallModem wizard if NO MODEM IS INSTALLED
  31. #define INETCFG_INSTALLMODEM 0x00000002
  32. // install RNA (if needed)
  33. #define INETCFG_INSTALLRNA 0x00000004
  34. // install TCP (if needed)
  35. #define INETCFG_INSTALLTCP 0x00000008
  36. // connecting with LAN (vs modem)
  37. #define INETCFG_CONNECTOVERLAN 0x00000010
  38. // Set the phone book entry for autodial
  39. #define INETCFG_SETASAUTODIAL 0x00000020
  40. // Overwrite the phone book entry if it exists
  41. // Note: if this flag is not set, and the entry exists, a unique name will
  42. // be created for the entry.
  43. #define INETCFG_OVERWRITEENTRY 0x00000040
  44. // Do not show the dialog that tells the user that files are about to be installed,
  45. // with OK/Cancel buttons.
  46. #define INETCFG_SUPPRESSINSTALLUI 0x00000080
  47. // Check if TCP/IP file sharing is turned on, and warn user to turn it off.
  48. // Reboot is required if the user turns it off.
  49. //#define INETCFG_WARNIFSHARINGBOUND 0x00000100
  50. // Check if TCP/IP file sharing is turned on, and force user to turn it off.
  51. // If user does not want to turn it off, return will be ERROR_CANCELLED
  52. // Reboot is required if the user turns it off.
  53. //#define INETCFG_REMOVEIFSHARINGBOUND 0x00000200
  54. // Indicates that this is a temporary phone book entry
  55. // In Win3.1 an icon will not be created
  56. #define INETCFG_TEMPPHONEBOOKENTRY 0x00000400
  57. // Show the busy dialog while checking system configuration
  58. //#define INETCFG_SHOWBUSYANIMATION 0x00000800
  59. //
  60. // Chrisk 5/8/97
  61. // Note: the next three switches are only valid for InetNeedSystemComponents
  62. // Check if LAN adapter is installed and bound to TCP
  63. //
  64. #define INETCFG_INSTALLLAN 0x00001000
  65. //
  66. // Check if DIALUP adapter is installed and bound to TCP
  67. //
  68. #define INETCFG_INSTALLDIALUP 0x00002000
  69. //
  70. // Check to see if TCP is installed requardless of binding
  71. //
  72. #define INETCFG_INSTALLTCPONLY 0x00004000
  73. #ifdef __cplusplus
  74. extern "C"
  75. {
  76. #endif // __cplusplus
  77. // constants for INETCLIENTINFO.dwFlags
  78. #define INETC_LOGONMAIL 0x00000001
  79. #define INETC_LOGONNEWS 0x00000002
  80. #define INETC_LOGONDIRSERV 0x00000004
  81. // Struct INETCLIENTINFO
  82. //
  83. // This structure is used when getting and setting the internet
  84. // client parameters
  85. //
  86. // The members are as follows:
  87. //
  88. // dwSize
  89. // size of this structure, for future versioning
  90. // this member should be set before passing the structure to the DLL
  91. // dwFlags
  92. // miscellaneous flags
  93. // see definitions above
  94. // szEMailName
  95. // user's internet email name
  96. // szEMailAddress
  97. // user's internet email address
  98. // ***Note: the following three fields are outdated, and should only be used by old legacy code.
  99. // *** new code should use szIncomingMail* and iIncomingProtocol fields.
  100. // szPOPLogonName
  101. // user's internet mail server logon name
  102. // szPOPLogonPassword
  103. // user's internet mail server logon password
  104. // szPOPServer
  105. // user's internet mail POP3 server
  106. // szSMTPServer
  107. // user's internet mail SMTP server
  108. // szNNTPLogonName
  109. // user's news server logon name
  110. // szNNTPLogonPassword
  111. // user's news server logon password
  112. // szNNTPServer
  113. // user's news server
  114. // ** End of original 1.0 structure.
  115. // ??/??/96 ValdonB
  116. // szNNTPName
  117. // user's friendly name to include in NNTP posts.(?? Valdon?)
  118. // szNNTPAddress
  119. // user's reply-to email address for NNTP posts.(?? Valdon?)
  120. // 11/23/96 jmazner Normandy #8504
  121. // iIncomingProtocol
  122. // user's choice of POP3 or IMAP4 protocol for incoming mail
  123. // Holds the enum values defined in ACCTTYPE from imact.h//
  124. // szIncomingMailLogonName
  125. // user's internet mail server logon name
  126. // szIncomingMailLogonPassword
  127. // user's internet mail server logon password
  128. // szIncomingMailServer
  129. // user's internet mail POP3 server
  130. // 12/15/96 jmazner
  131. // fMailLogonSPA
  132. // Use Sicily/SPA/DPA for the incoming mail server
  133. // fNewsLogonSPA
  134. // Use Sicily/SPA/DPA for the news server
  135. // 2/4/96 jmazner -- LDAP functionality
  136. // szLDAPLogonName
  137. // szLDAPLogonPassword
  138. // szLDAPServer
  139. // fLDAPLogonSPA
  140. // fLDAPResolve
  141. typedef struct tagINETCLIENTINFO
  142. {
  143. DWORD dwSize;
  144. DWORD dwFlags;
  145. CHAR szEMailName[MAX_EMAIL_NAME + 1];
  146. CHAR szEMailAddress[MAX_EMAIL_ADDRESS + 1];
  147. CHAR szPOPLogonName[MAX_LOGON_NAME + 1];
  148. CHAR szPOPLogonPassword[MAX_LOGON_PASSWORD + 1];
  149. CHAR szPOPServer[MAX_SERVER_NAME + 1];
  150. CHAR szSMTPServer[MAX_SERVER_NAME + 1];
  151. CHAR szNNTPLogonName[MAX_LOGON_NAME + 1];
  152. CHAR szNNTPLogonPassword[MAX_LOGON_PASSWORD + 1];
  153. CHAR szNNTPServer[MAX_SERVER_NAME + 1];
  154. // end of version 1.0 structure;
  155. // extended 1.1 structure includes the following fields:
  156. CHAR szNNTPName[MAX_EMAIL_NAME + 1];
  157. CHAR szNNTPAddress[MAX_EMAIL_ADDRESS + 1];
  158. int iIncomingProtocol;
  159. CHAR szIncomingMailLogonName[MAX_LOGON_NAME + 1];
  160. CHAR szIncomingMailLogonPassword[MAX_LOGON_PASSWORD + 1];
  161. CHAR szIncomingMailServer[MAX_SERVER_NAME + 1];
  162. BOOL fMailLogonSPA;
  163. BOOL fNewsLogonSPA;
  164. CHAR szLDAPLogonName[MAX_LOGON_NAME + 1];
  165. CHAR szLDAPLogonPassword[MAX_LOGON_PASSWORD + 1];
  166. CHAR szLDAPServer[MAX_SERVER_NAME + 1];
  167. BOOL fLDAPLogonSPA;
  168. BOOL fLDAPResolve;
  169. } INETCLIENTINFO, *PINETCLIENTINFO, FAR *LPINETCLIENTINFO;
  170. // Function prototypes
  171. //*******************************************************************
  172. //
  173. // FUNCTION: InetGetClientInfo
  174. //
  175. // PURPOSE: This function will get the internet client params
  176. // from the registry
  177. //
  178. // PARAMETERS: lpClientInfo - on return, this structure will contain
  179. // the internet client params as set in the registry.
  180. // lpszProfileName - Name of client info profile to
  181. // retrieve. If this is NULL, the default profile is used.
  182. //
  183. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  184. //
  185. //*******************************************************************
  186. HRESULT WINAPI InetGetClientInfo(
  187. LPCSTR lpszProfileName,
  188. LPINETCLIENTINFO lpClientInfo);
  189. //*******************************************************************
  190. //
  191. // FUNCTION: InetSetClientInfo
  192. //
  193. // PURPOSE: This function will set the internet client params
  194. //
  195. // PARAMETERS: lpClientInfo - pointer to struct with info to set
  196. // in the registry.
  197. // lpszProfileName - Name of client info profile to
  198. // modify. If this is NULL, the default profile is used.
  199. //
  200. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  201. //
  202. //*******************************************************************
  203. HRESULT WINAPI InetSetClientInfo(
  204. LPCSTR lpszProfileName,
  205. LPINETCLIENTINFO lpClientInfo);
  206. //*******************************************************************
  207. //
  208. // FUNCTION: InetConfigSystem
  209. //
  210. // PURPOSE: This function will install files that are needed
  211. // for internet access (such as TCP/IP and RNA) based
  212. // the state of the options flags.
  213. //
  214. // PARAMETERS: hwndParent - window handle of calling application. This
  215. // handle will be used as the parent for any dialogs that
  216. // are required for error messages or the "installing files"
  217. // dialog.
  218. // dwfOptions - a combination of INETCFG_ flags that controls
  219. // the installation and configuration as follows:
  220. //
  221. // INETCFG_INSTALLMAIL - install Internet mail
  222. // INETCFG_INSTALLMODEM - Invoke InstallModem wizard if NO
  223. // MODEM IS INSTALLED.
  224. // INETCFG_INSTALLRNA - install RNA (if needed)
  225. // INETCFG_INSTALLTCP - install TCP/IP (if needed)
  226. // INETCFG_CONNECTOVERLAN - connecting with LAN (vs modem)
  227. // INETCFG_WARNIFSHARINGBOUND - Check if TCP/IP file sharing is
  228. // turned on, and warn user to turn
  229. // it off. Reboot is required if
  230. // the user turns it off.
  231. // INETCFG_REMOVEIFSHARINGBOUND - Check if TCP/IP file sharing is
  232. // turned on, and force user to turn
  233. // it off. If user does not want to
  234. // turn it off, return will be
  235. // ERROR_CANCELLED. Reboot is
  236. // required if the user turns it off.
  237. //
  238. // lpfNeedsRestart - if non-NULL, then on return, this will be
  239. // TRUE if windows must be restarted to complete the installation.
  240. //
  241. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  242. //
  243. //*******************************************************************
  244. HRESULT WINAPI InetConfigSystem(
  245. HWND hwndParent,
  246. DWORD dwfOptions,
  247. LPBOOL lpfNeedsRestart);
  248. //*******************************************************************
  249. //
  250. // FUNCTION: InetConfigSystemFromPath
  251. //
  252. // PURPOSE: This function will install files that are needed
  253. // for internet access (such as TCP/IP and RNA) based
  254. // the state of the options flags and from the given [ath.
  255. //
  256. // PARAMETERS: hwndParent - window handle of calling application. This
  257. // handle will be used as the parent for any dialogs that
  258. // are required for error messages or the "installing files"
  259. // dialog.
  260. // dwfOptions - a combination of INETCFG_ flags that controls
  261. // the installation and configuration as follows:
  262. //
  263. // INETCFG_INSTALLMAIL - install Internet mail
  264. // INETCFG_INSTALLMODEM - Invoke InstallModem wizard if NO
  265. // MODEM IS INSTALLED.
  266. // INETCFG_INSTALLRNA - install RNA (if needed)
  267. // INETCFG_INSTALLTCP - install TCP/IP (if needed)
  268. // INETCFG_CONNECTOVERLAN - connecting with LAN (vs modem)
  269. // INETCFG_WARNIFSHARINGBOUND - Check if TCP/IP file sharing is
  270. // turned on, and warn user to turn
  271. // it off. Reboot is required if
  272. // the user turns it off.
  273. // INETCFG_REMOVEIFSHARINGBOUND - Check if TCP/IP file sharing is
  274. // turned on, and force user to turn
  275. // it off. If user does not want to
  276. // turn it off, return will be
  277. // ERROR_CANCELLED. Reboot is
  278. // required if the user turns it off.
  279. //
  280. // lpfNeedsRestart - if non-NULL, then on return, this will be
  281. // TRUE if windows must be restarted to complete the installation.
  282. // lpszSourcePath - full path of location of files to install. If
  283. // this is NULL, default path is used.
  284. //
  285. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  286. //
  287. //*******************************************************************
  288. HRESULT WINAPI InetConfigSystemFromPath(
  289. HWND hwndParent,
  290. DWORD dwfOptions,
  291. LPBOOL lpfNeedsRestart,
  292. LPCSTR lpszSourcePath);
  293. //*******************************************************************
  294. //
  295. // FUNCTION: InetConfigClient
  296. //
  297. // PURPOSE: This function requires a valid phone book entry name
  298. // (unless it is being used just to set the client info).
  299. // If lpRasEntry points to a valid RASENTRY struct, the phone
  300. // book entry will be created (or updated if it already exists)
  301. // with the data in the struct.
  302. // If username and password are given, these
  303. // will be set as the dial params for the phone book entry.
  304. // If a client info struct is given, that data will be set.
  305. // Any files (ie TCP and RNA) that are needed will be
  306. // installed by calling InetConfigSystem().
  307. // This function will also perform verification on the device
  308. // specified in the RASENTRY struct. If no device is specified,
  309. // the user will be prompted to install one if there are none
  310. // installed, or they will be prompted to choose one if there
  311. // is more than one installed.
  312. //
  313. // PARAMETERS: hwndParent - window handle of calling application. This
  314. // handle will be used as the parent for any dialogs that
  315. // are required for error messages or the "installing files"
  316. // dialog.
  317. // lpszPhonebook - name of phone book to store the entry in
  318. // lpszEntryName - name of phone book entry to be
  319. // created or modified
  320. // lpRasEntry - specifies a RASENTRY struct that contains
  321. // the phone book entry data for the entry lpszEntryName
  322. // lpszUsername - username to associate with the phone book entry
  323. // lpszPassword - password to associate with the phone book entry
  324. // lpszProfileName - Name of client info profile to
  325. // retrieve. If this is NULL, the default profile is used.
  326. // lpINetClientInfo - client information
  327. // dwfOptions - a combination of INETCFG_ flags that controls
  328. // the installation and configuration as follows:
  329. //
  330. // INETCFG_INSTALLMAIL - install Internet mail
  331. // INETCFG_INSTALLMODEM - Invoke InstallModem wizard if NO
  332. // MODEM IS INSTALLED. Note that if
  333. // no modem is installed and this flag
  334. // is not set, the function will fail
  335. // INETCFG_INSTALLRNA - install RNA (if needed)
  336. // INETCFG_INSTALLTCP - install TCP/IP (if needed)
  337. // INETCFG_CONNECTOVERLAN - connecting with LAN (vs modem)
  338. // INETCFG_SETASAUTODIAL - Set the phone book entry for autodial
  339. // INETCFG_OVERWRITEENTRY - Overwrite the phone book entry if it
  340. // exists. Note: if this flag is not
  341. // set, and the entry exists, a unique
  342. // name will be created for the entry.
  343. // INETCFG_WARNIFSHARINGBOUND - Check if TCP/IP file sharing is
  344. // turned on, and warn user to turn
  345. // it off. Reboot is required if
  346. // the user turns it off.
  347. // INETCFG_REMOVEIFSHARINGBOUND - Check if TCP/IP file sharing is
  348. // turned on, and force user to turn
  349. // it off. If user does not want to
  350. // turn it off, return will be
  351. // ERROR_CANCELLED. Reboot is
  352. // required if the user turns it off.
  353. //
  354. // lpfNeedsRestart - if non-NULL, then on return, this will be
  355. // TRUE if windows must be restarted to complete the installation.
  356. //
  357. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  358. //
  359. //*******************************************************************
  360. HRESULT WINAPI InetConfigClient(
  361. HWND hwndParent,
  362. LPCSTR lpszPhonebook,
  363. LPCSTR lpszEntryName,
  364. LPRASENTRY lpRasEntry,
  365. LPCSTR lpszUsername,
  366. LPCSTR lpszPassword,
  367. LPCSTR lpszProfileName,
  368. LPINETCLIENTINFO lpINetClientInfo,
  369. DWORD dwfOptions,
  370. LPBOOL lpfNeedsRestart);
  371. //*******************************************************************
  372. //
  373. // FUNCTION: InetGetAutodial
  374. //
  375. // PURPOSE: This function will get the autodial settings from the registry.
  376. //
  377. // PARAMETERS: lpfEnable - on return, this will be TRUE if autodial
  378. // is enabled
  379. // lpszEntryName - on return, this buffer will contain the
  380. // name of the phone book entry that is set for autodial
  381. // cbEntryNameSize - size of buffer for phone book entry name
  382. //
  383. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  384. //
  385. //*******************************************************************
  386. HRESULT WINAPI InetGetAutodial(
  387. LPBOOL lpfEnable,
  388. LPSTR lpszEntryName,
  389. DWORD cbEntryNameSize);
  390. //*******************************************************************
  391. //
  392. // FUNCTION: InetSetAutodial
  393. //
  394. // PURPOSE: This function will set the autodial settings in the registry.
  395. //
  396. // PARAMETERS: fEnable - If set to TRUE, autodial will be enabled.
  397. // If set to FALSE, autodial will be disabled.
  398. // lpszEntryName - name of the phone book entry to set
  399. // for autodial. If this is "", the
  400. // entry is cleared. If NULL, it is not changed.
  401. //
  402. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  403. //
  404. //*******************************************************************
  405. HRESULT WINAPI InetSetAutodial(
  406. BOOL fEnable,
  407. LPCSTR lpszEntryName);
  408. //*******************************************************************
  409. //
  410. // FUNCTION: InetSetProxy
  411. //
  412. // PURPOSE: This function will set the proxy settings in the registry.
  413. //
  414. // PARAMETERS: fEnable - If set to TRUE, proxy will be enabled.
  415. // If set to FALSE, proxy will be disabled.
  416. // lpszServer - name of the proxy server. If this is "", the
  417. // entry is cleared. If NULL, it is not changed.
  418. // lpszOverride - proxy override. If this is "", the
  419. // entry is cleared. If NULL, it is not changed.
  420. //
  421. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  422. //
  423. //*******************************************************************
  424. HRESULT WINAPI InetSetProxy(
  425. BOOL fEnable,
  426. LPCSTR lpszServer,
  427. LPCSTR lpszOverride);
  428. //*******************************************************************
  429. //
  430. // FUNCTION: InetGetProxy
  431. //
  432. // PURPOSE: This function will get the proxy settings from the registry.
  433. //
  434. // PARAMETERS: lpfEnable - on return, this will be TRUE if proxy
  435. // is enabled
  436. // lpszServer - on return, this buffer will contain the
  437. // name of the proxy server
  438. // cbServer - size of buffer for proxy server name
  439. // lpszOverride - on return, this buffer will contain the
  440. // name of the proxy server
  441. // cbOverride - size of buffer for proxy override
  442. //
  443. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  444. //
  445. //*******************************************************************
  446. HRESULT WINAPI InetGetProxy(
  447. LPBOOL lpfEnable,
  448. LPSTR lpszServer,
  449. DWORD cbServer,
  450. LPSTR lpszOverride,
  451. DWORD cbszOverride);
  452. //*******************************************************************
  453. //
  454. // FUNCTION: InetStartServices
  455. //
  456. // PURPOSE: This function guarentees that RAS services are running
  457. //
  458. // PARAMETERS: none
  459. //
  460. // RETURNS ERROR_SUCCESS - if the services are enabled and running
  461. //
  462. //*******************************************************************
  463. HRESULT WINAPI InetStartServices();
  464. //*******************************************************************
  465. //
  466. // Function: IsSmartStart
  467. //
  468. // Synopsis: This function will determine if the ICW should be run. The
  469. // decision is made based on the current state of the user's machine.
  470. //
  471. // Arguments: none
  472. //
  473. // Returns: TRUE - run ICW; FALSE - quit now
  474. //
  475. // History: 5/8/97 ChrisK Created
  476. //
  477. //*******************************************************************
  478. DWORD WINAPI IsSmartStart();
  479. #ifdef __cplusplus
  480. }
  481. #endif // __cplusplus
  482. #endif //_INETCFG_H_#