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.

169 lines
7.0 KiB

  1. ===============================================================================
  2. Interface: DiskQuotaControl
  3. ===============================================================================
  4. Methods:
  5. AddUser
  6. CreateEnumUsers
  7. CreateUserBatch
  8. DeleteUser
  9. FindUser
  10. GetDefaultQuotaLimit
  11. GetDefaultQuotaThreshold
  12. GetState
  13. Initialize
  14. InvalidateSidNameCache
  15. SetDefaultQuotaLimit
  16. SetDefaultQuotaThreshold
  17. SetLoggingState
  18. SetQuotaState
  19. ShutdownAndRelease
  20. -------------------------------------------------------------------------------
  21. DiskQuotaControl::AddUser
  22. -------------------------------------------------------------------------------
  23. Adds a user to the volume's quota file.
  24. Arguments:
  25. PSID pSid - Address of account's Security Identifier (SID).
  26. PDISKQUOTA_USER *ppUser - Address of interface pointer variable to receive
  27. the IDiskQuotaUser interface pointer for the new user object.
  28. Returns:
  29. E_NOTIMPL - This function is not yet implemented.
  30. -------------------------------------------------------------------------------
  31. DiskQuotaControl::CreateEnumUsers
  32. -------------------------------------------------------------------------------
  33. Creates a user enumerator object for enumerating users in a volume's quota
  34. information file. This (along with DiskQuotaControl::Find) is the primary
  35. method for creating user objects from a quota control object. The resulting
  36. enumerator object supports the required OLE EnumXXXXX interfaces of Next,
  37. Skip, Reset and Clone. If this function returns NO_ERROR, the returned
  38. enumerator object has a reference count of 1 and is ready for use.
  39. Arguments
  40. PSID pSidList [optional] - Address of an array of Security Identifiers;
  41. one for each user to be included in the enumeration. This argument may
  42. be NULL. If this argument is NULL, all users in the volume's quota
  43. information file are included in the enumeration.
  44. DWORD dwSidListLength [optional] - If pSidList is not NULL, this argument
  45. specifies the number of bytes in the SID list. If pSidList is NULL,
  46. this argument is ignored.
  47. PENUM_DISKQUOTA_USERS **ppOut - Address of interface variable to receive
  48. the IEnumDiskQuotaUsers inteface pointer of the new enumerator object.
  49. BOOL bAsyncNameResolution - Specifies the type of SID-to-Name resolution
  50. performed. Quota information files identify users by SID with SID-to-Name
  51. relationships maintained by the network domain controller. When a user
  52. object is first created, unless cached on the local machine, it's
  53. name is not known and must be obtained from the network DC. If
  54. bAsyncNameResolution is FALSE, the function will block until the name
  55. can be determined. If the argument is TRUE, the name resolution is
  56. performed asynchronously. The client code is notified through an
  57. OLE notification sink when the name has been obtained and set in the
  58. user object. See IDiskQuotaEvents for details.
  59. Returns:
  60. NO_ERROR - Success.
  61. E_POINTER - ppOut arg is NULL.
  62. E_OUTOFMEMORY - Insufficient memory to create enumerator object.
  63. -------------------------------------------------------------------------------
  64. DiskQuotaControl::CreateUserBatch
  65. -------------------------------------------------------------------------------
  66. Creates a user batch object for optimizing user quota information updates.
  67. The underlying NTIOAPI system supports batching of user quota information
  68. updates. This method creates a batching object that takes advantage of this
  69. NTIOAPI feature. The client creates a batch object, adds user object pointers
  70. to the batch object, updates the user object quota information and finally
  71. commands the batch object to write the data from the contained user objects
  72. to disk.
  73. Arguments:
  74. PDISKQUOTA_USER_BATCH *ppUserBatch - Address of interface variable to
  75. receive the IDiskQuotaUserBatch interface pointer of the new batch
  76. object.
  77. Returns:
  78. f
  79. NO_ERROR - Success.
  80. E_POINTER - ppOut arg is NULL.
  81. E_OUTOFMEMORY - Insufficient memory to create batch object.
  82. -------------------------------------------------------------------------------
  83. Macro: DiskQuotaControl_Initialize
  84. -------------------------------------------------------------------------------
  85. This macro calls DiskQuotaControl::InitializeW when the caller is compiled
  86. UNICODE and DiskQuotaControl::InitializeA when the caller is compiled ANSI.
  87. Arguments:
  88. pController - Address of quota controller object being initialized.
  89. pszFSObjectName - Name of the NTFS volume to open. InitializeA expects
  90. an ANSI string. IninitializeW expects a UNICODE string. Use the
  91. DiskQuotaControl_Initialize macro to automatically compile the
  92. proper function.
  93. Returns:
  94. See DiskQuotaControl::Initialize
  95. -------------------------------------------------------------------------------
  96. DiskQuotaControl::Initialize (A and W)
  97. -------------------------------------------------------------------------------
  98. Initializes a quota control object (IDiskQuotaControl) that has been created
  99. via CoCreateInstance. The quota control object is the primary object created
  100. by a client application to view/control the quota attributes of an NTFS volume.
  101. To create a controller object, call CoCreateInstance with the
  102. CLSID_IDiskQuotaControl interface ID. The interface pointer returned has a
  103. reference count of 1. For the object to be usable, the client must call the
  104. Initialize method passing the name of the NTFS volume as a text string.
  105. Arguments:
  106. pszFSObjectName - Name of the NTFS volume to open. InitializeA expects
  107. an ANSI string. IninitializeW expects a UNICODE string. Use the
  108. DiskQuotaControl_Initialize macro to automatically compile the
  109. proper function.
  110. Returns:
  111. NO_ERROR - Success.
  112. S_FALSE - Can't open FS object.
  113. E_POINTER - pszFSObjectName argument was NULL.
  114. E_OUTOFMEMORY - Insufficient memory.
  115. E_UNEXPECTED - Error thunking object name string
  116. DiskQuotaControl::Initialize
  117. STDMETHOD(InitializeW)(THIS_ LPCWSTR pszFSObjectNameW) PURE;
  118. STDMETHOD(InitializeA)(THIS_ LPCSTR pszFSObjectNameA) PURE;
  119. STDMETHOD(GetState)(THIS_ LPDWORD lpdwState) PURE;
  120. STDMETHOD(SetQuotaState)(THIS_ DWORD dwState) PURE;
  121. STDMETHOD(SetLoggingState)(THIS_ DWORD dwState) PURE;
  122. STDMETHOD(SetDefaultQuotaThreshold)(THIS_ DWORD, DWORD) PURE;
  123. STDMETHOD(SetDefaultQuotaLimit)(THIS_ DWORD, DWORD) PURE;
  124. STDMETHOD(GetDefaultQuotaThreshold)(THIS_ LPDWORD, LPDWORD) PURE;
  125. STDMETHOD(GetDefaultQuotaLimit)(THIS_ LPDWORD, LPDWORD) PURE;
  126. STDMETHOD(AddUser)(THIS_ PSID, ULONG, PDISKQUOTA_USER *) PURE;
  127. STDMETHOD(DeleteUser)(THIS_ PDISKQUOTA_USER) PURE;
  128. STDMETHOD(FindUser)(THIS_ PSID, ULONG, PDISKQUOTA_USER *, BOOL) PURE;
  129. STDMETHOD(CreateEnumUsers)(THIS_ PSID, DWORD, PENUM_DISKQUOTA_USERS *, BOOL) PURE;
  130. STDMETHOD(CreateUserBatch)(THIS_ PDISKQUOTA_USER_BATCH *) PURE;
  131. STDMETHOD(InvalidateSidNameCache)(THIS) PURE;
  132. STDMETHOD(ShutdownAndRelease)(THIS) PURE;