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.

126 lines
4.0 KiB

  1. // FileSvc.h : Base class for File Service Provider
  2. #ifndef __FILESVC_H_INCLUDED__
  3. #define __FILESVC_H_INCLUDED__
  4. // forward declarations
  5. class CFileMgmtCookie;
  6. class CFileMgmtResultCookie;
  7. class CFileMgmtComponentData;
  8. class CSecurityInformation;
  9. class FileServiceProvider
  10. {
  11. public:
  12. FileServiceProvider(CFileMgmtComponentData* pFileMgmtData);
  13. virtual ~FileServiceProvider();
  14. virtual HRESULT PopulateShares(
  15. IResultData* pResultData,
  16. CFileMgmtCookie* pcookie) = 0;
  17. // for EnumerateSessions and EnumerateResources:
  18. // if pResultData is not NULL, add sessions/resources to the listbox
  19. // if pResultData is NULL, delete all sessions/resources
  20. // if pResultData is NULL, return SUCCEEDED(hr) to continue or
  21. // FAILED(hr) to abort
  22. virtual HRESULT EnumerateSessions(
  23. IResultData* pResultData,
  24. CFileMgmtCookie* pcookie,
  25. bool bAddToResultPane) = 0;
  26. virtual HRESULT EnumerateResources(
  27. IResultData* pResultData,
  28. CFileMgmtCookie* pcookie) = 0;
  29. virtual DWORD DeleteShare(LPCTSTR ptchServerName, LPCTSTR ptchShareName) = 0;
  30. virtual DWORD CloseSession(CFileMgmtResultCookie* pcookie) = 0;
  31. virtual DWORD CloseResource(CFileMgmtResultCookie* pcookie) = 0;
  32. virtual VOID DisplayShareProperties( // CODEWORK can this be removed?
  33. LPPROPERTYSHEETCALLBACK pCallBack,
  34. LPDATAOBJECT pDataObject,
  35. LONG_PTR handle) = 0;
  36. virtual DWORD ReadShareProperties(
  37. LPCTSTR ptchServerName,
  38. LPCTSTR ptchShareName,
  39. OUT PVOID* ppvPropertyBlock,
  40. OUT CString& strDescription,
  41. OUT CString& strPath,
  42. OUT BOOL* pfEditDescription,
  43. OUT BOOL* pfEditPath, // CODEWORK always disable for now
  44. OUT DWORD* pdwShareType) = 0;
  45. virtual DWORD WriteShareProperties(
  46. LPCTSTR ptchServerName,
  47. LPCTSTR ptchShareName,
  48. PVOID pvPropertyBlock,
  49. LPCTSTR ptchDescription,
  50. LPCTSTR ptchPath) = 0;
  51. virtual HRESULT ReadSharePublishInfo(
  52. LPCTSTR ptchServerName,
  53. LPCTSTR ptchShareName,
  54. OUT BOOL* pbPublish,
  55. OUT CString& strUNCPath,
  56. OUT CString& strDescription,
  57. OUT CString& strKeywords,
  58. OUT CString& strManagedBy)
  59. {
  60. UNREFERENCED_PARAMETER (ptchServerName);
  61. UNREFERENCED_PARAMETER (ptchShareName);
  62. UNREFERENCED_PARAMETER (pbPublish);
  63. UNREFERENCED_PARAMETER (strUNCPath);
  64. UNREFERENCED_PARAMETER (strDescription);
  65. UNREFERENCED_PARAMETER (strKeywords);
  66. UNREFERENCED_PARAMETER (strManagedBy);
  67. return S_OK;
  68. }
  69. virtual HRESULT WriteSharePublishInfo(
  70. LPCTSTR ptchServerName,
  71. LPCTSTR ptchShareName,
  72. IN BOOL bPublish,
  73. LPCTSTR ptchDescription,
  74. LPCTSTR ptchKeywords,
  75. LPCTSTR ptchManagedBy)
  76. {
  77. UNREFERENCED_PARAMETER (ptchServerName);
  78. UNREFERENCED_PARAMETER (ptchShareName);
  79. UNREFERENCED_PARAMETER (bPublish);
  80. UNREFERENCED_PARAMETER (ptchDescription);
  81. UNREFERENCED_PARAMETER (ptchKeywords);
  82. UNREFERENCED_PARAMETER (ptchManagedBy);
  83. return S_OK;
  84. }
  85. virtual DWORD ReadShareType(
  86. LPCTSTR ptchServerName,
  87. LPCTSTR ptchShareName,
  88. DWORD* pdwShareType );
  89. virtual DWORD ReadShareFlags(
  90. LPCTSTR ptchServerName,
  91. LPCTSTR ptchShareName,
  92. DWORD* pdwFlags );
  93. virtual DWORD WriteShareFlags(
  94. LPCTSTR ptchServerName,
  95. LPCTSTR ptchShareName,
  96. DWORD dwFlags );
  97. virtual BOOL GetCachedFlag( DWORD dwFlags, DWORD dwFlagToCheck );
  98. virtual VOID SetCachedFlag( DWORD* pdwFlags, DWORD dwNewFlag );
  99. virtual VOID FreeShareProperties(PVOID pvPropertyBlock) = 0;
  100. virtual VOID FreeData(PVOID pv) = 0;
  101. virtual DWORD QueryMaxUsers(PVOID pvPropertyBlock) = 0;
  102. virtual VOID SetMaxUsers( PVOID pvPropertyBlock, DWORD dwMaxUsers) = 0;
  103. virtual LPCTSTR QueryTransportString() = 0;
  104. protected:
  105. CFileMgmtComponentData* m_pFileMgmtData;
  106. INT DoPopup( INT nResourceID,
  107. DWORD dwErrorNumber = 0,
  108. LPCTSTR pszInsertionString = NULL,
  109. UINT fuStyle = MB_OK | MB_ICONSTOP );
  110. HRESULT CreateFolderSecurityPropPage(
  111. LPPROPERTYSHEETCALLBACK pCallBack,
  112. LPDATAOBJECT pDataObject
  113. );
  114. };
  115. #endif // ~__FILESVC_H_INCLUDED__