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.

134 lines
5.0 KiB

  1. /****************************************************************************/
  2. // nshmapi.h
  3. //
  4. // RDP Display Driver/Share Core shared memory
  5. //
  6. // Copyright (C) 1996-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef _H_NSHMAPI
  9. #define _H_NSHMAPI
  10. #include <adcs.h>
  11. #include <aordprot.h>
  12. #include <aoaapi.h>
  13. #include <abaapi.h>
  14. #include <asbcapi.h>
  15. #include <acmapi.h>
  16. #include <apmapi.h>
  17. #include <aschapi.h>
  18. #include <aoeapi.h>
  19. #include <assiapi.h>
  20. #include <abcapi.h>
  21. #include <compress.h>
  22. #define SHM_CHECKVAL (UINT32)'!mhs' // "shm!"
  23. // Max size allowed for data to be input to the bulk MPPC compressor.
  24. #ifdef DC_HICOLOR
  25. #define MAX_COMPRESS_INPUT_BUF 16384
  26. #else
  27. #define MAX_COMPRESS_INPUT_BUF 8192
  28. #endif
  29. // Allocation size for a temp buffer used to hold data to be compressed with
  30. // MPPC. This data must fit into an 8K OUTBUF, so we might as well not alloc
  31. // the OUTBUF overhead size we'll never use anyway. See aschapi.h for
  32. // constants used for allocations.
  33. #define MAX_COMPRESSED_BUFFER (MAX_COMPRESS_INPUT_BUF - OUTBUF_OVERHEAD)
  34. /****************************************************************************/
  35. /* Format of the shadow data shared between stacks */
  36. /****************************************************************************/
  37. typedef struct tagSHADOW_INFO {
  38. ULONG messageSize;
  39. #ifdef DC_HICOLOR
  40. // Note we can't just send a chunk bigger than 16k - we have to introduce
  41. // an overflow buffer for high color
  42. ULONG messageSizeEx;
  43. #endif
  44. ULONG flags;
  45. ULONG senderID;
  46. ULONG channelID;
  47. BYTE data[1];
  48. } SHADOW_INFO, *PSHADOW_INFO;
  49. /****************************************************************************/
  50. /* Structure: SHM_SHARED_MEMORY */
  51. /* */
  52. /* Description: */
  53. /* Shared memory as used by the display driver and share core to */
  54. /* communicate. It is divided up into sub-structures for each component */
  55. /* that uses the shared mem, each sub-struct being named after the owning */
  56. /* component. */
  57. /****************************************************************************/
  58. typedef struct tagSHM_SHARED_MEMORY
  59. {
  60. /************************************************************************/
  61. /* We deliberately compile the guard values into the retail build */
  62. /* as well as the debug build so that we can mix-n-match retail and */
  63. /* debug wd/dd drivers (the shared memory format must be the same for */
  64. /* both). */
  65. /************************************************************************/
  66. UINT32 guardVal1;
  67. INT32 shareId;
  68. BOOLEAN fShmUpdate;
  69. PSHADOW_INFO pShadowInfo; /* used by the primary and shadow */
  70. /* stack(s) for communication. */
  71. /************************************************************************/
  72. // NOTE!!: Each component must make sure to init its Shm component.
  73. // We do NOT zero the shm on alloc to reduce init-time paging and cache
  74. // flushing.
  75. /************************************************************************/
  76. BA_SHARED_DATA ba; /* Accumulated bounds. */
  77. OA_SHARED_DATA oa; /* Order heap. */
  78. OE_SHARED_DATA oe; /* Transfer buffer for new parameters */
  79. CM_SHARED_DATA cm; /* Location for DD to put cursor details */
  80. SCH_SHARED_DATA sch; /* SCH shared data */
  81. PM_SHARED_DATA pm; /* PM shared data */
  82. SSI_SHARED_DATA ssi; /* SSI shared data */
  83. SBC_SHARED_DATA sbc; /* SBC shared data */
  84. BC_SHARED_DATA bc; // BC work buffers.
  85. UINT32 guardVal2;
  86. // Uninitialized work buffer for screen data compression.
  87. // Better in this case to use session space memory instead of putting
  88. // this in the ShareClass allocation in system space -- session space
  89. // PTEs are essentially unlimited.
  90. BYTE sdgTransferBuffer[MAX_UNCOMPRESSED_DATA_SIZE];
  91. UINT32 guardVal3;
  92. #ifdef DC_DEBUG
  93. TRC_SHARED_DATA trc; /* TRC shared data */
  94. #endif
  95. UINT32 guardVal4;
  96. UINT32 guardVal5;
  97. } SHM_SHARED_MEMORY, *PSHM_SHARED_MEMORY, **PPSHM_SHARED_MEMORY;
  98. /****************************************************************************/
  99. // Prototypes.
  100. /****************************************************************************/
  101. #ifdef DLL_DISP
  102. #include <nddapi.h>
  103. BOOLEAN RDPCALL SHM_Init(PDD_PDEV pPDev);
  104. void RDPCALL SHM_Term(void);
  105. #endif
  106. #endif // !defined(_H_NSHMAPI)