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.

193 lines
5.6 KiB

  1. /*
  2. File Rassrv.h
  3. Functions that perform ras server operations that can be implemented
  4. independent of the ui.
  5. Paul Mayfield, 10/7/97
  6. */
  7. #ifndef __rassrv_h
  8. #define __rassrv_h
  9. // Standard includes
  10. #include <nt.h>
  11. #include <ntrtl.h>
  12. #include <nturtl.h>
  13. #include <windows.h> // Windows base lib
  14. #include <windowsx.h>
  15. #include <mprapi.h> // Public router api's
  16. #include <mprapip.h> // Private router api's
  17. #include <commctrl.h> // Common controls header
  18. #include <lmaccess.h> // Needed to add new users
  19. #include <lmapibuf.h> // " " " "
  20. #include <lmerr.h> // " " " "
  21. #include <stdlib.h> // duh
  22. #include <uiutil.h> // Common ui utilities
  23. #include <popupdlg.h> // Msg box utilities
  24. #include <debug.h> // Trace/assert library
  25. #include <inetcfgp.h> // INetCfg interfaces
  26. #include <rasman.h> // rasman stuff used in devicedb
  27. #include <dsrole.h> // is this machine ntw, nts, dc, etc?
  28. #include <raserror.h> // some ras error codes we return
  29. #include <devguid.h>
  30. #define _PNP_POWER_
  31. #include <ntdef.h>
  32. #include "ndispnp.h"
  33. #include "ntddip.h" // IP_PNP_RECONFIG_REQUEST
  34. // temporary
  35. #include <stdio.h> // duh
  36. // Definition of interface between shell and ras server ui
  37. #include <rasuip.h>
  38. // The resource file is in a common directory so that it gets
  39. // built into rasdlg.dll. Also, the help id file.
  40. #include <rassrvrc.h>
  41. #include <rassrvrh.h>
  42. // Includes within the project
  43. #include "utils.h"
  44. #include "devicedb.h"
  45. #include "hnportmapping.h"
  46. #include "miscdb.h"
  47. #include "userdb.h"
  48. #include "netcfgdb.h"
  49. #include "gentab.h"
  50. #include "usertab.h"
  51. #include "nettab.h"
  52. #include "wizard.h"
  53. #include "service.h"
  54. #include "error.h"
  55. #include "ipxui.h"
  56. #include "tcpipui.h"
  57. #include "mdm.h"
  58. // ============================================================
  59. // ============================================================
  60. // Tab and property sheet identifiers.
  61. // ============================================================
  62. // ============================================================
  63. // Property Sheet Page ID's
  64. #define RASSRVUI_GENERAL_TAB 1
  65. #define RASSRVUI_USER_TAB 2
  66. #define RASSRVUI_ADVANCED_TAB 4
  67. #define RASSRVUI_MULTILINK_TAB 8
  68. // Wizard Page ID's
  69. #define RASSRVUI_DEVICE_WIZ_TAB 16
  70. #define RASSRVUI_VPN_WIZ_TAB 32
  71. #define RASSRVUI_USER_WIZ_TAB 64
  72. #define RASSRVUI_PROT_WIZ_TAB 128
  73. #define RASSRVUI_FINISH_WIZ_TAB 256
  74. // Wizard Page ID's for the direct connect wizard (host)
  75. #define RASSRVUI_DCC_DEVICE_WIZ_TAB 512
  76. // Wizard Page ID that allows us to pop up warning and
  77. // switch to mmc
  78. #define RASSRVUI_SWITCHMMC_WIZ_TAB 1024
  79. // Console page id's to be used for launching mmc consoles.
  80. #define RASSRVUI_NETWORKCONSOLE 1
  81. #define RASSRVUI_USERCONSOLE 2
  82. #define RASSRVUI_MPRCONSOLE 3
  83. #define RASSRVUI_SERVICESCONSOLE 4
  84. // Wizard page counts to report to the shell
  85. #define RASSRVUI_WIZ_PAGE_COUNT_INCOMING 5
  86. #define RASSRVUI_WIZ_PAGE_COUNT_SWITCH 1
  87. #define RASSRVUI_WIZ_PAGE_COUNT_DIRECT 2
  88. // Reasons for restarting remoteaccess at commit time
  89. #define RASSRVUI_RESTART_REASON_NONE 0
  90. #define RASSRVUI_RESTART_REASON_NBF_ADDED 1
  91. #define RASSRVUI_RESTART_REASON_NBF_REMOVED 2
  92. // ============================================================
  93. // ============================================================
  94. // Functions to maintain data accross property sheet pages.
  95. // ============================================================
  96. // ============================================================
  97. //
  98. // This structure defines the information that needs
  99. // to be provided for each property sheet (wizard) page
  100. // that uses the RasSrvMessageFilter. The structure must be
  101. // passed in as the lParam member of the PROPSHEETPAGE of the page.
  102. //
  103. typedef struct _RASSRV_PAGE_CONTEXT {
  104. DWORD dwId; // ID_XXX value below
  105. DWORD dwType; // RASWIZ_TYPE_XXX value
  106. PVOID pvContext; // Created with RasSrvCreateContext
  107. } RASSRV_PAGE_CONTEXT;
  108. #define ID_DEVICE_DATABASE 1
  109. #define ID_USER_DATABASE 2
  110. #define ID_PROTOCOL_DATABASE 4
  111. #define ID_MISC_DATABASE 8
  112. #define ID_NETCOMP_DATABASE 16
  113. // Helper function lets us know if we should display the
  114. // connections ras server wizard.
  115. DWORD
  116. APIENTRY
  117. RasSrvAllowConnectionsWizard (
  118. OUT BOOL* pfAllow);
  119. // Creates a context to be used to manage information associated
  120. // with a given page.
  121. DWORD
  122. RassrvCreatePageSetCtx(
  123. OUT PVOID * ppvContext);
  124. // Causes the remoteaccess service to not be stopped even if the context
  125. // associated with the given property sheet page is never committed.
  126. DWORD
  127. RasSrvLeaveServiceRunning (
  128. IN HWND hwndPage);
  129. // Gets a handle to a particular database. If this database needs
  130. // to be opened, it will be opened. In order to use this function,
  131. // the window proc of hwndPage must first call into RasSrvMessageFilter.
  132. DWORD
  133. RasSrvGetDatabaseHandle(
  134. IN HWND hwndPage,
  135. IN DWORD dwDatabaseId,
  136. IN HANDLE * hDatabase);
  137. // Returns the id of the page whose handle is hwndPage
  138. DWORD
  139. RasSrvGetPageId (
  140. IN HWND hwndPage,
  141. OUT LPDWORD lpdwId);
  142. //
  143. // Callback function for property sheet pages that cleans up
  144. // the page.
  145. //
  146. UINT
  147. CALLBACK
  148. RasSrvInitDestroyPropSheetCb(
  149. IN HWND hwndPage,
  150. IN UINT uMsg,
  151. IN LPPROPSHEETPAGE pPropPage);
  152. // Filters messages for RasSrv Property Pages. If this function returns
  153. // true, the winproc of the dialog window should return true immediately.
  154. // Otherwise message processing may continue as normal.
  155. BOOL
  156. RasSrvMessageFilter(
  157. IN HWND hwndDlg,
  158. IN UINT uMsg,
  159. IN WPARAM wParam,
  160. IN LPARAM lParam);
  161. #endif