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.

60 lines
1.9 KiB

  1. /******************************************************************
  2. DFSReplica.H -- WMI provider class definition
  3. Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  4. Description: Win32 Dfs Replica Provider
  5. *******************************************************************/
  6. #ifndef _CDFSREPLICA_H_
  7. #define _CDFSREPLICA_H_
  8. #define DFSREPLICA_ALL_PROPS 0xFFFFFFFF
  9. #define DFSREPLICA_PROP_LinkName 0x00000001
  10. #define DFSREPLICA_PROP_ServerName 0x00000002
  11. #define DFSREPLICA_PROP_ShareName 0x00000004
  12. #define DFSREPLICA_PROP_State 0x00000008
  13. class CDfsReplica : public Provider
  14. {
  15. private:
  16. HRESULT EnumerateAllReplicas ( MethodContext *pMethodContext, DWORD dwPropertiesReq );
  17. HRESULT LoadDfsReplica ( DWORD dwPropertiesReq, CInstance *pInstance, LPWSTR lpLinkName, PDFS_STORAGE_INFO pRepBuf );
  18. HRESULT FindAndSetDfsReplica ( LPCWSTR a_EntryPath, LPCWSTR a_ServerName, LPCWSTR a_ShareName,
  19. DWORD dwPropertiesReq, CInstance *pInstance, DWORD eOperation, bool &bRoot );
  20. HRESULT GetKeys(const CInstance *pInstance, CHString &sKey1, CHString &sKey2, CHString &sKey3);
  21. protected:
  22. HRESULT EnumerateInstances ( MethodContext *pMethodContext, long lFlags = 0L ) ;
  23. HRESULT GetObject ( CInstance *pInstance, long lFlags, CFrameworkQuery& Query ) ;
  24. HRESULT PutInstance ( const CInstance& Instance, long lFlags = 0L ) ;
  25. HRESULT DeleteInstance ( const CInstance& Instance, long lFlags = 0L ) ;
  26. public:
  27. CDfsReplica ( LPCWSTR lpwszClassName, LPCWSTR lpwszNameSpace );
  28. virtual ~CDfsReplica () ;
  29. private:
  30. CHString m_ComputerName;
  31. enum { eGet,eDelete,eAdd };
  32. enum DFS_REPLICA_STATE { DFS_REPLICA_STATE_UNASSIGNED = 0,
  33. DFS_REPLICA_STATE_ONLINE,
  34. DFS_REPLICA_STATE_OFFLINE,
  35. DFS_REPLICA_STATE_UNREACHABLE
  36. };
  37. } ;
  38. #endif