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.

1009 lines
27 KiB

  1. // Copyright (c) 1995, Microsoft Corporation, all rights reserved
  2. //
  3. // pbk.h
  4. // Remote Access phonebook file (.PBK) library
  5. // Public header
  6. //
  7. // 06/20/95 Steve Cobb
  8. #ifndef _PBK_H_
  9. #define _PBK_H_
  10. #include <windows.h> // Win32 core
  11. #include <nouiutil.h> // No-HWNDs utility library
  12. #include <ras.h> // Win32 RAS
  13. #include <raserror.h> // Win32 RAS error codes
  14. #include <rasfile.h> // RAS configuration file library
  15. #include <rasman.h> // RAS Manager library
  16. #include <rpc.h> // UUID support
  17. #include <rasapip.h>
  18. //----------------------------------------------------------------------------
  19. // Constants
  20. //----------------------------------------------------------------------------
  21. #define GLOBALSECTIONNAME "."
  22. #define GLOBALSECTIONNAMENEW ".GlobalSection"
  23. #define PREFIXSECTIONNAME ".Prefix"
  24. #define SUFFIXSECTIONNAME ".Suffix"
  25. #define GROUPID_Media "MEDIA="
  26. #define GROUPKEY_Media "MEDIA"
  27. #define GROUPID_Device "DEVICE="
  28. #define GROUPKEY_Device "DEVICE"
  29. #define GROUPID_NetComponents "NETCOMPONENTS="
  30. #define GROUPKEY_NetComponents "NETCOMPONENTS"
  31. // Project-specific maximums
  32. //
  33. // Note that the pbk and API use a different redial maximum than the RasDlg UI.
  34. #define MAX_UI_REDIAL_ATTEMPTS 99
  35. #define MAX_UI_REDIAL_CHARS 2
  36. #define RAS_MaxRedialCount 999999999
  37. #define RAS_RedialPause10m 600 // 600 seconds=10 min
  38. // Pbport flags
  39. //
  40. #define PBP_F_PptpDevice 0x00000001
  41. #define PBP_F_L2tpDevice 0x00000002
  42. #define PBP_F_NullModem 0x00000004
  43. #define PBP_F_BogusDevice 0x00000008 // pmay: 233287
  44. #define PBP_F_PPPoEDevice 0x00000010 // gangz:whistler 345068
  45. // ReadPhonebookFile flags
  46. //
  47. #define RPBF_ReadOnly 0x00000001
  48. #define RPBF_HeadersOnly 0x00000002
  49. #define RPBF_NoList 0x00000004
  50. #define RPBF_NoCreate 0x00000008
  51. #define RPBF_Router 0x00000010
  52. #define RPBF_NoUser 0x00000020
  53. #define RPBF_HeaderType 0x00000040
  54. #define RPBF_AllUserPbk 0x00000080 // If no path, then global .pbk 346918
  55. // PBENTRY.dwUsage
  56. #define PBK_ENTRY_USE_F_Internet 0x1 // connection to Internet
  57. // Base protocol definitions (see dwBaseProtocol).
  58. //
  59. #define BP_Ppp 1
  60. #define BP_Slip 2
  61. #define BP_Ras 3
  62. #ifdef AMB
  63. // Authentication strategy definitions (see dwAuthentication).
  64. //
  65. #define AS_Default -1
  66. #define AS_PppThenAmb 0
  67. #define AS_AmbThenPpp 1
  68. #define AS_PppOnly 2
  69. #define AS_AmbOnly 3
  70. #endif
  71. // Net protocol bit definitions (see dwfExcludedProtocols)
  72. //
  73. // (The NP_* definitions have moved to nouiutil.h with the
  74. // GetInstalledProtocols routine)
  75. // IP address source definitions (see dwIpAddressSource)
  76. //
  77. #define ASRC_ServerAssigned 1 // For router means "the ones in NCPA"
  78. #define ASRC_RequireSpecific 2
  79. #define ASRC_None 3 // Router only
  80. // Security restrictions on authentication (see dwAuthRestrictions)
  81. //
  82. // Note: AR_AuthTerminal is defunct and is not written to the phonebook by the
  83. // new library. It is, however, read and translated into AR_AuthAny,
  84. // fAutoLogon=0, and an after dialing terminal.
  85. //
  86. // Note: The AR_AuthXXX ordinals are replaced with AR_F_AuthXXX flags in NT5
  87. // to support the fact that these flags are not mutually exclusive.
  88. // You'll know if you need to upgrade the dwAuthRestrictions variable
  89. // because old phone books have this value set to 0 or have some of the
  90. // bottom 3 bits set.
  91. //
  92. // Note: The AR_F_AuthCustom bit is used a little differently. It indicates
  93. // that the settings are made in "advanced" mode rather than "typical"
  94. // mode. In "typical" mode the bits MUST correspond to one of the
  95. // AR_F_TypicalXxx sets.
  96. //
  97. // Note: The AR_F_AuthEAP bit is mutually exclusive of all other bits, except
  98. // the AR_F_AuthCustom bit. When AR_F_AuthEap is specified without the
  99. // AR_F_AuthCustom bit EAP_TLS_PROTOCOL should be assumed.
  100. //
  101. // Note: The AR_F_AuthW95MSCHAP flag will not be set in the UI unless
  102. // AR_F_AuthMSCHAP is set. This is a usability decision to steer user
  103. // away from misinterpreting the meaning of the W95 bit.
  104. //
  105. // The old scalar values (which should no eliminated from all non-PBK-upgrade
  106. // code).
  107. //
  108. #define AR_AuthAny 0 // Upgrade to AR_F_TypicalUnsecure
  109. #define AR_AuthTerminal 1 // Eliminate during upgrade
  110. #define AR_AuthEncrypted 2 // Upgrade to AR_F_TypicalSecure
  111. #define AR_AuthMsEncrypted 3 // Upgrade to AR_F_AuthMSCHAP
  112. #define AR_AuthCustom 4 // Upgrade ORs in AR_F_AuthEAP
  113. // The new bitmask style flags.
  114. //
  115. #define AR_F_AuthPAP 0x00000008
  116. #define AR_F_AuthSPAP 0x00000010
  117. #define AR_F_AuthMD5CHAP 0x00000020
  118. #define AR_F_AuthMSCHAP 0x00000040
  119. #define AR_F_AuthEAP 0x00000080 // See note above
  120. #define AR_F_AuthCustom 0x00000100 // See note above
  121. #define AR_F_AuthMSCHAP2 0x00000200
  122. #define AR_F_AuthW95MSCHAP 0x00000400 // See note above
  123. // the bitmask for IPSec Policy
  124. #define AR_F_IpSecPSK 0x1
  125. #define AR_F_IpSecUserCerts 0x2
  126. #define AR_F_IpSecSpecificCerts 0x4
  127. #define AR_F_AuthAnyMSCHAP (AR_F_AuthMSCHAP | AR_F_AuthW95MSCHAP | AR_F_AuthMSCHAP2)
  128. #define AR_F_AuthNoMPPE (AR_F_AuthPAP | AR_F_AuthSPAP | AR_F_AuthMD5CHAP)
  129. // "Typical" authentication setting masks. See 'dwAuthRestrictions'.
  130. //
  131. #define AR_F_TypicalUnsecure (AR_F_AuthPAP | AR_F_AuthSPAP | AR_F_AuthMD5CHAP | AR_F_AuthMSCHAP | AR_F_AuthMSCHAP2)
  132. #define AR_F_TypicalSecure (AR_F_AuthMD5CHAP | AR_F_AuthMSCHAP | AR_F_AuthMSCHAP2)
  133. #define AR_F_TypicalCardOrCert (AR_F_AuthEAP)
  134. // "Typical" authentication setting constants. See 'dwTypicalAuth'.
  135. //
  136. #define TA_Unsecure 1
  137. #define TA_Secure 2
  138. #define TA_CardOrCert 3
  139. // Script mode (see dwScriptMode)
  140. //
  141. #define SM_None 0
  142. #define SM_Terminal 1
  143. #define SM_ScriptWithTerminal 2
  144. #define SM_ScriptOnly 3
  145. // Miscellaneous "no value" constants.
  146. //
  147. #define XN_None 0 // No X25 network
  148. #define CPW_None -1 // No cached password
  149. // Description field. Move to ras.h if/when supported by
  150. // RasGet/SetEntryProperties API.
  151. //
  152. #define RAS_MaxDescription 200
  153. // 'OverridePref' bits. Set indicates the corresponding value read from the
  154. // phonebook should be used. Clear indicates the global user preference
  155. // should be used.
  156. //
  157. #define RASOR_RedialAttempts 0x00000001 // Always set in NT5
  158. #define RASOR_RedialSeconds 0x00000002 // Always set in NT5
  159. #define RASOR_IdleDisconnectSeconds 0x00000004 // Always set in NT5
  160. #define RASOR_RedialOnLinkFailure 0x00000008 // Always set in NT5
  161. #define RASOR_PopupOnTopWhenRedialing 0x00000010
  162. #define RASOR_CallbackMode 0x00000020
  163. // 'DwDataEncryption' codes. These are now bitmask-ish for the convenience of
  164. // the UI in building capability masks, though more than one bit will never be
  165. // set in 'dwDataEncryption'.
  166. //
  167. #define DE_None 0x00000000 // Do not encrypt
  168. #define DE_IfPossible 0x00000008 // Request encryption but none OK
  169. #define DE_Require 0x00000100 // Require encryption of any strength
  170. #define DE_RequireMax 0x00000200 // Require maximum strength encryption
  171. // The following bit values are now defunct and are converted during phonebook
  172. // upgrade to one of the above set. References should be eliminated from
  173. // non-PBK code.
  174. //
  175. #define DE_Mppe40bit 0x00000001 // Old DE_Weak. Setting for "Always encrypt data"
  176. #define DE_Mppe128bit 0x00000002 // Old De_Strong. Setting for "Always encrypt data"
  177. #define DE_IpsecDefault 0x00000004 // Setting for "Always encrypt data" for l2tp
  178. #define DE_VpnAlways 0x00000010 // Setting for vpn conn to "Always encrypt data"
  179. #define DE_PhysAlways (DE_Mppe40bit | DE_Mppe128bit)
  180. // 'dwDnsFlags' settings
  181. //
  182. // Used to determine the dns suffix registration behavior for an entry
  183. //
  184. // When 'dwDnsFlags' is 0, it means 'do not register'
  185. //
  186. #define DNS_RegPrimary 0x1 // register w/ primary domain suffix
  187. #define DNS_RegPerConnection 0x2 // register w/ per-connection suffix
  188. #define DNS_RegDhcpInform 0x4 // register w/ dhcp informed suffix
  189. #define DNS_RegDefault (DNS_RegPrimary)
  190. // 'dwIpNbtFlags' settings
  191. //
  192. // Used to determine the whether to enable nbt over tcpip for the connection
  193. //
  194. #define PBK_ENTRY_IP_NBT_Enable 1
  195. //-----------------------------------------------------------------------------
  196. // Data types
  197. //-----------------------------------------------------------------------------
  198. // Provides shorthand to identify devices without re-parsing RAS Manager
  199. // strings. "Other" is anything not recognized as another specific type.
  200. //
  201. // Note: This datatype is stored in the registry preferences so the values
  202. // must not change over time. For this reason, I have hard-coded the
  203. // value of each enumberated type.
  204. //
  205. typedef enum
  206. _PBDEVICETYPE
  207. {
  208. PBDT_None = 0,
  209. PBDT_Null = 1,
  210. PBDT_Other = 2,
  211. PBDT_Modem = 3,
  212. PBDT_Pad = 4,
  213. PBDT_Switch = 5,
  214. PBDT_Isdn = 6,
  215. PBDT_X25 = 7,
  216. PBDT_ComPort = 8, // added for dcc wizard (nt5)
  217. PBDT_Irda = 10, // added for nt5
  218. PBDT_Vpn = 11,
  219. PBDT_Serial = 12,
  220. PBDT_Atm = 13,
  221. PBDT_Parallel = 14,
  222. PBDT_Sonet = 15,
  223. PBDT_Sw56 = 16,
  224. PBDT_FrameRelay = 17,
  225. PBDT_PPPoE = 18
  226. }
  227. PBDEVICETYPE;
  228. // RAS port information read from RASMAN.
  229. //
  230. // Each port (and link) is uniquely identified by port name. If it were only
  231. // that simple...
  232. //
  233. // In the old RAS model, the port name was the unique identifier that was
  234. // presented to the user, and the user can have two same-type devices on two
  235. // different ports.
  236. //
  237. // In TAPI/Unimodem, the "friendly" device name is the unique identifier
  238. // that's presented to the user and the corresponding port is a property of
  239. // the device. If the port is changed and you dial it still finds the device
  240. // you originally selected. If you swap two devices on two ports it uses the
  241. // one with the matching unique device name. NT5 will follow this model.
  242. //
  243. typedef struct
  244. _PBPORT
  245. {
  246. // The port name is always unique, if configured. Unconfigured port names
  247. // might not be unique. This is never NULL.
  248. //
  249. TCHAR* pszPort;
  250. // Indicates the port is actually configured and not a remnant of an old
  251. // configuration read from the phonebook.
  252. //
  253. BOOL fConfigured;
  254. // The device name is the one from RASMAN when 'fConfigured' or the one
  255. // from the phonebook if not. May be NULL with unconfigured ports as it
  256. // was not stored in old phonebooks.
  257. //
  258. TCHAR* pszDevice;
  259. // The media as it appears in the MEDIA= lines in the phonebook. This is
  260. // usually but not always (for obscure historical reasons) the same as the
  261. // RASMAN media. See PbMedia.
  262. //
  263. TCHAR* pszMedia;
  264. // Shorthand device type code derived from the RASMAN device type string.
  265. //
  266. PBDEVICETYPE pbdevicetype;
  267. // RASET_* entry type code of the link. This is provided for the
  268. // convenience of the UI during link configuration.
  269. //
  270. DWORD dwType;
  271. // PBP_F_* flags that yield additional information concerning this port
  272. // that may be of use in rendering UI.
  273. DWORD dwFlags;
  274. // These are default settings read from RASMAN and are valid for modems
  275. // only. See AppendPbportToList.
  276. //
  277. DWORD dwBpsDefault;
  278. BOOL fHwFlowDefault;
  279. BOOL fEcDefault;
  280. BOOL fEccDefault;
  281. DWORD fSpeakerDefault;
  282. DWORD dwModemProtDefault;
  283. DTLLIST* pListProtocols;
  284. // These are valid only for modems.
  285. //
  286. BOOL fScriptBeforeTerminal;
  287. BOOL fScriptBefore;
  288. TCHAR* pszScriptBefore;
  289. }
  290. PBPORT;
  291. // Phonebook entry link phone number information.
  292. //
  293. typedef struct
  294. _PBPHONE
  295. {
  296. TCHAR* pszAreaCode;
  297. DWORD dwCountryCode;
  298. DWORD dwCountryID;
  299. TCHAR* pszPhoneNumber;
  300. BOOL fUseDialingRules;
  301. TCHAR* pszComment;
  302. }
  303. PBPHONE;
  304. // Phonebook entry link information. One per link, multiple per multi-link.
  305. //
  306. typedef struct
  307. _PBLINK
  308. {
  309. // Information about the port/device to which this link is attached.
  310. //
  311. PBPORT pbport;
  312. // These fields are set for modems only. See SetDefaultModemSettings.
  313. //
  314. DWORD dwBps;
  315. BOOL fHwFlow;
  316. BOOL fEc;
  317. BOOL fEcc;
  318. DWORD fSpeaker;
  319. DWORD dwModemProtocol; // pmay: 228565
  320. // These fields are set for ISDN only. 'LChannels' and 'fCompression' are
  321. // not used unless 'fProprietaryIsdn' is set.
  322. //
  323. BOOL fProprietaryIsdn;
  324. LONG lLineType;
  325. BOOL fFallback;
  326. BOOL fCompression;
  327. LONG lChannels;
  328. // Address and size of opaque device configuration block created/edited by
  329. // TAPI. Currently, there are no TAPI devices that provide blob-editing
  330. // acceptable to RAS so these field are unused.
  331. //
  332. BYTE* pTapiBlob;
  333. DWORD cbTapiBlob;
  334. // Phone number information for the link.
  335. //
  336. // Note: The 'iLastSelectedPhone' field is used only when
  337. // 'fTryNextAlternateOnFail' is clear. Otherwise, it is ignored and
  338. // assumed 0 (top of list). See bug 150958.
  339. //
  340. DTLLIST* pdtllistPhones;
  341. DWORD iLastSelectedPhone;
  342. BOOL fPromoteAlternates;
  343. BOOL fTryNextAlternateOnFail;
  344. // Indicates the link is enabled. All links appearing in the file are
  345. // enabled. This is provided for the convenience of the UI during link
  346. // configuration.
  347. //
  348. BOOL fEnabled;
  349. }
  350. PBLINK;
  351. // Phonebook entry information.
  352. //
  353. typedef struct
  354. _PBENTRY
  355. {
  356. // Arbitrary name of entry and it's RASET_* entry type code.
  357. //
  358. TCHAR* pszEntryName;
  359. DWORD dwType;
  360. // General page fields.
  361. //
  362. DTLLIST* pdtllistLinks;
  363. BOOL fSharedPhoneNumbers;
  364. BOOL fGlobalDeviceSettings; // whistler bug 281306
  365. BOOL fShowMonitorIconInTaskBar;
  366. TCHAR* pszPrerequisiteEntry;
  367. TCHAR* pszPrerequisitePbk;
  368. TCHAR* pszPreferredPort;
  369. TCHAR* pszPreferredDevice;
  370. //For .Net 639551
  371. //
  372. DWORD dwPreferredBps; // Port Speed
  373. BOOL fPreferredHwFlow; // Hardware Flow Control
  374. BOOL fPreferredEc; // Error control protocol
  375. BOOL fPreferredEcc; // Compression Control
  376. DWORD fPreferredSpeaker; // Enable Modem Speaker
  377. DWORD dwPreferredModemProtocol; //For whislter bug 402522
  378. // Options page fields.
  379. //
  380. // Note: Fields marked (1) are ignored when 'fAutoLogon' is set. Field
  381. // marked (2) *may* be set when 'fPreviewUserPw' is not also set.
  382. // In this case it means to include the domain in the authentication
  383. // but to to prompt only when the 'fPreviewUserPw' is set.
  384. // Otherwise, "save PW" with a domain does not include the domain
  385. // (MarkL problem) which is wrong. See also bug 212963 and 261374.
  386. //
  387. BOOL fShowDialingProgress;
  388. BOOL fPreviewUserPw; // See above: 1
  389. BOOL fPreviewDomain; // See above: 1, 2
  390. BOOL fPreviewPhoneNumber;
  391. DWORD dwDialMode;
  392. DWORD dwDialPercent;
  393. DWORD dwDialSeconds;
  394. DWORD dwHangUpPercent;
  395. DWORD dwHangUpSeconds;
  396. // How the connection was configured to be used.
  397. //
  398. DWORD dwUseFlags; // See PBK_ENTRY_USE_F_*
  399. // IPSec Policy fields for whisler bug 193987 gangz
  400. //
  401. DWORD dwIpSecFlags;
  402. // These fields are used in place of the equivalent user preference only
  403. // when the corresponding 'dwfOverridePref' bit is set. In NT5, the
  404. // indicated fields become always per-entry, i.e. the corresponding
  405. // override bits are always set.
  406. //
  407. DWORD dwfOverridePref;
  408. DWORD dwRedialAttempts; // Always per-entry in NT5
  409. DWORD dwRedialSeconds; // Always per-entry in NT5
  410. LONG lIdleDisconnectSeconds; // Always per-entry in NT5
  411. BOOL fRedialOnLinkFailure; // Always per-entry in NT5
  412. // Security page fields.
  413. //
  414. DWORD dwAuthRestrictions;
  415. DWORD dwVpnStrategy; // Valid for vpn entries only. see VS_xxx
  416. DWORD dwDataEncryption;
  417. BOOL fAutoLogon; // See dependencies on Option page flags
  418. BOOL fUseRasCredentials;
  419. // The selection in the "Typical" security listbox. This is for the UI's
  420. // use only. Others should refer to 'dwAuthRestrictions' for this
  421. // information.
  422. //
  423. DWORD dwTypicalAuth;
  424. // Note: CustomAuth fields have meaning only when dwAuthRestrictions
  425. // includes AR_F_AuthCustom. If the AR_F_Eap flag is set without
  426. // AR_F_AuthCustom, it should be assumed to be the
  427. // 'EAPCFG_DefaultKey' protocol, currently EAP_TLS_PROTOCOL.
  428. //
  429. DWORD dwCustomAuthKey;
  430. BYTE* pCustomAuthData;
  431. DWORD cbCustomAuthData;
  432. BOOL fScriptAfterTerminal;
  433. BOOL fScriptAfter;
  434. TCHAR* pszScriptAfter;
  435. DWORD dwCustomScript;
  436. TCHAR* pszX25Network;
  437. TCHAR* pszX25Address;
  438. TCHAR* pszX25UserData;
  439. TCHAR* pszX25Facilities;
  440. // Network page fields.
  441. //
  442. DWORD dwBaseProtocol;
  443. DWORD dwfExcludedProtocols;
  444. BOOL fLcpExtensions;
  445. BOOL fSwCompression;
  446. BOOL fNegotiateMultilinkAlways;
  447. BOOL fSkipNwcWarning;
  448. BOOL fSkipDownLevelDialog;
  449. BOOL fSkipDoubleDialDialog;
  450. BOOL fShareMsFilePrint;
  451. BOOL fBindMsNetClient;
  452. // List of KEYVALUE nodes containing any key/value pairs found in the
  453. // NETCOMPONENT group of the entry.
  454. //
  455. DTLLIST* pdtllistNetComponents;
  456. #ifdef AMB
  457. // Note: dwAuthentication is read-only. The phonebook file value of this
  458. // parameter is set by the RasDial API based on the result of
  459. // authentication attempts.
  460. //
  461. DWORD dwAuthentication;
  462. #endif
  463. // TCPIP settings sheet PPP or SLIP configuration information.
  464. // 'DwBaseProtocol' determines which.
  465. //
  466. BOOL fIpPrioritizeRemote;
  467. BOOL fIpHeaderCompression;
  468. TCHAR* pszIpAddress;
  469. TCHAR* pszIpDnsAddress;
  470. TCHAR* pszIpDns2Address;
  471. TCHAR* pszIpWinsAddress;
  472. TCHAR* pszIpWins2Address;
  473. DWORD dwIpAddressSource; // PPP only
  474. DWORD dwIpNameSource; // PPP only
  475. DWORD dwFrameSize; // SLIP only
  476. DWORD dwIpDnsFlags; // DNS_* values
  477. DWORD dwIpNbtFlags; // PBK_ENTRY_IP_NBT_*
  478. DWORD dwTcpWindowSize; // Whistler bug 300933. 0=default
  479. TCHAR* pszIpDnsSuffix; // The dns suffix for this connection
  480. // Router page.
  481. //
  482. DWORD dwCallbackMode;
  483. BOOL fAuthenticateServer;
  484. // Other fields not shown in UI.
  485. //
  486. TCHAR* pszCustomDialDll;
  487. TCHAR* pszCustomDialFunc;
  488. //
  489. // custom dialer name
  490. //
  491. TCHAR* pszCustomDialerName;
  492. // The UID of the cached password is fixed at entry creation. The GUID is
  493. // also created at entry creation and used for inter-machine uniqueness.
  494. // This is currently used to identify an IP configuration to the external
  495. // TCP/IP dialogs.
  496. //
  497. DWORD dwDialParamsUID;
  498. GUID* pGuid;
  499. // To translate user's old entries, the user name and domain are read and
  500. // used as authentication defaults if no cached credentials exist. They
  501. // are not rewritten to the entry.
  502. //
  503. TCHAR* pszOldUser;
  504. TCHAR* pszOldDomain;
  505. // Status flags. 'fDirty' is set when the entry has changed so as to
  506. // differ from the phonebook file on disk. 'fCustom' is set when the
  507. // entry contains a MEDIA and DEVICE (so RASAPI is able to read it) but
  508. // was not created by us. When 'fCustom' is set only 'pszEntry' is
  509. // guaranteed valid and the entry cannot be edited.
  510. //
  511. BOOL fDirty;
  512. BOOL fCustom;
  513. }
  514. PBENTRY;
  515. // Phonebook (.PBK) file information.
  516. //
  517. typedef struct
  518. _PBFILE
  519. {
  520. // Handle of phone book file.
  521. //
  522. HRASFILE hrasfile;
  523. // Fully qualified path to the phonebook.
  524. //
  525. TCHAR* pszPath;
  526. // Phonebook mode, system, personal, or alternate.
  527. //
  528. DWORD dwPhonebookMode;
  529. // Unsorted list of PBENTRY. The list is manipulated by the Entry
  530. // dialogs.
  531. //
  532. DTLLIST* pdtllistEntries;
  533. HANDLE hConnection;
  534. }
  535. PBFILE;
  536. typedef void (WINAPI *PBKENUMCALLBACK)( PBFILE *, VOID * );
  537. // The callback number for a device. This type is a node in the
  538. // 'pdllistCallbackNumbers' below.
  539. //
  540. typedef struct
  541. _CALLBACKNUMBER
  542. {
  543. TCHAR* pszDevice;
  544. TCHAR* pszCallbackNumber;
  545. }
  546. CALLBACKNUMBER;
  547. //----------------------------------------------------------------------------
  548. // Prototypes
  549. //----------------------------------------------------------------------------
  550. VOID
  551. ChangeEntryType(
  552. PBENTRY* ppbentry,
  553. DWORD dwType );
  554. DTLNODE*
  555. CloneEntryNode(
  556. DTLNODE* pdtlnodeSrc );
  557. VOID
  558. ClosePhonebookFile(
  559. IN OUT PBFILE* pFile );
  560. DWORD
  561. CopyToPbport(
  562. IN PBPORT* ppbportDst,
  563. IN PBPORT* ppbportSrc );
  564. DTLNODE*
  565. CreateEntryNode(
  566. BOOL fCreateLink );
  567. DTLNODE*
  568. CreateLinkNode(
  569. void );
  570. DTLNODE*
  571. CreatePhoneNode(
  572. void );
  573. DTLNODE*
  574. CreatePortNode(
  575. void );
  576. VOID
  577. DestroyEntryNode(
  578. IN DTLNODE* pdtlnode );
  579. VOID
  580. DestroyEntryTypeNode(
  581. IN DTLNODE *pdtlnode );
  582. VOID
  583. DestroyLinkNode(
  584. IN DTLNODE* pdtlnode );
  585. VOID
  586. DestroyPhoneNode(
  587. IN DTLNODE* pdtlnode );
  588. VOID
  589. DestroyPortNode(
  590. IN DTLNODE* pdtlnode );
  591. VOID
  592. DestroyProtocolNode(
  593. IN DTLNODE* pdtlnode );
  594. DTLNODE*
  595. DuplicateEntryNode(
  596. DTLNODE* pdtlnodeSrc );
  597. DTLNODE*
  598. DuplicateLinkNode(
  599. IN DTLNODE* pdtlnodeSrc );
  600. DTLNODE*
  601. DuplicatePhoneNode(
  602. IN DTLNODE* pdtlnodeSrc );
  603. DTLNODE*
  604. DuplicateProtocolNode(
  605. IN DTLNODE* pdtlnodeSrc );
  606. VOID
  607. EnableOrDisableNetComponent(
  608. IN PBENTRY* pEntry,
  609. IN LPCTSTR pszComponent,
  610. IN BOOL fEnable);
  611. BOOL
  612. FIsNetComponentListed(
  613. IN PBENTRY* pEntry,
  614. IN LPCTSTR pszComponent,
  615. OUT BOOL* pfEnabled,
  616. OUT KEYVALUE** ppKv);
  617. DTLNODE*
  618. EntryNodeFromName(
  619. IN DTLLIST* pdtllistEntries,
  620. IN LPCTSTR pszName );
  621. DWORD
  622. EntryTypeFromPbport(
  623. IN PBPORT* ppbport );
  624. BOOL
  625. GetDefaultPhonebookPath(
  626. IN DWORD dwFlags,
  627. OUT TCHAR** ppszPath );
  628. DWORD
  629. GetOverridableParam(
  630. IN PBUSER* pUser,
  631. IN PBENTRY* pEntry,
  632. IN DWORD dwfRasorBit );
  633. BOOL
  634. GetPhonebookPath(
  635. IN PBUSER* pUser,
  636. IN DWORD dwFlags,
  637. OUT TCHAR** ppszPath,
  638. OUT DWORD* pdwPhonebookMode );
  639. BOOL
  640. GetPhonebookDirectory(
  641. IN DWORD dwPhonebookMode,
  642. OUT TCHAR* pszPathBuf );
  643. BOOL
  644. GetPersonalPhonebookPath(
  645. IN TCHAR* pszFile,
  646. OUT TCHAR* pszPathBuf );
  647. BOOL
  648. GetPublicPhonebookPath(
  649. OUT TCHAR* pszPathBuf );
  650. DWORD
  651. InitializePbk(
  652. void );
  653. DWORD
  654. InitPersonalPhonebook(
  655. OUT TCHAR** ppszFile );
  656. BOOL
  657. IsPublicPhonebook(
  658. IN LPCTSTR pszPhonebookPath );
  659. DWORD
  660. ReadEntryFromSystem(
  661. IN LPCTSTR pszPhonebook,
  662. IN LPCTSTR pszEntry,
  663. IN DWORD dwFlags,
  664. IN OUT PBFILE *pFile,
  665. OUT DTLNODE **ppdtlnode,
  666. OUT OPTIONAL WCHAR **ppszFullPath);
  667. DWORD
  668. GetPbkAndEntryName(
  669. IN LPCTSTR pszPhonebook,
  670. IN LPCTSTR pszEntry,
  671. IN DWORD dwFlags,
  672. OUT PBFILE *pFile,
  673. OUT DTLNODE **ppdtlnode);
  674. DWORD
  675. LoadPadsList(
  676. OUT DTLLIST** ppdtllistPads );
  677. DWORD
  678. LoadPhonebookFile(
  679. IN TCHAR* pszPhonebookPath,
  680. IN TCHAR* pszSection,
  681. IN BOOL fHeadersOnly,
  682. IN BOOL fReadOnly,
  683. OUT HRASFILE* phrasfile,
  684. OUT BOOL* pfPersonal );
  685. DWORD
  686. LoadPortsList(
  687. OUT DTLLIST** ppdtllistPorts );
  688. DWORD
  689. LoadPortsList2(
  690. IN HANDLE hConnection,
  691. OUT DTLLIST** ppdtllistPorts,
  692. IN BOOL fRouter );
  693. DWORD
  694. LoadScriptsList(
  695. IN HANDLE hConnection,
  696. OUT DTLLIST** ppdtllistScripts );
  697. PBDEVICETYPE
  698. PbdevicetypeFromPszType(
  699. IN TCHAR* pszDeviceType );
  700. PBDEVICETYPE
  701. PbdevicetypeFromPszTypeA(
  702. IN CHAR* pszDeviceType );
  703. PBPORT*
  704. PpbportFromPortAndDeviceName(
  705. IN DTLLIST* pdtllistPorts,
  706. IN TCHAR* pszPort,
  707. IN TCHAR* pszDevice );
  708. PBPORT*
  709. PpbportFromNT4PortandDevice(
  710. IN DTLLIST* pdtlllistPorts,
  711. IN TCHAR* pszPort,
  712. IN TCHAR* pszDevice);
  713. DWORD
  714. RdtFromPbdt(PBDEVICETYPE pbdt,
  715. DWORD dwFlags);
  716. DWORD
  717. CalculatePhonebookPath(
  718. IN LPCTSTR pszPhonebookPath,
  719. IN PBUSER* pUser,
  720. IN DWORD dwFlags,
  721. OUT DWORD* lpdwMode,
  722. OUT LPTSTR* ppszFullPath);
  723. DWORD
  724. ReadPhonebookFile(
  725. IN LPCTSTR pszPhonebookPath,
  726. IN PBUSER* pUser,
  727. IN LPCTSTR pszSection,
  728. IN DWORD dwFlags,
  729. OUT PBFILE* pFile );
  730. TCHAR *pszDeviceTypeFromRdt(
  731. RASDEVICETYPE rdt);
  732. BOOL
  733. SetDefaultModemSettings(
  734. IN PBLINK* pLink );
  735. DWORD
  736. SetPersonalPhonebookInfo(
  737. IN BOOL fPersonal,
  738. IN TCHAR* pszPath );
  739. VOID
  740. TerminatePbk(
  741. void );
  742. DWORD
  743. WritePhonebookFile(
  744. IN PBFILE* pFile,
  745. IN LPCTSTR pszSectionToDelete );
  746. DWORD
  747. UpgradePhonebookFile(
  748. IN LPCTSTR pszPhonebookPath,
  749. IN PBUSER* pUser,
  750. OUT BOOL* pfUpgraded );
  751. BOOL
  752. ValidateAreaCode(
  753. IN OUT TCHAR* pszAreaCode );
  754. BOOL
  755. ValidateEntryName(
  756. IN LPCTSTR pszEntry );
  757. BOOL
  758. IsRouterPhonebook(LPCTSTR pszPhonebook);
  759. DWORD
  760. DwPbentryToDetails(
  761. IN PBENTRY* pEntry,
  762. IN LPCWSTR pszPhonebookPath,
  763. IN BOOL fIsAllUsersPbk,
  764. OUT RASENUMENTRYDETAILS* pDetails);
  765. DWORD
  766. DwSendRasNotification(
  767. IN RASEVENTTYPE Type,
  768. IN PBENTRY* pEntry,
  769. IN LPCTSTR pszPhonebookPath,
  770. IN HANDLE hData); // Extra Type-specific info
  771. DWORD
  772. DwGetCustomDllEntryPoint(
  773. LPCTSTR lpszPhonebook,
  774. LPCTSTR lpszEntry,
  775. BOOL *pfCustomDllSpecified,
  776. FARPROC *pfnCustomEntryPoint,
  777. HINSTANCE *phInstDll,
  778. DWORD dwFnId,
  779. LPTSTR pszCustomDialerName
  780. );
  781. DWORD
  782. DwCustomDialDlg(
  783. LPTSTR lpszPhonebook,
  784. LPTSTR lpszEntry,
  785. LPTSTR lpszPhoneNumber,
  786. LPRASDIALDLG lpInfo,
  787. DWORD dwFlags,
  788. BOOL *pfStatus,
  789. PVOID pvInfo,
  790. LPTSTR pszCustomDialer);
  791. DWORD
  792. DwCustomEntryDlg(
  793. LPTSTR lpszPhonebook,
  794. LPTSTR lpszEntry,
  795. LPRASENTRYDLG lpInfo,
  796. BOOL *pfStatus);
  797. DWORD
  798. DwCustomDeleteEntryNotify(
  799. LPCTSTR lpszPhonebook,
  800. LPCTSTR lpszEntry,
  801. LPTSTR pszCustomDialer);
  802. DWORD
  803. DwGetExpandedDllPath(LPTSTR pszDllPath,
  804. LPTSTR *ppszExpandedDllPath);
  805. DWORD
  806. DwGetEntryMode( LPCTSTR pszPhonebook,
  807. LPCTSTR pszEntry,
  808. PBFILE *pFileIn,
  809. DWORD *pdwFlags);
  810. DWORD
  811. DwEnumeratePhonebooksFromDirectory(
  812. TCHAR *pszDir,
  813. DWORD dwFlags,
  814. PBKENUMCALLBACK pfnCallback,
  815. VOID *pvContext
  816. );
  817. DWORD
  818. DwGetCustomAuthData(
  819. PBENTRY *pEntry,
  820. DWORD *pcbCustomAuthData,
  821. PBYTE *ppCustomAuthData
  822. );
  823. DWORD
  824. DwSetCustomAuthData(
  825. PBENTRY *pEntry,
  826. DWORD cbCustomAuthData,
  827. PBYTE pCustomAuthData
  828. );
  829. DWORD
  830. DwCustomTerminalDlg(
  831. TCHAR *pszPhonebook,
  832. HRASCONN hrasconn,
  833. PBENTRY *pEntry,
  834. HWND hwndDlg,
  835. RASDIALPARAMS *prdp,
  836. PVOID pvReserved
  837. );
  838. DWORD
  839. DwGetVpnDeviceName(
  840. DWORD dwVpnStrategy,
  841. WCHAR *pszDeviceDefault,
  842. WCHAR *pszDeviceName);
  843. #endif // _PBK_H_