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.

104 lines
3.4 KiB

  1. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  2. // CJobObjLimitInfoProps.h
  3. #pragma once
  4. //*****************************************************************************
  5. // BEGIN: Declaration of Win32_JobObjectLimitInfo class properties.
  6. //*****************************************************************************
  7. #define IDS_Win32_NamedJobObjectLimitSetting L"Win32_NamedJobObjectLimitSetting"
  8. #define PROP_ALL_REQUIRED 0xFFFFFFFF
  9. #define PROP_NONE_REQUIRED 0x00000000
  10. #define PROP_JOLimitInfoID 0x00000001
  11. #define PROP_PerProcessUserTimeLimit 0x00000002
  12. #define PROP_PerJobUserTimeLimit 0x00000004
  13. #define PROP_LimitFlags 0x00000008
  14. #define PROP_MinimumWorkingSetSize 0x00000010
  15. #define PROP_MaximumWorkingSetSize 0x00000020
  16. #define PROP_ActiveProcessLimit 0x00000040
  17. #define PROP_Affinity 0x00000080
  18. #define PROP_PriorityClass 0x00000100
  19. #define PROP_SchedulingClass 0x00000200
  20. #define PROP_ProcessMemoryLimit 0x00000400
  21. #define PROP_JobMemoryLimit 0x00000800
  22. // The following enum is used to reference
  23. // into the array that follows it. Hence,
  24. // they must be kept in synch.
  25. typedef enum tag_JOB_OBJ_LIMIT_INFO_PROPS
  26. {
  27. JOLMTPROP_ID = 0,
  28. JOLMTPROP_PerProcessUserTimeLimit,
  29. JOLMTPROP_PerJobUserTimeLimit,
  30. JOLMTPROP_LimitFlags,
  31. JOLMTPROP_MinimumWorkingSetSize,
  32. JOLMTPROP_MaximumWorkingSetSize,
  33. JOLMTPROP_ActiveProcessLimit,
  34. JOLMTPROP_Affinity,
  35. JOLMTPROP_PriorityClass,
  36. JOLMTPROP_SchedulingClass,
  37. JOLMTPROP_ProcessMemoryLimit,
  38. JOLMTPROP_JobMemoryLimit,
  39. // used to keep track of how many props we have:
  40. JOIOACTGPROP_JobObjLimitInfoPropertyCount
  41. } JOB_OBJ_LIMIT_INFO_PROPS;
  42. // WARNING!! MUST KEEP MEMBERS OF THE FOLLOWING ARRAY
  43. // IN SYNCH WITH THE ENUMERATION DECLARED ABOVE!!!
  44. extern LPCWSTR g_rgJobObjLimitInfoPropNames[];
  45. //*****************************************************************************
  46. // END: Declaration of Win32_JobObjectLimitInfo class properties.
  47. //*****************************************************************************
  48. class CJobObjLimitInfoProps : public CObjProps
  49. {
  50. public:
  51. CJobObjLimitInfoProps() { m_hJob = NULL; }
  52. CJobObjLimitInfoProps(CHString& chstrNamespace);
  53. CJobObjLimitInfoProps(
  54. HANDLE hJob,
  55. CHString& chstrNamespace);
  56. virtual ~CJobObjLimitInfoProps();
  57. HRESULT SetKeysFromPath(
  58. const BSTR ObjectPath,
  59. IWbemContext __RPC_FAR *pCtx);
  60. HRESULT SetKeysDirect(
  61. std::vector<CVARIANT>& vecvKeys);
  62. HRESULT GetWhichPropsReq(
  63. CFrameworkQuery& cfwq);
  64. HRESULT SetNonKeyReqProps();
  65. HRESULT LoadPropertyValues(
  66. IWbemClassObject* pIWCO);
  67. void SetHandle(const HANDLE hJob);
  68. HANDLE& GetHandle();
  69. HRESULT SetWin32JOLimitInfoProps(
  70. IWbemClassObject __RPC_FAR *pInst);
  71. private:
  72. HANDLE m_hJob;
  73. // Member meant to only be called
  74. // by base class.
  75. static DWORD CheckProps(
  76. CFrameworkQuery& Query);
  77. };