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.

93 lines
3.9 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. #define DBG 1
  14. #include "stddef.h"
  15. #include <stdarg.h>
  16. #include "windef.h"
  17. #include "wingdi.h"
  18. #include "winddi.h"
  19. #include "devioctl.h"
  20. #include "ntddvdeo.h"
  21. #include "debug.h"
  22. typedef struct _PDEV
  23. {
  24. HANDLE hDriver; // Handle to \Device\Screen
  25. HDEV hdevEng; // Engine's handle to PDEV
  26. HSURF hsurfEng; // Engine's handle to surface
  27. HPALETTE hpalDefault; // Handle to the default palette for device.
  28. PBYTE pjScreen; // This is pointer to base screen address
  29. ULONG cxScreen; // Visible screen width
  30. ULONG cyScreen; // Visible screen height
  31. POINTL ptlOrg; // Where this display is anchored in
  32. // the virtual desktop.
  33. ULONG ulMode; // Mode the mini-port driver is in.
  34. LONG lDeltaScreen; // Distance from one scan to the next.
  35. ULONG cScreenSize; // size of video memory, including
  36. // offscreen memory.
  37. PVOID pOffscreenList; // linked list of DCI offscreen surfaces.
  38. FLONG flRed; // For bitfields device, Red Mask
  39. FLONG flGreen; // For bitfields device, Green Mask
  40. FLONG flBlue; // For bitfields device, Blue Mask
  41. ULONG cPaletteShift; // number of bits the 8-8-8 palette must
  42. // be shifted by to fit in the hardware
  43. // palette.
  44. ULONG ulBitCount; // # of bits per pel 8,16,24,32 are only supported.
  45. POINTL ptlHotSpot; // adjustment for pointer hot spot
  46. VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
  47. PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes
  48. DWORD cjPointerAttributes; // Size of buffer allocated
  49. BOOL fHwCursorActive; // Are we currently using the hw cursor
  50. PALETTEENTRY *pPal; // If this is pal managed, this is the pal
  51. BOOL bSupportDCI; // Does the miniport support DCI?
  52. PVOID pvTmpBuffer; // ptr to MIRRSURF bits for screen surface
  53. } PDEV, *PPDEV;
  54. typedef struct _MIRRSURF {
  55. PPDEV *pdev;
  56. ULONG cx;
  57. ULONG cy;
  58. ULONG lDelta;
  59. ULONG ulBitCount;
  60. BOOL bIsScreen;
  61. } MIRRSURF, *PMIRRSURF;
  62. DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *);
  63. BOOL bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *);
  64. BOOL bInitSURF(PPDEV, BOOL);
  65. BOOL bInitPaletteInfo(PPDEV, DEVINFO *);
  66. BOOL bInitPointer(PPDEV, DEVINFO *);
  67. BOOL bInit256ColorPalette(PPDEV);
  68. VOID vDisablePalette(PPDEV);
  69. VOID vDisableSURF(PPDEV);
  70. #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
  71. //
  72. // Determines the size of the DriverExtra information in the DEVMODE
  73. // structure passed to and from the display driver.
  74. //
  75. #define DRIVER_EXTRA_SIZE 0
  76. #define DLL_NAME L"framebuf" // Name of the DLL in UNICODE
  77. #define STANDARD_DEBUG_PREFIX "FRAMEBUF: " // All debug output is prefixed
  78. #define ALLOC_TAG 'bfDD' // Four byte tag (characters in
  79. // reverse order) used for memory
  80. // allocations