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.

308 lines
12 KiB

  1. /************************************************************************
  2. * *
  3. * dispatch.idl - Windows NT Disk Quota dispatch interfaces. *
  4. * *
  5. * Copyright (c) 1991-1997, Microsoft Corp. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. const int DISPID_DISKQUOTAEVENTS_USERNAMECHANGED = 1;
  9. import "unknwn.idl";
  10. [
  11. uuid(7988B57C-EC89-11cf-9C00-00AA00A14F56),
  12. helpstring("Microsoft Disk Quota Type Library"),
  13. version(1.0)
  14. ]
  15. library DiskQuotaTypeLibrary
  16. {
  17. importlib("stdole2.tlb");
  18. // ========================================================================
  19. // Interface for DIDiskQuotaUser
  20. // ========================================================================
  21. [
  22. uuid(7988B57A-EC89-11cf-9C00-00AA00A14F56),
  23. helpstring("Automation interface for DiskQuotaUser"),
  24. oleautomation,
  25. dual,
  26. version(1.0)
  27. ]
  28. interface DIDiskQuotaUser : IDispatch
  29. {
  30. // --------------------------------------------------------------------
  31. // Properties
  32. // --------------------------------------------------------------------
  33. [propget, helpstring("Unique ID number")]
  34. HRESULT ID(
  35. [out, retval] long *pID);
  36. [propget, helpstring("Name of user's account container")]
  37. HRESULT AccountContainerName(
  38. [out, retval] BSTR *pContainerName);
  39. [propget, helpstring("User's logon account name")]
  40. HRESULT LogonName(
  41. [out, retval] BSTR *pLogonName);
  42. [propget, helpstring("User's display name")]
  43. HRESULT DisplayName(
  44. [out, retval] BSTR *pDisplayName);
  45. [propget, helpstring("User's quota warning threshold (bytes)")]
  46. HRESULT QuotaThreshold(
  47. [out, retval] double *pThreshold);
  48. [propput]
  49. HRESULT QuotaThreshold(
  50. [in] double Threshold);
  51. [propget, helpstring("User's quota warning threshold (text)")]
  52. HRESULT QuotaThresholdText(
  53. [out, retval] BSTR *pThresholdText);
  54. [propget, helpstring("User's quota limit (bytes)")]
  55. HRESULT QuotaLimit(
  56. [out, retval] double *pLimit);
  57. [propput]
  58. HRESULT QuotaLimit(
  59. [in] double Limit);
  60. [propget, helpstring("User's quota limit (text)")]
  61. HRESULT QuotaLimitText(
  62. [out, retval] BSTR *pLimitText);
  63. [propget, helpstring("Quota charged to user (bytes)")]
  64. HRESULT QuotaUsed(
  65. [out, retval] double *pUsed);
  66. [propget, helpstring("Quota charged to user (text)")]
  67. HRESULT QuotaUsedText(
  68. [out, retval] BSTR *pUsedText);
  69. //
  70. // AccountStatus property values.
  71. // These must match the DISKQUOTA_USER_ACCOUNT_XXXXXX constants
  72. // defined in dskquota.h.
  73. //
  74. typedef enum AccountStatusConstants {
  75. [helpstring("Account information is resolved")] dqAcctResolved = 0,
  76. [helpstring("Account information is unavailable")] dqAcctUnavailable = 1,
  77. [helpstring("Account has been deleted")] dqAcctDeleted = 2,
  78. [helpstring("Account is invalid")] dqAcctInvalid = 3,
  79. [helpstring("Account cannot be found")] dqAcctUnknown = 4,
  80. [helpstring("Account information is unresolved")] dqAcctUnresolved = 5
  81. } AccountStatusConstants;
  82. [propget, helpstring("Status of user's account")]
  83. HRESULT AccountStatus(
  84. [out, retval] AccountStatusConstants *pStatus);
  85. // --------------------------------------------------------------------
  86. // Methods
  87. // --------------------------------------------------------------------
  88. [helpstring("Invalidate data cached in user object")]
  89. HRESULT Invalidate(void);
  90. };
  91. // ========================================================================
  92. // Interface for DIDiskQuotaControlEvents
  93. // ========================================================================
  94. [
  95. uuid(7988B581-EC89-11cf-9C00-00AA00A14F56),
  96. helpstring("DIDiskQuotaControlEvents Interface"),
  97. nonextensible,
  98. version(1.0)
  99. ]
  100. dispinterface DIDiskQuotaControlEvents
  101. {
  102. properties:
  103. methods:
  104. [id(DISPID_DISKQUOTAEVENTS_USERNAMECHANGED),
  105. helpstring("Called when name information for a DiskQuotaUser object has been resolved")]
  106. void OnUserNameChanged(DIDiskQuotaUser *pUser);
  107. };
  108. // ========================================================================
  109. // Interface for DIDiskQuotaControl
  110. // ========================================================================
  111. [
  112. uuid(7988B575-EC89-11cf-9C00-00AA00A14F56),
  113. helpstring("Automation interface for DiskQuotaControl object"),
  114. oleautomation,
  115. dual,
  116. version(1.0)
  117. ]
  118. interface DIDiskQuotaControl : IDispatch
  119. {
  120. // --------------------------------------------------------------------
  121. // Properties
  122. // --------------------------------------------------------------------
  123. //
  124. // Quota state flags used in QuotaState property. These must match the
  125. // DISKQUOTA_STATE_XXXXX flags defined in dskquota.h
  126. //
  127. typedef enum QuotaStateConstants {
  128. [helpstring("Disk quota disabled")] dqStateDisable = 0,
  129. [helpstring("Track quota usage")] dqStateTrack = 1,
  130. [helpstring("Enforce quota limit")] dqStateEnforce = 2
  131. } QuotaStateConstants;
  132. const int dqStateMaxValue = 2;
  133. [propput, helpstring("State of the volume's disk quota system")]
  134. HRESULT QuotaState(
  135. [in] QuotaStateConstants State);
  136. [propget]
  137. HRESULT QuotaState(
  138. [out, retval] QuotaStateConstants *pState);
  139. [propget, helpstring("Indicates if quota information is out of date")]
  140. HRESULT QuotaFileIncomplete(
  141. [out, retval] VARIANT_BOOL *pbIncomplete);
  142. [propget, helpstring("Indicates if quota information is being rebuilt")]
  143. HRESULT QuotaFileRebuilding(
  144. [out, retval] VARIANT_BOOL *pbRebuilding);
  145. [propput, helpstring("Write event log entry when user exceeds quota warning threshold")]
  146. HRESULT LogQuotaThreshold(
  147. [in] VARIANT_BOOL bLogThreshold);
  148. [propget]
  149. HRESULT LogQuotaThreshold(
  150. [out, retval] VARIANT_BOOL *pbLogThreshold);
  151. [propput, helpstring("Write event log entry when user exceeds quota limit")]
  152. HRESULT LogQuotaLimit(
  153. [in] VARIANT_BOOL bLogLimit);
  154. [propget]
  155. HRESULT LogQuotaLimit(
  156. [out, retval] VARIANT_BOOL *pbLogLimit);
  157. [propput, helpstring("Default warning threshold applied to new volume users (byte value)")]
  158. HRESULT DefaultQuotaThreshold(
  159. [in] double Threshold);
  160. [propget]
  161. HRESULT DefaultQuotaThreshold(
  162. [out, retval] double *pThreshold);
  163. [propget, helpstring("Default warning threshold applied to new volume users (text string)")]
  164. HRESULT DefaultQuotaThresholdText(
  165. [out, retval] BSTR *pThresholdText);
  166. [propput, helpstring("Default quota limit applied to new volume users (byte value)")]
  167. HRESULT DefaultQuotaLimit(
  168. [in] double Limit);
  169. [propget]
  170. HRESULT DefaultQuotaLimit(
  171. [out, retval] double *pLimit);
  172. [propget, helpstring("Default quota limit applied to new volume users (text string)")]
  173. HRESULT DefaultQuotaLimitText(
  174. [out, retval] BSTR *pLimitText);
  175. //
  176. // Values for setting the user name resolution mode. These must match
  177. // the DISKQUOTA_USERNAME_RESOLVE_XXXX constants defined in dskquota.h
  178. //
  179. typedef enum UserNameResolutionConstants {
  180. [helpstring("Do not resolve user name information")] dqResolveNone = 0,
  181. [helpstring("Wait while resolving name information")] dqResolveSync = 1,
  182. [helpstring("Do not wait while resolving name information")] dqResolveAsync = 2
  183. } UserNameResolutionConstants;
  184. const int dqResolveMaxValue = 2;
  185. [propput, helpstring("Control the resolution of user Security IDs to user Names")]
  186. HRESULT UserNameResolution(
  187. [in] UserNameResolutionConstants ResolutionType);
  188. [propget]
  189. HRESULT UserNameResolution(
  190. [out, retval] UserNameResolutionConstants *pResolutionType);
  191. // --------------------------------------------------------------------
  192. // Methods
  193. // --------------------------------------------------------------------
  194. [helpstring("Initialize the quota control object for a specified volume")]
  195. HRESULT Initialize(
  196. [in] BSTR path,
  197. [in] VARIANT_BOOL bReadWrite);
  198. [helpstring("Terminate the user name resolution thread")]
  199. HRESULT ShutdownNameResolution(void);
  200. [helpstring("Add a user quota entry by Name")]
  201. HRESULT AddUser(
  202. [in] BSTR LogonName,
  203. [out, retval] DIDiskQuotaUser **ppUser);
  204. [helpstring("Delete a user quota entry")]
  205. HRESULT DeleteUser(
  206. [in] DIDiskQuotaUser *pUser);
  207. [helpstring("Find a user quota entry by Name")]
  208. HRESULT FindUser(
  209. [in] BSTR LogonName,
  210. [out, retval] DIDiskQuotaUser **ppUser);
  211. [helpstring("Invalidate the cache of user name information")]
  212. HRESULT InvalidateSidNameCache(void);
  213. [helpstring("Promote a user quota entry to the head of the name resolution queue")]
  214. HRESULT GiveUserNameResolutionPriority(
  215. [in] DIDiskQuotaUser *pUser);
  216. [helpstring("Translates a user logon name to a security ID")]
  217. HRESULT TranslateLogonNameToSID(
  218. [in] BSTR LogonName,
  219. [out, retval] BSTR *psid);
  220. [id(DISPID_NEWENUM), helpstring("Create a Collection object for user quota entry enumeration.")]
  221. HRESULT _NewEnum(
  222. [out, retval] IDispatch **ppEnum);
  223. };
  224. // ========================================================================
  225. // CoClass for Disk Quota object.
  226. // ========================================================================
  227. [
  228. uuid(7988B571-EC89-11cf-9C00-00AA00A14F56),
  229. helpstring("Microsoft Disk Quota"),
  230. version(1.0)
  231. ]
  232. coclass DiskQuotaControl{
  233. [default] interface DIDiskQuotaControl;
  234. [default, source] dispinterface DIDiskQuotaControlEvents;
  235. interface IDiskQuotaControlEvents;
  236. interface DIDiskQuotaUser;
  237. };
  238. };
  239. [
  240. object,
  241. dual,
  242. uuid(7988B579-EC89-11cf-9C00-00AA00A14F56),
  243. helpstring("Dual interface for DiskQuotaControl Events"),
  244. version(1.0)
  245. ]
  246. interface IDiskQuotaControlEvents : IDispatch
  247. {
  248. HRESULT OnUserNameChanged(
  249. [in] DIDiskQuotaUser *pUser);
  250. };