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.

167 lines
3.3 KiB

  1. /******************************************************************
  2. DskQuota.H -- WMI provider class definition
  3. Description: Header for Quotasettings class
  4. Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  5. *******************************************************************/
  6. // Property set identification
  7. //============================
  8. #ifndef _CDISKQUOTA_H_
  9. #define _CDISKQUOTA_H_
  10. #include "precomp.h"
  11. #include "DskQuotaCommon.h"
  12. // Defining bit values for the property, which will be used for defining the bitmap of properties required.
  13. #define DSKQUOTA_ALL_PROPS 0xFFFFFFFF
  14. #define DSKQUOTA_PROP_LogicalDiskObjectPath 0x00000001
  15. #define DSKQUOTA_PROP_UserObjectPath 0x00000002
  16. #define DSKQUOTA_PROP_Status 0x00000004
  17. #define DSKQUOTA_PROP_WarningLimit 0x00000008
  18. #define DSKQUOTA_PROP_Limit 0x00000010
  19. #define DSKQUOTA_PROP_DiskSpaceUsed 0x00000020
  20. class CDiskQuota : public Provider
  21. {
  22. private:
  23. HRESULT EnumerateUsersOfAllVolumes (
  24. MethodContext *pMethodContext,
  25. DWORD dwPropertiesReq
  26. );
  27. HRESULT EnumerateUsers (
  28. MethodContext *pMethodContext,
  29. LPCWSTR a_VolumeName,
  30. DWORD dwPropertiesReq
  31. );
  32. HRESULT LoadDiskQuotaUserProperties (
  33. IDiskQuotaUser* pIQuotaUser,
  34. CInstance *pInstance,
  35. DWORD dwPropertiesReq
  36. );
  37. HRESULT SetKeys (
  38. CInstance *pInstance,
  39. WCHAR w_Drive,
  40. DWORD dwPropertiesReq,
  41. IDiskQuotaUser* pIQuotaUser
  42. );
  43. HRESULT AddUserOnVolume (
  44. const CInstance &Instance,
  45. LPCWSTR a_VolumePathName,
  46. LPCWSTR a_UserLogonName
  47. );
  48. HRESULT UpdateUserQuotaProperties (
  49. const CInstance &Instance,
  50. LPCWSTR a_VolumePathName,
  51. LPCWSTR a_UserLogonName
  52. );
  53. HRESULT CheckParameters (
  54. const CInstance &a_Instance
  55. );
  56. void SetPropertiesReq (
  57. CFrameworkQuery *Query,
  58. DWORD &dwPropertiesReq
  59. );
  60. void ExtractUserLogOnName (
  61. CHString &a_UserLogonName,
  62. CHString &a_DomainName
  63. );
  64. void GetKeyValue (
  65. CHString &a_VolumePath,
  66. LPCWSTR a_VolumeObjectPath
  67. );
  68. BOOL GetDomainAndNameFromSid(
  69. PSID pSid,
  70. CHString& chstrDomain,
  71. CHString& chstrName);
  72. protected:
  73. // Reading Functions
  74. //============================
  75. HRESULT EnumerateInstances (
  76. MethodContext *pMethodContext,
  77. long lFlags = 0L
  78. ) ;
  79. HRESULT GetObject (
  80. CInstance *pInstance,
  81. long lFlags,
  82. CFrameworkQuery &Query
  83. ) ;
  84. HRESULT ExecQuery (
  85. MethodContext *pMethodContext,
  86. CFrameworkQuery& Query,
  87. long lFlags = 0
  88. ) ;
  89. // Writing Functions
  90. //============================
  91. HRESULT PutInstance (
  92. const CInstance& Instance,
  93. long lFlags = 0L
  94. ) ;
  95. HRESULT DeleteInstance (
  96. const CInstance& Instance,
  97. long lFlags = 0L
  98. ) ;
  99. public:
  100. // Constructor/destructor
  101. //=======================
  102. CDiskQuota(
  103. LPCWSTR lpwszClassName,
  104. LPCWSTR lpwszNameSpace
  105. ) ;
  106. virtual ~CDiskQuota () ;
  107. private:
  108. CHString m_ComputerName;
  109. DskCommonRoutines m_CommonRoutine;
  110. };
  111. #endif