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.

755 lines
29 KiB

  1. //*******************************************************************
  2. //
  3. // Copyright(c) Microsoft Corporation, 1996 - 97
  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. // IE Auto proxy value in registry
  28. #define AUTO_ONCE_EVER 0 // Auto proxy discovery
  29. #define AUTO_DISABLED 1
  30. #define AUTO_ONCE_PER_SESSION 2
  31. #define AUTO_ALWAYS 3
  32. // Flags for dwfOptions
  33. // install Internet mail
  34. #define INETCFG_INSTALLMAIL 0x00000001
  35. // Invoke InstallModem wizard if NO MODEM IS INSTALLED
  36. #define INETCFG_INSTALLMODEM 0x00000002
  37. // install RNA (if needed)
  38. #define INETCFG_INSTALLRNA 0x00000004
  39. // install TCP (if needed)
  40. #define INETCFG_INSTALLTCP 0x00000008
  41. // connecting with LAN (vs modem)
  42. #define INETCFG_CONNECTOVERLAN 0x00000010
  43. // Set the phone book entry for autodial
  44. #define INETCFG_SETASAUTODIAL 0x00000020
  45. // Overwrite the phone book entry if it exists
  46. // Note: if this flag is not set, and the entry exists, a unique name will
  47. // be created for the entry.
  48. #define INETCFG_OVERWRITEENTRY 0x00000040
  49. // Do not show the dialog that tells the user that files are about to be installed,
  50. // with OK/Cancel buttons.
  51. #define INETCFG_SUPPRESSINSTALLUI 0x00000080
  52. // Check if TCP/IP file sharing is turned on, and warn user to turn it off.
  53. // Reboot is required if the user turns it off.
  54. #define INETCFG_WARNIFSHARINGBOUND 0x00000100
  55. // Check if TCP/IP file sharing is turned on, and force user to turn it off.
  56. // If user does not want to turn it off, return will be ERROR_CANCELLED
  57. // Reboot is required if the user turns it off.
  58. #define INETCFG_REMOVEIFSHARINGBOUND 0x00000200
  59. // Indicates that this is a temporary phone book entry
  60. // In Win3.1 an icon will not be created
  61. #define INETCFG_TEMPPHONEBOOKENTRY 0x00000400
  62. // Show the busy dialog while checking system configuration
  63. #define INETCFG_SHOWBUSYANIMATION 0x00000800
  64. //
  65. // Chrisk 5/8/97
  66. // Note: the next three switches are only valid for InetNeedSystemComponents
  67. // Check if LAN adapter is installed and bound to TCP
  68. //
  69. #define INETCFG_INSTALLLAN 0x00001000
  70. //
  71. // Check if DIALUP adapter is installed and bound to TCP
  72. //
  73. #define INETCFG_INSTALLDIALUP 0x00002000
  74. //
  75. // Check to see if TCP is installed requardless of binding
  76. //
  77. #define INETCFG_INSTALLTCPONLY 0x00004000
  78. #ifdef __cplusplus
  79. extern "C"
  80. {
  81. #endif // __cplusplus
  82. // constants for INETCLIENTINFO.dwFlags
  83. #define INETC_LOGONMAIL 0x00000001
  84. #define INETC_LOGONNEWS 0x00000002
  85. #define INETC_LOGONDIRSERV 0x00000004
  86. // Struct INETCLIENTINFO
  87. //
  88. // This structure is used when getting and setting the internet
  89. // client parameters
  90. //
  91. // The members are as follows:
  92. //
  93. // dwSize
  94. // size of this structure, for future versioning
  95. // this member should be set before passing the structure to the DLL
  96. // dwFlags
  97. // miscellaneous flags
  98. // see definitions above
  99. // szEMailName
  100. // user's internet email name
  101. // szEMailAddress
  102. // user's internet email address
  103. // ***Note: the following three fields are outdated, and should only be used by old legacy code.
  104. // *** new code should use szIncomingMail* and iIncomingProtocol fields.
  105. // szPOPLogonName
  106. // user's internet mail server logon name
  107. // szPOPLogonPassword
  108. // user's internet mail server logon password
  109. // szPOPServer
  110. // user's internet mail POP3 server
  111. // szSMTPServer
  112. // user's internet mail SMTP server
  113. // szNNTPLogonName
  114. // user's news server logon name
  115. // szNNTPLogonPassword
  116. // user's news server logon password
  117. // szNNTPServer
  118. // user's news server
  119. // ** End of original 1.0 structure.
  120. // ??/??/96 ValdonB
  121. // szNNTPName
  122. // user's friendly name to include in NNTP posts.(?? Valdon?)
  123. // szNNTPAddress
  124. // user's reply-to email address for NNTP posts.(?? Valdon?)
  125. // 11/23/96 jmazner Normandy #8504
  126. // iIncomingProtocol
  127. // user's choice of POP3 or IMAP4 protocol for incoming mail
  128. // Holds the enum values defined in ACCTTYPE from imact.h//
  129. // szIncomingMailLogonName
  130. // user's internet mail server logon name
  131. // szIncomingMailLogonPassword
  132. // user's internet mail server logon password
  133. // szIncomingMailServer
  134. // user's internet mail POP3 server
  135. // 12/15/96 jmazner
  136. // fMailLogonSPA
  137. // Use Sicily/SPA/DPA for the incoming mail server
  138. // fNewsLogonSPA
  139. // Use Sicily/SPA/DPA for the news server
  140. // 2/4/96 jmazner -- LDAP functionality
  141. // szLDAPLogonName
  142. // szLDAPLogonPassword
  143. // szLDAPServer
  144. // fLDAPLogonSPA
  145. // fLDAPResolve
  146. typedef struct tagINETCLIENTINFOA
  147. {
  148. DWORD dwSize;
  149. DWORD dwFlags;
  150. CHAR szEMailName[MAX_EMAIL_NAME + 1];
  151. CHAR szEMailAddress[MAX_EMAIL_ADDRESS + 1];
  152. CHAR szPOPLogonName[MAX_LOGON_NAME + 1];
  153. CHAR szPOPLogonPassword[MAX_LOGON_PASSWORD + 1];
  154. CHAR szPOPServer[MAX_SERVER_NAME + 1];
  155. CHAR szSMTPServer[MAX_SERVER_NAME + 1];
  156. CHAR szNNTPLogonName[MAX_LOGON_NAME + 1];
  157. CHAR szNNTPLogonPassword[MAX_LOGON_PASSWORD + 1];
  158. CHAR szNNTPServer[MAX_SERVER_NAME + 1];
  159. // end of version 1.0 structure;
  160. // extended 1.1 structure includes the following fields:
  161. CHAR szNNTPName[MAX_EMAIL_NAME + 1];
  162. CHAR szNNTPAddress[MAX_EMAIL_ADDRESS + 1];
  163. int iIncomingProtocol;
  164. CHAR szIncomingMailLogonName[MAX_LOGON_NAME + 1];
  165. CHAR szIncomingMailLogonPassword[MAX_LOGON_PASSWORD + 1];
  166. CHAR szIncomingMailServer[MAX_SERVER_NAME + 1];
  167. BOOL fMailLogonSPA;
  168. BOOL fNewsLogonSPA;
  169. CHAR szLDAPLogonName[MAX_LOGON_NAME + 1];
  170. CHAR szLDAPLogonPassword[MAX_LOGON_PASSWORD + 1];
  171. CHAR szLDAPServer[MAX_SERVER_NAME + 1];
  172. BOOL fLDAPLogonSPA;
  173. BOOL fLDAPResolve;
  174. } INETCLIENTINFOA, *PINETCLIENTINFOA, FAR *LPINETCLIENTINFOA;
  175. typedef struct tagINETCLIENTINFOW
  176. {
  177. DWORD dwSize;
  178. DWORD dwFlags;
  179. WCHAR szEMailName[MAX_EMAIL_NAME + 1];
  180. WCHAR szEMailAddress[MAX_EMAIL_ADDRESS + 1];
  181. WCHAR szPOPLogonName[MAX_LOGON_NAME + 1];
  182. WCHAR szPOPLogonPassword[MAX_LOGON_PASSWORD + 1];
  183. WCHAR szPOPServer[MAX_SERVER_NAME + 1];
  184. WCHAR szSMTPServer[MAX_SERVER_NAME + 1];
  185. WCHAR szNNTPLogonName[MAX_LOGON_NAME + 1];
  186. WCHAR szNNTPLogonPassword[MAX_LOGON_PASSWORD + 1];
  187. WCHAR szNNTPServer[MAX_SERVER_NAME + 1];
  188. // end of version 1.0 structure;
  189. // extended 1.1 structure includes the following fields:
  190. WCHAR szNNTPName[MAX_EMAIL_NAME + 1];
  191. WCHAR szNNTPAddress[MAX_EMAIL_ADDRESS + 1];
  192. int iIncomingProtocol;
  193. WCHAR szIncomingMailLogonName[MAX_LOGON_NAME + 1];
  194. WCHAR szIncomingMailLogonPassword[MAX_LOGON_PASSWORD + 1];
  195. WCHAR szIncomingMailServer[MAX_SERVER_NAME + 1];
  196. BOOL fMailLogonSPA;
  197. BOOL fNewsLogonSPA;
  198. WCHAR szLDAPLogonName[MAX_LOGON_NAME + 1];
  199. WCHAR szLDAPLogonPassword[MAX_LOGON_PASSWORD + 1];
  200. WCHAR szLDAPServer[MAX_SERVER_NAME + 1];
  201. BOOL fLDAPLogonSPA;
  202. BOOL fLDAPResolve;
  203. } INETCLIENTINFOW, *PINETCLIENTINFOW, FAR *LPINETCLIENTINFOW;
  204. #ifdef UNICODE
  205. typedef INETCLIENTINFOW INETCLIENTINFO;
  206. typedef PINETCLIENTINFOW PINETCLIENTINFO;
  207. typedef LPINETCLIENTINFOW LPINETCLIENTINFO;
  208. #else
  209. typedef INETCLIENTINFOA INETCLIENTINFO;
  210. typedef PINETCLIENTINFOA PINETCLIENTINFO;
  211. typedef LPINETCLIENTINFOA LPINETCLIENTINFO;
  212. #endif
  213. // Function prototypes
  214. //*******************************************************************
  215. //
  216. // FUNCTION: InetGetClientInfo
  217. //
  218. // PURPOSE: This function will get the internet client params
  219. // from the registry
  220. //
  221. // PARAMETERS: lpClientInfo - on return, this structure will contain
  222. // the internet client params as set in the registry.
  223. // lpszProfileName - Name of client info profile to
  224. // retrieve. If this is NULL, the default profile is used.
  225. //
  226. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  227. //
  228. //*******************************************************************
  229. HRESULT WINAPI InetGetClientInfoA(
  230. LPCSTR lpszProfileName,
  231. LPINETCLIENTINFOA lpClientInfo);
  232. HRESULT WINAPI InetGetClientInfoW(
  233. LPCWSTR lpszProfileName,
  234. LPINETCLIENTINFOW lpClientInfo);
  235. #ifdef UNICODE
  236. #define InetGetClientInfo InetGetClientInfoW
  237. #else
  238. #define InetGetClientInfo InetGetClientInfoA
  239. #endif
  240. //*******************************************************************
  241. //
  242. // FUNCTION: InetSetClientInfo
  243. //
  244. // PURPOSE: This function will set the internet client params
  245. //
  246. // PARAMETERS: lpClientInfo - pointer to struct with info to set
  247. // in the registry.
  248. // lpszProfileName - Name of client info profile to
  249. // modify. If this is NULL, the default profile is used.
  250. //
  251. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  252. //
  253. //*******************************************************************
  254. HRESULT WINAPI InetSetClientInfoA(
  255. LPCSTR lpszProfileName,
  256. LPINETCLIENTINFOA lpClientInfo);
  257. HRESULT WINAPI InetSetClientInfoW(
  258. LPCWSTR lpszProfileName,
  259. LPINETCLIENTINFOW lpClientInfo);
  260. #ifdef UNICODE
  261. #define InetSetClientInfo InetSetClientInfoW
  262. #else
  263. #define InetSetClientInfo InetSetClientInfoA
  264. #endif
  265. //*******************************************************************
  266. //
  267. // FUNCTION: InetConfigSystem
  268. //
  269. // PURPOSE: This function will install files that are needed
  270. // for internet access (such as TCP/IP and RNA) based
  271. // the state of the options flags.
  272. //
  273. // PARAMETERS: hwndParent - window handle of calling application. This
  274. // handle will be used as the parent for any dialogs that
  275. // are required for error messages or the "installing files"
  276. // dialog.
  277. // dwfOptions - a combination of INETCFG_ flags that controls
  278. // the installation and configuration as follows:
  279. //
  280. // INETCFG_INSTALLMAIL - install Internet mail
  281. // INETCFG_INSTALLMODEM - Invoke InstallModem wizard if NO
  282. // MODEM IS INSTALLED.
  283. // INETCFG_INSTALLRNA - install RNA (if needed)
  284. // INETCFG_INSTALLTCP - install TCP/IP (if needed)
  285. // INETCFG_CONNECTOVERLAN - connecting with LAN (vs modem)
  286. // INETCFG_WARNIFSHARINGBOUND - Check if TCP/IP file sharing is
  287. // turned on, and warn user to turn
  288. // it off. Reboot is required if
  289. // the user turns it off.
  290. // INETCFG_REMOVEIFSHARINGBOUND - Check if TCP/IP file sharing is
  291. // turned on, and force user to turn
  292. // it off. If user does not want to
  293. // turn it off, return will be
  294. // ERROR_CANCELLED. Reboot is
  295. // required if the user turns it off.
  296. //
  297. // lpfNeedsRestart - if non-NULL, then on return, this will be
  298. // TRUE if windows must be restarted to complete the installation.
  299. //
  300. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  301. //
  302. //*******************************************************************
  303. HRESULT WINAPI InetConfigSystem(
  304. HWND hwndParent,
  305. DWORD dwfOptions,
  306. LPBOOL lpfNeedsRestart);
  307. //*******************************************************************
  308. //
  309. // FUNCTION: InetConfigSystemFromPath
  310. //
  311. // PURPOSE: This function will install files that are needed
  312. // for internet access (such as TCP/IP and RNA) based
  313. // the state of the options flags and from the given [ath.
  314. //
  315. // PARAMETERS: hwndParent - window handle of calling application. This
  316. // handle will be used as the parent for any dialogs that
  317. // are required for error messages or the "installing files"
  318. // dialog.
  319. // dwfOptions - a combination of INETCFG_ flags that controls
  320. // the installation and configuration as follows:
  321. //
  322. // INETCFG_INSTALLMAIL - install Internet mail
  323. // INETCFG_INSTALLMODEM - Invoke InstallModem wizard if NO
  324. // MODEM IS INSTALLED.
  325. // INETCFG_INSTALLRNA - install RNA (if needed)
  326. // INETCFG_INSTALLTCP - install TCP/IP (if needed)
  327. // INETCFG_CONNECTOVERLAN - connecting with LAN (vs modem)
  328. // INETCFG_WARNIFSHARINGBOUND - Check if TCP/IP file sharing is
  329. // turned on, and warn user to turn
  330. // it off. Reboot is required if
  331. // the user turns it off.
  332. // INETCFG_REMOVEIFSHARINGBOUND - Check if TCP/IP file sharing is
  333. // turned on, and force user to turn
  334. // it off. If user does not want to
  335. // turn it off, return will be
  336. // ERROR_CANCELLED. Reboot is
  337. // required if the user turns it off.
  338. //
  339. // lpfNeedsRestart - if non-NULL, then on return, this will be
  340. // TRUE if windows must be restarted to complete the installation.
  341. // lpszSourcePath - full path of location of files to install. If
  342. // this is NULL, default path is used.
  343. //
  344. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  345. //
  346. //*******************************************************************
  347. HRESULT WINAPI InetConfigSystemFromPathA(
  348. HWND hwndParent,
  349. DWORD dwfOptions,
  350. LPBOOL lpfNeedsRestart,
  351. LPCSTR lpszSourcePath);
  352. HRESULT WINAPI InetConfigSystemFromPathW(
  353. HWND hwndParent,
  354. DWORD dwfOptions,
  355. LPBOOL lpfNeedsRestart,
  356. LPCWSTR lpszSourcePath);
  357. #ifdef UNICODE
  358. #define InetConfigSystemFromPath InetConfigSystemFromPathW
  359. #else
  360. #define InetConfigSystemFromPath InetConfigSystemFromPathA
  361. #endif
  362. //*******************************************************************
  363. //
  364. // FUNCTION: InetConfigClient
  365. //
  366. // PURPOSE: This function requires a valid phone book entry name
  367. // (unless it is being used just to set the client info).
  368. // If lpRasEntry points to a valid RASENTRY struct, the phone
  369. // book entry will be created (or updated if it already exists)
  370. // with the data in the struct.
  371. // If username and password are given, these
  372. // will be set as the dial params for the phone book entry.
  373. // If a client info struct is given, that data will be set.
  374. // Any files (ie TCP and RNA) that are needed will be
  375. // installed by calling InetConfigSystem().
  376. // This function will also perform verification on the device
  377. // specified in the RASENTRY struct. If no device is specified,
  378. // the user will be prompted to install one if there are none
  379. // installed, or they will be prompted to choose one if there
  380. // is more than one installed.
  381. //
  382. // PARAMETERS: hwndParent - window handle of calling application. This
  383. // handle will be used as the parent for any dialogs that
  384. // are required for error messages or the "installing files"
  385. // dialog.
  386. // lpszPhonebook - name of phone book to store the entry in
  387. // lpszEntryName - name of phone book entry to be
  388. // created or modified
  389. // lpRasEntry - specifies a RASENTRY struct that contains
  390. // the phone book entry data for the entry lpszEntryName
  391. // lpszUsername - username to associate with the phone book entry
  392. // lpszPassword - password to associate with the phone book entry
  393. // lpszProfileName - Name of client info profile to
  394. // retrieve. If this is NULL, the default profile is used.
  395. // lpINetClientInfo - client information
  396. // dwfOptions - a combination of INETCFG_ flags that controls
  397. // the installation and configuration as follows:
  398. //
  399. // INETCFG_INSTALLMAIL - install Internet mail
  400. // INETCFG_INSTALLMODEM - Invoke InstallModem wizard if NO
  401. // MODEM IS INSTALLED. Note that if
  402. // no modem is installed and this flag
  403. // is not set, the function will fail
  404. // INETCFG_INSTALLRNA - install RNA (if needed)
  405. // INETCFG_INSTALLTCP - install TCP/IP (if needed)
  406. // INETCFG_CONNECTOVERLAN - connecting with LAN (vs modem)
  407. // INETCFG_SETASAUTODIAL - Set the phone book entry for autodial
  408. // INETCFG_OVERWRITEENTRY - Overwrite the phone book entry if it
  409. // exists. Note: if this flag is not
  410. // set, and the entry exists, a unique
  411. // name will be created for the entry.
  412. // INETCFG_WARNIFSHARINGBOUND - Check if TCP/IP file sharing is
  413. // turned on, and warn user to turn
  414. // it off. Reboot is required if
  415. // the user turns it off.
  416. // INETCFG_REMOVEIFSHARINGBOUND - Check if TCP/IP file sharing is
  417. // turned on, and force user to turn
  418. // it off. If user does not want to
  419. // turn it off, return will be
  420. // ERROR_CANCELLED. Reboot is
  421. // required if the user turns it off.
  422. //
  423. // lpfNeedsRestart - if non-NULL, then on return, this will be
  424. // TRUE if windows must be restarted to complete the installation.
  425. //
  426. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  427. //
  428. //*******************************************************************
  429. HRESULT WINAPI InetConfigClientA(
  430. HWND hwndParent,
  431. LPCSTR lpszPhonebook,
  432. LPCSTR lpszEntryName,
  433. LPRASENTRY lpRasEntry,
  434. LPCSTR lpszUsername,
  435. LPCSTR lpszPassword,
  436. LPCSTR lpszProfileName,
  437. LPINETCLIENTINFOA lpINetClientInfo,
  438. DWORD dwfOptions,
  439. LPBOOL lpfNeedsRestart);
  440. HRESULT WINAPI InetConfigClientW(
  441. HWND hwndParent,
  442. LPCWSTR lpszPhonebook,
  443. LPCWSTR lpszEntryName,
  444. LPRASENTRY lpRasEntry,
  445. LPCWSTR lpszUsername,
  446. LPCWSTR lpszPassword,
  447. LPCWSTR lpszProfileName,
  448. LPINETCLIENTINFOW lpINetClientInfo,
  449. DWORD dwfOptions,
  450. LPBOOL lpfNeedsRestart);
  451. #ifdef UNICODE
  452. #define InetConfigClient InetConfigClientW
  453. #else
  454. #define InetConfigClient InetConfigClientA
  455. #endif
  456. //*******************************************************************
  457. //
  458. // FUNCTION: InetGetAutodial
  459. //
  460. // PURPOSE: This function will get the autodial settings from the registry.
  461. //
  462. // PARAMETERS: lpfEnable - on return, this will be TRUE if autodial
  463. // is enabled
  464. // lpszEntryName - on return, this buffer will contain the
  465. // name of the phone book entry that is set for autodial
  466. // cbEntryNameSize - size of buffer for phone book entry name
  467. //
  468. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  469. //
  470. //*******************************************************************
  471. HRESULT WINAPI InetGetAutodialA(
  472. LPBOOL lpfEnable,
  473. LPSTR lpszEntryName,
  474. DWORD cbEntryNameSize);
  475. HRESULT WINAPI InetGetAutodialW(
  476. LPBOOL lpfEnable,
  477. LPWSTR lpszEntryName,
  478. DWORD cbEntryNameSize);
  479. #ifdef UNICODE
  480. #define InetGetAutodial InetGetAutodialW
  481. #else
  482. #define InetGetAutodial InetGetAutodialA
  483. #endif
  484. //*******************************************************************
  485. //
  486. // FUNCTION: InetSetAutodial
  487. //
  488. // PURPOSE: This function will set the autodial settings in the registry.
  489. //
  490. // PARAMETERS: fEnable - If set to TRUE, autodial will be enabled.
  491. // If set to FALSE, autodial will be disabled.
  492. // lpszEntryName - name of the phone book entry to set
  493. // for autodial. If this is "", the
  494. // entry is cleared. If NULL, it is not changed.
  495. //
  496. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  497. //
  498. //*******************************************************************
  499. HRESULT WINAPI InetSetAutodialA(
  500. BOOL fEnable,
  501. LPCSTR lpszEntryName);
  502. HRESULT WINAPI InetSetAutodialW(
  503. BOOL fEnable,
  504. LPCWSTR lpszEntryName);
  505. #ifdef UNICODE
  506. #define InetSetAutodial InetSetAutodialW
  507. #else
  508. #define InetSetAutodial InetSetAutodialA
  509. #endif
  510. //*******************************************************************
  511. //
  512. // FUNCTION: InetSetAutoProxy
  513. //
  514. // PURPOSE: This function will set the auto config proxy settings
  515. // in the registry.
  516. //
  517. // PARAMETERS: fEnable - If set to TRUE, proxy will be enabled.
  518. // If set to FALSE, proxy will be disabled.
  519. // dwProxyDetectMode - value to be update in the
  520. // HKEY_CURRENT_USER\Software\Microsoft
  521. // \Windows\CurrentVersion\Internet Settings
  522. // AutoProxyDetectMode
  523. // lpszScriptAddr - value to be update in
  524. // HKEY_CURRENT_USER\Software\Microsoft
  525. // \Windows\CurrentVersion\Internet Settings
  526. // AutoConfigURL
  527. //
  528. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  529. //
  530. //*******************************************************************
  531. HRESULT WINAPI InetSetAutoProxyA(
  532. BOOL fEnable,
  533. DWORD dwProxyDetectMode,
  534. LPCSTR lpszScriptAddr);
  535. HRESULT WINAPI InetSetAutoProxyW(
  536. BOOL fEnable,
  537. DWORD dwProxyDetectMode,
  538. LPCWSTR lpszScriptAddr);
  539. #ifdef UNICODE
  540. #define InetSetAutoProxy InetSetAutoProxyW
  541. #else
  542. #define InetSetAutoProxy InetSetAutoProxyA
  543. #endif
  544. //*******************************************************************
  545. //
  546. // FUNCTION: InetSetProxy
  547. //
  548. // PURPOSE: This function is currently replaced by InetSetProxyEx
  549. // due to a change in Wininet API. It will return
  550. // ERROR_SUCCESS.
  551. //
  552. // PARAMETERS: fEnable - If set to TRUE, proxy will be enabled.
  553. // If set to FALSE, proxy will be disabled.
  554. // lpszServer - name of the proxy server. If this is "", the
  555. // entry is cleared. If NULL, it is not changed.
  556. // lpszOverride - proxy override. If this is "", the
  557. // entry is cleared. If NULL, it is not changed.
  558. //
  559. // RETURNS: ERROR_SUCCESS
  560. //
  561. //*******************************************************************
  562. HRESULT WINAPI InetSetProxyA(
  563. BOOL fEnable,
  564. LPCSTR lpszServer,
  565. LPCSTR lpszOverride);
  566. HRESULT WINAPI InetSetProxyW(
  567. BOOL fEnable,
  568. LPCWSTR lpszServer,
  569. LPCWSTR lpszOverride);
  570. #ifdef UNICODE
  571. #define InetSetProxy InetSetProxyW
  572. #else
  573. #define InetSetProxy InetSetProxyA
  574. #endif
  575. //*******************************************************************
  576. //
  577. // FUNCTION: InetSetProxyEx
  578. //
  579. // PURPOSE: This function will set the proxy settings in the registry.
  580. //
  581. // PARAMETERS: fEnable - If set to TRUE, proxy will be enabled.
  582. // If set to FALSE, proxy will be disabled.
  583. // lpszConnectoidName - Name of connectoid to set proxy on
  584. // NULL for LAN
  585. // lpszServer - name of the proxy server. If this is "", the
  586. // entry is cleared. If NULL, it is not changed.
  587. // lpszOverride - proxy override. If this is "", the
  588. // entry is cleared. If NULL, it is not changed.
  589. //
  590. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  591. //
  592. //*******************************************************************
  593. HRESULT WINAPI InetSetProxyExA(
  594. BOOL fEnable,
  595. LPCSTR lpszConnectoidName,
  596. LPCSTR lpszServer,
  597. LPCSTR lpszOverride);
  598. HRESULT WINAPI InetSetProxyExW(
  599. BOOL fEnable,
  600. LPCWSTR lpszConnectoidName,
  601. LPCWSTR lpszServer,
  602. LPCWSTR lpszOverride);
  603. #ifdef UNICODE
  604. #define InetSetProxyEx InetSetProxyExW
  605. #else
  606. #define InetSetProxyEx InetSetProxyExA
  607. #endif
  608. //*******************************************************************
  609. //
  610. // FUNCTION: InetGetProxy
  611. //
  612. // PURPOSE: This function will get the proxy settings from the registry.
  613. //
  614. // PARAMETERS: lpfEnable - on return, this will be TRUE if proxy
  615. // is enabled
  616. // lpszServer - on return, this buffer will contain the
  617. // name of the proxy server
  618. // cbServer - size of buffer for proxy server name
  619. // lpszOverride - on return, this buffer will contain the
  620. // name of the proxy server
  621. // cbOverride - size of buffer for proxy override
  622. //
  623. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  624. //
  625. //*******************************************************************
  626. HRESULT WINAPI InetGetProxyA(
  627. LPBOOL lpfEnable,
  628. LPSTR lpszServer,
  629. DWORD cbServer,
  630. LPSTR lpszOverride,
  631. DWORD cbszOverride);
  632. HRESULT WINAPI InetGetProxyW(
  633. LPBOOL lpfEnable,
  634. LPWSTR lpszServer,
  635. DWORD cbServer,
  636. LPWSTR lpszOverride,
  637. DWORD cbszOverride);
  638. #ifdef UNICODE
  639. #define InetGetProxy InetGetProxyW
  640. #else
  641. #define InetGetProxy InetGetProxyA
  642. #endif
  643. //*******************************************************************
  644. //
  645. // FUNCTION: InetStartServices
  646. //
  647. // PURPOSE: This function guarentees that RAS services are running
  648. //
  649. // PARAMETERS: none
  650. //
  651. // RETURNS ERROR_SUCCESS - if the services are enabled and running
  652. //
  653. //*******************************************************************
  654. HRESULT WINAPI InetStartServices();
  655. //*******************************************************************
  656. //
  657. // Function: IsSmartStart
  658. //
  659. // Synopsis: This function will determine if the ICW should be run. The
  660. // decision is made based on the current state of the user's machine.
  661. //
  662. // Arguments: none
  663. //
  664. // Returns: TRUE - run ICW; FALSE - quit now
  665. //
  666. // History: 5/8/97 ChrisK Created
  667. //
  668. //*******************************************************************
  669. DWORD WINAPI IsSmartStart();
  670. //*******************************************************************
  671. //
  672. // FUNCTION: SetAutoProxyConnectoid
  673. //
  674. // PURPOSE: This function will set the enable/disable auto
  675. // proxy settings in creating connectoid.
  676. //
  677. // PARAMETERS: fEnable - If set to TRUE, proxy will be enabled.
  678. // If set to FALSE, proxy will be disabled.
  679. //
  680. //*******************************************************************
  681. HRESULT WINAPI SetAutoProxyConnectoid( BOOL bEnable);
  682. #ifdef __cplusplus
  683. }
  684. #endif // __cplusplus
  685. #endif //_INETCFG_H_#