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.

268 lines
11 KiB

  1. // --------------------------------------------------------------------------------
  2. // SMIMEPOL.IDL
  3. // Copyright (c)1993-1998 Microsoft Corporation, All Rights Reserved
  4. // SMIME Policy definitions.
  5. // --------------------------------------------------------------------------------
  6. import "ocidl.idl";
  7. import "objidl.idl";
  8. #ifndef UNIX
  9. import "propidl.idl";
  10. #else
  11. import "urlmon.idl";
  12. #endif /* unix */
  13. import "mimeole.idl";
  14. midl_pragma warning(disable:2139)
  15. #ifdef SMIME_V3
  16. // Forward declarations.
  17. interface ISMIMEPolicySimpleEdit;
  18. interface ISMIMEPolicyFullEdit;
  19. interface ISMIMEPolicyCheckAccess;
  20. interface ISMIMEPolicyLabelInfo;
  21. interface ISMIMEPolicyValidateSend;
  22. // Comments
  23. cpp_quote("//--------------------------------------------------------------------------------")
  24. cpp_quote("// SMIMEPOL.H")
  25. cpp_quote("//--------------------------------------------------------------------------------")
  26. cpp_quote("// (C) Copyright 1995-1998 Microsoft Corporation. All Rights Reserved.")
  27. cpp_quote("//")
  28. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  29. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  30. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  31. cpp_quote("// PARTICULAR PURPOSE.")
  32. cpp_quote("//--------------------------------------------------------------------------------")
  33. cpp_quote("")
  34. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  35. cpp_quote("")
  36. // Guids
  37. cpp_quote("// --------------------------------------------------------------------------------")
  38. cpp_quote("// GUIDS")
  39. cpp_quote("// --------------------------------------------------------------------------------")
  40. cpp_quote("// {5073B6B4-AA66-11d2-9841-0060B0EC2DF3}")
  41. cpp_quote("DEFINE_GUID(IID_ISMimePolicySimpleEdit, 0x5073b6b4, 0xaa66, 0x11d2, 0x98, 0x41, 0x0, 0x60, 0xb0, 0xec, 0x2d, 0xf3);")
  42. cpp_quote("")
  43. cpp_quote("// {5073B6B5-AA66-11d2-9841-0060B0EC2DF3}")
  44. cpp_quote("DEFINE_GUID(IID_ISMimePolicyFullEdit, 0x5073b6b5, 0xaa66, 0x11d2, 0x98, 0x41, 0x0, 0x60, 0xb0, 0xec, 0x2d, 0xf3);")
  45. cpp_quote("")
  46. cpp_quote("// {5073B6B6-AA66-11d2-9841-0060B0EC2DF3}")
  47. cpp_quote("DEFINE_GUID(IID_ISMimePolicyCheckAccess, 0x5073b6b6, 0xaa66, 0x11d2, 0x98, 0x41, 0x0, 0x60, 0xb0, 0xec, 0x2d, 0xf3);")
  48. cpp_quote("")
  49. cpp_quote("// {5073B6B7-AA66-11d2-9841-0060B0EC2DF3}")
  50. cpp_quote("DEFINE_GUID(IID_ISMimePolicyLabelInfo, 0x5073b6b7, 0xaa66, 0x11d2, 0x98, 0x41, 0x0, 0x60, 0xb0, 0xec, 0x2d, 0xf3);")
  51. cpp_quote("")
  52. cpp_quote("// {5073B6B8-AA66-11d2-9841-0060B0EC2DF3}")
  53. cpp_quote("DEFINE_GUID(IID_ISMimePolicyValidateSend, 0x5073b6b8, 0xaa66, 0x11d2, 0x98, 0x41, 0x0, 0x60, 0xb0, 0xec, 0x2d, 0xf3);")
  54. cpp_quote("")
  55. // Typedefs.
  56. cpp_quote("// Typedefs")
  57. cpp_quote("#ifndef LPBYTE")
  58. cpp_quote("typedef BYTE *LPBYTE;")
  59. cpp_quote("#endif")
  60. cpp_quote("")
  61. //
  62. // Common Defines
  63. //
  64. cpp_quote("// --------------------------------------------------------------------------------")
  65. cpp_quote("// Common Macros")
  66. cpp_quote("// --------------------------------------------------------------------------------")
  67. cpp_quote("")
  68. cpp_quote("// PolicyFlags.")
  69. cpp_quote("#define SMIME_POLICY_MODULE_SUPPORTS_ADV_CONFIG 0x00000001")
  70. cpp_quote("#define SMIME_POLICY_MODULE_FORCE_ENCRYPTION 0x00000002")
  71. cpp_quote("#define SMIME_POLICY_MODULE_VALIDATE_RECIPIENT 0x00000004")
  72. cpp_quote("#define SMIME_POLICY_MODULE_VALIDATE_SENDER 0x00000008")
  73. cpp_quote("#define SMIME_POLICY_MODULE_PRIVACYMARK_READONLY 0x00000010")
  74. cpp_quote("")
  75. cpp_quote("// Common Flags.")
  76. cpp_quote("#define SMIME_POLICY_MODULE_NOUI 0x00000001")
  77. cpp_quote("#define SMIME_POLICY_MODULE_NOEDIT 0x00000002")
  78. // ---------------------------------------------------------------------------------------
  79. // ISMimePolicySimpleEdit - Used for simple editing of security label properties.
  80. // ---------------------------------------------------------------------------------------
  81. [
  82. uuid(5073B6B4-AA66-11d2-9841-0060B0EC2DF3),
  83. local,
  84. helpstring("ISMimePolicySimpleEdit"),
  85. ]
  86. interface ISMimePolicySimpleEdit : IUnknown
  87. {
  88. typedef [unique] ISMimePolicySimpleEdit *LPSMIMEPOLICYSIMPLEEDIT;
  89. HRESULT GetPolicyInfo(
  90. [in] DWORD dwFlags,
  91. [out] DWORD *pdwPolicyFlags);
  92. HRESULT GetClassifications(
  93. [in] DWORD dwFlags,
  94. [out] DWORD *pcClassifications,
  95. [out] LPWSTR **rgwszClassifications,
  96. [out] LPDWORD *rgdwClassifications,
  97. [out] DWORD *pdwDefault);
  98. HRESULT GetDefaultPolicyInfo(
  99. [in] DWORD dwFlags,
  100. [out] DWORD *pdwClassification, // default classification
  101. [out] LPWSTR *pwszPrivaryMark);
  102. HRESULT IsLabelValid(
  103. [in] DWORD dwFlags,
  104. [in] HWND hwndParent,
  105. [in,out] PSMIME_SECURITY_LABEL *pplabel);
  106. }
  107. // ---------------------------------------------------------------------------------------
  108. // ISMimePolicyFullEdit - Used for full editing of security label properties.
  109. // ---------------------------------------------------------------------------------------
  110. [
  111. uuid(5073B6B5-AA66-11d2-9841-0060B0EC2DF3),
  112. local,
  113. helpstring("ISMimePolicyFullEdit"),
  114. ]
  115. interface ISMimePolicyFullEdit : ISMimePolicySimpleEdit
  116. {
  117. typedef [unique] ISMimePolicyFullEdit *LPSMIMEPOLICYFULLEDIT;
  118. HRESULT DoAdvancedEdit(
  119. [in] DWORD dwFlags,
  120. [in] HWND hwndParent,
  121. [in,out] PSMIME_SECURITY_LABEL *pplabel);
  122. HRESULT IsLabelValidAdvanced(
  123. [in] DWORD dwFlags,
  124. [in] HWND hwndParent,
  125. [in,out] PSMIME_SECURITY_LABEL *pplabel);
  126. }
  127. // ---------------------------------------------------------------------------------------
  128. // ISMimePolicyCheckAccess - Used for checking if access should be granted to the message.
  129. // ---------------------------------------------------------------------------------------
  130. [
  131. uuid(5073B6B6-AA66-11d2-9841-0060B0EC2DF3),
  132. local,
  133. helpstring("ISMimePolicyCheckAccess"),
  134. ]
  135. interface ISMimePolicyCheckAccess : IUnknown
  136. {
  137. typedef [unique] ISMimePolicyCheckAccess *LPSMIMEPOLICYCHECKACCESS;
  138. HRESULT IsAccessGranted(
  139. [in] DWORD dwFlags,
  140. [in] HWND hwndParent,
  141. [in] const PSMIME_SECURITY_LABEL plabel,
  142. [in] const PCCERT_CONTEXT pccertDecrypt, /*optional*/
  143. [in] const PCCERT_CONTEXT pccertSign,
  144. [in] const HCERTSTORE hcertstor /*optional*/ );
  145. }
  146. // ---------------------------------------------------------------------------------------
  147. // IID_ISMimePolicyLabelInfo - Used for getting label info and displaying adv properties.
  148. // ---------------------------------------------------------------------------------------
  149. [
  150. uuid(5073B6B7-AA66-11d2-9841-0060B0EC2DF3),
  151. local,
  152. helpstring("ISMimePolicyLabelInfo"),
  153. ]
  154. interface ISMimePolicyLabelInfo : IUnknown
  155. {
  156. typedef [unique] ISMimePolicyLabelInfo *LPSMIMEPOLICYLABELINFO;
  157. HRESULT GetLabelAsStrings(
  158. [in] DWORD dwFlags,
  159. [in] const PSMIME_SECURITY_LABEL plabel,
  160. [out] LPWSTR *pwszPolicyName,
  161. [out] LPWSTR *pwszClassification,
  162. [out] LPWSTR *pwszPrivacyMark,
  163. [out] LPWSTR *pwszCategory);
  164. HRESULT GetStringizedLabel(
  165. [in] DWORD dwFlags,
  166. [in] const PSMIME_SECURITY_LABEL plabel,
  167. [out] LPWSTR *pwszLabel);
  168. HRESULT DisplayAdvancedLabelProperties(
  169. [in] DWORD dwFlags,
  170. [in] HWND hwndParent,
  171. [in] const PSMIME_SECURITY_LABEL plabel);
  172. }
  173. // ---------------------------------------------------------------------------------------
  174. // IID_ISMimePolicyValidateSend - Used for validation at send time.
  175. // ---------------------------------------------------------------------------------------
  176. [
  177. uuid(5073B6B8-AA66-11d2-9841-0060B0EC2DF3),
  178. local,
  179. helpstring("ISMimePolicyLabelInfo"),
  180. ]
  181. interface ISMimePolicyValidateSend : IUnknown
  182. {
  183. typedef [unique] ISMimePolicyValidateSend *LPSMIMEPOLICYVALIDATESEND;
  184. HRESULT IsValidLabelSignerCert(
  185. [in] DWORD dwFlags,
  186. [in] HWND hwndParent,
  187. [in] const PSMIME_SECURITY_LABEL plabel,
  188. [in] const PCCERT_CONTEXT pccertSigner);
  189. HRESULT IsValidLabelRecipientCert(
  190. [in] DWORD dwFlags,
  191. [in] HWND hwndParent,
  192. [in] const PSMIME_SECURITY_LABEL plabel,
  193. [in] const PCCERT_CONTEXT pccertRecipient);
  194. }
  195. cpp_quote("typedef HRESULT (*PFNGetSMimePolicy) (")
  196. cpp_quote(" /* in */ DWORD dwFlags,")
  197. cpp_quote(" /* in */ LPSTR szObjIdSecurityPolicy,")
  198. cpp_quote(" /* in */ LCID lcid,")
  199. cpp_quote(" /* in */ REFIID riid,")
  200. cpp_quote(" /* out */ LPUNKNOWN *ppUnk);")
  201. cpp_quote("")
  202. cpp_quote("// Macros for the memfree/alloc used by the policy module. ")
  203. cpp_quote("#define SecPolicyAlloc(cb) GlobalAlloc(GPTR, (cb)) ")
  204. cpp_quote("#define SecPolicyFree(hMem) if (hMem) { GlobalFree(hMem); hMem = NULL; } ")
  205. cpp_quote(" // Other useful macros ")
  206. cpp_quote("#define MAX_OID_LENGTH MAX_PATH ")
  207. cpp_quote("#define MAX_POLICY_NAME MAX_PATH ")
  208. cpp_quote("#define MAX_FUNC_NAME MAX_PATH ")
  209. cpp_quote("// Don't use classification and privacy strings larger than this # of chars. ")
  210. cpp_quote("#define MAX_PRIVACYMARK_LENGTH MAX_PATH ")
  211. #endif // SMIME_V3