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.

182 lines
6.1 KiB

  1. //
  2. // Copyright 1997 - Microsoft
  3. //
  4. //
  5. // CComputr.H - Computer properties class
  6. //
  7. #ifndef _CSERVICE_H_
  8. #define _CSERVICE_H_
  9. #include <adsprop.h>
  10. // QITable
  11. BEGIN_QITABLE( CService )
  12. DEFINE_QI( IID_IShellExtInit, IShellExtInit , 1 )
  13. DEFINE_QI( IID_IShellPropSheetExt, IShellPropSheetExt, 2 )
  14. DEFINE_QI( IID_IIntelliMirrorSAP, IIntelliMirrorSAP , 30 )
  15. END_QITABLE
  16. // Definitions
  17. LPVOID
  18. CService_CreateInstance( void );
  19. // Private IIntelliMirrorSAP Interface Definition
  20. interface
  21. IIntelliMirrorSAP:
  22. public IUnknown
  23. {
  24. public:
  25. STDMETHOD(CommitChanges)( void ) PURE; // 1
  26. STDMETHOD(IsAdmin)( BOOL * pbool ) PURE; // 2
  27. STDMETHOD(GetAllowNewClients)( BOOL *pbool ) PURE; // 3
  28. STDMETHOD(SetAllowNewClients)( BOOL pbool ) PURE; // 4
  29. STDMETHOD(GetLimitClients)( BOOL *pbool ) PURE; // 5
  30. STDMETHOD(SetLimitClients)( BOOL pbool ) PURE; // 6
  31. STDMETHOD(GetMaxClients)( UINT *pint ) PURE; // 7
  32. STDMETHOD(SetMaxClients)( UINT pint ) PURE; // 8
  33. STDMETHOD(GetCurrentClientCount)( UINT *pint ) PURE; // 9
  34. STDMETHOD(SetCurrentClientCount)( UINT pint ) PURE; // 10
  35. STDMETHOD(GetAnswerRequests)( BOOL *pbool ) PURE; // 11
  36. STDMETHOD(SetAnswerRequests)( BOOL pbool ) PURE; // 12
  37. STDMETHOD(GetAnswerOnlyValidClients)( BOOL *pbool ) PURE; // 13
  38. STDMETHOD(SetAnswerOnlyValidClients)( BOOL pbool ) PURE; // 14
  39. STDMETHOD(GetNewMachineNamingPolicy)( LPWSTR *pwsz ) PURE; // 15
  40. STDMETHOD(SetNewMachineNamingPolicy)( LPWSTR pwsz ) PURE; // 16
  41. STDMETHOD(GetNewMachineOU)( LPWSTR *pwsz ) PURE; // 17
  42. STDMETHOD(SetNewMachineOU)( LPWSTR pwsz ) PURE; // 18
  43. STDMETHOD(EnumIntelliMirrorOSes)( DWORD dwFlags, LPUNKNOWN *punk ) PURE; // 19
  44. STDMETHOD(GetDefaultIntelliMirrorOS)( LPWSTR * pszName, LPWSTR * pszTimeout ) PURE; // 20
  45. STDMETHOD(SetDefaultIntelliMirrorOS)( LPWSTR pszName, LPWSTR pszTimeout ) PURE; // 21
  46. STDMETHOD(EnumTools)( DWORD dwFlags, LPUNKNOWN *punk ) PURE; // 22
  47. STDMETHOD(EnumLocalInstallOSes)( DWORD dwFlags, LPUNKNOWN *punk ) PURE; // 23
  48. STDMETHOD(GetServerDN)( LPWSTR *pwsz ) PURE; // 24
  49. STDMETHOD(SetServerDN)( LPWSTR pwsz ) PURE; // 25
  50. STDMETHOD(GetSCPDN)( LPWSTR * pwsz ) PURE; // 26
  51. STDMETHOD(GetGroupDN)( LPWSTR * pwsz ) PURE; // 27
  52. STDMETHOD(GetServerName)( LPWSTR *pwsz ) PURE; // 28
  53. STDMETHOD(GetDataObject)( LPDATAOBJECT * pDataObj ) PURE; // 29
  54. STDMETHOD(GetNotifyWindow)( HWND * phNotifyObj ) PURE; // 30
  55. };
  56. typedef IIntelliMirrorSAP *LPINTELLIMIRRORSAP;
  57. // CService
  58. class
  59. CService:
  60. public IShellExtInit, IShellPropSheetExt, IIntelliMirrorSAP
  61. {
  62. private:
  63. // Enums
  64. enum {
  65. MODE_SHELL = 0,
  66. MODE_ADMIN
  67. };
  68. UINT _uMode; // Admin or Shell mode
  69. LPWSTR _pszSCPDN; // LDAP path to SCP
  70. LPWSTR _pszGroupDN; // LDAP path to group. If NULL, not in a group.
  71. LPWSTR _pszMachineName; // Machine Name
  72. LPWSTR _pszDSServerName; // Save this so we use the same as DSADMIN
  73. // IUnknown
  74. ULONG _cRef;
  75. DECLARE_QITABLE( CService );
  76. LPDATAOBJECT _pDataObj; // DSA's data object
  77. HWND _hwndNotify; // DSA notify window
  78. ADSPROPINITPARAMS _InitParams; // DSA init params
  79. IADs * _pads; // ADs to MAO
  80. private: // Methods
  81. CService();
  82. ~CService();
  83. STDMETHOD(Init)();
  84. HRESULT _GetDefaultSIF( LPWSTR pszAttribute, LPWSTR * pszName, LPWSTR * pszTimeout );
  85. HRESULT _SetDefaultSIF( LPWSTR pszAttribute, LPWSTR pszName, LPWSTR pszTimeout );
  86. HRESULT _GetComputerNameFromADs( );
  87. HRESULT _FixObjectPath( LPWSTR pszOldObjectPath, LPWSTR *ppszNewObjectPath );
  88. public: // Methods
  89. friend LPVOID CService_CreateInstance( void );
  90. STDMETHOD(Init2)( IADs * pads );
  91. // IUnknown
  92. STDMETHOD(QueryInterface)( REFIID riid, LPVOID *ppv );
  93. STDMETHOD_(ULONG, AddRef)(void);
  94. STDMETHOD_(ULONG, Release)(void);
  95. // IShellExtInit
  96. STDMETHOD(Initialize)( LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID);
  97. // IShellPropSheetExt
  98. STDMETHOD(AddPages)( LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  99. STDMETHOD(ReplacePage)( UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  100. LPARAM lParam);
  101. // IIntelliMirrorSAP
  102. STDMETHOD(CommitChanges)( void );
  103. STDMETHOD(IsAdmin)( BOOL * pbool );
  104. STDMETHOD(GetAllowNewClients)( BOOL *pbool );
  105. STDMETHOD(SetAllowNewClients)( BOOL pbool );
  106. STDMETHOD(GetLimitClients)( BOOL *pbool );
  107. STDMETHOD(SetLimitClients)( BOOL pbool );
  108. STDMETHOD(GetMaxClients)( UINT *pint );
  109. STDMETHOD(SetMaxClients)( UINT pint );
  110. STDMETHOD(GetCurrentClientCount)( UINT *pint );
  111. STDMETHOD(SetCurrentClientCount)( UINT pint );
  112. STDMETHOD(GetAnswerRequests)( BOOL *pbool );
  113. STDMETHOD(SetAnswerRequests)( BOOL pbool );
  114. STDMETHOD(GetAnswerOnlyValidClients)( BOOL *pbool );
  115. STDMETHOD(SetAnswerOnlyValidClients)( BOOL pbool );
  116. STDMETHOD(GetNewMachineNamingPolicy)( LPWSTR *pwsz );
  117. STDMETHOD(SetNewMachineNamingPolicy)( LPWSTR pwsz );
  118. STDMETHOD(GetNewMachineOU)( LPWSTR *pwsz );
  119. STDMETHOD(SetNewMachineOU)( LPWSTR pwsz );
  120. STDMETHOD(EnumIntelliMirrorOSes)( DWORD dwFlags, LPUNKNOWN *punk );
  121. STDMETHOD(GetDefaultIntelliMirrorOS)( LPWSTR * pszName, LPWSTR * pszTimeout );
  122. STDMETHOD(SetDefaultIntelliMirrorOS)( LPWSTR pszName, LPWSTR pszTimeout );
  123. STDMETHOD(EnumTools)( DWORD dwFlags, LPUNKNOWN *punk );
  124. STDMETHOD(EnumLocalInstallOSes)( DWORD dwFlags, LPUNKNOWN *punk );
  125. STDMETHOD(GetServerDN)( LPWSTR *pwsz );
  126. STDMETHOD(SetServerDN)( LPWSTR pwsz );
  127. STDMETHOD(GetSCPDN)( LPWSTR * pwsz );
  128. STDMETHOD(GetGroupDN)( LPWSTR * pwsz );
  129. STDMETHOD(GetServerName)( LPWSTR * pwsz );
  130. STDMETHOD(GetDataObject)( LPDATAOBJECT * pDataObj );
  131. STDMETHOD(GetNotifyWindow)( HWND * phNotifyObj );
  132. };
  133. typedef CService* LPSERVICE;
  134. #endif // _CSERVICE_H_