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.

524 lines
11 KiB

  1. // Copyright (c) 1995, Microsoft Corporation, all rights reserved
  2. //
  3. // rasdlgp.h
  4. // Remote Access Common Dialog APIs
  5. // Private pre-compiled header
  6. //
  7. // 06/18/95 Steve Cobb
  8. #ifndef _RASDLGP_H_
  9. #define _RASDLGP_H_
  10. #define COBJMACROS
  11. #include <nt.h> // NT declarations
  12. #include <ntrtl.h> // NT general runtime-library
  13. #include <nturtl.h> // NT user-mode runtime-library
  14. #include <windows.h> // Win32 root
  15. #include <windowsx.h> // Win32 macro extensions
  16. #include <commctrl.h> // Win32 common controls
  17. #include <commdlg.h> // Win32 common dialogs
  18. #include <prsht.h> // Win32 property sheets
  19. #include <setupapi.h> // Class image lists for network components
  20. #include <shlobj.h> // To get profile directory for user
  21. #include <tapi.h> // Telephony API
  22. #include <rasdlg.h> // Win32 RAS common dialogs (our public header)
  23. #include <rasuip.h> // RAS UI APIs (our private header)
  24. #include <raserror.h> // Win32 RAS error codes
  25. #include <netcfgx.h> // INetCfg interfaces
  26. #include <hnetcfg.h> // IHNetCfg interfaces
  27. #include <pbk.h> // RAS phonebook library
  28. #include <tapiutil.h> // TAPI helper library
  29. #include <nouiutil.h> // No-HWND helper library
  30. #include <phonenum.h> // Phone number helper library
  31. #include <debug.h> // Trace/assert library
  32. #include <uiutil.h> // HWND helper library
  33. #include <wait.rch> // LoadRas resource constants
  34. #include <mdm.h> // installs null modems for the dcc wizards.
  35. #include <pwutil.h> // password encoding, etc.
  36. #include "rasdlgrc.h" // Our resource constants
  37. #include "rasdlghc.h" // Our help context constants
  38. #include "entry.h" // High-level common phonebook entry helpers
  39. #include "rassrv.h"
  40. // Fusion support
  41. // For whistler bug 349866
  42. #include "shfusion.h"
  43. // Whistler bug 224074 use only lstrcpyn's to prevent maliciousness
  44. //
  45. // Created this for the use of dial.c/terminal.c, max length of the IP address
  46. // for the terminal dialog
  47. //
  48. #define TERM_IpAddress 17
  49. // Positional offset of property sheets and wizards from the main dialog.
  50. //
  51. #define DXSHEET 12
  52. #define DYSHEET 25
  53. // List editor dialog option flags
  54. //
  55. #define LEDFLAG_NoDeleteLastItem 0x00000001
  56. #define LEDFLAG_Sorted 0x00000002
  57. #define LEDFLAG_Unique 0x00000004
  58. //-----------------------------------------------------------------------------
  59. // Datatypes
  60. //-----------------------------------------------------------------------------
  61. // Defines arguments passed internally via reserved words in the public
  62. // interface. This is done so an API doesn't have to re-load the phonebook
  63. // and user preferences when serving another API.
  64. //
  65. typedef struct
  66. _INTERNALARGS
  67. {
  68. PBFILE* pFile;
  69. PBUSER* pUser;
  70. RASNOUSER* pNoUser;
  71. BOOL fNoUser;
  72. BOOL fNoUserChanged;
  73. BOOL fMoveOwnerOffDesktop;
  74. BOOL fForceCloseOnDial;
  75. HANDLE hConnection;
  76. BOOL fInvalid;
  77. PVOID pvEapInfo;
  78. BOOL fDisableFirstConnect;
  79. }
  80. INTERNALARGS;
  81. // Static list table item.
  82. //
  83. typedef struct
  84. _LBTABLEITEM
  85. {
  86. DWORD sidItem;
  87. DWORD dwData;
  88. }
  89. LBTABLEITEM;
  90. //-----------------------------------------------------------------------------
  91. // Global declarations (defined in main.c)
  92. //-----------------------------------------------------------------------------
  93. extern HINSTANCE g_hinstDll;
  94. extern LPCWSTR g_contextId;
  95. extern HBITMAP g_hbmWizard;
  96. extern TCHAR* g_pszHelpFile;
  97. extern TCHAR* g_pszRouterHelpFile;
  98. extern BOOL g_fEncryptionPermitted;
  99. extern HANDLE g_hmutexCallbacks;
  100. extern LONG g_ulCallbacksActive;
  101. extern BOOL g_fTerminateAsap;
  102. //-----------------------------------------------------------------------------
  103. // Macros
  104. //-----------------------------------------------------------------------------
  105. #define ErrorDlg(h,o,e,a) \
  106. ErrorDlgUtil(h,o,e,a,g_hinstDll,SID_PopupTitle,SID_FMT_ErrorMsg)
  107. #define MsgDlg(h,m,a) \
  108. MsgDlgUtil(h,m,a,g_hinstDll,SID_PopupTitle)
  109. // Extended tracing macros. Specifying a flag by name in the first parameter
  110. // allows the caller to categorize messages printed e.g.
  111. //
  112. // TRACEX(RASDLG_TIMER,"entering LsRefresh")
  113. //
  114. #define RASDLG_TIMER ((DWORD)0x80000000|0x00000002)
  115. //-----------------------------------------------------------------------------
  116. // Cross-file prototypes (alphabetically)
  117. //-----------------------------------------------------------------------------
  118. BOOL
  119. AdvancedSecurityDlg(
  120. IN HWND hwndOwner,
  121. IN OUT EINFO* pArgs );
  122. BOOL
  123. AllLinksAreModems(
  124. IN PBENTRY* pEntry );
  125. BOOL
  126. AllowDccWizard(
  127. IN HANDLE hConnection);
  128. BOOL
  129. AlternatePhoneNumbersDlg(
  130. IN HWND hwndOwner,
  131. IN OUT DTLNODE* pLinkNode,
  132. IN OUT DTLLIST* pListAreaCodes );
  133. DWORD
  134. AuthRestrictionsFromTypicalAuth(
  135. IN DWORD dwTypicalAuth );
  136. ULONG
  137. CallbacksActive(
  138. INT nSetTerminateAsap,
  139. BOOL* pfTerminateAsap );
  140. VOID
  141. ContextHelp(
  142. IN const DWORD* padwMap,
  143. IN HWND hwndDlg,
  144. IN UINT unMsg,
  145. IN WPARAM wparam,
  146. IN LPARAM lparam );
  147. VOID
  148. ContextHelpX(
  149. IN const DWORD* padwMap,
  150. IN HWND hwndDlg,
  151. IN UINT unMsg,
  152. IN WPARAM wparam,
  153. IN LPARAM lparam,
  154. IN BOOL fRouter);
  155. VOID
  156. CopyLinkPhoneNumberInfo(
  157. OUT DTLNODE* pDstLinkNode,
  158. IN DTLNODE* pSrcLinkNode );
  159. VOID
  160. CopyPszListToPhoneList(
  161. IN OUT PBLINK* pLink,
  162. IN DTLLIST* pListPhoneNumbers );
  163. HWND
  164. CreateWizardBitmap(
  165. IN HWND hwndDlg,
  166. IN BOOL fPage );
  167. BOOL
  168. CustomAuthenticationDlg(
  169. IN HWND hwndOwner,
  170. IN OUT PBENTRY* pEntry,
  171. IN DTLLIST* pList,
  172. IN DTLNODE* pNodeToSelect,
  173. OUT DTLNODE** ppNodeSelected );
  174. BOOL
  175. DataEncryptionDlg(
  176. IN HWND hwndOwner,
  177. IN OUT PBENTRY* pEntry,
  178. IN DWORD dwfCaps );
  179. VOID
  180. DereferenceRunningCallbacks(
  181. VOID );
  182. BOOL
  183. DeviceConfigureDlg(
  184. IN HWND hwndOwner,
  185. IN PBLINK* pLink,
  186. IN PBENTRY* pEntry,
  187. IN BOOL fSingleLink,
  188. IN BOOL fRouter);
  189. TCHAR*
  190. DisplayPszFromDeviceAndPort(
  191. IN TCHAR* pszDevice,
  192. IN TCHAR* pszPort );
  193. TCHAR*
  194. DisplayPszFromPpbport(
  195. IN PBPORT* pPort,
  196. OUT DWORD* pdwDeviceIcon );
  197. DWORD
  198. DwCustomTerminalDlg(TCHAR *pszPhonebook,
  199. HRASCONN hrasconn,
  200. PBENTRY *pEntry,
  201. HWND hwndDlg,
  202. RASDIALPARAMS *prasdialparams,
  203. PVOID pvReserved);
  204. BOOL
  205. EditPhoneNumberDlg(
  206. IN HWND hwndOwner,
  207. IN OUT DTLNODE* pPhoneNode,
  208. IN OUT DTLLIST* pListAreaCodes,
  209. IN DWORD sidTitle );
  210. VOID
  211. EnableCbWithRestore(
  212. IN HWND hwndCb,
  213. IN BOOL fEnable,
  214. IN BOOL fDisabledCheck,
  215. IN OUT BOOL* pfRestore );
  216. VOID
  217. EnableLbWithRestore(
  218. IN HWND hwndLb,
  219. IN BOOL fEnable,
  220. IN OUT INT* piRestore );
  221. DTLNODE*
  222. FirstPhoneNodeFromPhoneList(
  223. IN DTLLIST* pListPhones );
  224. VOID
  225. FirstPhoneNodeToPhoneList(
  226. IN DTLLIST* pListPhones,
  227. IN DTLNODE* pNewNode );
  228. TCHAR*
  229. FirstPhoneNumberFromEntry(
  230. IN PBENTRY* pEntry );
  231. TCHAR*
  232. FirstPszFromList(
  233. IN DTLLIST* pPszList );
  234. DWORD
  235. FirstPhoneNumberToEntry(
  236. IN PBENTRY* pEntry,
  237. IN TCHAR* pszPhoneNumber );
  238. DWORD
  239. FirstPszToList(
  240. IN DTLLIST* pPszList,
  241. IN TCHAR* psz );
  242. VOID
  243. GetBoldWindowFont(
  244. IN HWND hwnd,
  245. IN BOOL fLargeFont,
  246. OUT HFONT * pBoldFont);
  247. DWORD
  248. GetDefaultEntryName(
  249. IN PBFILE* pFile,
  250. IN DWORD dwType,
  251. IN BOOL fRouter,
  252. OUT TCHAR** ppszName );
  253. BOOL
  254. IPSecPolicyDlg(
  255. IN HWND hwndOwner,
  256. IN OUT EINFO* pArgs );
  257. BOOL
  258. IsLocalPad(
  259. IN PBENTRY* pEntry );
  260. /*
  261. DWORD
  262. IsNt40Machine (
  263. IN PWCHAR pszServer,
  264. OUT PBOOL pbIsNt40
  265. );
  266. */
  267. BOOL
  268. ListEditorDlg(
  269. IN HWND hwndOwner,
  270. IN OUT DTLLIST* pList,
  271. IN OUT BOOL* pfCheck,
  272. IN DWORD dwMaxItemLen,
  273. IN TCHAR* pszTitle,
  274. IN TCHAR* pszItemLabel,
  275. IN TCHAR* pszListLabel,
  276. IN TCHAR* pszCheckLabel,
  277. IN TCHAR* pszDefaultItem,
  278. IN INT iSelInitial,
  279. IN DWORD* pdwHelp,
  280. IN DWORD dwfFlags,
  281. IN PDESTROYNODE pDestroyId );
  282. BOOL
  283. MultiLinkConfigureDlg(
  284. IN HWND hwndOwner,
  285. IN PBENTRY* pEntry,
  286. IN BOOL fRouter );
  287. BOOL
  288. MultiLinkDialingDlg(
  289. IN HWND hwndOwner,
  290. OUT PBENTRY* pEntry );
  291. BOOL
  292. NwConnectionCheck(
  293. IN HWND hwndOwner,
  294. IN BOOL fPosition,
  295. IN LONG xDlg,
  296. IN LONG yDlg,
  297. IN PBFILE* pFile,
  298. IN PBENTRY* pEntry );
  299. BOOL
  300. PhoneNodeIsBlank(
  301. IN DTLNODE* pNode );
  302. BOOL
  303. PhoneNumberDlg(
  304. IN HWND hwndOwner,
  305. IN BOOL fRouter,
  306. IN OUT DTLLIST* pList,
  307. IN OUT BOOL* pfCheck );
  308. VOID
  309. PositionDlg(
  310. IN HWND hwndDlg,
  311. IN BOOL fPosition,
  312. IN LONG xDlg,
  313. IN LONG yDlg );
  314. LRESULT CALLBACK
  315. PositionDlgStdCallWndProc(
  316. int code,
  317. WPARAM wparam,
  318. LPARAM lparam );
  319. BOOL
  320. PppTcpipDlg(
  321. IN HWND hwndOwner,
  322. IN OUT PBENTRY* pEntry,
  323. IN BOOL fRouter );
  324. BOOL
  325. PrefixSuffixLocationDlg(
  326. IN HWND hwndOwner,
  327. IN TCHAR* pszLocation,
  328. IN DWORD dwLocationId,
  329. IN OUT PBUSER* pUser,
  330. IN OUT HLINEAPP* pHlineapp );
  331. TCHAR*
  332. PszFromPhoneNumberList(
  333. IN DTLLIST* pList );
  334. LRESULT CALLBACK
  335. SelectDesktopCallWndRetProc(
  336. int code,
  337. WPARAM wparam,
  338. LPARAM lparam );
  339. HICON
  340. GetCurrentIconEntryType(
  341. IN DWORD dwType,
  342. BOOL fSmall);
  343. VOID
  344. SetIconFromEntryType(
  345. IN HWND hwndIcon,
  346. IN DWORD dwType,
  347. BOOL fSmall);
  348. BOOL
  349. SlipTcpipDlg(
  350. IN HWND hwndOwner,
  351. IN OUT PBENTRY* pEntry );
  352. BOOL
  353. StringEditorDlg(
  354. IN HWND hwndOwner,
  355. IN TCHAR* pszIn,
  356. IN DWORD dwSidTitle,
  357. IN DWORD dwSidLabel,
  358. IN DWORD cbMax,
  359. IN DWORD dwHelpId,
  360. IN OUT TCHAR** ppszOut );
  361. BOOL
  362. TerminalDlg(
  363. IN PBENTRY* pEntry,
  364. IN RASDIALPARAMS* pRdp,
  365. IN HWND hwndOwner,
  366. IN HRASCONN hrasconn,
  367. IN DWORD sidTitle,
  368. IN OUT TCHAR* pszIpAddress );
  369. VOID
  370. TweakTitleBar(
  371. IN HWND hwndDlg );
  372. int CALLBACK
  373. UnHelpCallbackFunc(
  374. IN HWND hwndDlg,
  375. IN UINT unMsg,
  376. IN LPARAM lparam );
  377. BOOL
  378. UserPreferencesDlg(
  379. IN HLINEAPP hlineapp,
  380. IN HWND hwndOwner,
  381. IN BOOL fLogon,
  382. IN DWORD dwFlags,
  383. OUT PBUSER* pUser,
  384. OUT PBFILE** ppFile );
  385. BOOL
  386. WaitForRasDialCallbacksToTerminate(
  387. VOID );
  388. BOOL
  389. X25LogonSettingsDlg(
  390. IN HWND hwndOwner,
  391. IN BOOL fLocalPad,
  392. IN OUT PBENTRY* pEntry );
  393. //-----------------------------------------------------------------------------
  394. //
  395. // pmay: 213060
  396. // Prototypes moved from pref.c and entryps.c, cleanup added
  397. //
  398. // Callback number utilities
  399. //
  400. //-----------------------------------------------------------------------------
  401. //
  402. // Per-callback number context.
  403. //
  404. // CbutilFillLvNumbers will allocate one of these contexts for each
  405. // item it puts in the list (accessed as LV_ITEM.lParam).
  406. // CbutilLvNumbersCleanup will cleanup these contexts.
  407. //
  408. typedef struct _CBCONTEXT
  409. {
  410. TCHAR* pszPortName; // Pointer to port name (not owned by struct)
  411. TCHAR* pszDeviceName;// Pointer to device name (not owned by struct)
  412. DWORD dwDeviceType; // pointer to the type of the device
  413. BOOL fConfigured; // Whether device referenced is installed on sys.
  414. } CBCONTEXT;
  415. VOID
  416. CbutilFillLvNumbers(
  417. IN HWND hwndDlg,
  418. IN HWND hwndLvNumbers,
  419. IN DTLLIST* pListCallback,
  420. IN BOOL fRouter );
  421. VOID
  422. CbutilLvNumbersCleanup(
  423. IN HWND hwndLvNumbers );
  424. LVXDRAWINFO*
  425. CbutilLvNumbersCallback(
  426. IN HWND hwndLv,
  427. IN DWORD dwItem );
  428. VOID
  429. CbutilEdit(
  430. IN HWND hwndDlg,
  431. IN HWND hwndLvNumbers );
  432. VOID
  433. CbutilDelete(
  434. IN HWND hwndDlg,
  435. IN HWND hwndLvNumbers );
  436. VOID
  437. CbutilSaveLv(
  438. IN HWND hwndLvNumbers,
  439. OUT DTLLIST* pListCallback );
  440. #endif // _RASDLGP_H_