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.

166 lines
5.0 KiB

  1. // support.h: interface for the CEnumPrivileges and CEnumRegistryValues.
  2. //
  3. // Copyright (c)1997-1999 Microsoft Corporation
  4. //
  5. //////////////////////////////////////////////////////////////////////
  6. #if !defined(AFX_SUPPORT_H__BD7570F7_9F0E_4C6B_B525_E078691B6D0E__INCLUDED_)
  7. #define AFX_SUPPORT_H__BD7570F7_9F0E_4C6B_B525_E078691B6D0E__INCLUDED_
  8. #if _MSC_VER >= 1000
  9. #pragma once
  10. #endif // _MSC_VER >= 1000
  11. #include "GenericClass.h"
  12. /*
  13. Class description
  14. Naming:
  15. CEnumRegistryValues stands for Registry Values Enumerator.
  16. Base class:
  17. CGenericClass, because it is a class representing a WMI
  18. object - its WMI class name is Sce_KnownRegistryValues
  19. Purpose of class:
  20. (1) Implement Sce_KnownRegistryValues WMI class.
  21. (2) Help to find out if a particular registry is one of the known registry values.
  22. Design:
  23. (1) Almost trivial other than implementing necessary method as a concrete class
  24. Use:
  25. (1) Almost never used directly. Alway through the common interface defined by
  26. CGenericClass.
  27. */
  28. class CEnumRegistryValues : public CGenericClass
  29. {
  30. public:
  31. CEnumRegistryValues (
  32. ISceKeyChain *pKeyChain,
  33. IWbemServices *pNamespace,
  34. IWbemContext *pCtx = NULL
  35. );
  36. virtual ~CEnumRegistryValues ();
  37. virtual HRESULT PutInst (
  38. IWbemClassObject *pInst,
  39. IWbemObjectSink *pHandler,
  40. IWbemContext *pCtx
  41. );
  42. virtual HRESULT CreateObject (
  43. IWbemObjectSink *pHandler,
  44. ACTIONTYPE atAction
  45. );
  46. private:
  47. HRESULT EnumerateInstances (
  48. IWbemObjectSink *pHandler
  49. );
  50. HRESULT ConstructInstance (
  51. IWbemObjectSink *pHandler,
  52. LPCWSTR wszRegKeyName,
  53. LPCWSTR wszRegPath,
  54. HKEY hKeyRoot
  55. );
  56. HRESULT DeleteInstance (
  57. IWbemObjectSink *pHandler,
  58. LPCWSTR wszRegKeyName
  59. );
  60. HRESULT SavePropertyToReg (
  61. LPCWSTR wszKeyName,
  62. int RegType,
  63. int DispType,
  64. LPCWSTR wszDispName,
  65. LPCWSTR wszUnits,
  66. PSCE_NAME_LIST pnlChoice,
  67. PSCE_NAME_LIST pnlResult
  68. );
  69. };
  70. //================================================================================
  71. /*
  72. Class description
  73. Naming:
  74. CEnumPrivileges stands for Supported Privilege Enumerator.
  75. Base class:
  76. CGenericClass, because it is a class representing a WMI
  77. object - its WMI class name is Sce_SupportedPrivileges
  78. Purpose of class:
  79. (1) Implement Sce_SupportedPrivileges WMI class.
  80. (2) Help to determine if a certain privilege is supported or not.
  81. Design:
  82. (1) Almost trivial other than implementing necessary method as a concrete class
  83. (2) We don't allow supported privileges to grow. So, not PutInstance support.
  84. Use:
  85. (1) Almost never used directly. Alway through the common interface defined by
  86. CGenericClass.
  87. */
  88. class CEnumPrivileges : public CGenericClass
  89. {
  90. public:
  91. CEnumPrivileges (
  92. ISceKeyChain *pKeyChain,
  93. IWbemServices *pNamespace,
  94. IWbemContext *pCtx = NULL
  95. );
  96. virtual ~CEnumPrivileges ();
  97. virtual HRESULT PutInst (
  98. IWbemClassObject *pInst,
  99. IWbemObjectSink *pHandler,
  100. IWbemContext *pCtx
  101. )
  102. {
  103. return WBEM_E_NOT_SUPPORTED;
  104. }
  105. virtual HRESULT CreateObject (
  106. IWbemObjectSink *pHandler,
  107. ACTIONTYPE atAction
  108. );
  109. private:
  110. HRESULT ConstructInstance (
  111. IWbemObjectSink *pHandler,
  112. LPCWSTR PrivName
  113. );
  114. };
  115. #endif // !defined(AFX_SUPPORT_H__BD7570F7_9F0E_4C6B_B525_E078691B6D0E__INCLUDED_)