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.

89 lines
2.8 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to
  4. // existing Microsoft documentation.
  5. //
  6. //
  7. //
  8. //
  9. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  10. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  11. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  12. // PURPOSE.
  13. //
  14. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  15. //
  16. //
  17. //
  18. //==============================================================;
  19. #ifndef _SNAPINBASE_H
  20. #define _SNAPINBASE_H
  21. #include "DeleBase.h"
  22. class CStaticNode : public CDelegationBase {
  23. public:
  24. CStaticNode();
  25. virtual ~CStaticNode();
  26. virtual const _TCHAR *GetDisplayName(int nCol = 0) {
  27. static _TCHAR szDisplayName[256] = {0};
  28. LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, sizeof(szDisplayName));
  29. if (*snapInData.m_host != 0) {
  30. _tcscat(szDisplayName, _T(" ("));
  31. _tcscat(szDisplayName, snapInData.m_host);
  32. _tcscat(szDisplayName, _T(")"));
  33. }
  34. return szDisplayName;
  35. }
  36. virtual const GUID & getNodeType() { return thisGuid; }
  37. virtual const int GetBitmapIndex() { return INDEX_NONE; }
  38. public:
  39. // virtual functions go here (for MMCN_*)
  40. virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
  41. virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle);
  42. virtual HRESULT HasPropertySheets();
  43. virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
  44. HBITMAP *lphHeader,
  45. HPALETTE *lphPalette,
  46. BOOL *bStretch);
  47. private:
  48. enum { NUMBER_OF_CHILDREN = 4 };
  49. CDelegationBase *children[NUMBER_OF_CHILDREN];
  50. // {2974380C-4C4B-11d2-89D8-000021473128}
  51. static const GUID thisGuid;
  52. struct privateData {
  53. _TCHAR m_host[MAX_PATH];
  54. BOOL m_fIsRadioLocalMachine;
  55. BOOL m_fAllowOverrideMachineNameOut;
  56. bool m_isDirty;
  57. privateData() : m_isDirty(false) {
  58. ZeroMemory(m_host, sizeof(m_host));
  59. m_fIsRadioLocalMachine = TRUE;
  60. m_fAllowOverrideMachineNameOut = FALSE;
  61. }
  62. } snapInData;
  63. static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  64. public:
  65. LONG getDataSize() { return sizeof(privateData); }
  66. void *getData() { return &snapInData; }
  67. bool isDirty() { return snapInData.m_isDirty; }
  68. void clearDirty() { snapInData.m_isDirty = false; };
  69. _TCHAR *getHost() { return *snapInData.m_host == 0 ? NULL : snapInData.m_host; }
  70. };
  71. #endif // _SNAPINBASE_H