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.

121 lines
3.4 KiB

  1. //
  2. // Copyright 1997 - Microsoft
  3. //
  4. //
  5. // CComputr.H - Computer properties class
  6. //
  7. #ifndef _CCOMPUTR_H_
  8. #define _CCOMPUTR_H_
  9. #include <adsprop.h>
  10. // QITable
  11. BEGIN_QITABLE( CComputer )
  12. DEFINE_QI( IID_IShellExtInit, IShellExtInit , 1 )
  13. DEFINE_QI( IID_IShellPropSheetExt, IShellPropSheetExt , 2 )
  14. DEFINE_QI( IID_IMAO, IMAO , 11 )
  15. END_QITABLE
  16. // Definitions
  17. LPVOID
  18. CComputer_CreateInstance( void );
  19. LPVOID
  20. CreateIntelliMirrorClientComputer(
  21. IADs * pads);
  22. // Error Codes
  23. #define E_INVALIDSTATE TYPE_E_INVALIDSTATE
  24. // Private IMAO Interface Definition
  25. class
  26. IMAO:
  27. public IUnknown
  28. {
  29. public:
  30. STDMETHOD(CommitChanges)( void ) PURE; // 1
  31. STDMETHOD(IsAdmin)( BOOL *fAdmin ) PURE; // 2
  32. STDMETHOD(IsServer)( BOOL *fServer ) PURE; // 3
  33. STDMETHOD(IsClient)( BOOL *fClient ) PURE; // 4
  34. STDMETHOD(SetServerName)( LPWSTR ppszName ) PURE; // 5
  35. STDMETHOD(GetServerName)( LPWSTR * ppszName ) PURE; // 6
  36. STDMETHOD(SetGUID)( LPWSTR ppGUID ) PURE; // 7
  37. STDMETHOD(GetGUID)( LPWSTR * ppszGUID, LPBYTE uGUID ) PURE; // 8
  38. STDMETHOD(GetSAP)( LPVOID * punk ) PURE; // 9
  39. STDMETHOD(GetDataObject)( LPDATAOBJECT * pDataObj ) PURE; // 10
  40. STDMETHOD(GetNotifyWindow)( HWND *phNotifyObj ) PURE; // 11
  41. };
  42. // CComputer
  43. class
  44. CComputer:
  45. public IShellExtInit, IShellPropSheetExt, IMAO
  46. {
  47. private:
  48. // Enums
  49. enum {
  50. MODE_SHELL = 0,
  51. MODE_ADMIN
  52. };
  53. // IUnknown
  54. ULONG _cRef;
  55. DECLARE_QITABLE( CComputer );
  56. UINT _uMode; // Admin or Shell mode
  57. LPDATAOBJECT _pDataObj; // Data Object passed to ServerTab
  58. LPWSTR _pszObjectName;// DN of the object
  59. IADs * _pads; // ADs to MAO
  60. VARIANT _vGUID;
  61. VARIANT _vMachineFilepath;
  62. VARIANT _vInitialization;
  63. VARIANT _vSCP;
  64. HWND _hwndNotify; // DS notify window handle
  65. ADSPROPINITPARAMS _InitParams; // DSA init params
  66. private: // Methods
  67. CComputer();
  68. ~CComputer();
  69. STDMETHOD(Init)();
  70. STDMETHOD(Init2)( IADs * pads );
  71. HRESULT _FixObjectPath( LPWSTR pszOldObjectPath, LPWSTR *ppszNewObjectPath );
  72. public: // Methods
  73. friend LPVOID CComputer_CreateInstance( void );
  74. friend LPVOID CreateIntelliMirrorClientComputer( IADs * pads);
  75. // IUnknown
  76. STDMETHOD(QueryInterface)( REFIID riid, LPVOID *ppv );
  77. STDMETHOD_(ULONG, AddRef)(void);
  78. STDMETHOD_(ULONG, Release)(void);
  79. // IShellExtInit
  80. STDMETHOD(Initialize)( LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID);
  81. // IShellPropSheetExt
  82. STDMETHOD(AddPages)( LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  83. STDMETHOD(ReplacePage) ( UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam);
  84. // IMAO
  85. STDMETHOD(CommitChanges)( void );
  86. STDMETHOD(IsAdmin)( BOOL *fAdmin );
  87. STDMETHOD(IsServer)( BOOL *fServer );
  88. STDMETHOD(IsClient)( BOOL *fClient );
  89. STDMETHOD(SetServerName)( LPWSTR ppszName );
  90. STDMETHOD(GetServerName)( LPWSTR * ppszName );
  91. STDMETHOD(SetGUID)( LPWSTR ppGUID );
  92. STDMETHOD(GetGUID)( LPWSTR * ppszGUID, LPBYTE uGUID );
  93. STDMETHOD(GetSAP)( LPVOID *punk );
  94. STDMETHOD(GetDataObject)( LPDATAOBJECT * pDataObj );
  95. STDMETHOD(GetNotifyWindow)( HWND *phNotifyObj );
  96. };
  97. typedef CComputer* LPCOMPUTER;
  98. #endif // _CCOMPUTR_H_