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.

118 lines
4.7 KiB

  1. #if !defined(_FUSION_INC_PSTREAM_H_INCLUDED_)
  2. #define _FUSION_INC_PSTREAM_H_INCLUDED_
  3. #pragma once
  4. typedef struct tagFUSION_PSTREAM_VERSION_INDEPENDENT_HEADER
  5. {
  6. WORD wByteOrder; // Always 0xFFFE for little-endian
  7. WORD wFormat; // Starting with 1
  8. DWORD dwOSVer; // System version
  9. CLSID clsid; // Originator identifier
  10. DWORD reserved; // reserved as in PROPERTYSETHEADER
  11. } FUSION_PSTREAM_VERSION_INDEPENDENT_HEADER, *PFUSION_PSTREAM_VERSION_INDEPENDENT_HEADER;
  12. typedef const FUSION_PSTREAM_VERSION_INDEPENDENT_HEADER *PCFUSION_PSTREAM_VERSION_INDEPENDENT_HEADER;
  13. typedef struct tagFUSION_PSTREAM_VERSION_1_HEADER
  14. {
  15. FUSION_PSTREAM_VERSION_INDEPENDENT_HEADER vih;
  16. } FUSION_PSTREAM_VERSION_1_HEADER, *PFUSION_PSTREAM_VERSION_1_HEADER;
  17. typedef struct tagFUSION_PSTREAM_ELEMENT
  18. {
  19. BYTE bIndicator;
  20. union
  21. {
  22. struct
  23. {
  24. GUID guidSectionSet;
  25. ULONG ulSectionID;
  26. } BeginSectionVal;
  27. struct
  28. {
  29. DWORD propid;
  30. WORD wType;
  31. } PropertyVal;
  32. };
  33. } FUSION_PSTREAM_ELEMENT, *PFUSION_PSTREAM_ELEMENT;
  34. typedef const FUSION_PSTREAM_ELEMENT *PCFUSION_PSTREAM_ELEMENT;
  35. #define FUSION_PSTREAM_INDICATOR_SECTION_BEGIN (1)
  36. #define FUSION_PSTREAM_SIZEOF_SECTION_BEGIN (21) // BYTE + GUID + ULONG
  37. #define FUSION_PSTREAM_INDICATOR_SECTION_END (2)
  38. #define FUSION_PSTREAM_SIZEOF_SECTION_END (1) // BYTE
  39. #define FUSION_PSTREAM_INDICATOR_PROPERTY (3)
  40. #define FUSION_PSTREAM_SIZEOF_PROPERTY (7) // BYTE + DWORD + WORD
  41. #define FUSION_PSTREAM_INDICATOR_END (4)
  42. #define FUSION_PSTREAM_SIZEOF_END (1) // BYTE
  43. //
  44. // While the design for the fusion property stream is similar to the
  45. // OLE property set persistance format, it's specifically optimized to
  46. // be able to be pushed over the wire with as little pre-calculation
  47. // and buffering as possible. Thus rather than having each property
  48. // carry its total byte count (which may not be computable), each
  49. // type is generally prefixed by either an element count or a length.
  50. //
  51. // Specifics, per type:
  52. //
  53. // VT_I1, VT_UI1:
  54. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  55. // xx xx xx xx // property id
  56. // 10 00 // VT_I1
  57. // yy // single byte integer value
  58. //
  59. // VT_I2, VT_UI2:
  60. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  61. // xx xx xx xx // property id
  62. // 02 00 // VT_I2
  63. // yy yy // word integer value
  64. //
  65. // VT_I4, VT_UI4:
  66. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  67. // xx xx xx xx // property id
  68. // 03 00 // VT_I4
  69. // yy yy yy yy // dword integer value
  70. //
  71. // VT_LPSTR:
  72. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  73. // xx xx xx xx // property id
  74. // 1E 00 // VT_LPSTR
  75. // yy yy yy yy // byte/character count
  76. // ... // "y" bytes of data; no null terminator and no padding
  77. //
  78. // VT_LPWSTR:
  79. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  80. // xx xx xx xx // property id
  81. // 1F 00 // VT_LPWSTR
  82. // yy yy yy yy // character count
  83. // ... // "y" characters (2*y bytes) of data; no null terminator and no padding
  84. //
  85. // VT_BLOB:
  86. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  87. // xx xx xx xx // property id
  88. // 41 00 // VT_BLOB
  89. // yy yy yy yy // byte count
  90. // ... // "y" bytes of data; no padding
  91. //
  92. // VT_VECTOR | VT_LPWSTR:
  93. // 03 // FUSION_PSTREAM_INDICATOR_PROPERTY
  94. // xx xx xx xx // property id
  95. // 1F 10 // VT_VECTOR | VT_LPWSTR
  96. // yy yy yy yy // element count
  97. // zz zz zz zz // character count for first element
  98. // ... // "z" characters (2*z bytes) of data; no null terminator and no padding
  99. // zz zz zz zz // character count for 2nd element
  100. // ... // "z" characters (2*z bytes) of data; no null terminator and no padding
  101. // .
  102. // .
  103. // .
  104. // repeats "y" times; y may be 0 in which case the property ends immediately
  105. // after the "y" bytes.
  106. //
  107. //
  108. #endif