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.

176 lines
5.4 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1994-1998 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dmemmgr.h
  6. * Content: Direct Memory Manager include file
  7. *
  8. ***************************************************************************/
  9. #ifndef __DMEMMGR_INCLUDED__
  10. #define __DMEMMGR_INCLUDED__
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #ifndef __NTDDKCOMP__
  15. /*
  16. * pointer to video memory
  17. */
  18. typedef ULONG_PTR FLATPTR;
  19. typedef struct _VIDMEM *LPVIDMEM;
  20. #else
  21. /*
  22. * pointer to video memory, potentially 64-bit
  23. */
  24. typedef ULONG_PTR FLATPTR;
  25. typedef struct _VIDEOMEMORY *LPVIDMEM;
  26. #endif
  27. /*
  28. * Structure for querying extended heap alignment requirements
  29. */
  30. typedef struct _SURFACEALIGNMENT
  31. {
  32. union
  33. {
  34. struct
  35. {
  36. DWORD dwStartAlignment;
  37. DWORD dwPitchAlignment;
  38. DWORD dwReserved1;
  39. DWORD dwReserved2;
  40. } Linear;
  41. struct
  42. {
  43. DWORD dwXAlignment;
  44. DWORD dwYAlignment;
  45. DWORD dwReserved1;
  46. DWORD dwReserved2;
  47. } Rectangular;
  48. };
  49. } SURFACEALIGNMENT;
  50. typedef struct _SURFACEALIGNMENT FAR *LPSURFACEALIGNMENT;
  51. typedef struct _HEAPALIGNMENT
  52. {
  53. DWORD dwSize;
  54. DDSCAPS ddsCaps; /* Indicates which alignment fields are valid.*/
  55. DWORD dwReserved;
  56. SURFACEALIGNMENT ExecuteBuffer; /* Surfaces tagged with DDSCAPS_EXECUTEBUFFER */
  57. SURFACEALIGNMENT Overlay; /* Surfaces tagged with DDSCAPS_OVERLAY */
  58. SURFACEALIGNMENT Texture; /* Surfaces tagged with DDSCAPS_TEXTURE */
  59. SURFACEALIGNMENT ZBuffer; /* Surfaces tagged with DDSCAPS_ZBUFFER */
  60. SURFACEALIGNMENT AlphaBuffer; /* Surfaces tagged with DDSCAPS_ALPHA */
  61. SURFACEALIGNMENT Offscreen; /* Surfaces tagged with DDSCAPS_OFFSCREENPLAIN*/
  62. SURFACEALIGNMENT FlipTarget; /* Surfaces whose bits are potential primaries i.e. back buffers*/
  63. } HEAPALIGNMENT;
  64. typedef struct _HEAPALIGNMENT FAR *LPHEAPALIGNMENT;
  65. /*
  66. * video memory manager structures
  67. */
  68. typedef struct _VMEML
  69. {
  70. struct _VMEML FAR *next;
  71. FLATPTR ptr;
  72. DWORD size;
  73. } VMEML, FAR *LPVMEML, FAR * FAR *LPLPVMEML;
  74. typedef struct _VMEMR
  75. {
  76. struct _VMEMR FAR *next;
  77. struct _VMEMR FAR *prev;
  78. /*
  79. * The pUp, pDown, pLeft and pRight members were removed in DX5
  80. */
  81. struct _VMEMR FAR *pUp;
  82. struct _VMEMR FAR *pDown;
  83. struct _VMEMR FAR *pLeft;
  84. struct _VMEMR FAR *pRight;
  85. FLATPTR ptr;
  86. DWORD size;
  87. DWORD x;
  88. DWORD y;
  89. DWORD cx;
  90. DWORD cy;
  91. DWORD flags;
  92. FLATPTR pBits;
  93. } VMEMR, FAR *LPVMEMR, FAR * FAR *LPLPVMEMR;
  94. typedef struct _VMEMHEAP
  95. {
  96. DWORD dwFlags;
  97. DWORD stride;
  98. LPVOID freeList;
  99. LPVOID allocList;
  100. DWORD dwTotalSize;
  101. FLATPTR fpGARTLin; /* AGP: GART linear base of heap (app. visible) */
  102. FLATPTR fpGARTDev; /* AGP: GART device base of heap (driver visible) */
  103. DWORD dwCommitedSize; /* AGP: Number of bytes commited to heap */
  104. /*
  105. * Extended alignment data:
  106. * Filled in by DirectDraw in response to a GetHeapAlignment HAL call.
  107. */
  108. DWORD dwCoalesceCount;
  109. HEAPALIGNMENT Alignment;
  110. /*
  111. * These are analogous to VIDMEM.ddsCaps and VIDMEM.ddsCapsAlt. These values are queried from the
  112. * driver by a GetDriverInfo call. See the documentation for GUID_DDMoreSurfaceCaps
  113. */
  114. DDSCAPSEX ddsCapsEx;
  115. DDSCAPSEX ddsCapsExAlt;
  116. #ifndef IS_16
  117. // Full physical address of heap base for NT AGP heaps.
  118. LARGE_INTEGER liPhysAGPBase;
  119. #endif
  120. // hdev for use with VidMemAllocAligned on NT. Set by the system at
  121. // initialization time.
  122. HANDLE hdevAGP;
  123. // Physical reservation handle for NT heaps.
  124. LPVOID pvPhysRsrv;
  125. } VMEMHEAP;
  126. typedef VMEMHEAP FAR *LPVMEMHEAP;
  127. #define VMEMHEAP_LINEAR 0x00000001l /* Heap is linear */
  128. #define VMEMHEAP_RECTANGULAR 0x00000002l /* Heap is rectangular */
  129. #define VMEMHEAP_ALIGNMENT 0x00000004l /* Heap has extended alignment info */
  130. /*
  131. * This legacy export doesn't handle nonlocal heaps
  132. * This function is not available on Windows NT
  133. */
  134. #ifndef __NTDDKCOMP__
  135. extern FLATPTR WINAPI VidMemAlloc( LPVMEMHEAP pvmh, DWORD width, DWORD height );
  136. #endif
  137. /*
  138. * This export can be used by drivers to allocate aligned surfaces from heaps which
  139. * they have previously exposed to DirectDraw. This function can allocate from nonlocal heaps.
  140. */
  141. extern FLATPTR WINAPI HeapVidMemAllocAligned(
  142. LPVIDMEM lpVidMem,
  143. DWORD dwWidth,
  144. DWORD dwHeight,
  145. LPSURFACEALIGNMENT lpAlignment ,
  146. LPLONG lpNewPitch );
  147. /*
  148. * This export can free memory allocated via either allocation function
  149. */
  150. extern void WINAPI VidMemFree( LPVMEMHEAP pvmh, FLATPTR ptr );
  151. #ifdef __cplusplus
  152. };
  153. #endif
  154. #endif