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.

182 lines
5.6 KiB

  1. #if !defined( _UTILS_H_ )
  2. #define _UTILS_H_
  3. #define STREAMTYPE_CONTROL 0x00000001
  4. #define STREAMTYPE_CACHE 0x00000002
  5. #define STREAMTYPE_CONTAINER 0x00000004
  6. #define STREAMTYPE_OTHER \
  7. (!(STREAMTYPE_CONTROL | STREAMTYPE_CACHE | STREAMTYPE_CONTAINER))
  8. #define STREAMTYPE_ALL 0xFFFFFFFF
  9. #define OPCODE_COPY 1
  10. #define OPCODE_REMOVE 2
  11. #define OPCODE_MOVE 3
  12. #define OPCODE_EXCLUDEFROMCOPY 4
  13. #define CONVERT_NOSOURCE 1
  14. #define CONVERT_NODESTINATION 2
  15. typedef struct tagPLACEABLEMETAHEADER {
  16. DWORD key; /* must be 0x9AC6CDD7L */
  17. HANDLE hmf; /* must be zero */
  18. RECT bbox; /* bounding rectangle of the metafile */
  19. WORD inch; /* # of metafile units per inch must be < 1440 */
  20. /* most apps use 576 or 1000 */
  21. DWORD reserved; /* must be zero */
  22. WORD checksum;
  23. } PLACEABLEMETAHEADER;
  24. #ifdef _MAC
  25. #define UtMemCpy(lpdst,lpsrc,dwCount) (BlockMove(lpsrc, lpdst, dwCount))
  26. #else
  27. #define UtMemCpy(lpdst,lpsrc,dwCount) (hmemcpy(lpdst, lpsrc, dwCount))
  28. #endif
  29. FARINTERNAL_(BOOL) UtGlobalHandleCpy(HANDLE FAR* lphdst, HANDLE hsrc);
  30. FARINTERNAL_(HANDLE) UtDupGlobal (HANDLE hSrc, UINT uiFlags=GMEM_MOVEABLE);
  31. FARINTERNAL_(BOOL) UtIsFormatSupported (LPDATAOBJECT lpObj, BOOL fGet,
  32. BOOL fSet, CLIPFORMAT cfFormat);
  33. FARINTERNAL_(LPSTR) UtDupString(LPCSTR lpszIn);
  34. FARINTERNAL_(BOOL) UtCopyFormatEtc(FORMATETC FAR* pFetcIn,
  35. FORMATETC FAR* pFetcCopy);
  36. FARINTERNAL_(int) UtCompareFormatEtc(FORMATETC FAR* pFetcLeft,
  37. FORMATETC FAR* pFetcRight);
  38. FARINTERNAL_(BOOL) UtCompareTargetDevice(DVTARGETDEVICE FAR* ptdLeft,
  39. DVTARGETDEVICE FAR* ptdRight);
  40. FARINTERNAL_(BOOL) UtCopyStatData(STATDATA FAR* pSDIn,
  41. STATDATA FAR* pSDCopy);
  42. FARINTERNAL_(void) UtReleaseStatData(STATDATA FAR* pStatData);
  43. FARINTERNAL_(HPALETTE) UtDupPalette(HPALETTE hpalette);
  44. FARINTERNAL_(int) UtPaletteSize (int iBitCount);
  45. FARINTERNAL_(DWORD) UtFormatToTymed (CLIPFORMAT cf);
  46. FARINTERNAL_(BOOL) UtQueryPictFormat(LPDATAOBJECT lpSrcDataObj,
  47. LPFORMATETC lpforetc);
  48. FARINTERNAL_(HBITMAP) UtConvertDibToBitmap(HANDLE hDib);
  49. FARINTERNAL_(HANDLE) UtConvertBitmapToDib(HBITMAP hBitmapm,
  50. HPALETTE hpal = NULL);
  51. FARINTERNAL_(void) UtGetClassID(LPUNKNOWN lpUnk, CLSID FAR* lpClsid);
  52. FARINTERNAL_(DVTARGETDEVICE FAR*) UtCopyTargetDevice(DVTARGETDEVICE FAR* ptd);
  53. FARINTERNAL UtGetIconData(LPDATAOBJECT lpSrcDataObj,
  54. REFCLSID rclsid, LPFORMATETC lpforetc,
  55. LPSTGMEDIUM lpstgmed);
  56. OLEAPI UtDoStreamOperation (LPSTORAGE pstgSrc,
  57. LPSTORAGE pstgDst, int iOpCode,
  58. DWORD grfAllowedStmTypes);
  59. FARINTERNAL_(LPSTR) UtStrRChr (LPCSTR sz, const char ch);
  60. FARINTERNAL_(void) UtGetPresStreamName (LPSTR lpszName, int iStreamNum);
  61. FARINTERNAL_(void) UtRemoveExtraOlePresStreams (LPSTORAGE pstg,
  62. int iStart);
  63. /*** Following routines can be found in convert.cpp *****/
  64. FARINTERNAL UtGetHGLOBALFromStm(LPSTREAM lpstream, DWORD dwSize,
  65. HANDLE FAR* lphPres);
  66. FARINTERNAL UtGetHDIBFromDIBFileStm(LPSTREAM pstm,
  67. HANDLE FAR* lphdata);
  68. FARINTERNAL_(HANDLE) UtGetHMFPICT(HMETAFILE hMF, BOOL fDeletOnError,
  69. DWORD xExt, DWORD yExt);
  70. FARINTERNAL UtGetHMFFromMFStm(LPSTREAM lpstream, DWORD dwSize,
  71. BOOL fConvert, HANDLE FAR* lphPres);
  72. FARINTERNAL UtGetSizeAndExtentsFromPlaceableMFStm(LPSTREAM pstm,
  73. DWORD FAR* dwSize, LONG FAR* plWidth,
  74. LONG FAR* plHeight);
  75. FARINTERNAL UtGetHMFPICTFromPlaceableMFStm(LPSTREAM pstm,
  76. HANDLE FAR* lphdata);
  77. FARINTERNAL UtHGLOBALToStm(HANDLE hdata, DWORD dwSize,
  78. LPSTREAM pstm);
  79. FARINTERNAL_(void) UtGetDibExtents (LPBITMAPINFOHEADER lpbmi,
  80. LONG FAR* plWidth, LONG FAR* plHeight);
  81. FARINTERNAL UtHDIBToDIBFileStm(HANDLE hdata,
  82. DWORD dwSize, LPSTREAM pstm);
  83. FARINTERNAL UtDIBStmToDIBFileStm(LPSTREAM pstmDIB,
  84. DWORD dwSize, LPSTREAM pstmDIBFile);
  85. FARINTERNAL UtHDIBFileToOlePresStm(HANDLE hdata, LPSTREAM pstm);
  86. FARINTERNAL UtHMFToMFStm(HANDLE FAR* lphMF, DWORD dwSize,
  87. LPSTREAM lpstream);
  88. FARINTERNAL UtHMFToPlaceableMFStm(HANDLE FAR* lphMF,
  89. DWORD dwSize, LONG lWidth, LONG lHeight,
  90. LPSTREAM pstm);
  91. FARINTERNAL UtMFStmToPlaceableMFStm(LPSTREAM pstmMF,
  92. DWORD dwSize, LONG lWidth, LONG lHeight,
  93. LPSTREAM pstmPMF);
  94. FARINTERNAL UtReadOlePresStmHeader (LPSTREAM pstm,
  95. LPFORMATETC pforetc, DWORD FAR* pdwAdvf,
  96. BOOL FAR* pfConvert);
  97. FARINTERNAL UtWriteOlePresStmHeader(LPSTREAM lppstream,
  98. LPFORMATETC pforetc, DWORD dwAdvf);
  99. FARINTERNAL UtOlePresStmToContentsStm (LPSTORAGE pstg,
  100. LPSTR lpszPresStm, BOOL fDeletePresStm,
  101. UINT FAR* puiStatus);
  102. /*** Following routines can be found in ..\dde\client\ddecnvrt.cpp *****/
  103. FARINTERNAL UtGetHMFPICTFromMSDrawNativeStm (LPSTREAM pstm,
  104. DWORD dwSize, HANDLE FAR* lphdata);
  105. FARINTERNAL UtPlaceableMFStmToMSDrawNativeStm (LPSTREAM pstmPMF,
  106. LPSTREAM pstmMSDraw);
  107. FARINTERNAL UtDIBFileStmToPBrushNativeStm (LPSTREAM pstmDIBFile,
  108. LPSTREAM pstmPBrush);
  109. FARINTERNAL_(HANDLE) UtGetHPRESFromNative (LPSTORAGE pstg,
  110. CLIPFORMAT cfFormat, BOOL fOle10Native);
  111. FARINTERNAL UtContentsStmTo10NativeStm (LPSTORAGE pstg,
  112. REFCLSID rclsid, BOOL fDeleteContents,
  113. UINT FAR* puiStatus);
  114. FARINTERNAL Ut10NativeStmToContentsStm(LPSTORAGE pstg,
  115. REFCLSID rclsid, BOOL fDeleteSrcStm);
  116. #endif // _UTILS_H