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.

538 lines
13 KiB

  1. // Copyright (c) 1995, Microsoft Corporation, all rights reserved
  2. //
  3. // entry.h
  4. // Remote Access Common Dialog APIs
  5. // Phonebook entry property sheet and wizard header
  6. //
  7. // 06/18/95 Steve Cobb
  8. #ifndef _ENTRY_H_
  9. #define _ENTRY_H_
  10. #define RASEDFLAG_AnyNewEntry (RASEDFLAG_NewEntry | \
  11. RASEDFLAG_NewPhoneEntry | \
  12. RASEDFLAG_NewTunnelEntry | \
  13. RASEDFLAG_NewDirectEntry | \
  14. RASEDFLAG_NewBroadbandEntry)
  15. //
  16. // pmay: 233287
  17. //
  18. // We need to be able to filter ports lists such that
  19. // all port types are included in the list and such that
  20. // all non-vpn port types are included in the list. This
  21. // is a requirement for the demand dial interface wizard.
  22. //
  23. // Define private RASET_* types to be used with the
  24. // EuChangeEntryType function.
  25. //
  26. #define RASET_P_AllTypes ((DWORD)-1)
  27. #define RASET_P_NonVpnTypes ((DWORD)-2)
  28. //
  29. // pmay: 378432
  30. //
  31. // Add more flexibility to Su* api's
  32. // See SUINFO.dwFlags
  33. //
  34. #define SU_F_DisableTerminal 0x1
  35. #define SU_F_DisableScripting 0x2
  36. //-----------------------------------------------------------------------------
  37. // Datatypes
  38. //-----------------------------------------------------------------------------
  39. // Phonebook Entry common block.
  40. //
  41. typedef struct
  42. _EINFO
  43. {
  44. // RAS API arguments.
  45. //
  46. TCHAR* pszPhonebook;
  47. TCHAR* pszEntry;
  48. RASENTRYDLG* pApiArgs;
  49. // Set true by property sheet or wizard when changes should be committed
  50. // before returning from the API. Does not apply in ShellOwned-mode where
  51. // the API returns before the property sheet is dismissed.
  52. //
  53. BOOL fCommit;
  54. // Set if we have been called via RouterEntryDlg.
  55. //
  56. BOOL fRouter;
  57. // Set if fRouter is TRUE and pszRouter refers to a remote machine.
  58. //
  59. BOOL fRemote;
  60. // Set if pszRouter is an NT4 steelhead machine. Valid only
  61. // if fRouter is true.
  62. //
  63. BOOL fNt4Router;
  64. //Set if pszRouter is an Windows 2000 machine, Valid only if
  65. // fRouter is true
  66. BOOL fW2kRouter;
  67. // The name of the server in "\\server" form or NULL if none (or if
  68. // 'fRouter' is not set).
  69. //
  70. TCHAR* pszRouter;
  71. // Set by the add entry or add interface wizards if user chooses to end
  72. // the wizard and go edit the properties directly. When this flag is set
  73. // the wizard should *not* call EuFree before returning.
  74. //
  75. BOOL fChainPropertySheet;
  76. // Phonebook settings read from the phonebook file. All access should be
  77. // thru 'pFile' as 'file' will only be used in cases where the open
  78. // phonebook is not passed thru the reserved word hack.
  79. //
  80. PBFILE* pFile;
  81. PBFILE file;
  82. // Global preferences read via phonebook library. All access should be
  83. // thru 'pUser' as 'user' will only be used in cases where the preferences
  84. // are not passed thru the reserved word hack.
  85. //
  86. PBUSER* pUser;
  87. PBUSER user;
  88. // Set if "no user before logon" mode.
  89. //
  90. BOOL fNoUser;
  91. // Set by the add-entry wizard if the selected port is an X.25 PAD.
  92. //
  93. BOOL fPadSelected;
  94. // Set if there are multiple devices configured, i.e. if the UI is running
  95. // in the multiple device mode. This is implicitly false in VPN and
  96. // Direct modes.
  97. //
  98. BOOL fMultipleDevices;
  99. // Link storing the List of PBPHONEs and alternate options for shared
  100. // phone number mode. This allows user to change the port/device to
  101. // another link without losing the phone number he typed.
  102. //
  103. DTLNODE* pSharedNode;
  104. // The node being edited (still in the list), and the original entry name
  105. // for use in comparison later. These are valid in "edit" case only.
  106. //
  107. DTLNODE* pOldNode;
  108. TCHAR szOldEntryName[ RAS_MaxEntryName + 1 ];
  109. // The work entry node containing and a shortcut pointer to the entry
  110. // inside.
  111. //
  112. DTLNODE* pNode;
  113. PBENTRY* pEntry;
  114. // The master list of configured ports used by EuChangeEntryType to
  115. // construct an appropriate sub-list of PBLINKs in the work entry node.
  116. //
  117. DTLLIST* pListPorts;
  118. // The "current" device. This value is NULL for multilink entries. It
  119. // is the device that the entry will use if no change is made. We compare
  120. // the current device to the device selected from the general tab to know
  121. // when it is appropriate to update the phonebook's "preferred" device.
  122. //
  123. TCHAR* pszCurDevice;
  124. TCHAR* pszCurPort;
  125. // Set true if there are no ports of the current entry type configured,
  126. // not including any bogus "uninstalled" ports added to the link list so
  127. // the rest of the code can assume there is at least one link.
  128. //
  129. BOOL fNoPortsConfigured;
  130. // Dial-out user info for router; used by AiWizard. Used to set interface
  131. // credentials via MprAdminInterfaceSetCredentials.
  132. //
  133. TCHAR* pszRouterUserName;
  134. TCHAR* pszRouterDomain;
  135. TCHAR* pszRouterPassword;
  136. // Dial-in user info for router (optional); used by AiWizard. Used to
  137. // create dial-in user account via NetUserAdd; the user name for the
  138. // account is the interface (phonebook entry) name.
  139. //
  140. BOOL fAddUser;
  141. TCHAR* pszRouterDialInPassword;
  142. // Home networking settings for the entry.
  143. //
  144. BOOL fComInitialized;
  145. HRESULT hShowHNetPagesResult;
  146. BOOL fShared;
  147. BOOL fDemandDial;
  148. BOOL fNewShared;
  149. BOOL fNewDemandDial;
  150. DWORD dwLanCount;
  151. IHNetConnection *pPrivateLanConnection;
  152. // AboladeG - security level of the current user.
  153. // Set true if the user is an administrator/power user.
  154. // This is required by several pages, both in the wizard
  155. // and in the property sheet.
  156. //
  157. BOOL fIsUserAdminOrPowerUser;
  158. // Set if strong encryption is supported by NDISWAN, as determined in
  159. // EuInit.
  160. //
  161. BOOL fStrongEncryption;
  162. // Set whent the VPN "first connect" controls should be read-only, e.g. in
  163. // the dialer's Properties button is pressed in the middle of a double
  164. // dial.
  165. //
  166. BOOL fDisableFirstConnect;
  167. //Used in the IPSec Policy in the Security tab for a VPN connection
  168. //
  169. BOOL fPSKCached;
  170. TCHAR szPSK[PWLEN + 1];
  171. // Flags to track whether to save the default Internet connection
  172. //
  173. BOOL fDefInternet;
  174. // Default credentials
  175. //
  176. BOOL fGlobalCred; //add for whistler bug 328673
  177. TCHAR* pszDefUserName;
  178. TCHAR* pszDefPassword;
  179. }
  180. EINFO;
  181. // Complex phone number utilities context block.
  182. //
  183. typedef struct
  184. _CUINFO
  185. {
  186. // Array of country information.
  187. //
  188. COUNTRY* pCountries;
  189. // Number of countries in the 'pCountries' array.
  190. //
  191. DWORD cCountries;
  192. // The complete country list, rather than a partial, is loaded.
  193. //
  194. BOOL fComplete;
  195. // Handles of the controls involved.
  196. //
  197. HWND hwndStAreaCodes;
  198. HWND hwndClbAreaCodes;
  199. HWND hwndStPhoneNumber; // May be NULL
  200. HWND hwndEbPhoneNumber;
  201. HWND hwndStCountryCodes;
  202. HWND hwndLbCountryCodes;
  203. HWND hwndCbUseDialingRules;
  204. HWND hwndPbDialingRules; // May be NULL
  205. HWND hwndPbAlternates; // May be NULL
  206. HWND hwndStComment; // May be NULL
  207. HWND hwndEbComment; // May be NULL
  208. // List of area codes modified to include all strings retrieved with
  209. // CuGetInfo. The list is owned by the caller, i.e. it is not cleaned up
  210. // on CuFree.
  211. //
  212. DTLLIST* pListAreaCodes; // May be NULL
  213. // The area code and country code fields are blanked when "use dialing
  214. // rules" is not checked to avoid confusing the typical user who doesn't
  215. // understand them. The setting to which each field would be restored
  216. // were "use dialing rules" to be enabled is stored here. These fields
  217. // always reflect the value at the last rules toggle or set swap.
  218. //
  219. // This country ID also serves as the "country ID to select" passed to
  220. // CuUpdateCountryCodeLb, which allows an optimization where the full
  221. // Country Code list is only loaded when user requests to view it.
  222. //
  223. TCHAR* pszAreaCode;
  224. DWORD dwCountryId;
  225. DWORD dwCountryCode;
  226. // Used by tapi for the dialing rules
  227. HLINEAPP hlineapp;
  228. }
  229. CUINFO;
  230. // Scripting utilities context block.
  231. //
  232. typedef struct
  233. _SUINFO
  234. {
  235. // The managed controls.
  236. //
  237. HWND hwndCbRunScript;
  238. HWND hwndCbTerminal;
  239. HWND hwndLbScripts;
  240. HWND hwndPbEdit;
  241. HWND hwndPbBrowse;
  242. // List of scripts loaded.
  243. //
  244. DTLLIST* pList;
  245. // The current list selection or if disabled the hidden selection.
  246. //
  247. TCHAR* pszSelection;
  248. // hConnection to the server in case this is a remote
  249. // machine.
  250. //
  251. HANDLE hConnection;
  252. // The flags
  253. //
  254. DWORD dwFlags;
  255. }
  256. SUINFO;
  257. // "Dial another first" list item context block.
  258. //
  259. typedef struct
  260. PREREQITEM
  261. {
  262. TCHAR* pszEntry;
  263. TCHAR* pszPbk;
  264. }
  265. PREREQITEM;
  266. //-----------------------------------------------------------------------------
  267. // Prototypes
  268. //-----------------------------------------------------------------------------
  269. VOID
  270. AeWizard(
  271. IN OUT EINFO* pEinfo );
  272. VOID
  273. AiWizard(
  274. IN OUT EINFO* pEinfo );
  275. VOID
  276. PePropertySheet(
  277. IN OUT EINFO* pEinfo );
  278. DWORD
  279. EuChangeEntryType(
  280. IN EINFO* pInfo,
  281. IN DWORD dwType );
  282. BOOL
  283. EuCommit(
  284. IN EINFO* pInfo );
  285. DWORD
  286. EuRouterInterfaceCreate(
  287. IN EINFO* pInfo );
  288. DWORD
  289. EuCredentialsCommit(
  290. IN EINFO* pInfo );
  291. DWORD
  292. EuCredentialsCommitRouterStandard(
  293. IN EINFO* pInfo );
  294. DWORD
  295. EuCredentialsCommitRouterIPSec(
  296. IN EINFO* pInfo );
  297. DWORD
  298. EuCredentialsCommitRasGlobal(
  299. IN EINFO* pInfo );
  300. DWORD
  301. EuCredentialsCommitRasIPSec(
  302. IN EINFO* pInfo );
  303. BOOL
  304. EuRouterInterfaceIsNew(
  305. IN EINFO * pInfo );
  306. DWORD
  307. EuInternetSettingsCommitDefault(
  308. IN EINFO* pInfo );
  309. DWORD
  310. EuHomenetCommitSettings(
  311. IN EINFO* pInfo);
  312. VOID
  313. EuFree(
  314. IN EINFO* pInfo );
  315. VOID
  316. EuGetEditFlags(
  317. IN EINFO* pEinfo,
  318. OUT BOOL* pfEditMode,
  319. OUT BOOL* pfChangedNameInEditMode );
  320. DWORD
  321. EuInit(
  322. IN TCHAR* pszPhonebook,
  323. IN TCHAR* pszEntry,
  324. IN RASENTRYDLG* pArgs,
  325. IN BOOL fRouter,
  326. OUT EINFO** ppInfo,
  327. OUT DWORD* pdwOp );
  328. BOOL
  329. EuValidateName(
  330. IN HWND hwndOwner,
  331. IN EINFO* pEinfo );
  332. VOID
  333. CuClearCountryCodeLb(
  334. IN CUINFO* pCuInfo );
  335. BOOL
  336. CuCountryCodeLbHandler(
  337. IN CUINFO* pCuInfo,
  338. IN WORD wNotification );
  339. VOID
  340. CuCountryCodeLbSelChange(
  341. IN CUINFO* pCuInfo );
  342. BOOL
  343. CuDialingRulesCbHandler(
  344. IN CUINFO* pCuInfo,
  345. IN WORD wNotification );
  346. VOID
  347. CuFree(
  348. IN CUINFO* pCuInfo );
  349. VOID
  350. CuGetInfo(
  351. IN CUINFO* pCuInfo,
  352. OUT DTLNODE* pPhoneNode );
  353. VOID
  354. CuInit(
  355. OUT CUINFO* pCuInfo,
  356. IN HWND hwndStAreaCodes,
  357. IN HWND hwndClbAreaCodes,
  358. IN HWND hwndStPhoneNumber,
  359. IN HWND hwndEbPhoneNumber,
  360. IN HWND hwndStCountryCodes,
  361. IN HWND hwndLbCountryCodes,
  362. IN HWND hwndCbUseDialingRules,
  363. IN HWND hwndPbDialingRules,
  364. IN HWND hwndPbAlternates,
  365. IN HWND hwndStComment,
  366. IN HWND hwndEbComment,
  367. IN DTLLIST* pListAreaCodes );
  368. VOID
  369. CuSaveToAreaCodeList(
  370. IN CUINFO* pCuInfo,
  371. IN TCHAR* pszAreaCode );
  372. VOID
  373. CuSetInfo(
  374. IN CUINFO* pCuInfo,
  375. IN DTLNODE* pPhoneNode,
  376. IN BOOL fDisableAll );
  377. VOID
  378. CuUpdateAreaCodeClb(
  379. IN CUINFO* pCuInfo );
  380. VOID
  381. CuUpdateCountryCodeLb(
  382. IN CUINFO* pCuInfo,
  383. IN BOOL fComplete );
  384. BOOL
  385. SuBrowsePbHandler(
  386. IN SUINFO* pSuInfo,
  387. IN WORD wNotification );
  388. BOOL
  389. SuEditPbHandler(
  390. IN SUINFO* pSuInfo,
  391. IN WORD wNotification );
  392. VOID
  393. SuEditScpScript(
  394. IN HWND hwndOwner,
  395. IN TCHAR* pszScript );
  396. VOID
  397. SuEditSwitchInf(
  398. IN HWND hwndOwner );
  399. VOID
  400. SuFillDoubleScriptsList(
  401. IN SUINFO* pSuInfo );
  402. VOID
  403. SuFillScriptsList(
  404. IN EINFO* pEinfo,
  405. IN HWND hwndLbScripts,
  406. IN TCHAR* pszSelection );
  407. VOID
  408. SuFree(
  409. IN SUINFO* pSuInfo );
  410. VOID
  411. SuGetInfo(
  412. IN SUINFO* pSuInfo,
  413. OUT BOOL* pfScript,
  414. OUT BOOL* pfTerminal,
  415. OUT TCHAR** ppszScript );
  416. VOID
  417. SuInit(
  418. IN SUINFO* pSuInfo,
  419. IN HWND hwndCbRunScript,
  420. IN HWND hwndCbTerminal,
  421. IN HWND hwndLbScripts,
  422. IN HWND hwndPbEdit,
  423. IN HWND hwndPbBrowse,
  424. IN DWORD dwFlags);
  425. DWORD
  426. SuLoadScpScriptsList(
  427. OUT DTLLIST** ppList );
  428. BOOL
  429. SuScriptsCbHandler(
  430. IN SUINFO* pSuInfo,
  431. IN WORD wNotification );
  432. VOID
  433. SuSetInfo(
  434. IN SUINFO* pSuInfo,
  435. IN BOOL fScript,
  436. IN BOOL fTerminal,
  437. IN TCHAR* pszScript );
  438. VOID
  439. SuUpdateScriptControls(
  440. IN SUINFO* pSuInfo );
  441. #endif // _ENTRY_H_