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.

457 lines
13 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. scesvc.h
  5. Abstract:
  6. Wrapper APIs for services
  7. Revision History:
  8. --*/
  9. DEFINE_GUID(cNodetypeSceTemplateServices, 0x24a7f717, 0x1f0c, 0x11d1, 0xaf, 0xfb, 0x0, 0xc0, 0x4f, 0xb9, 0x84, 0xf9);
  10. DEFINE_GUID(cNodetypeSceAnalysisServices, 0x678050c7, 0x1ff8, 0x11d1, 0xaf, 0xfb, 0x0, 0xc0, 0x4f, 0xb9, 0x84, 0xf9);
  11. DEFINE_GUID(cNodetypeSceEventLog, 0x2ce06698, 0x4bf3, 0x11d1, 0x8c, 0x30, 0x0, 0xc0, 0x4f, 0xb9, 0x84, 0xf9);
  12. DEFINE_GUID(IID_ISceSvcAttachmentPersistInfo, 0x6d90e0d0, 0x200d, 0x11d1, 0xaf, 0xfb, 0x0, 0xc0, 0x4f, 0xb9, 0x84, 0xf9);
  13. DEFINE_GUID(IID_ISceSvcAttachmentData, 0x17c35fde, 0x200d, 0x11d1, 0xaf, 0xfb, 0x0, 0xc0, 0x4f, 0xb9, 0x84, 0xf9);
  14. #ifndef _scesvc_
  15. #define _scesvc_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #ifndef _SCE_SHARED_HEADER
  20. #define _SCE_SHARED_HEADER
  21. typedef DWORD SCESTATUS;
  22. #define SCESTATUS_SUCCESS 0L
  23. #define SCESTATUS_INVALID_PARAMETER 1L
  24. #define SCESTATUS_RECORD_NOT_FOUND 2L
  25. #define SCESTATUS_INVALID_DATA 3L
  26. #define SCESTATUS_OBJECT_EXIST 4L
  27. #define SCESTATUS_BUFFER_TOO_SMALL 5L
  28. #define SCESTATUS_PROFILE_NOT_FOUND 6L
  29. #define SCESTATUS_BAD_FORMAT 7L
  30. #define SCESTATUS_NOT_ENOUGH_RESOURCE 8L
  31. #define SCESTATUS_ACCESS_DENIED 9L
  32. #define SCESTATUS_CANT_DELETE 10L
  33. #define SCESTATUS_PREFIX_OVERFLOW 11L
  34. #define SCESTATUS_OTHER_ERROR 12L
  35. #define SCESTATUS_ALREADY_RUNNING 13L
  36. #define SCESTATUS_SERVICE_NOT_SUPPORT 14L
  37. #define SCESTATUS_MOD_NOT_FOUND 15L
  38. #define SCESTATUS_EXCEPTION_IN_SERVER 16L
  39. #define SCESTATUS_NO_TEMPLATE_GIVEN 17L
  40. #define SCESTATUS_NO_MAPPING 18L
  41. #define SCESTATUS_TRUST_FAIL 19L
  42. typedef struct _SCESVC_CONFIGURATION_LINE_ {
  43. LPTSTR Key;
  44. LPTSTR Value;
  45. DWORD ValueLen; // number of bytes
  46. } SCESVC_CONFIGURATION_LINE, *PSCESVC_CONFIGURATION_LINE;
  47. typedef struct _SCESVC_CONFIGURATION_INFO_ {
  48. DWORD Count;
  49. PSCESVC_CONFIGURATION_LINE Lines;
  50. } SCESVC_CONFIGURATION_INFO, *PSCESVC_CONFIGURATION_INFO;
  51. typedef PVOID SCE_HANDLE;
  52. typedef ULONG SCE_ENUMERATION_CONTEXT, *PSCE_ENUMERATION_CONTEXT;
  53. typedef enum _SCESVC_INFO_TYPE {
  54. SceSvcConfigurationInfo,
  55. SceSvcMergedPolicyInfo,
  56. SceSvcAnalysisInfo,
  57. SceSvcInternalUse // !!!do not use this type!!!
  58. } SCESVC_INFO_TYPE;
  59. #define SCE_ROOT_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\SeCEdit")
  60. #define SCE_ROOT_SERVICE_PATH \
  61. SCE_ROOT_PATH TEXT("\\SvcEngs")
  62. #endif
  63. typedef PVOID SCESVC_HANDLE;
  64. typedef struct _SCESVC_ANALYSIS_LINE_ {
  65. LPTSTR Key;
  66. PBYTE Value;
  67. DWORD ValueLen; // number of bytes
  68. } SCESVC_ANALYSIS_LINE, *PSCESVC_ANALYSIS_LINE;
  69. typedef struct _SCESVC_ANALYSIS_INFO_ {
  70. DWORD Count;
  71. PSCESVC_ANALYSIS_LINE Lines;
  72. } SCESVC_ANALYSIS_INFO, *PSCESVC_ANALYSIS_INFO;
  73. #define SCESVC_ENUMERATION_MAX 100L
  74. typedef
  75. SCESTATUS
  76. (CALLBACK *PFSCE_QUERY_INFO)(
  77. IN SCE_HANDLE sceHandle,
  78. IN SCESVC_INFO_TYPE sceType,
  79. IN LPTSTR lpPrefix OPTIONAL,
  80. IN BOOL bExact,
  81. OUT PVOID *ppvInfo,
  82. OUT PSCE_ENUMERATION_CONTEXT psceEnumHandle
  83. );
  84. typedef
  85. SCESTATUS
  86. (CALLBACK *PFSCE_SET_INFO)(
  87. IN SCE_HANDLE sceHandle,
  88. IN SCESVC_INFO_TYPE sceType,
  89. IN LPTSTR lpPrefix OPTIONAL,
  90. IN BOOL bExact,
  91. IN PVOID pvInfo
  92. );
  93. typedef
  94. SCESTATUS
  95. (CALLBACK *PFSCE_FREE_INFO)(
  96. IN PVOID pvServiceInfo
  97. );
  98. #define SCE_LOG_LEVEL_ALWAYS 0
  99. #define SCE_LOG_LEVEL_ERROR 1
  100. #define SCE_LOG_LEVEL_DETAIL 2
  101. #define SCE_LOG_LEVEL_DEBUG 3
  102. typedef
  103. SCESTATUS
  104. (CALLBACK *PFSCE_LOG_INFO)(
  105. IN INT ErrLevel,
  106. IN DWORD Win32rc,
  107. IN LPTSTR pErrFmt,
  108. ...
  109. );
  110. typedef struct _SCESVC_CALLBACK_INFO_ {
  111. SCE_HANDLE sceHandle;
  112. PFSCE_QUERY_INFO pfQueryInfo;
  113. PFSCE_SET_INFO pfSetInfo;
  114. PFSCE_FREE_INFO pfFreeInfo;
  115. PFSCE_LOG_INFO pfLogInfo;
  116. } SCESVC_CALLBACK_INFO, *PSCESVC_CALLBACK_INFO;
  117. typedef
  118. SCESTATUS
  119. (*PF_ConfigAnalyzeService)(
  120. IN PSCESVC_CALLBACK_INFO pSceCbInfo
  121. );
  122. typedef
  123. SCESTATUS
  124. (*PF_UpdateService)(
  125. IN PSCESVC_CALLBACK_INFO pSceCbInfo,
  126. IN PSCESVC_CONFIGURATION_INFO ServiceInfo
  127. );
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif
  132. //#if _WIN32_WINNT==0x0500
  133. //
  134. // headers for extension snap-ins
  135. // only define this for NT5
  136. //
  137. #ifndef _UUIDS_SCE_ATTACHMENT_
  138. #define _UUIDS_SCE_ATTACHMENT_
  139. #include "rpc.h"
  140. #include "rpcndr.h"
  141. //#ifndef __RPCNDR_H_VERSION__
  142. //#error this stub requires an updated version of <rpcndr.h>
  143. //#endif // __RPCNDR_H_VERSION__
  144. #if __RPCNDR_H_VERSION__ < 440
  145. #define __RPCNDR_H_VERSION__ 440
  146. #ifndef MIDL_INTERFACE
  147. #define MIDL_INTERFACE(x) interface
  148. #endif
  149. #endif
  150. #ifndef COM_NO_WINDOWS_H
  151. #include "windows.h"
  152. #include "ole2.h"
  153. #endif /*COM_NO_WINDOWS_H*/
  154. #ifdef __cplusplus
  155. extern "C" {
  156. #endif
  157. #define struuidNodetypeSceTemplateServices "{24a7f717-1f0c-11d1-affb-00c04fb984f9}"
  158. #define lstruuidNodetypeSceTemplateServices L"{24a7f717-1f0c-11d1-affb-00c04fb984f9}"
  159. #define struuidNodetypeSceAnalysisServices "{678050c7-1ff8-11d1-affb-00c04fb984f9}"
  160. #define lstruuidNodetypeSceAnalysisServices L"{678050c7-1ff8-11d1-affb-00c04fb984f9}"
  161. #define struuidNodetypeSceEventLog "{2ce06698-4bf3-11d1-8c30-00c04fb984f9}"
  162. #define lstruuidNodetypeSceEventLog L"{2ce06698-4bf3-11d1-8c30-00c04fb984f9}"
  163. typedef PSCESVC_CONFIGURATION_INFO __RPC_FAR *LPSCESVC_CONFIGURATION_INFO;
  164. typedef PSCESVC_ANALYSIS_INFO __RPC_FAR *LPSCESVC_ANALYSIS_INFO;
  165. #define CCF_SCESVC_ATTACHMENT L"CCF_SCESVC_ATTACHMENT"
  166. #define CCF_SCESVC_ATTACHMENT_DATA L"CCF_SCESVC_ATTACHMENT_DATA"
  167. //
  168. // implemented by service attachment
  169. //
  170. typedef interface ISceSvcAttachmentPersistInfo ISceSvcAttachmentPersistInfo;
  171. typedef ISceSvcAttachmentPersistInfo __RPC_FAR *LPSCESVCATTACHMENTPERSISTINFO;
  172. //extern const IID IID_ISceSvcAttachmentPersistInfo;
  173. #if defined(__cplusplus) && !defined(CINTERFACE)
  174. MIDL_INTERFACE("6d90e0d0-200d-11d1-affb-00c04fb984f9")
  175. ISceSvcAttachmentPersistInfo : public IUnknown
  176. {
  177. public:
  178. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Save(
  179. /* [in] */ LPTSTR lpTemplateName,
  180. /* [out] */ SCESVC_HANDLE *scesvcHandle,
  181. /* [out] */ PVOID *ppvData,
  182. /* [out] */ PBOOL pbOverwriteAll ) = 0;
  183. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE IsDirty(
  184. /* [in] */ LPTSTR lpTemplateName ) = 0;
  185. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FreeBuffer(
  186. /* [in] */ PVOID pvData) = 0;
  187. };
  188. #else
  189. // c style interface
  190. typedef struct ISceSvcAttachmentPersistInfoVtbl
  191. {
  192. BEGIN_INTERFACE
  193. HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
  194. ISceSvcAttachmentPersistInfo __RPC_FAR * This,
  195. /* [in] */ REFIID riid,
  196. /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
  197. ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
  198. ISceSvcAttachmentPersistInfo __RPC_FAR * This);
  199. ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
  200. ISceSvcAttachmentPersistInfo __RPC_FAR * This);
  201. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Save )(
  202. /* [in] */ ISceSvcAttachmentPersistInfo __RPC_FAR * This,
  203. /* [in] */ LPTSTR lpTemplateName,
  204. /* [in] */ SCESVC_HANDLE scesvcHandle,
  205. /* [out] */ PVOID *ppvData,
  206. /* [in out] */ PBOOL pbOverwriteAll );
  207. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *FreeBuffer )(
  208. /* [in] */ ISceSvcAttachmentPersistInfo __RPC_FAR * This,
  209. /* [in] */ PVOID pvData);
  210. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *IsDirty )(
  211. /* [in] */ ISceSvcAttachmentPersistInfo __RPC_FAR * This,
  212. /* [in] */ LPTSTR lpTemplateName );
  213. END_INTERFACE
  214. } ISceSvcAttachmentPersistInfoVtbl;
  215. interface ISceSvcAttachmentPersistInfo
  216. {
  217. CONST_VTBL struct ISceSvcAttachmentPersistInfoVtbl __RPC_FAR *lpVtbl;
  218. };
  219. #ifdef COBJMACROS
  220. #define IData_QueryInterface(This,riid,ppvObject) \
  221. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  222. #define ISceSvcAttachmentPersistInfo_AddRef(This) \
  223. (This)->lpVtbl -> AddRef(This)
  224. #define ISceSvcAttachmentPersistInfo_Release(This) \
  225. (This)->lpVtbl -> Release(This)
  226. #define ISceSvcAttachmentPersistInfo_Save(This, lpTemplateName, scesvcHandle, ppvData, pbOverwriteAll) \
  227. (This)->lpVtbl -> Save(lpTemplateName, scesvcHandle, ppvData, pbOverwriteAll)
  228. #define ISceSvcAttachmentPersistInfo_FreeBuffer(This,pvData) \
  229. (This)->lpVtbl -> FreeBuffer(pvData)
  230. #define ISceSvcAttachmentPersistInfo_CloseHandle(This, lpTemplateName) \
  231. (This)->lpVtbl -> IsDirty(lpTemplateName)
  232. #endif /* COBJMACROS */
  233. #endif
  234. //
  235. // implemented by SecEdit
  236. //
  237. typedef interface ISceSvcAttachmentData ISceSvcAttachmentData;
  238. typedef ISceSvcAttachmentData __RPC_FAR *LPSCESVCATTACHMENTDATA;
  239. //extern const IID IID_ISceSvcAttachmentData;
  240. #if defined(__cplusplus) && !defined(CINTERFACE)
  241. MIDL_INTERFACE("17c35fde-200d-11d1-affb-00c04fb984f9")
  242. ISceSvcAttachmentData : public IUnknown
  243. {
  244. public:
  245. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetData(
  246. /* [in] */ SCESVC_HANDLE scesvcHandle,
  247. /* [in] */ SCESVC_INFO_TYPE sceType,
  248. /* [out] */ PVOID *ppvData,
  249. /* [in out] */ PSCE_ENUMERATION_CONTEXT psceEnumHandle ) = 0;
  250. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
  251. /* [in] */ LPCTSTR lpServiceName,
  252. /* [in] */ LPCTSTR lpTemplateName,
  253. /* [in] */ LPSCESVCATTACHMENTPERSISTINFO lpSceSvcPersistInfo,
  254. /* [out] */ SCESVC_HANDLE *pscesvcHandle) = 0;
  255. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FreeBuffer(
  256. /* [in] */ PVOID pvData) = 0;
  257. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CloseHandle(
  258. /* [in] */ SCESVC_HANDLE scesvcHandle) = 0;
  259. };
  260. #else
  261. // c style interface
  262. typedef struct ISceSvcAttachmentDataVtbl
  263. {
  264. BEGIN_INTERFACE
  265. HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
  266. ISceSvcAttachmentData __RPC_FAR * This,
  267. /* [in] */ REFIID riid,
  268. /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
  269. ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
  270. ISceSvcAttachmentData __RPC_FAR * This);
  271. ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
  272. ISceSvcAttachmentData __RPC_FAR * This);
  273. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Initialize )(
  274. /* [in] */ ISceSvcAttachmentData __RPC_FAR * This,
  275. /* [in] */ LPCTSTR lpServiceName,
  276. /* [in] */ LPCTSTR lpTemplateName,
  277. /* [in] */ LPSCESVCATTACHMENTPERSISTINFO lpSceSvcPersistInfo,
  278. /* [out] */ SCESVC_HANDLE *pscesvcHandle);
  279. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetData )(
  280. /* [in] */ ISceSvcAttachmentData __RPC_FAR * This,
  281. /* [in] */ SCESVC_HANDLE scesvcHandle,
  282. /* [in] */ SCESVC_INFO_TYPE sceType,
  283. /* [out] */ PVOID *ppvData,
  284. /* [in out] */ PSCE_ENUMERATION_CONTEXT psceEnumHandle );
  285. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *FreeBuffer )(
  286. /* [in] */ ISceSvcAttachmentData __RPC_FAR * This,
  287. /* [in] */ PVOID pvData);
  288. /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CloseHandle )(
  289. /* [in] */ ISceSvcAttachmentData __RPC_FAR * This,
  290. /* [in] */ SCESVC_HANDLE scesvcHandle);
  291. END_INTERFACE
  292. } ISceSvcAttachmentDataVtbl;
  293. interface ISceSvcAttachmentData
  294. {
  295. CONST_VTBL struct ISceSvcAttachmentDataVtbl __RPC_FAR *lpVtbl;
  296. };
  297. #ifdef COBJMACROS
  298. #define IData_QueryInterface(This,riid,ppvObject) \
  299. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  300. #define ISceSvcAttachmentData_AddRef(This) \
  301. (This)->lpVtbl -> AddRef(This)
  302. #define ISceSvcAttachmentData_Release(This) \
  303. (This)->lpVtbl -> Release(This)
  304. #define ISceSvcAttachmentData_Initialize(This, lpServiceName, lpTemplateName, lpSceSvcPersistInfo, pscesvcHandle) \
  305. (This)->lpVtbl -> Initialize(lpServiceName, lpTemplateName, lpSceSvcPersistInfo, pscesvcHandle)
  306. #define ISceSvcAttachmentData_GetData(This, scesvcHandle, sceType, ppvData, psceEnumHandle) \
  307. (This)->lpVtbl -> GetData(scesvcHandle, sceType, ppvData, psceEnumHandle)
  308. #define ISceSvcAttachmentData_FreeBuffer(This,pvData) \
  309. (This)->lpVtbl -> FreeBuffer(pvData)
  310. #define ISceSvcAttachmentData_CloseHandle(This, scesvcHandle) \
  311. (This)->lpVtbl -> CloseHandle(scesvcHandle)
  312. #endif /* COBJMACROS */
  313. #endif
  314. #ifdef __cplusplus
  315. }
  316. #endif
  317. #endif // _UUIDS_COMPUTER_MANAGEMENT_
  318. //#endif