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.

273 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. serverp.h
  5. Abstract:
  6. This module defines the data structures and function prototypes
  7. for the security managment utility
  8. Author:
  9. Jin Huang (jinhuang) 28-Oct-1996
  10. Revision History:
  11. jinhuang 26-Jan-1998 splitted for client-server
  12. --*/
  13. #ifndef _serverp_
  14. #define _serverp_
  15. #include "headers.h"
  16. #include <ntsam.h>
  17. #include <ntlsa.h>
  18. #include <ntseapi.h>
  19. #include <ntdddisk.h>
  20. #define OEMRESOURCE // setting this gets OBM_ constants in windows.h
  21. #include <winspool.h>
  22. #include <ddeml.h>
  23. #include <commdlg.h>
  24. #include <commctrl.h>
  25. #include <cfgmgr32.h>
  26. //#include <objbase.h>
  27. #include <userenv.h>
  28. #include <regstr.h>
  29. #include <setupbat.h>
  30. #include <aclapi.h>
  31. #include <winldap.h>
  32. #include "scejetp.h"
  33. //
  34. // the following header is defined as a c header so both c and cpp can
  35. // link to the client lib
  36. //
  37. #include "scesvc.h"
  38. #include "scerpc.h"
  39. #include "scep.h"
  40. #include "srvutil.h"
  41. #include "srvrpcp.h"
  42. #include "scesrvrc.h"
  43. #include "sceutil.h"
  44. #include "service.h"
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. #if _WIN32_WINNT>=0x0500
  49. #include <dsgetdc.h>
  50. #include <ntdsapi.h>
  51. typedef DWORD (WINAPI *PFNDSGETDCNAME)(LPCTSTR, LPCTSTR, GUID *, LPCTSTR, ULONG, PDOMAIN_CONTROLLER_INFO *);
  52. typedef DWORD (WINAPI *PFNNETAPIFREE)(LPVOID);
  53. #endif
  54. #define Thread __declspec( thread )
  55. extern DWORD Thread gCurrentTicks;
  56. extern DWORD Thread gTotalTicks;
  57. extern BYTE Thread cbClientFlag;
  58. extern DWORD Thread gWarningCode;
  59. extern BOOL Thread gbInvalidData;
  60. extern BOOL Thread bLogOn;
  61. extern INT Thread gDebugLevel;
  62. extern DWORD Thread gMaxRegTicks;
  63. extern DWORD Thread gMaxFileTicks;
  64. extern DWORD Thread gMaxDsTicks;
  65. extern NT_PRODUCT_TYPE Thread ProductType;
  66. extern PSID Thread AdminsSid;
  67. extern DWORD Thread gdwPolicyLog;
  68. #define SCE_RPC_SERVER_ACTIVE L"SCE_RPC_SERVER_ACTIVE"
  69. #define SCE_RPC_SERVER_STOPPED L"SCE_RPC_SERVER_STOPPED"
  70. //
  71. // prototypes in server.cpp
  72. //
  73. VOID
  74. ScepInitServerData();
  75. VOID
  76. ScepUninitServerData();
  77. NTSTATUS
  78. ScepStartServerServices();
  79. NTSTATUS
  80. ScepStopServerServices(
  81. IN BOOL bShutDown
  82. );
  83. SCESTATUS
  84. ScepPostProgress(
  85. IN DWORD Delta,
  86. IN AREA_INFORMATION Area,
  87. IN LPTSTR szName OPTIONAL
  88. );
  89. SCESTATUS
  90. ScepRsopLog(
  91. IN AREA_INFORMATION Area,
  92. IN DWORD dwConfigStatus,
  93. IN wchar_t *pStatusInfo OPTIONAL,
  94. IN DWORD dwPrivLow OPTIONAL,
  95. IN DWORD dwPrivHigh OPTIONAL
  96. );
  97. BOOL
  98. ScepIsSystemShutDown();
  99. SCESTATUS
  100. ScepServerCancelTimer();
  101. //
  102. // prototypes in errlog.c
  103. //
  104. SCESTATUS
  105. ScepSetVerboseLog(
  106. IN INT dbgLevel
  107. );
  108. SCESTATUS
  109. ScepEnableDisableLog(
  110. IN BOOL bOnOff
  111. );
  112. //
  113. // prototypes defined in tree.c
  114. //
  115. SCESTATUS
  116. ScepBuildObjectTree(
  117. IN OUT PSCE_OBJECT_TREE *ParentNode,
  118. IN OUT PSCE_OBJECT_CHILD_LIST *ChildHead,
  119. IN ULONG Level,
  120. IN WCHAR Delim,
  121. IN PCWSTR ObjectFullName,
  122. IN BOOL IsContainer,
  123. IN BYTE Status,
  124. IN PSECURITY_DESCRIPTOR pInfSecurityDescriptor,
  125. IN SECURITY_INFORMATION InfSeInfo
  126. );
  127. SCESTATUS
  128. ScepCalculateSecurityToApply(
  129. IN PSCE_OBJECT_TREE ThisNode,
  130. IN SE_OBJECT_TYPE ObjectType,
  131. IN HANDLE Token,
  132. IN PGENERIC_MAPPING GenericMapping
  133. );
  134. SCESTATUS
  135. ScepConfigureObjectTree(
  136. IN PSCE_OBJECT_TREE ThisNode,
  137. IN SE_OBJECT_TYPE ObjectType,
  138. IN HANDLE Token,
  139. IN PGENERIC_MAPPING GenericMapping,
  140. IN DWORD ConfigOptions
  141. );
  142. SCESTATUS
  143. ScepFreeObject2Security(
  144. IN PSCE_OBJECT_CHILD_LIST NodeList,
  145. IN BOOL bFreeComputedSDOnly
  146. );
  147. DWORD
  148. ScepSetSecurityWin32(
  149. IN PCWSTR ObjectName,
  150. IN SECURITY_INFORMATION SeInfo,
  151. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  152. IN SE_OBJECT_TYPE ObjectType
  153. );
  154. DWORD
  155. ScepSetSecurityObjectOnly(
  156. IN PCWSTR ObjectName,
  157. IN SECURITY_INFORMATION SeInfo,
  158. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  159. IN SE_OBJECT_TYPE ObjectType,
  160. OUT PBOOL pbHasChild
  161. );
  162. DWORD
  163. ScepGetNewSecurity(
  164. IN LPTSTR ObjectName,
  165. IN PSECURITY_DESCRIPTOR pParentSD OPTIONAL,
  166. IN PSECURITY_DESCRIPTOR pObjectSD OPTIONAL,
  167. IN BYTE nFlag,
  168. IN BOOLEAN bIsContainer,
  169. IN SECURITY_INFORMATION SeInfo,
  170. IN SE_OBJECT_TYPE ObjectType,
  171. IN HANDLE Token,
  172. IN PGENERIC_MAPPING GenericMapping,
  173. OUT PSECURITY_DESCRIPTOR *ppNewSD
  174. );
  175. SCESTATUS
  176. ScepSetupResetLocalPolicy(
  177. IN PSCECONTEXT Context,
  178. IN AREA_INFORMATION Area,
  179. IN PCWSTR SectionName OPTIONAL,
  180. IN SCETYPE ProfileType,
  181. IN BOOL bKeepBasicPolicy
  182. );
  183. DWORD
  184. ScepAddSidStringToNameList(
  185. IN OUT PSCE_NAME_LIST *ppNameList,
  186. IN PSID pSid
  187. );
  188. DWORD
  189. ScepNotifyProcessOneNodeDC(
  190. IN SECURITY_DB_TYPE DbType,
  191. IN SECURITY_DB_OBJECT_TYPE ObjectType,
  192. IN SECURITY_DB_DELTA_TYPE DeltaType,
  193. IN PSID ObjectSid,
  194. IN DWORD ExplicitLowRight,
  195. IN DWORD ExplicitHighRight
  196. );
  197. VOID
  198. ScepConfigureConvertedFileSecurityThreadFunc(
  199. IN PVOID pV
  200. );
  201. VOID
  202. ScepWaitForServicesEventAndConvertSecurityThreadFunc(
  203. IN PVOID pV
  204. );
  205. DWORD
  206. ScepServerConfigureSystem(
  207. IN PWSTR InfFileName,
  208. IN PWSTR DatabaseName,
  209. IN PWSTR LogFileName,
  210. IN DWORD ConfigOptions,
  211. IN AREA_INFORMATION Area
  212. );
  213. #ifdef __cplusplus
  214. }
  215. #endif
  216. #endif