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.

102 lines
4.8 KiB

  1. /******************************Module*Header*******************************\
  2. *
  3. * *******************
  4. * * GDI SAMPLE CODE *
  5. * *******************
  6. *
  7. * Module Name: driver.h
  8. *
  9. * contains prototypes for the frame buffer driver.
  10. *
  11. * Copyright (c) 1992-1998 Microsoft Corporation
  12. \**************************************************************************/
  13. #include "stddef.h"
  14. #include <stdarg.h>
  15. #include "windef.h"
  16. #include "wingdi.h"
  17. #include "winddi.h"
  18. #include "devioctl.h"
  19. #include "ntddvdeo.h"
  20. #include "debug.h"
  21. typedef struct _PDEV
  22. {
  23. HANDLE hDriver; // Handle to \Device\Screen
  24. HDEV hdevEng; // Engine's handle to PDEV
  25. HSURF hsurfEng; // Engine's handle to surface
  26. HPALETTE hpalDefault; // Handle to the default palette for device.
  27. PVOID pdsurf; // Associated surface
  28. SIZEL sizlSurf; // Displayed size of the surface
  29. PBYTE pjScreen; // This is pointer to base screen address
  30. ULONG cxScreen; // Visible screen width
  31. ULONG cyScreen; // Visible screen height
  32. POINTL ptlOrg; // Where this display is anchored in
  33. // the virtual desktop.
  34. ULONG ulMode; // Mode the mini-port driver is in.
  35. LONG lDeltaScreen; // Distance from one scan to the next.
  36. ULONG cScreenSize; // size of video memory, including
  37. // offscreen memory.
  38. PVOID pOffscreenList; // linked list of DCI offscreen surfaces.
  39. FLONG flRed; // For bitfields device, Red Mask
  40. FLONG flGreen; // For bitfields device, Green Mask
  41. FLONG flBlue; // For bitfields device, Blue Mask
  42. ULONG cPaletteShift; // number of bits the 8-8-8 palette must
  43. // be shifted by to fit in the hardware
  44. // palette.
  45. ULONG ulBitCount; // # of bits per pel 8,16,24,32 are only supported.
  46. POINTL ptlHotSpot; // adjustment for pointer hot spot
  47. VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
  48. PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes
  49. DWORD cjPointerAttributes; // Size of buffer allocated
  50. BOOL fHwCursorActive; // Are we currently using the hw cursor
  51. PALETTEENTRY *pPal; // If this is pal managed, this is the pal
  52. BOOL bSupportDCI; // Does the miniport support DCI?
  53. } PDEV, *PPDEV;
  54. typedef struct _DEVSURF /* dsurf */
  55. {
  56. ULONG flSurf; // DS_ flags as defined below
  57. BYTE iColor; // Solid color surface if DS_SOLIDBRUSH
  58. // If DS_SOLIDBRUSH, the following fields are undefined and not guaranteed to
  59. // have been allocated!
  60. BYTE iFormat; // BMF_*, BMF_PHYSDEVICE
  61. BYTE jReserved1; // Reserved
  62. BYTE jReserved2; // Reserved
  63. PPDEV ppdev; // Pointer to associated PDEV
  64. SIZEL sizlSurf; // Size of the surface
  65. ULONG lNextScan; // Offset from scan "n" to "n+1"
  66. ULONG lNextPlane; // Offset from plane "n" to "n+1"
  67. ULONG ulBitmapSize; // Length of bitmap if there were no
  68. // banking, in CPU addressable bytes
  69. // control function
  70. ULONG ajBits[1]; // Bits will start here for device bitmaps
  71. } DEVSURF, * PDEVSURF;
  72. DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *);
  73. BOOL bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *);
  74. BOOL bInitSURF(PPDEV, BOOL);
  75. BOOL bInitPaletteInfo(PPDEV, DEVINFO *);
  76. BOOL bInitPointer(PPDEV, DEVINFO *);
  77. BOOL bInit256ColorPalette(PPDEV);
  78. VOID vDisablePalette(PPDEV);
  79. VOID vDisableSURF(PPDEV);
  80. #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
  81. //
  82. // Determines the size of the DriverExtra information in the DEVMODE
  83. // structure passed to and from the display driver.
  84. //
  85. #define DRIVER_EXTRA_SIZE 0
  86. #define DLL_NAME L"framebuf" // Name of the DLL in UNICODE
  87. #define STANDARD_DEBUG_PREFIX "FRAMEBUF: " // All debug output is prefixed
  88. #define ALLOC_TAG 'bfDD' // Four byte tag (characters in
  89. // reverse order) used for memory
  90. // allocations