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.

851 lines
31 KiB

  1. #ifndef __OBCOMGLB_H_
  2. #define __OBCOMGLB_H_
  3. #include <windows.h>
  4. #include <tchar.h>
  5. #include <ras.h>
  6. #include <raserror.h>
  7. #include <tapi.h>
  8. #include "wininet.h"
  9. #include <mapidefs.h>
  10. #include <assert.h>
  11. #include "appdefs.h"
  12. //--------------------------------------------------------------------------------
  13. // obcomglb.h
  14. // The information contained in this file is the sole property of Microsoft Corporation.
  15. // Copywrite Microsoft 1999
  16. //
  17. // Created 2/7/99, vyung
  18. //--------------------------------------------------------------------------------
  19. //-----------------------------------------------------------------------------
  20. // DEFINES
  21. #undef DATASEG_PERINSTANCE
  22. #define DATASEG_PERINSTANCE ".instance"
  23. #define DATASEG_SHARED ".data"
  24. #define DATASEG_DEFAULT DATASEG_SHARED
  25. #undef DATASEG_READONLY
  26. #define DATASEG_READONLY ".rdata"
  27. #define ERROR_USERCANCEL 32767 // quit message value
  28. #define ERROR_USERBACK 32766 // back message value
  29. #define ERROR_USERNEXT 32765 // back message value
  30. #define ERROR_DOWNLOADIDNT 32764 // Download failure
  31. #define ERROR_READING_DUN 32768
  32. #define ERROR_READING_ISP 32769
  33. #define ERROR_PHBK_NOT_FOUND 32770
  34. #define ERROR_DOWNLOAD_NOT_FOUND 32771
  35. #define cMarvelBpsMin 2400 // minimum modem speed
  36. #define INVALID_PORTID UINT_MAX
  37. #define pcszDataModem L"comm/datamodem"
  38. #define MAX_SECTIONS_BUFFER 1024
  39. #define MAX_KEYS_BUFFER 1024
  40. // install TCP (if needed)
  41. #define ICFG_INSTALLTCP 0x00000001
  42. // install RAS (if needed)
  43. #define ICFG_INSTALLRAS 0x00000002
  44. // install exchange and internet mail
  45. #define ICFG_INSTALLMAIL 0x00000004
  46. //
  47. // ChrisK 5/8/97
  48. // Note: the next three switches are only valid for IcfgNeedInetComponet
  49. // check to see if a LAN adapter with TCP bound is installed
  50. //
  51. #define ICFG_INSTALLLAN 0x00000008
  52. //
  53. // Check to see if a DIALUP adapter with TCP bound is installed
  54. //
  55. #define ICFG_INSTALLDIALUP 0x00000010
  56. //
  57. // Check to see if TCP is installed
  58. //
  59. #define ICFG_INSTALLTCPONLY 0x00000020
  60. #define szLoginKey L"Software\\Microsoft\\MOS\\Connection"
  61. #define szCurrentComDev L"CurrentCommDev"
  62. #define szTollFree L"OlRegPhone"
  63. #define CCD_BUFFER_SIZE 255
  64. #define szSignupConnectoidName L"MSN Signup Connection"
  65. #define szSignupDeviceKey L"SignupCommDevice"
  66. #define KEYVALUE_SIGNUPID L"iSignUp"
  67. #define RASENTRYVALUENAME L"RasEntryName"
  68. #define GATHERINFOVALUENAME L"UserInfo"
  69. #define INFFILE_USER_SECTION L"User"
  70. #define INFFILE_PASSWORD L"Password"
  71. #define INFFILE_DOMAIN L"Domain"
  72. #define DUN_SECTION L"DUN"
  73. #define USERNAME L"Username"
  74. #define INF_OEMREGPAGE L"OEMRegistrationPage"
  75. #define NULLSZ L""
  76. #define cchMoreSpace 22000 // bytes needed to hold results of lineGetCountry(0, ...).
  77. // Currently this function returns about 16K, docs say 20K,
  78. // this should be enough.
  79. #define DwFromSz(sz) Sz2Dw(sz) //make it inline, so this is faster.
  80. #define DwFromSzFast(sz) Sz2DwFast(sz)
  81. #define CONNECT_SIGNUPFIRST 1 // phonenumber constant for determining the firstcall phonenumber TO DO
  82. #define CONNECTFLAGS_MASK_TOLLFREE 0x01
  83. #define CONNECTFLAGS_MASK_TCP 0x02
  84. #define CONNECTFLAGS_MASK_ISDN 0x04
  85. #define CONNECTFLAGS_MASK_DIRECT 0x08
  86. #define CONNECTFLAGS_MASK_OTHERDIALUP 0x10
  87. #define CONNECTFLAGS_MASK_PROXY 0x20
  88. #define CONNECTFLAGS_MASK_FIRST CONNECTFLAGS_MASK_TCP
  89. #define CONNECTFLAGS_MASK_LAST CONNECTFLAGS_MASK_ISDN
  90. #define CONNECTMSNDIALUP(dw) ((dw & (CONNECTFLAGS_MASK_TOLLFREE|CONNECTFLAGS_M
  91. #define LANORSHUTTLE(dw) ((dw)==10 || (dw)==34)
  92. #define IS_SHUTTLE(dw) ((dw)==34)
  93. #define IS_ISP(dw) ((dw)==18)
  94. #define CONNECTPROTOCOL_MSNDIALUPX25 0
  95. #define CONNECTPROTOCOL_MSNDIALUPTCP 2
  96. #define CONNECTPROTOCOL_MSNDIALUPTCPISDN 6
  97. #define CONNECTPROTOCOL_LANDIRECT 10
  98. #define CONNECTPROTOCOL_ISPDIALUPTCP 18
  99. #define CONNECTPROTOCOL_LANSHUTTLE 34
  100. #define clineMaxATT 16 //for 950 MNEMONIC
  101. #define NXXMin 200
  102. #define NXXMax 999
  103. #define cbgrbitNXX ((NXXMax + 1 - NXXMin) / 8)
  104. #define crgnpab (NPAMax + 1 - NPAMin)
  105. #define MAX_PROMO 64
  106. #define MAX_OEMNAME 64
  107. #define MAX_AREACODE RAS_MaxAreaCode
  108. #define MAX_RELPROD 8
  109. #define MAX_RELVER 30
  110. #define MAX_STRING 256 //used by ErrorMsg1 in mt.cpp
  111. #define NUM_PHBK_SUGGESTIONS 50
  112. #define TYPE_SIGNUP_ANY 0x82
  113. #define MASK_SIGNUP_ANY 0xB2
  114. //#define RASENUMAPI "RasEnumConnectionsA"
  115. //#define RASHANGUP "RasHangUpA"
  116. #define INF_SUFFIX L".ISP"
  117. #define INF_PHONE_BOOK L"PhoneBookFile"
  118. #define INF_DUN_FILE L"DUNFile"
  119. #define INF_REFERAL_URL L"URLReferral"
  120. #define INF_SIGNUPEXE L"Sign_Up_EXE"
  121. #define INF_SIGNUPPARAMS L"Sign_Up_Params"
  122. #define INF_WELCOME_LABEL L"Welcome_Label"
  123. #define INF_ISP_MSNSU L"MSICW"
  124. #define INF_SIGNUP_URL L"Signup"
  125. #define INF_AUTOCONFIG_URL L"AutoConfig"
  126. #define INF_ISDN_URL L"ISDNSignup"
  127. #define INF_ISDN_AUTOCONFIG_URL L"ISDNAutoConfig"
  128. #define INF_SECTION_URL L"URL"
  129. #define INF_SECTION_ISPINFO L"ISP INFO"
  130. #define INF_RECONNECT_URL L"Reconnect"
  131. #define INF_SECTION_CONNECTION L"Connection"
  132. #define ISP_MSNSIGNUP L"MsnSignup"
  133. #define QUERY_STRING_MSNSIGNUP L"&MSNSIGNUP=1"
  134. #define DUN_NOPHONENUMBER L"000000000000"
  135. #define MAX_VERSION_LEN 40
  136. #define MB_MYERROR (MB_APPLMODAL | MB_ICONERROR | MB_SETFOREGROUND)
  137. // 8/9/96 jmazner
  138. // Added new macro to fix MOS Normandy Bug #4170
  139. #define MB_MYINFORMATION (MB_APPLMODAL | MB_ICONINFORMATION | MB_SETFOREGROUND)
  140. // 8/27/96 jmazner
  141. #define MB_MYEXCLAMATION (MB_APPLMODAL | MB_ICONEXCLAMATION | MB_SETFOREGROUND)
  142. #define WM_STATECHANGE WM_USER
  143. #define WM_DIENOW WM_USER + 1
  144. #define WM_DUMMY WM_USER + 2
  145. #define WM_DOWNLOAD_DONE WM_USER + 3
  146. #define WM_DOWNLOAD_PROGRESS WM_USER + 4
  147. #define WM_MYINITDIALOG (WM_USER + 4)
  148. #define MAX_REDIALS 2
  149. #define REG_USER_INFO L"Software\\Microsoft\\User information"
  150. #define REG_USER_NAME1 L"Default First Name"
  151. #define REG_USER_NAME2 L"Default Last Name"
  152. #define REG_USER_COMPANY L"Default Company"
  153. #define REG_USER_ADDRESS1 L"Mailing Address"
  154. #define REG_USER_ADDRESS2 L"Additional Address"
  155. #define REG_USER_CITY L"City"
  156. #define REG_USER_STATE L"State"
  157. #define REG_USER_ZIP L"ZIP Code"
  158. #define REG_USER_PHONE L"Daytime Phone"
  159. #define REG_USER_COUNTRY L"Country"
  160. #define SIGNUPKEY L"SOFTWARE\\MICROSOFT\\GETCONN"
  161. #define DEVICENAMEKEY L"DeviceName" // used to store user's choice among multiple modems
  162. #define DEVICETYPEKEY L"DeviceType"
  163. #define ICWSETTINGSPATH L"Software\\Microsoft\\Internet Connection Wizard"
  164. #define ICWBUSYMESSAGES L"Software\\Microsoft\\Internet Connection Wizard\\Busy Messages"
  165. #define ICWCOMPLETEDKEY L"Completed"
  166. #define OOBERUNONCE L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce"
  167. #define ICSSETTINGSPATH L"Software\\Microsoft\\Windows\\CurrentVersion\\ICS"
  168. #define ICSCLIENT L"ICS Client"
  169. #define RELEASEPRODUCTKEY L"Release Product"
  170. #define RELEASEVERSIONKEY L"Release Product Version"
  171. #define MAX_DIGITAL_PID 256
  172. #define CONNECTOIDNAME L"Connectoid"
  173. #define ACCESSINFO L"AccessInfo"
  174. #define SETUPPATH_NONE L"current"
  175. #define SETUPPATH_MANUAL L"manual"
  176. #define SETUPPATH_AUTO L"automatic"
  177. #define MAX_SETUPPATH_TOKEN 200
  178. // Defines
  179. #define MAX_ISP_NAME (RAS_MaxEntryName-1) // internet service provider name
  180. #define MAX_ISP_USERNAME UNLEN // max length of login username
  181. #define MAX_ISP_PASSWORD PWLEN // max length of login password
  182. #define MAX_PORT_LEN 5 // max length of proxy port number (max # = 65535)
  183. // constants for INETCLIENTINFO.dwFlags
  184. #define INETC_LOGONMAIL 0x00000001
  185. #define INETC_LOGONNEWS 0x00000002
  186. #define INETC_LOGONDIRSERV 0x00000004
  187. // Connection Type
  188. #define CONNECTION_ICS_TYPE 0x00000001
  189. #define ERROR_INETCFG_UNKNOWN 0x20000000L
  190. #define MAX_EMAIL_NAME 64
  191. #define MAX_EMAIL_ADDRESS 128
  192. #define MAX_LOGON_NAME UNLEN
  193. #define MAX_LOGON_PASSWORD PWLEN
  194. #define MAX_SERVER_NAME 64 // max length of DNS name per RFC 1035 +1
  195. // IE Auto proxy value in registry
  196. #define AUTO_ONCE_EVER 0 // Auto proxy discovery
  197. #define AUTO_DISABLED 1
  198. #define AUTO_ONCE_PER_SESSION 2
  199. #define AUTO_ALWAYS 3
  200. // Flags for dwfOptions
  201. // install Internet mail
  202. #define INETCFG_INSTALLMAIL 0x00000001
  203. // Invoke InstallModem wizard if NO MODEM IS INSTALLED
  204. #define INETCFG_INSTALLMODEM 0x00000002
  205. // install RNA (if needed)
  206. #define INETCFG_INSTALLRNA 0x00000004
  207. // install TCP (if needed)
  208. #define INETCFG_INSTALLTCP 0x00000008
  209. // connecting with LAN (vs modem)
  210. #define INETCFG_CONNECTOVERLAN 0x00000010
  211. // Set the phone book entry for autodial
  212. #define INETCFG_SETASAUTODIAL 0x00000020
  213. // Overwrite the phone book entry if it exists
  214. // Note: if this flag is not set, and the entry exists, a unique name will
  215. // be created for the entry.
  216. #define INETCFG_OVERWRITEENTRY 0x00000040
  217. // Do not show the dialog that tells the user that files are about to be installed,
  218. // with OK/Cancel buttons.
  219. #define INETCFG_SUPPRESSINSTALLUI 0x00000080
  220. // Check if TCP/IP file sharing is turned on, and warn user to turn it off.
  221. // Reboot is required if the user turns it off.
  222. #define INETCFG_WARNIFSHARINGBOUND 0x00000100
  223. // Check if TCP/IP file sharing is turned on, and force user to turn it off.
  224. // If user does not want to turn it off, return will be ERROR_CANCELLED
  225. // Reboot is required if the user turns it off.
  226. #define INETCFG_REMOVEIFSHARINGBOUND 0x00000200
  227. // Indicates that this is a temporary phone book entry
  228. // In Win3.1 an icon will not be created
  229. #define INETCFG_TEMPPHONEBOOKENTRY 0x00000400
  230. // Show the busy dialog while checking system configuration
  231. #define INETCFG_SHOWBUSYANIMATION 0x00000800
  232. //
  233. // Chrisk 5/8/97
  234. // Note: the next three switches are only valid for InetNeedSystemComponents
  235. // Check if LAN adapter is installed and bound to TCP
  236. //
  237. #define INETCFG_INSTALLLAN 0x00001000
  238. //
  239. // Check if DIALUP adapter is installed and bound to TCP
  240. //
  241. #define INETCFG_INSTALLDIALUP 0x00002000
  242. //
  243. // Check to see if TCP is installed requardless of binding
  244. //
  245. #define INETCFG_INSTALLTCPONLY 0x00004000
  246. /*
  247. #ifdef __cplusplus
  248. extern "C"
  249. {
  250. #endif // __cplusplus
  251. */
  252. // constants for INETCLIENTINFO.dwFlags
  253. #define INETC_LOGONMAIL 0x00000001
  254. #define INETC_LOGONNEWS 0x00000002
  255. #define INETC_LOGONDIRSERV 0x00000004
  256. #define NUM_SERVER_TYPES 4
  257. #define STR_BSTR 0
  258. #define STR_OLESTR 1
  259. #define BSTRFROMANSI(x) (BSTR)MakeWideStrFromAnsi((LPWSTR)(x), STR_BSTR)
  260. #define OLESTRFROMANSI(x) (LPOLESTR)MakeWideStrFromAnsi((LPWSTR)(x), STR_OLESTR)
  261. #define BSTRFROMRESID(x) (BSTR)MakeWideStrFromResourceId(x, STR_BSTR)
  262. #define OLESTRFROMRESID(x) (LPOLESTR)MakeWideStrFromResourceId(x, STR_OLESTR)
  263. #define COPYOLESTR(x) (LPOLESTR)MakeWideStrFromWide(x, STR_OLESTR)
  264. #define COPYBSTR(x) (BSTR)MakeWideStrFromWide(x, STR_BSTR)
  265. // Note that bryanst and marcl have confirmed that this key will be supported in IE 4
  266. #define IE_PATHKEY L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\IEXPLORE.EXE"
  267. // IE 4 has major.minor version 4.71
  268. // IE 3 golden has major.minor.release.build version # > 4.70.0.1155
  269. // IE 2 has major.minor of 4.40
  270. #define IE4_MAJOR_VERSION (UINT) 4
  271. #define IE4_MINOR_VERSION (UINT) 71
  272. #define IE4_VERSIONMS (DWORD) ((IE4_MAJOR_VERSION << 16) | IE4_MINOR_VERSION)
  273. // 4-30-97 ChrisK Olympus 2934
  274. // While the ICW is trying to connect to the referral server, indicate something is
  275. // working
  276. #define MAX_BUSY_MESSAGE 255
  277. #define MAX_VALUE_NAME 10
  278. #define DEFAULT_IDEVENT 31
  279. #define DEFAULT_UELAPSE 3000
  280. #define cbAreaCode 6 // maximum number of characters in an area code, not including \0
  281. #define cbCity 19 // maximum number of chars in city name, not including \0
  282. #define cbAccessNumber 15 // maximum number of chars in phone number, not including \0
  283. #define cbStateName 31 // maximum number of chars in state name, not including \0
  284. #define cbBaudRate 6 // maximum number of chars in a baud rate, not including \0
  285. #define cbDataCenter (MAX_PATH+1) // max length of data center string
  286. #define MAX_EXIT_RETRIES 10
  287. static const WCHAR szFmtAppendIntToString[] = L"%s %d";
  288. static const WCHAR cszOobePhBkFile[] = L"Phone.obe";
  289. static const WCHAR cszOobePhBkCountry[] = L"COUNTRY_CODE";
  290. static const WCHAR cszOobePhBkCount[] = L"NUMBERS";
  291. static const WCHAR cszOobePhBkNumber[] = L"NUMBER%d";
  292. static const WCHAR cszOobePhBkDunFile[] = L"NUMBER%d_DUN";
  293. static const WCHAR cszOobePhBkCity[] = L"NUMBER%d_CITY";
  294. static const WCHAR cszOobePhBkAreaCode[] = L"NUMBER%d_ACODE";
  295. static const WCHAR cszOobePhBkRandom[] = L"RANDOM";
  296. static const WCHAR cszHTTPS[] = L"https:";
  297. // code relies on these two being the same length
  298. static const WCHAR cszHTTP[] = L"http:";
  299. static const WCHAR cszFILE[] = L"file:";
  300. static const WCHAR cszOEMBRND[] = L"oembrnd.ins";
  301. static const WCHAR cszOEMCNFG[] = L"oemcnfg.ins";
  302. static const WCHAR cszISPCNFG[] = L"ispcnfg.ins";
  303. static const WCHAR cszOOBEINFOINI[] = L"oobeinfo.INI";
  304. static const WCHAR cszSignup[] = L"Signup";
  305. static const WCHAR cszOfferCode[] = L"OfferCode";
  306. static const WCHAR cszISPSignup[] = L"ISPSignup";
  307. static const WCHAR cszISPQuery[] = L"Query String";
  308. static const WCHAR cszBranding[] = L"Branding";
  309. static const WCHAR cszOEMName[] = L"OEMName";
  310. static const WCHAR cszOptions[] = L"Options";
  311. static const WCHAR cszBroadbandDeviceName[] = L"BroadbandDeviceName";
  312. static const WCHAR cszBroadbandDevicePnpid[] = L"BroadbandDevicePnpid";
  313. //--------------------------------------------------------------------------------
  314. // Type declarations
  315. // NOTE: due to code in connmain, the order of these IS IMPORTANT. They should be
  316. // in the same order that they appear.
  317. typedef HRESULT (WINAPI * ICFGNEEDSYSCOMPONENTS) (DWORD dwfOptions, LPBOOL lpfNeedComponents);
  318. typedef struct tagGatherInfo
  319. {
  320. LCID m_lcidUser;
  321. LCID m_lcidSys;
  322. LCID m_lcidApps;
  323. DWORD m_dwOS;
  324. DWORD m_dwMajorVersion;
  325. DWORD m_dwMinorVersion;
  326. WORD m_wArchitecture;
  327. WCHAR m_szPromo[MAX_PROMO];
  328. DWORD m_dwCountryID;
  329. DWORD m_dwCountryCode;
  330. WCHAR m_szAreaCode[MAX_AREACODE+1];
  331. HWND m_hwnd;
  332. LPLINECOUNTRYLIST m_pLineCountryList;
  333. BOOL m_bUsePhbk;
  334. //LPCNTRYNAMELOOKUPELEMENT m_rgNameLookUp;
  335. WCHAR m_szSUVersion[MAX_VERSION_LEN];
  336. WORD m_wState;
  337. BYTE m_fType;
  338. BYTE m_bMask;
  339. WCHAR m_szISPFile[MAX_PATH+1];
  340. WCHAR m_szAppDir[MAX_PATH+1];
  341. WCHAR m_szRelProd[MAX_RELPROD + 1];
  342. WCHAR m_szRelVer[MAX_RELVER + 1];
  343. DWORD m_dwFlag;
  344. } GATHERINFO, *LPGATHERINFO;
  345. typedef struct tagRASDEVICE
  346. {
  347. LPRASDEVINFO lpRasDevInfo;
  348. DWORD dwTapiDev;
  349. } RASDEVICE, *PRASDEVICE;
  350. HRESULT GetINTFromISPFile
  351. (
  352. LPWSTR pszISPCode,
  353. LPWSTR pszSection,
  354. LPWSTR pszDataName,
  355. int far *lpData,
  356. int iDefaultValue
  357. );
  358. typedef struct tagINETCLIENTINFO
  359. {
  360. DWORD dwSize;
  361. DWORD dwFlags;
  362. WCHAR szEMailName[MAX_EMAIL_NAME + 1];
  363. WCHAR szEMailAddress[MAX_EMAIL_ADDRESS + 1];
  364. WCHAR szPOPLogonName[MAX_LOGON_NAME + 1];
  365. WCHAR szPOPLogonPassword[MAX_LOGON_PASSWORD + 1];
  366. WCHAR szPOPServer[MAX_SERVER_NAME + 1];
  367. WCHAR szSMTPServer[MAX_SERVER_NAME + 1];
  368. WCHAR szNNTPLogonName[MAX_LOGON_NAME + 1];
  369. WCHAR szNNTPLogonPassword[MAX_LOGON_PASSWORD + 1];
  370. WCHAR szNNTPServer[MAX_SERVER_NAME + 1];
  371. // end of version 1.0 structure;
  372. // extended 1.1 structure includes the following fields:
  373. WCHAR szNNTPName[MAX_EMAIL_NAME + 1];
  374. WCHAR szNNTPAddress[MAX_EMAIL_ADDRESS + 1];
  375. int iIncomingProtocol;
  376. WCHAR szIncomingMailLogonName[MAX_LOGON_NAME + 1];
  377. WCHAR szIncomingMailLogonPassword[MAX_LOGON_PASSWORD + 1];
  378. WCHAR szIncomingMailServer[MAX_SERVER_NAME + 1];
  379. BOOL fMailLogonSPA;
  380. BOOL fNewsLogonSPA;
  381. WCHAR szLDAPLogonName[MAX_LOGON_NAME + 1];
  382. WCHAR szLDAPLogonPassword[MAX_LOGON_PASSWORD + 1];
  383. WCHAR szLDAPServer[MAX_SERVER_NAME + 1];
  384. BOOL fLDAPLogonSPA;
  385. BOOL fLDAPResolve;
  386. } INETCLIENTINFO, *PINETCLIENTINFO, FAR *LPINETCLIENTINFO;
  387. typedef struct SERVER_TYPES_tag
  388. {
  389. WCHAR szType[6];
  390. DWORD dwType;
  391. DWORD dwfOptions;
  392. } SERVER_TYPES;
  393. typedef struct
  394. {
  395. DWORD dwIndex; // index number
  396. BYTE bFlipFactor; // for auto-pick
  397. DWORD fType; // phone number type
  398. WORD wStateID; // state ID
  399. DWORD dwCountryID; // TAPI country ID
  400. DWORD dwCountryCode; // TAPI country code
  401. DWORD dwAreaCode; // area code or NO_AREA_CODE if none
  402. DWORD dwConnectSpeedMin; // minimum baud rate
  403. DWORD dwConnectSpeedMax; // maximum baud rate
  404. WCHAR szCity[MAX_PATH]; // city name
  405. WCHAR szAccessNumber[MAX_PATH]; // access number
  406. WCHAR szDataCenter[MAX_PATH]; // data center access string
  407. WCHAR szAreaCode[MAX_PATH]; //Keep the actual area code string around.
  408. } ACCESSENTRY, far *PACCESSENTRY; // ae
  409. typedef struct tagSUGGESTIONINFO
  410. {
  411. DWORD dwCountryID;
  412. DWORD dwCountryCode;
  413. DWORD dwAreaCode;
  414. DWORD dwPick;
  415. WORD wNumber;
  416. //DWORD fType; // 9/6/96 jmazner Normandy
  417. //DWORD bMask; // make this struct look like the one in %msnroot%\core\client\phbk\phbk.h
  418. ACCESSENTRY AccessEntry;
  419. } SUGGESTINFO, far *PSUGGESTINFO;
  420. // structure used to pass information to mail profile config APIs.
  421. // Most likely the pointers point into a USERINFO struct,
  422. typedef struct MAILCONFIGINFO {
  423. WCHAR * pszEmailAddress; // user's email address
  424. WCHAR * pszEmailServer; // user's email server path
  425. WCHAR * pszEmailDisplayName; // user's name
  426. WCHAR * pszEmailAccountName; // account name
  427. WCHAR * pszEmailAccountPwd; // account password
  428. WCHAR * pszProfileName; // name of profile to use
  429. // (create or use default if NULL)
  430. BOOL fSetProfileAsDefault; // set profile as default profile
  431. WCHAR * pszConnectoidName; // name of connectoid to dial
  432. BOOL fRememberPassword; // password cached if TRUE
  433. } MAILCONFIGINFO;
  434. // structure to pass data back from IDD_CHOOSEPROFILENAME handler
  435. typedef struct tagCHOOSEPROFILEDLGINFO
  436. {
  437. WCHAR szProfileName[cchProfileNameMax+1];
  438. BOOL fSetProfileAsDefault;
  439. } CHOOSEPROFILEDLGINFO, * PCHOOSEPROFILEDLGINFO;
  440. // structure for getting proc addresses of api functions
  441. typedef struct APIFCN {
  442. PVOID * ppFcnPtr;
  443. LPCSTR pszName;
  444. } APIFCN;
  445. // The following are the names for the name/value pairs that will be passed as a query string to the
  446. // ISP signup server
  447. const WCHAR csz_USER_FIRSTNAME[] = L"USER_FIRSTNAME";
  448. const WCHAR csz_USER_LASTNAME[] = L"USER_LASTNAME";
  449. const WCHAR csz_USER_ADDRESS[] = L"USER_ADDRESS";
  450. const WCHAR csz_USER_MOREADDRESS[] = L"USER_MOREADDRESS";
  451. const WCHAR csz_USER_CITY[] = L"USER_CITY";
  452. const WCHAR csz_USER_STATE[] = L"USER_STATE";
  453. const WCHAR csz_USER_ZIP[] = L"USER_ZIP";
  454. const WCHAR csz_USER_PHONE[] = L"USER_PHONE";
  455. const WCHAR csz_AREACODE[] = L"AREACODE";
  456. const WCHAR csz_COUNTRYCODE[] = L"COUNTRYCODE";
  457. const WCHAR csz_USER_FE_NAME[] = L"USER_FE_NAME";
  458. const WCHAR csz_PAYMENT_TYPE[] = L"PAYMENT_TYPE";
  459. const WCHAR csz_PAYMENT_BILLNAME[] = L"PAYMENT_BILLNAME";
  460. const WCHAR csz_PAYMENT_BILLADDRESS[] = L"PAYMENT_BILLADDRESS";
  461. const WCHAR csz_PAYMENT_BILLEXADDRESS[] = L"PAYMENT_BILLEXADDRESS";
  462. const WCHAR csz_PAYMENT_BILLCITY[] = L"PAYMENT_BILLCITY";
  463. const WCHAR csz_PAYMENT_BILLSTATE[] = L"PAYMENT_BILLSTATE";
  464. const WCHAR csz_PAYMENT_BILLZIP[] = L"PAYMENT_BILLZIP";
  465. const WCHAR csz_PAYMENT_BILLPHONE[] = L"PAYMENT_BILLPHONE";
  466. const WCHAR csz_PAYMENT_DISPLAYNAME[] = L"PAYMENT_DISPLAYNAME";
  467. const WCHAR csz_PAYMENT_CARDNUMBER[] = L"PAYMENT_CARDNUMBER";
  468. const WCHAR csz_PAYMENT_EXMONTH[] = L"PAYMENT_EXMONTH";
  469. const WCHAR csz_PAYMENT_EXYEAR[] = L"PAYMENT_EXYEAR";
  470. const WCHAR csz_PAYMENT_CARDHOLDER[] = L"PAYMENT_CARDHOLDER";
  471. const WCHAR csz_SIGNED_PID[] = L"SIGNED_PID";
  472. const WCHAR csz_GUID[] = L"GUID";
  473. const WCHAR csz_OFFERID[] = L"OFFERID";
  474. const WCHAR csz_USER_COMPANYNAME[] = L"USER_COMPANYNAME";
  475. const WCHAR csz_ICW_VERSION[] = L"ICW_Version";
  476. //Info required flags
  477. // 1 -- required
  478. // 0 -- optional
  479. //User Info
  480. #define REQUIRE_FE_NAME 0x00000001
  481. #define REQUIRE_FIRSTNAME 0x00000002
  482. #define REQUIRE_LASTNAME 0x00000004
  483. #define REQUIRE_ADDRESS 0x00000008
  484. #define REQUIRE_MOREADDRESS 0x00000010
  485. #define REQUIRE_CITY 0x00000020
  486. #define REQUIRE_STATE 0x00000040
  487. #define REQUIRE_ZIP 0x00000080
  488. #define REQUIRE_PHONE 0x00000100
  489. #define REQUIRE_COMPANYNAME 0x00000200
  490. //Credit Card
  491. #define REQUIRE_CCNAME 0x00000400
  492. #define REQUIRE_CCADDRESS 0x00000800
  493. #define REQUIRE_CCNUMBER 0x00001000
  494. #define REQUIRE_CCZIP REQUIRE_ZIP
  495. //Invoice
  496. #define REQUIRE_IVADDRESS1 REQUIRE_ADDRESS
  497. #define REQUIRE_IVADDRESS2 REQUIRE_MOREADDRESS
  498. #define REQUIRE_IVCITY REQUIRE_CITY
  499. #define REQUIRE_IVSTATE REQUIRE_STATE
  500. #define REQUIRE_IVZIP REQUIRE_ZIP
  501. //Phone
  502. #define REQUIRE_PHONEIV_BILLNAME 0x00002000
  503. #define REQUIRE_PHONEIV_ACCNUM REQUIRE_PHONE
  504. //Htm pagetype flags
  505. #define PAGETYPE_UNDEFINED E_FAIL
  506. #define PAGETYPE_NOOFFERS 0x00000001
  507. #define PAGETYPE_MARKETING 0x00000002
  508. #define PAGETYPE_BRANDED 0x00000004
  509. #define PAGETYPE_BILLING 0x00000008
  510. #define PAGETYPE_CUSTOMPAY 0x00000010
  511. #define PAGETYPE_ISP_NORMAL 0x00000020
  512. #define PAGETYPE_ISP_TOS 0x00000040
  513. #define PAGETYPE_ISP_FINISH 0x00000080
  514. #define PAGETYPE_ISP_CUSTOMFINISH 0x00000100
  515. #define PAGETYPE_OLS_FINISH 0x00000200
  516. typedef BOOL (* VALIDATECONTENT) (LPCWSTR lpData);
  517. enum IPSDataContentValidators
  518. {
  519. ValidateCCNumber = 0,
  520. ValidateCCExpire
  521. };
  522. typedef struct tag_ISPDATAELEMENT
  523. {
  524. LPCWSTR lpQueryElementName; // Static name to put in query string
  525. LPWSTR lpQueryElementValue; // data for element
  526. WORD idContentValidator; // id of content validator
  527. WORD wValidateNameID; // validation element name string ID
  528. DWORD dwValidateFlag; // validation bit flag for this element
  529. }ISPDATAELEMENT, *LPISPDATAELEMENT;
  530. enum IPSDataElements
  531. {
  532. ISPDATA_USER_FIRSTNAME = 0,
  533. ISPDATA_USER_LASTNAME,
  534. ISPDATA_USER_ADDRESS,
  535. ISPDATA_USER_MOREADDRESS,
  536. ISPDATA_USER_CITY,
  537. ISPDATA_USER_STATE,
  538. ISPDATA_USER_ZIP,
  539. ISPDATA_USER_PHONE,
  540. ISPDATA_AREACODE,
  541. ISPDATA_COUNTRYCODE,
  542. ISPDATA_USER_FE_NAME,
  543. ISPDATA_PAYMENT_TYPE,
  544. ISPDATA_PAYMENT_BILLNAME,
  545. ISPDATA_PAYMENT_BILLADDRESS,
  546. ISPDATA_PAYMENT_BILLEXADDRESS,
  547. ISPDATA_PAYMENT_BILLCITY,
  548. ISPDATA_PAYMENT_BILLSTATE,
  549. ISPDATA_PAYMENT_BILLZIP,
  550. ISPDATA_PAYMENT_BILLPHONE,
  551. ISPDATA_PAYMENT_DISPLAYNAME,
  552. ISPDATA_PAYMENT_CARDNUMBER,
  553. ISPDATA_PAYMENT_EXMONTH,
  554. ISPDATA_PAYMENT_EXYEAR,
  555. ISPDATA_PAYMENT_CARDHOLDER,
  556. ISPDATA_SIGNED_PID,
  557. ISPDATA_GUID,
  558. ISPDATA_OFFERID,
  559. ISPDATA_BILLING_OPTION,
  560. ISPDATA_PAYMENT_CUSTOMDATA,
  561. ISPDATA_USER_COMPANYNAME,
  562. ISPDATA_ICW_VERSION
  563. };
  564. enum ISPDATAValidateLevels
  565. {
  566. ISPDATA_Validate_None = 0,
  567. ISPDATA_Validate_DataPresent,
  568. ISPDATA_Validate_Content
  569. };
  570. //--------------------------------------------------------------------------------
  571. // Prototypes
  572. // functions in MAPICALL.C
  573. BOOL InitMAPI(HWND hWnd);
  574. VOID DeInitMAPI(VOID);
  575. HRESULT SetMailProfileInformation(MAILCONFIGINFO * pMailConfigInfo);
  576. BOOL FindInternetMailService(WCHAR * pszEmailAddress, DWORD cbEmailAddress,
  577. WCHAR * pszEmailServer, DWORD cbEmailServer);
  578. DWORD ConfigRasEntryDevice( LPRASENTRY lpRasEntry );
  579. BOOL FInsureTCPIP();
  580. LPWSTR GetSz(DWORD dwszID);
  581. //void SetStatusArrow(CState wState);
  582. BOOL FInsureModemTAPI(HWND hwnd);
  583. BOOL FGetModemSpeed(PDWORD pdwSpeed);
  584. BOOL FGetDeviceID(HLINEAPP *phLineApp, PDWORD pdwAPI, PDWORD pdwDevice);
  585. BOOL FDoModemWizard(HWND hWnd);
  586. BOOL FInsureNetwork(PBOOL pfNeedReboot);
  587. BOOL TestInternetConnection();
  588. WORD Sz2W (LPCWSTR szBuf);
  589. DWORD Sz2Dw(LPCWSTR pSz);
  590. DWORD Sz2DwFast(LPCWSTR pSz);
  591. BOOL FSz2Dw(LPCWSTR pSz, LPDWORD dw);
  592. BOOL FSz2DwEx(LPCWSTR pSz, DWORD far *dw);
  593. BOOL FSz2WEx(LPCWSTR pSz, WORD far *w);
  594. BOOL FSz2W(LPCWSTR pSz, WORD far *w);
  595. BOOL FSz2B(LPCWSTR pSz, BYTE far *pb);
  596. BOOL FSz2W(LPCWSTR pSz, WORD far *w);
  597. BOOL FSz2BOOL(LPCWSTR pSz, BOOL far *pbool);
  598. BOOL FSz2SPECIAL(LPCWSTR pSz, BOOL far *pbool, BOOL far *pbIsSpecial, int far *pInt);
  599. BOOL FSz2B(LPCWSTR pSz, BYTE far *pb);
  600. int __cdecl CompareCountryNames(const void *pv1, const void *pv2);
  601. DWORD GetCurrentTapiCountryID(void);
  602. int __cdecl CompareNPAEntry(const void *pv1, const void *pv2);
  603. //HRESULT GatherInformation(LPGATHERINFO pGatheredInfo, HWND hwndParent);
  604. HRESULT DownLoadISPInfo(GATHERINFO *pGI);
  605. HRESULT GetDataFromISPFile(LPWSTR pszISPCode, LPWSTR pszSection, LPWSTR pszDataName, LPWSTR pszOutput,
  606. DWORD dwOutputLength);
  607. HRESULT StoreInSignUpReg(LPBYTE lpbData, DWORD dwSize, DWORD dwType, LPCWSTR pszKey);
  608. extern HRESULT ReadSignUpReg(LPBYTE lpbData, DWORD *pdwSize, DWORD dwType, LPCWSTR pszKey);
  609. extern HRESULT DeleteSignUpReg(LPCWSTR pszKey);
  610. VOID WINAPI MyProgressCallBack(
  611. HINTERNET hInternet,
  612. DWORD dwContext,
  613. DWORD dwInternetStatus,
  614. LPVOID lpvStatusInformation,
  615. DWORD dwStatusInformationLength
  616. );
  617. HRESULT ReleaseBold(HWND hwnd);
  618. HRESULT MakeBold (HWND hwnd, BOOL fSize, LONG lfWeight);
  619. //HRESULT ShowDialingDialog(LPWSTR, LPGATHERINFO, LPWSTR);
  620. DWORD RasErrorToIDS(DWORD dwErr);
  621. HRESULT CreateEntryFromDUNFile(LPWSTR pszDunFile);
  622. //HRESULT RestoreHappyWelcomeScreen();
  623. HRESULT KillHappyWelcomeScreen();
  624. HRESULT GetCurrentWebSettings();
  625. LPWSTR LoadInfoFromWindowUser();
  626. HRESULT GetTapiCountryID2(LPDWORD pdwCountryID);
  627. HRESULT RestoreAutodialer();
  628. //HRESULT FilterStringDigits(LPWSTR);
  629. BOOL IsDigitString(LPWSTR szBuff);
  630. BOOL WaitForAppExit(HINSTANCE hInstance);
  631. VOID PrepareForRunOnceApp(VOID);
  632. void MinimizeRNAWindow(LPWSTR pszConnectoidName, HINSTANCE hInst);
  633. // 3/28/97 ChrisK Olympus 296
  634. void StopRNAReestablishZapper(HANDLE hthread);
  635. HANDLE LaunchRNAReestablishZapper(HINSTANCE hInst);
  636. BOOL FGetSystemShutdownPrivledge();
  637. BOOL LclSetEntryScriptPatch(LPWSTR lpszScript, LPCWSTR lpszEntry);
  638. BOOL IsScriptingInstalled();
  639. void InstallScripter(void);
  640. void DeleteStartUpCommand ();
  641. extern BOOL IsNT (VOID);
  642. extern BOOL IsNT4SP3Lower (VOID);
  643. HRESULT GetCommonAppDataDirectory(LPWSTR szDirectory, DWORD cchDirectory);
  644. HRESULT GetDefaultPhoneBook(LPWSTR szPhoneBook, DWORD cchPhoneBook);
  645. BOOL INetNToW(struct in_addr inaddr, LPWSTR szAddr);
  646. typedef enum tagAUTODIAL_TYPE
  647. {
  648. AutodialTypeNever = 1,
  649. AutodialTypeNoNet,
  650. AutodialTypeAlways
  651. } AUTODIAL_TYPE, *PAUTODIAL_TYPE;
  652. LONG
  653. SetAutodial(
  654. IN HKEY hUserRoot,
  655. IN AUTODIAL_TYPE eType,
  656. IN LPCWSTR szConnectoidName,
  657. IN BOOL bSetICWCompleted
  658. );
  659. BOOL
  660. SetMultiUserAutodial(
  661. IN AUTODIAL_TYPE eType,
  662. IN LPCWSTR szConnectoidName,
  663. IN BOOL bSetICWCompleted
  664. );
  665. BOOL SetDefaultConnectoid(AUTODIAL_TYPE eType, LPCWSTR szConnectoidName);
  666. //
  667. // ChrisK Olympus 6368 6/24/97
  668. //
  669. #if defined(PRERELEASE)
  670. BOOL FCampusNetOverride();
  671. #endif //PRERELEASE
  672. //*******************************************************************
  673. //
  674. // FUNCTION: InetGetClientInfo
  675. //
  676. // PURPOSE: This function will get the internet client params
  677. // from the registry
  678. //
  679. // PARAMETERS: lpClientInfo - on return, this structure will contain
  680. // the internet client params as set in the registry.
  681. // lpszProfileName - Name of client info profile to
  682. // retrieve. If this is NULL, the default profile is used.
  683. //
  684. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  685. //
  686. //*******************************************************************
  687. HRESULT WINAPI InetGetClientInfo(
  688. LPCWSTR lpszProfileName,
  689. LPINETCLIENTINFO lpClientInfo);
  690. //*******************************************************************
  691. //
  692. // FUNCTION: InetSetClientInfo
  693. //
  694. // PURPOSE: This function will set the internet client params
  695. //
  696. // PARAMETERS: lpClientInfo - pointer to struct with info to set
  697. // in the registry.
  698. // lpszProfileName - Name of client info profile to
  699. // modify. If this is NULL, the default profile is used.
  700. //
  701. // RETURNS: HRESULT code, ERROR_SUCCESS if no errors occurred
  702. //
  703. //*******************************************************************
  704. HRESULT WINAPI InetSetClientInfo(
  705. LPCWSTR lpszProfileName,
  706. LPINETCLIENTINFO lpClientInfo);
  707. //#ifdef __cplusplus
  708. //extern "C" {
  709. //#endif // __cplusplus
  710. // //10/24/96 jmazner Normandy 6968
  711. // //No longer neccessary thanks to Valdon's hooks for invoking ICW.
  712. // 11/21/96 jmazner Normandy 11812
  713. // oops, it _is_ neccessary, since if user downgrades from IE 4 to IE 3,
  714. // ICW 1.1 needs to morph the IE 3 icon.
  715. HRESULT GetDeskTopInternetCommand();
  716. HRESULT RestoreDeskTopInternetCommand();
  717. //
  718. // 7/24/97 ChrisK Olympus 1923
  719. //
  720. BOOL WaitForConnectionTermination(HRASCONN);
  721. // 11/21/96 jmazner Normandy #11812
  722. BOOL GetIEVersion(PDWORD pdwVerNumMS, PDWORD pdwVerNumLS);
  723. HRESULT ClearProxySettings();
  724. HRESULT RestoreProxySettings();
  725. BOOL FShouldRetry2(HRESULT hrErr);
  726. LPBYTE MyMemCpy(LPBYTE dest, const LPBYTE src, size_t count);
  727. #endif