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.

84 lines
2.7 KiB

  1. /******************************************************************
  2. DFSJnPt.H -- WMI provider class definition
  3. Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  4. Description: Class definition of DFS Junction Point/Links provider
  5. Class
  6. *******************************************************************/
  7. #ifndef _CDFSJNPT_H_
  8. #define _CDFSJNPT_H_
  9. // Bitmaps for the properties
  10. #define DFSJNPT_ALL_PROPS 0xFFFFFFFF
  11. #define DFSJNPT_PROP_DfsEntryPath 0x00000001
  12. //#define DFSJNPT_PROP_NoOfStorages 0x00000002
  13. //#define DFSJNPT_PROP_ServerName 0x00000004
  14. //#define DFSJNPT_PROP_ShareName 0x00000008
  15. #define DFSJNPT_PROP_State 0x00000010
  16. #define DFSJNPT_PROP_Comment 0x00000020
  17. #define DFSJNPT_PROP_Timeout 0x00000040
  18. #define DFSJNPT_PROP_Caption 0x00000080
  19. // #defines for the property names
  20. #define DFSNAME L"Name"
  21. #define DFSENTRYPATH L"DFSENTRYPATH"
  22. #define SERVERNAME L"SERVERNAME"
  23. #define SHARENAME L"SHARENAME"
  24. #define STATE L"STATE"
  25. #define COMMENT L"Description"
  26. #define TIMEOUT L"TIMEOUT"
  27. #define LINKNAME L"LinkName"
  28. #define CAPTION L"Caption"
  29. class CDfsJnPt : public Provider
  30. {
  31. private:
  32. HRESULT EnumerateAllJnPts ( MethodContext *pMethodContext, DWORD dwPropertiesReq );
  33. HRESULT FindAndSetDfsEntry ( LPCWSTR a_Key, DWORD dwPropertiesReq, CInstance *pInstance, DWORD eOperation );
  34. HRESULT DeleteDfsJnPt ( PDFS_INFO_4 pJnPtBuf );
  35. HRESULT UpdateDfsJnPt ( const CInstance &Instance, DWORD dwOperation );
  36. NET_API_STATUS AddDfsJnPt ( LPWSTR a_DfsEntry, LPWSTR a_ServerName, LPWSTR a_ShareName, LPWSTR a_Comment );
  37. HRESULT LoadDfsJnPt ( DWORD dwPropertiesReq, CInstance *pInstance, PDFS_INFO_4 pJnPtBuf, bool bRoot );
  38. void SetRequiredProperties ( CFrameworkQuery &Query, DWORD &dwPropertiesReq );
  39. HRESULT CheckParameters ( const CInstance &a_Instance ,int iStatus ) ;
  40. BOOL IsDfsRoot ( LPCWSTR lpKey );
  41. protected:
  42. HRESULT EnumerateInstances ( MethodContext *pMethodContext, long lFlags = 0L ) ;
  43. HRESULT GetObject ( CInstance *pInstance, long lFlags, CFrameworkQuery &Query ) ;
  44. HRESULT PutInstance ( const CInstance& Instance, long lFlags = 0L ) ;
  45. HRESULT DeleteInstance ( const CInstance& Instance, long lFlags = 0L) ;
  46. HRESULT ExecMethod (
  47. const CInstance& a_Instance,
  48. const BSTR a_MethodName ,
  49. CInstance *a_InParams ,
  50. CInstance *a_OutParams ,
  51. long a_Flags
  52. );
  53. public:
  54. CDfsJnPt ( LPCWSTR lpwszClassName, LPCWSTR lpwszNameSpace ) ;
  55. virtual ~CDfsJnPt () ;
  56. private:
  57. CHString m_ComputerName;
  58. enum { eGet, eDelete, eModify, eAdd, eUpdate };
  59. } ;
  60. #endif