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.

93 lines
3.9 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: ddetrack.h
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * Stuff for dde tracking
  7. *
  8. * History:
  9. * 9-3-91 sanfords Created
  10. \***************************************************************************/
  11. typedef struct tagDDEPACK {
  12. UINT_PTR uiLo;
  13. UINT_PTR uiHi;
  14. } DDEPACK, *PDDEPACK;
  15. #if defined(BUILD_WOW6432)
  16. //
  17. // This structure has the same layout as the DDEDATA when allocated by 32-bit
  18. // clients running on Win64. It's used only by USER to apply correct structure-size
  19. // validation.
  20. //
  21. typedef struct _DDEDATA_WOW6432
  22. {
  23. WORD wStatus;
  24. WORD wFmt;
  25. ULONG_PTR Data;
  26. } DDEDATA_WOW6432, *PDDEDATA_WOW6432;
  27. #endif
  28. // Packing set to 1 on 64 bits to prevent compiler from generating extra
  29. // packing for DDE_DATA that will later corrupt data when we attempt to cast
  30. // a pointer to a DDEDATA structure as a DDE_DATA pointer. DDEDATA is not
  31. // packed and uses __unaligned directive to assign pointer values to Value
  32. // field. To make sure those pointer values are extracted properly, DDE_DATA
  33. // must be packed to 1.
  34. #if defined(_WIN64) || defined(BUILD_WOW6432)
  35. #pragma pack(1)
  36. #endif
  37. typedef struct tagDDE_DATA { // useful for sanely manipulating DDE data
  38. WORD wStatus;
  39. WORD wFmt;
  40. KERNEL_PVOID Data; // often cast to a HANDLE so has to scale 32 and 64 bits.
  41. } DDE_DATA, *PDDE_DATA;
  42. #if defined(_WIN64) || defined(BUILD_WOW6432)
  43. #pragma pack()
  44. #endif
  45. //
  46. // This structure heads the single server side object used to hold DDE Data.
  47. // Its complexity derives from the fact that we may need to copy huge and
  48. // complex DDE data across the CSR barrier. (TYPE_DDEDATA object)
  49. //
  50. typedef struct tagINTDDEINFO {
  51. DDEPACK DdePack; // original dde pack struct
  52. DWORD flags; // XS_ flags describing the data
  53. HANDLE hDirect; // handle to direct DDE data
  54. PBYTE pDirect; // pointer to source buffer for direct data
  55. int cbDirect; // size of direct data total
  56. HANDLE hIndirect; // handle referenced by direct data
  57. PBYTE pIndirect; // pointer to source of indirect data - if being copied
  58. int cbIndirect; // amount of indirect data total
  59. // Directly following this struct is the
  60. // raw DDE data being copied between processes
  61. } INTDDEINFO, *PINTDDEINFO;
  62. // values for flags fields
  63. #define XS_PACKED 0x0001 // this transaction has a packed lParam
  64. #define XS_DATA 0x0002 // this transaction has data w/status-format info.
  65. #define XS_METAFILEPICT 0x0004 // the data in this transaction has a METAFILEPICT
  66. #define XS_BITMAP 0x0008 // the data in this transaction has a HBITMAP
  67. #define XS_DIB 0x0010 // the data in this transaction has a DIB
  68. #define XS_ENHMETAFILE 0x0020 // the data in this transaction has a HMF
  69. #define XS_PALETTE 0x0040 // the data in this transaction has a HPALETTE
  70. #define XS_LOHANDLE 0x0080 // the uiLo part has the data handle
  71. #define XS_HIHANDLE 0x0100 // the uiHi part has the data handle
  72. #define XS_FREEPXS 0x0200 // DDETrackGetMessageHook() should free pxs.
  73. #define XS_FRELEASE 0x0400 // DDE_FRELEASE bit was set in the data msg.
  74. #define XS_EXECUTE 0x0800 // execute data handle
  75. #define XS_FREESRC 0x1000 // free source after copy.
  76. #define XS_PUBLICOBJ 0x2000 // object being shared is public - cleanup if needed.
  77. #define XS_GIVEBACKONNACK 0x4000 // object was given and may need to be returned.
  78. #define XS_DUMPMSG 0x8000 // used for backing out PostMessages.
  79. #define XS_UNICODE 0x10000 // execute string is expected to be UNICODE
  80. #define FAIL_POST 0 // return values from DDETrackPostHook()
  81. #define FAKE_POST 1
  82. #define DO_POST 2
  83. #define FAILNOFREE_POST 3