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.

132 lines
4.8 KiB

  1. /*++
  2. (c) 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. RpData.h
  5. Abstract:
  6. Contains structure definitions for the interface between RsFilter and the Fsa
  7. Environment:
  8. User and Kernel mode
  9. --*/
  10. #if !defined (RPDATA_H)
  11. #define RPDATA_H
  12. /*
  13. Reparse point information for placeholder files
  14. The version must be changed whenever the structure of the reparse point
  15. data has changed. Initial version is 100
  16. */
  17. #define RP_VERSION 101
  18. //
  19. // Used to verify that the placeholder data is valid
  20. //
  21. #define RP_GEN_QUALIFIER(hsmData, qual) {UCHAR * __cP; ULONG __ix;\
  22. __cP = (UCHAR *) &(hsmData)->version;\
  23. (qual) = 0L;\
  24. for (__ix = 0; __ix < sizeof(RP_DATA) - sizeof(ULONG) - sizeof(GUID) ; __ix++){\
  25. qual += (ULONG) *__cP;\
  26. __cP++;}}
  27. //
  28. // Bit flag defined that indicates state of data: Truncated or Premigrated
  29. // Use macros to test the bits.
  30. //
  31. // The following bits are mutually exclusive - if the file is truncated then truncate on close
  32. // or premigrate on close make no sense, and if the file is set to truncate on close it is not
  33. // truncated now and should not be added to the premigrated list on close...
  34. //
  35. #define RP_FLAG_TRUNCATED 0x00000001 // File is a placeholder
  36. #define RP_FLAG_TRUNCATE_ON_CLOSE 0x00000002 // Truncate this file when closed
  37. #define RP_FLAG_PREMIGRATE_ON_CLOSE 0x00000004 // Add to premigrated list on close
  38. //
  39. // The following flag is never to be written to media. It is set by the engine after
  40. // the CRC has been calculated and is cleared by the filter. It is used to indicate that
  41. // it is the engine that is setting the reparse point.
  42. //
  43. #define RP_FLAG_ENGINE_ORIGINATED 0x80000000
  44. #define RP_FILE_IS_TRUNCATED( bitFlag ) ( bitFlag & RP_FLAG_TRUNCATED)
  45. #define RP_FILE_IS_PREMIGRATED( bitFlag ) ( !( bitFlag & RP_FLAG_TRUNCATED ) )
  46. #define RP_INIT_BITFLAG( bitflag ) ( ( bitflag ) = 0 )
  47. #define RP_SET_TRUNCATED_BIT( bitflag ) ( ( bitflag ) |= RP_FLAG_TRUNCATED)
  48. #define RP_CLEAR_TRUNCATED_BIT( bitflag) ( ( bitflag ) &= ~RP_FLAG_TRUNCATED)
  49. #define RP_IS_ENGINE_ORIGINATED( bitFlag ) ( ( bitFlag & RP_FLAG_ENGINE_ORIGINATED) )
  50. #define RP_SET_ORIGINATOR_BIT( bitflag ) ( ( bitflag ) |= RP_FLAG_ENGINE_ORIGINATED)
  51. #define RP_CLEAR_ORIGINATOR_BIT( bitflag) ( ( bitflag ) &= ~RP_FLAG_ENGINE_ORIGINATED)
  52. #define RP_FILE_DO_TRUNCATE_ON_CLOSE( bitFlag ) ( bitFlag & RP_FLAG_TRUNCATE_ON_CLOSE)
  53. #define RP_SET_TRUNCATE_ON_CLOSE_BIT( bitflag ) ( ( bitflag ) |= RP_FLAG_TRUNCATE_ON_CLOSE)
  54. #define RP_CLEAR_TRUNCATE_ON_CLOSE_BIT( bitflag) ( ( bitflag ) &= ~RP_FLAG_TRUNCATE_ON_CLOSE)
  55. #define RP_FILE_DO_PREMIGRATE_ON_CLOSE( bitFlag ) ( bitFlag & RP_FLAG_PREMIGRATE_ON_CLOSE)
  56. #define RP_SET_PREMIGRATE_ON_CLOSE_BIT( bitflag ) ( ( bitflag ) |= RP_FLAG_PREMIGRATE_ON_CLOSE)
  57. #define RP_CLEAR_PREMIGRATE_ON_CLOSE_BIT( bitflag) ( ( bitflag ) &= ~RP_FLAG_PREMIGRATE_ON_CLOSE)
  58. #define RP_RESV_SIZE 52
  59. //
  60. // Some important shared limits
  61. //
  62. //
  63. // Number of outstanding IOCTLs FSA has pending with RsFilter used
  64. // for communication. The cost is basically thenon-paged pool that is
  65. // sizeof(IRP) multiplied by this number
  66. // (i.e. approx. 100 * RP_MAX_RECALL_BUFFERS is the Non-paged pool outstanding)
  67. //
  68. #define RP_MAX_RECALL_BUFFERS 20
  69. #define RP_DEFAULT_RUNAWAY_RECALL_LIMIT 60
  70. //
  71. // Placeholder data - all versions unioned together
  72. //
  73. typedef struct _RP_PRIVATE_DATA {
  74. CHAR reserved[RP_RESV_SIZE]; // Must be 0
  75. ULONG bitFlags; // bitflags indicating status of the segment
  76. LARGE_INTEGER migrationTime; // When migration occurred
  77. GUID hsmId;
  78. GUID bagId;
  79. LARGE_INTEGER fileStart;
  80. LARGE_INTEGER fileSize;
  81. LARGE_INTEGER dataStart;
  82. LARGE_INTEGER dataSize;
  83. LARGE_INTEGER fileVersionId;
  84. LARGE_INTEGER verificationData;
  85. ULONG verificationType;
  86. ULONG recallCount;
  87. LARGE_INTEGER recallTime;
  88. LARGE_INTEGER dataStreamStart;
  89. LARGE_INTEGER dataStreamSize;
  90. ULONG dataStream;
  91. ULONG dataStreamCRCType;
  92. LARGE_INTEGER dataStreamCRC;
  93. } RP_PRIVATE_DATA, *PRP_PRIVATE_DATA;
  94. typedef struct _RP_DATA {
  95. GUID vendorId; // Unique HSM vendor ID -- This is first to match REPARSE_GUID_DATA_BUFFER
  96. ULONG qualifier; // Used to checksum the data
  97. ULONG version; // Version of the structure
  98. ULONG globalBitFlags; // bitflags indicating status of the file
  99. ULONG numPrivateData; // number of private data entries
  100. GUID fileIdentifier; // Unique file ID
  101. RP_PRIVATE_DATA data; // Vendor specific data
  102. } RP_DATA, *PRP_DATA;
  103. #endif