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.

98 lines
2.2 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. #ifndef __ENVPAGE__
  3. #define __ENVPAGE__
  4. #pragma once
  5. #include "..\Common\WbemPageHelper.h"
  6. #include "..\common\simplearray.h"
  7. //-----------------------------------------------------------------------------
  8. class EnvPage : public WBEMPageHelper
  9. {
  10. private:
  11. class ENVARS
  12. {
  13. public:
  14. bool changed;
  15. LPTSTR userName;
  16. LPTSTR objPath;
  17. LPTSTR szValueName;
  18. LPTSTR szValue;
  19. LPTSTR szExpValue;
  20. ENVARS()
  21. {
  22. changed = false;
  23. objPath = NULL;
  24. userName = NULL;
  25. szValueName = NULL;
  26. szValue = NULL;
  27. szExpValue = NULL;
  28. }
  29. ~ENVARS()
  30. {
  31. delete[] userName;
  32. delete[] objPath;
  33. delete[] szValueName;
  34. delete[] szValue;
  35. delete[] szExpValue;
  36. }
  37. };
  38. BOOL m_bEditSystemVars;
  39. BOOL m_bUserVars;
  40. bool m_currUserModified;
  41. bool m_SysModified;
  42. bstr_t m_currentUser;
  43. bool m_bLocal;
  44. void LoadUser(IWbemClassObject *envInst,
  45. bstr_t userName,
  46. HWND hwndUser);
  47. bool IsLoggedInUser(_bstr_t userName);
  48. void GetLoggedinUser(bstr_t *userName);
  49. BOOL Init(HWND hDlg);
  50. void CleanUp (HWND hDlg);
  51. void Save(HWND hDlg, int ID);
  52. int FindVar (HWND hwndLV, LPTSTR szVar);
  53. int GetSelectedItem (HWND hCtrl);
  54. void DoCommand(HWND hDlg,
  55. HWND hwndCtl,
  56. int idCtl,
  57. int iNotify );
  58. int AddUniqueUser(HWND hwnd, LPCTSTR str);
  59. void EmptyListView(HWND hDlg, int ID);
  60. void DeleteVar(HWND hDlg,
  61. UINT VarType,
  62. LPCTSTR szVarName);
  63. void SetVar(HWND hDlg,
  64. UINT VarType,
  65. LPCTSTR szVarName,
  66. LPCTSTR szVarValue);
  67. void DoEdit(HWND hWnd,
  68. UINT VarType,
  69. UINT EditType,
  70. int iSelection);
  71. ENVARS *GetVar(HWND hDlg,
  72. UINT VarType,
  73. int iSelection);
  74. // deletions are saved here until committed.
  75. typedef CSimpleArray<ENVARS *> ENVLIST;
  76. ENVLIST m_killers;
  77. void KillLater(ENVARS *var);
  78. void KillThemAllNow(void);
  79. public:
  80. EnvPage(WbemServiceThread *serviceThread);
  81. ~EnvPage();
  82. INT_PTR DoModal(HWND hDlg);
  83. INT_PTR CALLBACK DlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam);
  84. };
  85. INT_PTR CALLBACK StaticEnvDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam);
  86. #endif __ENVPAGE__