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.

116 lines
2.2 KiB

  1. /*++
  2. Copyright (C) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. hwprof.h
  5. Abstract:
  6. header file for hwprof.cpp
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. class CHwProfile;
  12. class CHwProfileList;
  13. class CHwProfileList
  14. {
  15. public:
  16. CHwProfileList() : m_pDevice(NULL), m_CurHwProfile(0), m_CurHwProfileIndex(0) {}
  17. ~CHwProfileList();
  18. BOOL Create(CDevice* pDevice, DWORD ConfigFlags = 0);
  19. BOOL GetFirst(CHwProfile** pphwpf, PVOID& Context);
  20. BOOL GetNext(CHwProfile** pphwpf, PVOID& Context);
  21. BOOL GetCurrentHwProfile(CHwProfile** pphwpf);
  22. int GetCurrentHwProfileIndex()
  23. {
  24. return m_CurHwProfileIndex;
  25. }
  26. ULONG IndexToHwProfile(int HwProfileIndex);
  27. int GetCount()
  28. {
  29. return m_listProfile.GetCount();
  30. }
  31. private:
  32. CList<CHwProfile*,CHwProfile* > m_listProfile;
  33. CDevice* m_pDevice;
  34. ULONG m_CurHwProfile;
  35. int m_CurHwProfileIndex;
  36. };
  37. class CHwProfile
  38. {
  39. public:
  40. CHwProfile(int Index, PHWPROFILEINFO phwpfInfo, CDevice* pDevice, DWORD hwpfFlags);
  41. DWORD GetFlags()
  42. {
  43. return m_Flags;
  44. }
  45. LPCTSTR GetFriendlyName() const
  46. {
  47. return m_hwpfInfo.HWPI_szFriendlyName;
  48. }
  49. DWORD GetIndex()
  50. {
  51. return m_Index;
  52. }
  53. ULONG GetHwProfile()
  54. {
  55. return m_hwpfInfo.HWPI_ulHWProfile;
  56. }
  57. BOOL IsDisabled()
  58. {
  59. return (m_Flags & CSCONFIGFLAG_DISABLED);
  60. }
  61. BOOL DoNotCreate()
  62. {
  63. return (m_Flags & CSCONFIGFLAG_DO_NOT_CREATE);
  64. }
  65. BOOL DoNotStart()
  66. {
  67. return (m_Flags & CSCONFIGFLAG_DO_NOT_START);
  68. }
  69. void SetEnablePending()
  70. {
  71. m_EnablePending = TRUE;
  72. }
  73. void ResetEnablePending()
  74. {
  75. m_EnablePending = FALSE;
  76. }
  77. void SetDisablePending()
  78. {
  79. m_DisablePending = TRUE;
  80. }
  81. void ResetDisablePending()
  82. {
  83. m_DisablePending = FALSE;
  84. }
  85. BOOL IsEnablePending()
  86. {
  87. return m_EnablePending;
  88. }
  89. BOOL IsDisablePending()
  90. {
  91. return m_DisablePending;
  92. }
  93. private:
  94. DWORD m_Index;
  95. HWPROFILEINFO m_hwpfInfo;
  96. DWORD m_Flags;
  97. CDevice* m_pDevice;
  98. BOOL m_EnablePending;
  99. BOOL m_DisablePending;
  100. };