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.

128 lines
4.3 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 OpenShare(LPCTSTR ptchServerName, LPCTSTR ptchShareName) = 0;
  30. virtual HRESULT ConfirmDeleteShare(LPCTSTR ptchServerName, LPCTSTR ptchShareName) = 0;
  31. virtual DWORD DeleteShare(LPCTSTR ptchServerName, LPCTSTR ptchShareName) = 0;
  32. virtual DWORD CloseSession(CFileMgmtResultCookie* pcookie) = 0;
  33. virtual DWORD CloseResource(CFileMgmtResultCookie* pcookie) = 0;
  34. virtual VOID DisplayShareProperties( // CODEWORK can this be removed?
  35. LPPROPERTYSHEETCALLBACK pCallBack,
  36. LPDATAOBJECT pDataObject,
  37. LONG_PTR handle) = 0;
  38. virtual DWORD ReadShareProperties(
  39. LPCTSTR ptchServerName,
  40. LPCTSTR ptchShareName,
  41. OUT PVOID* ppvPropertyBlock,
  42. OUT CString& strDescription,
  43. OUT CString& strPath,
  44. OUT BOOL* pfEditDescription,
  45. OUT BOOL* pfEditPath, // CODEWORK always disable for now
  46. OUT DWORD* pdwShareType) = 0;
  47. virtual DWORD WriteShareProperties(
  48. LPCTSTR ptchServerName,
  49. LPCTSTR ptchShareName,
  50. PVOID pvPropertyBlock,
  51. LPCTSTR ptchDescription,
  52. LPCTSTR ptchPath) = 0;
  53. virtual HRESULT ReadSharePublishInfo(
  54. LPCTSTR ptchServerName,
  55. LPCTSTR ptchShareName,
  56. OUT BOOL* pbPublish,
  57. OUT CString& strUNCPath,
  58. OUT CString& strDescription,
  59. OUT CString& strKeywords,
  60. OUT CString& strManagedBy)
  61. {
  62. UNREFERENCED_PARAMETER (ptchServerName);
  63. UNREFERENCED_PARAMETER (ptchShareName);
  64. UNREFERENCED_PARAMETER (pbPublish);
  65. UNREFERENCED_PARAMETER (strUNCPath);
  66. UNREFERENCED_PARAMETER (strDescription);
  67. UNREFERENCED_PARAMETER (strKeywords);
  68. UNREFERENCED_PARAMETER (strManagedBy);
  69. return S_OK;
  70. }
  71. virtual HRESULT WriteSharePublishInfo(
  72. LPCTSTR ptchServerName,
  73. LPCTSTR ptchShareName,
  74. IN BOOL bPublish,
  75. LPCTSTR ptchDescription,
  76. LPCTSTR ptchKeywords,
  77. LPCTSTR ptchManagedBy)
  78. {
  79. UNREFERENCED_PARAMETER (ptchServerName);
  80. UNREFERENCED_PARAMETER (ptchShareName);
  81. UNREFERENCED_PARAMETER (bPublish);
  82. UNREFERENCED_PARAMETER (ptchDescription);
  83. UNREFERENCED_PARAMETER (ptchKeywords);
  84. UNREFERENCED_PARAMETER (ptchManagedBy);
  85. return S_OK;
  86. }
  87. virtual DWORD ReadShareType(
  88. LPCTSTR ptchServerName,
  89. LPCTSTR ptchShareName,
  90. DWORD* pdwShareType );
  91. virtual DWORD ReadShareFlags(
  92. LPCTSTR ptchServerName,
  93. LPCTSTR ptchShareName,
  94. DWORD* pdwFlags );
  95. virtual DWORD WriteShareFlags(
  96. LPCTSTR ptchServerName,
  97. LPCTSTR ptchShareName,
  98. DWORD dwFlags );
  99. virtual BOOL GetCachedFlag( DWORD dwFlags, DWORD dwFlagToCheck );
  100. virtual VOID SetCachedFlag( DWORD* pdwFlags, DWORD dwNewFlag );
  101. virtual VOID FreeShareProperties(PVOID pvPropertyBlock) = 0;
  102. virtual VOID FreeData(PVOID pv) = 0;
  103. virtual DWORD QueryMaxUsers(PVOID pvPropertyBlock) = 0;
  104. virtual VOID SetMaxUsers( PVOID pvPropertyBlock, DWORD dwMaxUsers) = 0;
  105. virtual LPCTSTR QueryTransportString() = 0;
  106. protected:
  107. CFileMgmtComponentData* m_pFileMgmtData;
  108. INT DoPopup( INT nResourceID,
  109. DWORD dwErrorNumber = 0,
  110. LPCTSTR pszInsertionString = NULL,
  111. UINT fuStyle = MB_OK | MB_ICONSTOP );
  112. HRESULT CreateFolderSecurityPropPage(
  113. LPPROPERTYSHEETCALLBACK pCallBack,
  114. LPDATAOBJECT pDataObject
  115. );
  116. };
  117. #endif // ~__FILESVC_H_INCLUDED__