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.

116 lines
3.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1998.
  5. //
  6. // File: wSecStor.hxx
  7. //
  8. // Contents: Implementation of the wrapper around Security Store
  9. //
  10. // Classes: CSecurityStoreWrapper
  11. //
  12. // History: 7-14-97 srikants Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <prcstob.hxx>
  17. #include <rcstxact.hxx>
  18. #include <cistore.hxx>
  19. #include <secstore.hxx>
  20. #include <fsciexps.hxx>
  21. //+-------------------------------------------------------------------------
  22. //
  23. // Class: CSecurityStoreWrapper
  24. //
  25. // Purpose: Implementation of the PSecurityStorage wrapper class
  26. // around Security Store.
  27. //
  28. // History: 7-14-97 srikants Created
  29. // 01-Nov-98 KLam Added cMegToLeaveOnDisk to constructor
  30. // Added _cMegToLeaveOnDisk private member
  31. //
  32. //--------------------------------------------------------------------------
  33. class CSecurityStoreWrapper : public PSecurityStore
  34. {
  35. public:
  36. CSecurityStoreWrapper( ICiCAdviseStatus *pAdviseStatus, ULONG cMegToLeaveOnDisk );
  37. ULONG AddRef()
  38. {
  39. return InterlockedIncrement(&_lRefCount);
  40. }
  41. ULONG Release()
  42. {
  43. LONG lRef;
  44. lRef = InterlockedDecrement(&_lRefCount);
  45. if ( lRef <= 0 )
  46. delete this;
  47. return lRef;
  48. }
  49. virtual SCODE Init( WCHAR const * pwszDirectory );
  50. virtual SCODE Load( WCHAR const * pwszDestinationDirectory, // dest dir
  51. IEnumString * pFileList, // list of files to copy
  52. IProgressNotify * pProgressNotify,
  53. BOOL fCallerOwnsFiles,
  54. BOOL * pfAbort );
  55. virtual SCODE Save( WCHAR const * pwszSaveDir,
  56. BOOL * pfAbort,
  57. IEnumString ** ppFileList,
  58. IProgressNotify * pProgress );
  59. virtual SCODE Empty();
  60. virtual SCODE LookupSDID( PSECURITY_DESCRIPTOR pSD, ULONG cbSD,
  61. SDID & sdid );
  62. virtual SCODE AccessCheck( SDID sdid,
  63. HANDLE hToken,
  64. ACCESS_MASK am,
  65. BOOL & fGranted );
  66. virtual SCODE GetSecurityDescriptor(
  67. SDID sdid,
  68. PSECURITY_DESCRIPTOR pSD,
  69. ULONG cbSDIn,
  70. ULONG & cbSDOut );
  71. virtual SCODE Shutdown()
  72. {
  73. _secStore.Shutdown();
  74. return S_OK;
  75. }
  76. private:
  77. virtual ~CSecurityStoreWrapper ();
  78. long _lRefCount;
  79. ULONG _cMegToLeaveOnDisk; // megabytes to leave on disk
  80. //
  81. // Security store needs a CiStorage object owned by the creating
  82. // object. _pStorage must live as long as the
  83. //
  84. XPtr<CiStorage> _xStorage;
  85. CSdidLookupTable _secStore;
  86. XInterface<ICiCAdviseStatus> _xAdviseStatus;
  87. };