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.

242 lines
8.8 KiB

  1. -------------------------------------------------------------------------------
  2. OLE STRUCTURED STORAGE
  3. REFERERENCE IMPLEMENTATION
  4. RELEASE NOTES
  5. August, 2002
  6. Microsoft Windows
  7. Copyright (C) 1992-2002, Microsoft Corporation.
  8. -------------------------------------------------------------------------------
  9. <add: license agreement?>
  10. CONTENTS
  11. --------
  12. 1) What is included in the distribution
  13. 2) Building the distribution
  14. 3) ANSI and Unicode API support
  15. 4) Documentation
  16. 5) Supported Interfaces and differences
  17. 6) Using the reference implementation
  18. 7) Reporting bugs
  19. -------------------------------------------------------------------------------
  20. 1) What is included in the distribution
  21. Included in the distribution are the source code for the interfaces IStorage,
  22. ILockBytes, IStream, IEnumSTATSTG, IMalloc, IPropertySetStorage,
  23. IPropertyStorage, IEnumSTATPROPSETSTG, and IEnumSTATPROPSTG. Note that not all
  24. the functionality of these interfaces are supported, see (5) for more
  25. information.
  26. Also, included are some test programs: 'stgdrt' and 'reftest' for the storage
  27. interfaces, and 'proptest' for the property set interfaces. There is a
  28. 'readme.txt' in each of those directories that contains a short description of
  29. the tests. For details, please read the source code files.
  30. ----------------------------
  31. 2) Building the distribution
  32. The distributions comes with a "makefile" which includes the correct makefile
  33. file:
  34. - makefile.<system> the actual makefile
  35. where <system> refers to the development system used to compile the
  36. makefile. Therefore, to change the development system, edit the makefile to
  37. include the correct files, or overwrite it with the correct one. Please note
  38. that the files in the distribution are in the DOS format, and thus you will
  39. need to use some utilities to remove the linefeeds before they can be compiled.
  40. Files included in the distribution support these systems:
  41. - "msc" which works with Microsoft Visual C++ compiler and 'nmake'.
  42. This has been tested on Windows.
  43. - "gcc" which works with GNU C++ compiler aka 'gcc' and GNU's 'make',
  44. dependencies can be generated using 'makedepend'.
  45. Only tested on Solaris, HP-UX, and Linux (2.0.7).
  46. However, using these files on other O.S. using the ported versions
  47. of the GNU tools should require minimum effort.
  48. To compile the distribution, type 'make' or 'nmake' at the root of the src
  49. tree. To do a clean build, do 'make clean' or 'nmake clean'. You might also
  50. need to do a 'make depend' to update the dependencies since the standard
  51. include paths tend to be different.
  52. Note that in the common makefile, 'commk.<system>', in the main directory you
  53. must specify the correct byte-order of the target machine. For Big Endian
  54. machines, define the macro BIGENDIAN as 1. Otherwise, define LITTLEENDIAN as
  55. 1. These macros allow the byte-swapping code to work correctly.
  56. The tests 'stgdrt', 'reftest' and 'proptest' can be built likewise.
  57. ----------------------------
  58. 3) ANSI and Unicode API support
  59. For flexibility, the reference implementation can be compiled to support
  60. either ANSI (i.e. char) or Unicode (i.e. WCHAR) API's. When the macro
  61. '_UNICODE' is turned on, the APIs will be using Unicode, otherwise it uses
  62. ANSI.
  63. Affected functions are those that contain 'STATSTG' parameters:
  64. - IEnumSTATSTG::Next
  65. - IStream::Stat
  66. - IStorage::Stat
  67. those that contain "WCHAR" parameters:
  68. - StgCreateStorageEx
  69. - StgCreateDocfile
  70. - StgOpenStorage
  71. - StgIsStorageFile
  72. - IStorage::OpenStream
  73. - IStorage::CreateStorage
  74. - IStorage::OpenStorage
  75. - IStorage::DestroyElement
  76. - IStorage::RenameElement
  77. - IStorage::MoveElementTo
  78. - IStorage::SetElementTimes
  79. and those that contain the "SNB" parameters:
  80. - IStorage::CopyTo
  81. - StgOpenStorageOnILockBytes
  82. For property set related functions, BSTR is single char based for ANSI
  83. API's and wide character based for UNICODE API's. This affect the following
  84. functions :
  85. - SysAllocString
  86. - SysFreeString
  87. Also PROPSPEC's lpwstr function is defined with LPOLESTR, which means it will
  88. be either a 'WCHAR' array or 'char' array. This affects the following
  89. functions:
  90. - IPropertyStorage::ReadMultiple
  91. - IPropertyStorage::WriteMultiple
  92. - IPropertyStorage::DeleteMultiple
  93. The change of names of properties to LPOLESTR affects these functions:
  94. - IPropertyStorage::ReadPropertyNames
  95. - IPropertyStorage::WritePropertyNames
  96. - IPropertyStorage::DeletePropertyNames
  97. Remember to recompile the tests using the same precompiler flags before using
  98. them on the new library!
  99. ----------------------------
  100. 4) Documentation
  101. The documentation for the API's can be found in the MSDN library and Windows
  102. Platform SDK. The property sets API's are new and their documentation can be
  103. found in MSDN library, or Windows Platform SDK. Another
  104. source of documentation for the property set interfaces would be "Introducing
  105. Distributed COM and the New OLE Features in Windows NT 4.0" in the May/96
  106. Microsoft Systems Journal.
  107. In addition, there is a file stgfmt2.doc which is a
  108. Microsoft Word document describing the disk format of OLE docfiles.
  109. ----------------------------
  110. 5) Supported functions/Interfaces and differences
  111. First of all, the reference implementation is not multi-thread safe, and it
  112. has no marshaling support. Below are details of differences between the
  113. reference implementation and that of the actual OLE API's.
  114. o StgCreateDocFile
  115. o StgCreateDocFileOnILockBytes
  116. o StgCreateStorageEx
  117. o StgOpenStorage
  118. o StgOpenStorageOnILockBytes
  119. o StgIsStorageFile
  120. o StgIsStorageILockBytes
  121. o IStorage
  122. o ILockBytes
  123. o IStream
  124. o IEnumSTATSTG
  125. For the above interfaces and APIs,
  126. - There is no transaction or simple mode in the storage interfaces, namely
  127. STGM_TRANSACTED/STGM_SIMPLE/STGM_PRIORITY/STGM_NOSCRATCH are not supported.
  128. - IStorage::SetElementTime() with a NULL 'lpszName' is not supported also.
  129. For the same reason StgSetTimes() is not supported as well
  130. - Access Times (part of STATSTG) for storage elements are not suported.
  131. - ILockBytes::LockRegion(), ILockBytes::UnlockRegion(), IStream::LockRegion(),
  132. IStream::UnlockRegion() are not supported
  133. - The STGOPTIONS parameter in StgCreateStorageEx can be used to create 4k sector structured storage files, which are supported in Windows 2000 and above.
  134. o CoGetMalloc
  135. o CoTaskMemAlloc
  136. o CoTaskMemFree
  137. o CoTaskRealloc
  138. o IMalloc
  139. These interfaces are mapped into the generic 'new' and 'delete' calls. They
  140. are provided to ease conversion of existing code that might be dependent on
  141. them to use the reference implementation.
  142. o FreePropVariantArray
  143. o PropVariantClear
  144. o PropVariantCopy
  145. o SysAllocString
  146. o SysFreeString
  147. o IPropertySetStorage
  148. o IPropertyStorage
  149. o IEnumSTATPROPSETSTG
  150. o IEnumSTATPROPSTG
  151. Code from these interfaces can be turned off by removing '-DNEWPROPS' from the
  152. makefiles, or specifying 'nmake NOPROPS=1' when building. For these
  153. interfaces, non-simple property sets are not supported. In fact, the reference
  154. implementation of property sets treats non-simple propvariant types like
  155. VT_STREAM as invalid types.
  156. ----------------------------
  157. 6) Using the reference implementation
  158. On the Windows platform, the code will compile into a dynamic link library
  159. (i.e. refstg.dll). To use the reference implementation, include 'storage.h'
  160. (for the storage interfaces) and ('props.h') for the property set interfaces
  161. to link up with the declarations. Note that only C++ headers are provided for
  162. this distribution.
  163. On UNIX, the code compiles into a library archive. i.e. "refstg.a". The
  164. headers should be included as in the Windows Platform. Please note that on
  165. certain UNIX machines, the standard headers declare 'wchar_t' as a 4-byte data
  166. type, which is incompatible with OLE's 2-byte character type. The reference
  167. implementation uses 'WCHAR' as the 2-byte character type, to avoid any
  168. confusion.
  169. NOTE: We have experience some problems when the g++ library, namely the
  170. fwrite() function on some versions of Linux overwrites memory in the wrong
  171. places. This can be avoided by using 'gcc' instead of 'g++' as the compiler.
  172. To turn off debugging code and do a 'retail' build, edit the makefiles (both
  173. in the root and in props sub-directory) and specify the relevant flags and do
  174. a clean build (see the makefiles for details).
  175. ----------------------------
  176. 7) Bug reports
  177. Please report any bugs found to :
  178. [email protected]