Source code of Windows XP (NT5)
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.

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