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.

129 lines
3.3 KiB

  1. // FileSvc.cpp : File Service provider base class
  2. #include "stdafx.h"
  3. #include "safetemp.h"
  4. #include "FileSvc.h"
  5. #include "compdata.h" // CFileMgmtComponentData::DoPopup
  6. #include "macros.h"
  7. USE_HANDLE_MACROS("FILEMGMT(FileSvc.cpp)")
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. FileServiceProvider::FileServiceProvider(CFileMgmtComponentData* pFileMgmtData)
  14. : m_pFileMgmtData( pFileMgmtData )
  15. {
  16. ASSERT( m_pFileMgmtData != NULL );
  17. }
  18. FileServiceProvider::~FileServiceProvider()
  19. {
  20. }
  21. //+-------------------------------------------------------------------------
  22. //
  23. // Function: AddPageProc
  24. //
  25. // Synopsis: The IShellPropSheetExt->AddPages callback.
  26. //
  27. //--------------------------------------------------------------------------
  28. BOOL CALLBACK
  29. AddPageProc(HPROPSHEETPAGE hPage, LPARAM pCallBack)
  30. {
  31. HRESULT hr = ((LPPROPERTYSHEETCALLBACK)pCallBack)->AddPage(hPage);
  32. return (hr == S_OK);
  33. }
  34. // Security Shell extension CLSID - {1F2E5C40-9550-11CE-99D2-00AA006E086C}
  35. const CLSID CLSID_ShellExtSecurity =
  36. {0x1F2E5C40, 0x9550, 0x11CE, {0x99, 0xD2, 0x0, 0xAA, 0x0, 0x6E, 0x08, 0x6C}};
  37. HRESULT
  38. FileServiceProvider::CreateFolderSecurityPropPage(
  39. LPPROPERTYSHEETCALLBACK pCallBack,
  40. LPDATAOBJECT pDataObject
  41. )
  42. {
  43. //
  44. // add the file system security page
  45. //
  46. CComPtr<IShellExtInit> spShlInit;
  47. HRESULT hr = CoCreateInstance(CLSID_ShellExtSecurity,
  48. NULL,
  49. CLSCTX_INPROC_SERVER,
  50. IID_IShellExtInit,
  51. (void **)&spShlInit);
  52. if (SUCCEEDED(hr))
  53. {
  54. hr = spShlInit->Initialize(NULL, pDataObject, 0);
  55. if (SUCCEEDED(hr))
  56. {
  57. CComPtr<IShellPropSheetExt> spSPSE;
  58. hr = spShlInit->QueryInterface(IID_IShellPropSheetExt, (void **)&spSPSE);
  59. if (SUCCEEDED(hr))
  60. hr = spSPSE->AddPages(AddPageProc, (LPARAM)pCallBack);
  61. }
  62. }
  63. return hr;
  64. }
  65. INT FileServiceProvider::DoPopup(
  66. INT nResourceID,
  67. DWORD dwErrorNumber,
  68. LPCTSTR pszInsertionString,
  69. UINT fuStyle )
  70. {
  71. return m_pFileMgmtData->DoPopup( nResourceID, dwErrorNumber, pszInsertionString, fuStyle );
  72. }
  73. //
  74. // These methods cover the seperate API to determine whether share type is admin specific
  75. // By default (FPNW and SFM) have no admin specific shares.
  76. //
  77. DWORD FileServiceProvider::ReadShareType(
  78. LPCTSTR /*ptchServerName*/,
  79. LPCTSTR /*ptchShareName*/,
  80. DWORD* pdwShareType )
  81. {
  82. ASSERT(pdwShareType);
  83. *pdwShareType = 0;
  84. return NERR_Success;
  85. }
  86. //
  87. // These methods cover the seperate API to determine whether IntelliMirror
  88. // caching is enabled. By default (FPNW and SFM) they are disabled.
  89. //
  90. DWORD FileServiceProvider::ReadShareFlags(
  91. LPCTSTR /*ptchServerName*/,
  92. LPCTSTR /*ptchShareName*/,
  93. DWORD* /*pdwFlags*/ )
  94. {
  95. return NERR_InvalidAPI; // caught by CSharePageGeneralSMB::Load()
  96. }
  97. DWORD FileServiceProvider::WriteShareFlags(
  98. LPCTSTR /*ptchServerName*/,
  99. LPCTSTR /*ptchShareName*/,
  100. DWORD /*dwFlags*/ )
  101. {
  102. ASSERT( FALSE ); // why was this called?
  103. return NERR_Success;
  104. }
  105. BOOL FileServiceProvider::GetCachedFlag( DWORD /*dwFlags*/, DWORD /*dwFlagToCheck*/ )
  106. {
  107. ASSERT(FALSE);
  108. return FALSE;
  109. }
  110. VOID FileServiceProvider::SetCachedFlag( DWORD* /*pdwFlags*/, DWORD /*dwNewFlag*/ )
  111. {
  112. ASSERT(FALSE);
  113. }