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.

96 lines
2.3 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. #ifndef __WBEMPAGEHELPER__
  3. #define __WBEMPAGEHELPER__
  4. #pragma once
  5. #include "..\common\SshWbemHelpers.h"
  6. #include "..\common\ServiceThread.h"
  7. #define SCB_FROMFILE (0x1)
  8. #define SCB_REPLACEONLY (0x2)
  9. #define CLOSE_SNAPIN 0xfdfd
  10. #define WBEM_ENABLE ( 0x0001 )
  11. #define WBEM_METHOD_EXECUTE ( 0x0002 )
  12. #define WBEM_FULL_WRITE_REP ( 0x001c )
  13. #define WBEM_PARTIAL_WRITE_REP ( 0x0008 )
  14. #define WBEM_WRITE_PROVIDER ( 0x0010 )
  15. class WBEMPageHelper
  16. {
  17. public:
  18. IWbemServices *m_service;
  19. CWbemServices m_WbemServices;
  20. bool m_okPressed;
  21. HWND m_hDlg;
  22. bool m_userCancelled; // the connectServer() thread.
  23. HWND m_AVIbox;
  24. WBEMPageHelper(CWbemServices &service);
  25. WBEMPageHelper(WbemServiceThread *serviceThread);
  26. virtual ~WBEMPageHelper();
  27. CWbemClassObject ExchangeInstance(IWbemClassObject **ppbadInst);
  28. virtual bool GetOnOkPressed(void) {return m_okPressed;};
  29. // get the first instance of the named class.
  30. IWbemClassObject *FirstInstanceOf(bstr_t className);
  31. static LPTSTR CloneString( LPTSTR pszSrc );
  32. BOOL SetClearBitmap(HWND control,
  33. LPCTSTR resource,
  34. UINT fl);
  35. void HourGlass( bool bOn );
  36. int MsgBoxParam(HWND hWnd,
  37. DWORD wText,
  38. DWORD wCaption,
  39. DWORD wType,
  40. LPTSTR var1 = NULL,
  41. LPTSTR var2 = NULL);
  42. DWORD SetLBWidthEx(HWND hwndLB,
  43. LPTSTR szBuffer,
  44. DWORD cxCurWidth,
  45. DWORD cxExtra);
  46. void SetDefButton(HWND hwndDlg,
  47. int idButton);
  48. void SetDlgItemMB(HWND hDlg,
  49. int idControl,
  50. ULONG dwMBValue );
  51. void SetWbemService(IWbemServices *pServices);
  52. #define NO_UI 0 // for uCaption
  53. bool ServiceIsReady(UINT uCaption,
  54. UINT uWaitMsg,
  55. UINT uBadMsg);
  56. HRESULT Reboot(UINT flags = EWX_REBOOT,
  57. long *retval = NULL);
  58. HRESULT RemoteRegWriteable(const _bstr_t regPath,
  59. BOOL& writable);
  60. bool HasPerm(DWORD mask);
  61. bool HasPriv(LPCTSTR privName);
  62. static BOOL g_fRebootRequired;
  63. WbemServiceThread *m_serviceThread;
  64. private:
  65. // these support efficiency in RemoteRegWriteable().
  66. CWbemClassObject m_checkAccessIn;
  67. CWbemClassObject m_checkAccessOut;
  68. CWbemServices m_defaultNS;
  69. };
  70. #endif __WBEMPAGEHELPER__