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.

128 lines
5.9 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: driver.h
  3. *
  4. * Contains prototypes for the display driver.
  5. *
  6. * Copyright (c) 1992-1995 Microsoft Corporation
  7. \**************************************************************************/
  8. typedef struct _PDEV PDEV; // Handy forward declaration
  9. //////////////////////////////////////////////////////////////////////
  10. // Miscellaneous shared stuff
  11. #define DLL_NAME L"modex" // Name of the DLL in UNICODE
  12. #define STANDARD_DEBUG_PREFIX "ModeX: " // All debug output is prefixed
  13. // by this string
  14. #define ALLOC_TAG 'xdmD' // Dmdx
  15. // Four byte tag (characters in
  16. // reverse order) used for
  17. // memory allocations
  18. #define DRIVER_EXTRA_SIZE 0 // Size of the DriverExtra information in the
  19. // DEVMODE structure
  20. #define NUM_FLIP_BUFFERS 5 // Total number of flip buffers that we'll tell
  21. // DirectDraw we have, including the primary
  22. // surface buffer
  23. /////////////////////////////////////////////////////////////////////////
  24. // Palette stuff
  25. BOOL bEnablePalette(PDEV*);
  26. VOID vDisablePalette(PDEV*);
  27. VOID vAssertModePalette(PDEV*, BOOL);
  28. BOOL bInitializePalette(PDEV*, DEVINFO*);
  29. VOID vUninitializePalette(PDEV*);
  30. #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
  31. /////////////////////////////////////////////////////////////////////////
  32. // DirectDraw stuff
  33. typedef struct _FLIPRECORD
  34. {
  35. FLATPTR fpFlipFrom; // Surface we last flipped from
  36. LONGLONG liFlipTime; // Time at which last flip
  37. // occured
  38. LONGLONG liFlipDuration; // Precise amount of time it
  39. // takes from vblank to vblank
  40. BOOL bHaveEverCrossedVBlank; // True if we noticed that we
  41. // switched from inactive to
  42. // vblank
  43. BOOL bWasEverInDisplay; // True if we ever noticed that
  44. // we were inactive
  45. BOOL bFlipFlag; // True if we think a flip is
  46. // still pending
  47. } FLIPRECORD;
  48. BOOL bEnableDirectDraw(PDEV*);
  49. VOID vDisableDirectDraw(PDEV*);
  50. VOID vAssertModeDirectDraw(PDEV*, BOOL);
  51. ////////////////////////////////////////////////////////////////////////
  52. // The Physical Device data structure
  53. typedef struct _PDEV
  54. {
  55. ULONG iBitmapFormat; // BMF_8BPP (our current colour depth)
  56. UCHAR* pjBase; // Mapped IO port base for this PDEV
  57. LONG lVgaDelta; // VGA screen stride
  58. BYTE* pjVga; // Points to VGA's base screen address
  59. ULONG cjVgaOffset; // Offset from pjVga to current flip
  60. // buffer
  61. ULONG iVgaPage; // Page number of current flip buffer
  62. ULONG cVgaPages; // Count of flip buffers
  63. ULONG cjVgaPageSize; // Size of a flip buffer
  64. BYTE* pjScreen; // Points to shadow buffer
  65. LONG lScreenDelta; // Shadow buffer stride
  66. FLATPTR fpScreenOffset; // Offset to current DirectDraw flip
  67. // buffer; if zero, primary GDI
  68. // surface is visible
  69. LONG cxScreen; // Visible screen width
  70. LONG cyScreen; // Visible screen height
  71. LONG cxMemory; // Shadow buffer width
  72. LONG cyMemory; // Shadow buffer height
  73. HANDLE hDriver; // Handle to \Device\Screen
  74. HDEV hdevEng; // Engine's handle to PDEV
  75. HSURF hsurfScreen; // Engine's handle to screen surface
  76. HSURF hsurfShadow; // Engine's handle to our shadow buffer
  77. FLONG flHooks; // What we're hooking from GDI
  78. ULONG ulMode; // Mode the mini-port driver is in.
  79. SURFOBJ* pso; // DIB copy of our shaodw surface to
  80. // which we have GDI draw everything
  81. LONG cLocks; // Number of current DirectDraw
  82. // locks
  83. RECTL rclLock; // Bounding box of all current Direct-
  84. // Draw locks
  85. ////////// Palette stuff:
  86. PALETTEENTRY* pPal; // The palette if palette managed
  87. HPALETTE hpalDefault; // GDI handle to the default palette.
  88. FLONG flRed; // Red mask for 16/32bpp bitfields
  89. FLONG flGreen; // Green mask for 16/32bpp bitfields
  90. FLONG flBlue; // Blue mask for 16/32bpp bitfields
  91. ULONG cPaletteShift; // number of bits the 8-8-8 palette must
  92. // be shifted by to fit in the hardware
  93. /////////// DirectDraw stuff:
  94. FLIPRECORD flipRecord; // Used to track vertical blank status
  95. ULONG cDwordsPerPlane; // Total number of dwords per plane
  96. } PDEV, *PPDEV;
  97. /////////////////////////////////////////////////////////////////////////
  98. // Miscellaneous prototypes:
  99. VOID vUpdate(PDEV*, RECTL*, CLIPOBJ*);
  100. BOOL bAssertModeHardware(PDEV*, BOOL);
  101. BOOL bEnableHardware(PDEV*);
  102. VOID vDisableHardware(PDEV*);