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.

205 lines
6.0 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. //gangz
  59. //For secure password bug .Net 754400
  60. #include "pwutil.h"
  61. // ============================================================
  62. // ============================================================
  63. // Tab and property sheet identifiers.
  64. // ============================================================
  65. // ============================================================
  66. // Property Sheet Page ID's
  67. #define RASSRVUI_GENERAL_TAB 1
  68. #define RASSRVUI_USER_TAB 2
  69. #define RASSRVUI_ADVANCED_TAB 4
  70. #define RASSRVUI_MULTILINK_TAB 8
  71. // Wizard Page ID's
  72. #define RASSRVUI_DEVICE_WIZ_TAB 16
  73. #define RASSRVUI_VPN_WIZ_TAB 32
  74. #define RASSRVUI_USER_WIZ_TAB 64
  75. #define RASSRVUI_PROT_WIZ_TAB 128
  76. #define RASSRVUI_FINISH_WIZ_TAB 256
  77. // Wizard Page ID's for the direct connect wizard (host)
  78. #define RASSRVUI_DCC_DEVICE_WIZ_TAB 512
  79. // Wizard Page ID that allows us to pop up warning and
  80. // switch to mmc
  81. #define RASSRVUI_SWITCHMMC_WIZ_TAB 1024
  82. // Console page id's to be used for launching mmc consoles.
  83. #define RASSRVUI_NETWORKCONSOLE 1
  84. #define RASSRVUI_USERCONSOLE 2
  85. #define RASSRVUI_MPRCONSOLE 3
  86. #define RASSRVUI_SERVICESCONSOLE 4
  87. // Wizard page counts to report to the shell
  88. #define RASSRVUI_WIZ_PAGE_COUNT_INCOMING 5
  89. #define RASSRVUI_WIZ_PAGE_COUNT_SWITCH 1
  90. #define RASSRVUI_WIZ_PAGE_COUNT_DIRECT 2
  91. // Reasons for restarting remoteaccess at commit time
  92. #define RASSRVUI_RESTART_REASON_NONE 0
  93. #define RASSRVUI_RESTART_REASON_NBF_ADDED 1
  94. #define RASSRVUI_RESTART_REASON_NBF_REMOVED 2
  95. // ============================================================
  96. // ============================================================
  97. // Functions to maintain data accross property sheet pages.
  98. // ============================================================
  99. // ============================================================
  100. //
  101. // This structure defines the information that needs
  102. // to be provided for each property sheet (wizard) page
  103. // that uses the RasSrvMessageFilter. The structure must be
  104. // passed in as the lParam member of the PROPSHEETPAGE of the page.
  105. //
  106. typedef struct _RASSRV_PAGE_CONTEXT {
  107. DWORD dwId; // ID_XXX value below
  108. DWORD dwType; // RASWIZ_TYPE_XXX value
  109. PVOID pvContext; // Created with RasSrvCreateContext
  110. } RASSRV_PAGE_CONTEXT;
  111. #define ID_DEVICE_DATABASE 1
  112. #define ID_USER_DATABASE 2
  113. #define ID_PROTOCOL_DATABASE 4
  114. #define ID_MISC_DATABASE 8
  115. #define ID_NETCOMP_DATABASE 16
  116. // Helper function lets us know if we should display the
  117. // connections ras server wizard.
  118. DWORD
  119. APIENTRY
  120. RasSrvAllowConnectionsWizard (
  121. OUT BOOL* pfAllow);
  122. // Creates a context to be used to manage information associated
  123. // with a given page.
  124. DWORD
  125. RassrvCreatePageSetCtx(
  126. OUT PVOID * ppvContext);
  127. // Causes the remoteaccess service to not be stopped even if the context
  128. // associated with the given property sheet page is never committed.
  129. DWORD
  130. RasSrvLeaveServiceRunning (
  131. IN HWND hwndPage);
  132. // Gets a handle to a particular database. If this database needs
  133. // to be opened, it will be opened. In order to use this function,
  134. // the window proc of hwndPage must first call into RasSrvMessageFilter.
  135. DWORD
  136. RasSrvGetDatabaseHandle(
  137. IN HWND hwndPage,
  138. IN DWORD dwDatabaseId,
  139. IN HANDLE * hDatabase);
  140. // Returns the id of the page whose handle is hwndPage
  141. DWORD
  142. RasSrvGetPageId (
  143. IN HWND hwndPage,
  144. OUT LPDWORD lpdwId);
  145. //
  146. // Callback function for property sheet pages that cleans up
  147. // the page.
  148. //
  149. UINT
  150. CALLBACK
  151. RasSrvInitDestroyPropSheetCb(
  152. IN HWND hwndPage,
  153. IN UINT uMsg,
  154. IN LPPROPSHEETPAGE pPropPage);
  155. // Filters messages for RasSrv Property Pages. If this function returns
  156. // true, the winproc of the dialog window should return true immediately.
  157. // Otherwise message processing may continue as normal.
  158. BOOL
  159. RasSrvMessageFilter(
  160. IN HWND hwndDlg,
  161. IN UINT uMsg,
  162. IN WPARAM wParam,
  163. IN LPARAM lParam);
  164. DWORD
  165. RassrvSetICConfig(
  166. IN DWORD dwValue );
  167. DWORD
  168. RasSrvIsICConfigured(
  169. OUT BOOL * pfConfig);
  170. #endif