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.

565 lines
12 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. #include "rasdiagp.h" // For whistler 460931
  41. // Fusion support
  42. // For whistler bug 349866
  43. #include "shfusion.h"
  44. // Whistler bug 224074 use only lstrcpyn's to prevent maliciousness
  45. //
  46. // Created this for the use of dial.c/terminal.c, max length of the IP address
  47. // for the terminal dialog
  48. //
  49. #define TERM_IpAddress 17
  50. // Positional offset of property sheets and wizards from the main dialog.
  51. //
  52. #define DXSHEET 12
  53. #define DYSHEET 25
  54. // List editor dialog option flags
  55. //
  56. #define LEDFLAG_NoDeleteLastItem 0x00000001
  57. #define LEDFLAG_Sorted 0x00000002
  58. #define LEDFLAG_Unique 0x00000004
  59. //-----------------------------------------------------------------------------
  60. // Datatypes
  61. //-----------------------------------------------------------------------------
  62. // For whistler 460931
  63. //
  64. typedef struct _tagDiagnosticInfo
  65. {
  66. HINSTANCE hDiagDll;
  67. DiagGetDiagnosticFunctions pfnGetDiagFunc;
  68. RAS_DIAGNOSTIC_FUNCTIONS strDiagFuncs;
  69. } DiagnosticInfo;
  70. // Defines arguments passed internally via reserved words in the public
  71. // interface. This is done so an API doesn't have to re-load the phonebook
  72. // and user preferences when serving another API.
  73. //
  74. typedef struct
  75. _INTERNALARGS
  76. {
  77. PBFILE* pFile;
  78. PBUSER* pUser;
  79. RASNOUSER* pNoUser;
  80. BOOL fNoUser;
  81. BOOL fNoUserChanged;
  82. BOOL fMoveOwnerOffDesktop;
  83. BOOL fForceCloseOnDial;
  84. HANDLE hConnection;
  85. BOOL fInvalid;
  86. PVOID pvEapInfo;
  87. BOOL fDisableFirstConnect;
  88. PVOID * pvSRouteInfo;
  89. }
  90. INTERNALARGS;
  91. // Static list table item.
  92. //
  93. typedef struct
  94. _LBTABLEITEM
  95. {
  96. DWORD sidItem;
  97. DWORD dwData;
  98. }
  99. LBTABLEITEM;
  100. //-----------------------------------------------------------------------------
  101. // Global declarations (defined in main.c)
  102. //-----------------------------------------------------------------------------
  103. extern HINSTANCE g_hinstDll;
  104. extern LPCWSTR g_contextId;
  105. extern HBITMAP g_hbmWizard;
  106. extern TCHAR* g_pszHelpFile;
  107. extern TCHAR* g_pszRouterHelpFile;
  108. extern BOOL g_fEncryptionPermitted;
  109. extern LONG g_ulCallbacksActive;
  110. extern BOOL g_fTerminateAsap;
  111. extern CRITICAL_SECTION g_csDiagTab; //For whistler 460931
  112. extern CRITICAL_SECTION g_csCallBacks; //for .Net 511810
  113. //-----------------------------------------------------------------------------
  114. // Macros
  115. //-----------------------------------------------------------------------------
  116. #define ErrorDlg(h,o,e,a) \
  117. ErrorDlgUtil(h,o,e,a,g_hinstDll,SID_PopupTitle,SID_FMT_ErrorMsg)
  118. #define MsgDlg(h,m,a) \
  119. MsgDlgUtil(h,m,a,g_hinstDll,SID_PopupTitle)
  120. // Extended tracing macros. Specifying a flag by name in the first parameter
  121. // allows the caller to categorize messages printed e.g.
  122. //
  123. // TRACEX(RASDLG_TIMER,"entering LsRefresh")
  124. //
  125. #define RASDLG_TIMER ((DWORD)0x80000000|0x00000002)
  126. //-----------------------------------------------------------------------------
  127. // Cross-file prototypes (alphabetically)
  128. //-----------------------------------------------------------------------------
  129. BOOL
  130. AdvancedSecurityDlg(
  131. IN HWND hwndOwner,
  132. IN OUT EINFO* pArgs );
  133. BOOL
  134. AllLinksAreModems(
  135. IN PBENTRY* pEntry );
  136. BOOL
  137. AllowDccWizard(
  138. IN HANDLE hConnection);
  139. BOOL
  140. AlternatePhoneNumbersDlg(
  141. IN HWND hwndOwner,
  142. IN OUT DTLNODE* pLinkNode,
  143. IN OUT DTLLIST* pListAreaCodes );
  144. DWORD
  145. AuthRestrictionsFromTypicalAuth(
  146. IN DWORD dwTypicalAuth );
  147. LONG GetGlobalCallbackActive( );
  148. LONG IncGlobalCallbackActive( );
  149. LONG DecGlobalCallbackActive( );
  150. ULONG
  151. CallbacksActive(
  152. INT nSetTerminateAsap,
  153. BOOL* pfTerminateAsap );
  154. VOID
  155. ContextHelp(
  156. IN const DWORD* padwMap,
  157. IN HWND hwndDlg,
  158. IN UINT unMsg,
  159. IN WPARAM wparam,
  160. IN LPARAM lparam );
  161. VOID
  162. ContextHelpX(
  163. IN const DWORD* padwMap,
  164. IN HWND hwndDlg,
  165. IN UINT unMsg,
  166. IN WPARAM wparam,
  167. IN LPARAM lparam,
  168. IN BOOL fRouter);
  169. VOID
  170. CopyLinkPhoneNumberInfo(
  171. OUT DTLNODE* pDstLinkNode,
  172. IN DTLNODE* pSrcLinkNode );
  173. VOID
  174. CopyPszListToPhoneList(
  175. IN OUT PBLINK* pLink,
  176. IN DTLLIST* pListPhoneNumbers );
  177. HWND
  178. CreateWizardBitmap(
  179. IN HWND hwndDlg,
  180. IN BOOL fPage );
  181. BOOL
  182. CustomAuthenticationDlg(
  183. IN HWND hwndOwner,
  184. IN OUT PBENTRY* pEntry,
  185. IN DTLLIST* pList,
  186. IN DTLNODE* pNodeToSelect,
  187. OUT DTLNODE** ppNodeSelected );
  188. BOOL
  189. DataEncryptionDlg(
  190. IN HWND hwndOwner,
  191. IN OUT PBENTRY* pEntry,
  192. IN DWORD dwfCaps );
  193. VOID
  194. DereferenceRunningCallbacks(
  195. VOID );
  196. BOOL
  197. DeviceConfigureDlg(
  198. IN HWND hwndOwner,
  199. IN PBLINK* pLink,
  200. IN PBENTRY* pEntry,
  201. IN BOOL fSingleLink,
  202. IN BOOL fRouter);
  203. TCHAR*
  204. DisplayPszFromDeviceAndPort(
  205. IN TCHAR* pszDevice,
  206. IN TCHAR* pszPort );
  207. TCHAR*
  208. DisplayPszFromPpbport(
  209. IN PBPORT* pPort,
  210. OUT DWORD* pdwDeviceIcon );
  211. DWORD
  212. DwCustomTerminalDlg(TCHAR *pszPhonebook,
  213. HRASCONN hrasconn,
  214. PBENTRY *pEntry,
  215. HWND hwndDlg,
  216. RASDIALPARAMS *prasdialparams,
  217. PVOID pvReserved);
  218. BOOL
  219. EditPhoneNumberDlg(
  220. IN HWND hwndOwner,
  221. IN OUT DTLNODE* pPhoneNode,
  222. IN OUT DTLLIST* pListAreaCodes,
  223. IN DWORD sidTitle );
  224. VOID
  225. EnableCbWithRestore(
  226. IN HWND hwndCb,
  227. IN BOOL fEnable,
  228. IN BOOL fDisabledCheck,
  229. IN OUT BOOL* pfRestore );
  230. VOID
  231. EnableLbWithRestore(
  232. IN HWND hwndLb,
  233. IN BOOL fEnable,
  234. IN OUT INT* piRestore );
  235. DTLNODE*
  236. FirstPhoneNodeFromPhoneList(
  237. IN DTLLIST* pListPhones );
  238. VOID
  239. FirstPhoneNodeToPhoneList(
  240. IN DTLLIST* pListPhones,
  241. IN DTLNODE* pNewNode );
  242. TCHAR*
  243. FirstPhoneNumberFromEntry(
  244. IN PBENTRY* pEntry );
  245. TCHAR*
  246. FirstPszFromList(
  247. IN DTLLIST* pPszList );
  248. DWORD
  249. FirstPhoneNumberToEntry(
  250. IN PBENTRY* pEntry,
  251. IN TCHAR* pszPhoneNumber );
  252. DWORD
  253. FirstPszToList(
  254. IN DTLLIST* pPszList,
  255. IN TCHAR* psz );
  256. VOID
  257. GetBoldWindowFont(
  258. IN HWND hwnd,
  259. IN BOOL fLargeFont,
  260. OUT HFONT * pBoldFont);
  261. DWORD
  262. GetDefaultEntryName(
  263. IN PBFILE* pFile,
  264. IN DWORD dwType,
  265. IN BOOL fRouter,
  266. OUT TCHAR** ppszName );
  267. BOOL
  268. IPSecPolicyDlg(
  269. IN HWND hwndOwner,
  270. IN OUT EINFO* pArgs );
  271. BOOL
  272. IsLocalPad(
  273. IN PBENTRY* pEntry );
  274. /*
  275. DWORD
  276. IsNt40Machine (
  277. IN PWCHAR pszServer,
  278. OUT PBOOL pbIsNt40
  279. );
  280. */
  281. BOOL
  282. ListEditorDlg(
  283. IN HWND hwndOwner,
  284. IN OUT DTLLIST* pList,
  285. IN OUT BOOL* pfCheck,
  286. IN DWORD dwMaxItemLen,
  287. IN TCHAR* pszTitle,
  288. IN TCHAR* pszItemLabel,
  289. IN TCHAR* pszListLabel,
  290. IN TCHAR* pszCheckLabel,
  291. IN TCHAR* pszDefaultItem,
  292. IN INT iSelInitial,
  293. IN DWORD* pdwHelp,
  294. IN DWORD dwfFlags,
  295. IN PDESTROYNODE pDestroyId );
  296. BOOL
  297. MultiLinkConfigureDlg(
  298. IN HWND hwndOwner,
  299. IN PBENTRY* pEntry,
  300. IN BOOL fRouter );
  301. BOOL
  302. MultiLinkDialingDlg(
  303. IN HWND hwndOwner,
  304. OUT PBENTRY* pEntry );
  305. BOOL
  306. NwConnectionCheck(
  307. IN HWND hwndOwner,
  308. IN BOOL fPosition,
  309. IN LONG xDlg,
  310. IN LONG yDlg,
  311. IN PBFILE* pFile,
  312. IN PBENTRY* pEntry );
  313. BOOL
  314. PhoneNodeIsBlank(
  315. IN DTLNODE* pNode );
  316. BOOL
  317. PhoneNumberDlg(
  318. IN HWND hwndOwner,
  319. IN BOOL fRouter,
  320. IN OUT DTLLIST* pList,
  321. IN OUT BOOL* pfCheck );
  322. VOID
  323. PositionDlg(
  324. IN HWND hwndDlg,
  325. IN BOOL fPosition,
  326. IN LONG xDlg,
  327. IN LONG yDlg );
  328. LRESULT CALLBACK
  329. PositionDlgStdCallWndProc(
  330. int code,
  331. WPARAM wparam,
  332. LPARAM lparam );
  333. BOOL
  334. PppTcpipDlg(
  335. IN HWND hwndOwner,
  336. IN OUT PBENTRY* pEntry,
  337. IN BOOL fRouter );
  338. BOOL
  339. PrefixSuffixLocationDlg(
  340. IN HWND hwndOwner,
  341. IN TCHAR* pszLocation,
  342. IN DWORD dwLocationId,
  343. IN OUT PBUSER* pUser,
  344. IN OUT HLINEAPP* pHlineapp );
  345. TCHAR*
  346. PszFromPhoneNumberList(
  347. IN DTLLIST* pList );
  348. LRESULT CALLBACK
  349. SelectDesktopCallWndRetProc(
  350. int code,
  351. WPARAM wparam,
  352. LPARAM lparam );
  353. HICON
  354. GetCurrentIconEntryType(
  355. IN DWORD dwType,
  356. BOOL fSmall);
  357. VOID
  358. SetIconFromEntryType(
  359. IN HWND hwndIcon,
  360. IN DWORD dwType,
  361. BOOL fSmall);
  362. BOOL
  363. SlipTcpipDlg(
  364. IN HWND hwndOwner,
  365. IN OUT PBENTRY* pEntry );
  366. BOOL
  367. StringEditorDlg(
  368. IN HWND hwndOwner,
  369. IN TCHAR* pszIn,
  370. IN DWORD dwSidTitle,
  371. IN DWORD dwSidLabel,
  372. IN DWORD cbMax,
  373. IN DWORD dwHelpId,
  374. IN OUT TCHAR** ppszOut );
  375. BOOL
  376. TerminalDlg(
  377. IN PBENTRY* pEntry,
  378. IN RASDIALPARAMS* pRdp,
  379. IN HWND hwndOwner,
  380. IN HRASCONN hrasconn,
  381. IN DWORD sidTitle,
  382. IN OUT TCHAR* pszIpAddress );
  383. VOID
  384. TweakTitleBar(
  385. IN HWND hwndDlg );
  386. int CALLBACK
  387. UnHelpCallbackFunc(
  388. IN HWND hwndDlg,
  389. IN UINT unMsg,
  390. IN LPARAM lparam );
  391. BOOL
  392. UserPreferencesDlg(
  393. IN HLINEAPP hlineapp,
  394. IN HWND hwndOwner,
  395. IN DWORD dwFlags,
  396. OUT PBUSER* pUser,
  397. OUT PBFILE** ppFile );
  398. BOOL
  399. WaitForRasDialCallbacksToTerminate(
  400. VOID );
  401. BOOL
  402. X25LogonSettingsDlg(
  403. IN HWND hwndOwner,
  404. IN BOOL fLocalPad,
  405. IN OUT PBENTRY* pEntry );
  406. //-----------------------------------------------------------------------------
  407. //
  408. // pmay: 213060
  409. // Prototypes moved from pref.c and entryps.c, cleanup added
  410. //
  411. // Callback number utilities
  412. //
  413. //-----------------------------------------------------------------------------
  414. //
  415. // Per-callback number context.
  416. //
  417. // CbutilFillLvNumbers will allocate one of these contexts for each
  418. // item it puts in the list (accessed as LV_ITEM.lParam).
  419. // CbutilLvNumbersCleanup will cleanup these contexts.
  420. //
  421. typedef struct _CBCONTEXT
  422. {
  423. TCHAR* pszPortName; // Pointer to port name (not owned by struct)
  424. TCHAR* pszDeviceName;// Pointer to device name (not owned by struct)
  425. DWORD dwDeviceType; // pointer to the type of the device
  426. BOOL fConfigured; // Whether device referenced is installed on sys.
  427. } CBCONTEXT;
  428. VOID
  429. CbutilFillLvNumbers(
  430. IN HWND hwndDlg,
  431. IN HWND hwndLvNumbers,
  432. IN DTLLIST* pListCallback,
  433. IN BOOL fRouter );
  434. VOID
  435. CbutilLvNumbersCleanup(
  436. IN HWND hwndLvNumbers );
  437. LVXDRAWINFO*
  438. CbutilLvNumbersCallback(
  439. IN HWND hwndLv,
  440. IN DWORD dwItem );
  441. VOID
  442. CbutilEdit(
  443. IN HWND hwndDlg,
  444. IN HWND hwndLvNumbers );
  445. VOID
  446. CbutilDelete(
  447. IN HWND hwndDlg,
  448. IN HWND hwndLvNumbers );
  449. VOID
  450. CbutilSaveLv(
  451. IN HWND hwndLvNumbers,
  452. OUT DTLLIST* pListCallback );
  453. // For whistler 460931
  454. //
  455. // Begin of functions implemented in diagnostic.c
  456. //
  457. INT_PTR CALLBACK
  458. DgDlgProc(
  459. IN HWND hwnd,
  460. IN UINT unMsg,
  461. IN WPARAM wparam,
  462. IN LPARAM lparam );
  463. DWORD
  464. UnLoadDiagnosticDll(
  465. IN DiagnosticInfo * pInfo );
  466. DWORD
  467. LoadDiagnosticDll(
  468. IN DiagnosticInfo * pInfo);
  469. // End of functions implemented in diagnostic.c
  470. //
  471. #endif // _RASDLGP_H_