ReactOS  0.4.14-dev-98-gb0d4763
framebufacc.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <guiddef.h>
#include <wingdi.h>
#include <winddi.h>
#include <winioctl.h>
#include <ntddvdeo.h>
Include dependency graph for framebufacc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PDEV
 

Macros

#define DEVICE_NAME   L"framebuf"
 
#define ALLOC_TAG   'FUBF'
 

Typedefs

typedef struct _PDEV PDEV
 
typedef struct _PDEVPPDEV
 

Functions

DHPDEV APIENTRY DrvEnablePDEV (IN DEVMODEW *pdm, IN LPWSTR pwszLogAddress, IN ULONG cPat, OUT HSURF *phsurfPatterns, IN ULONG cjCaps, OUT ULONG *pdevcaps, IN ULONG cjDevInfo, OUT DEVINFO *pdi, IN HDEV hdev, IN LPWSTR pwszDeviceName, IN HANDLE hDriver)
 
VOID APIENTRY DrvCompletePDEV (IN DHPDEV dhpdev, IN HDEV hdev)
 
VOID APIENTRY DrvDisablePDEV (IN DHPDEV dhpdev)
 
HSURF APIENTRY DrvEnableSurface (IN DHPDEV dhpdev)
 
VOID APIENTRY DrvDisableSurface (IN DHPDEV dhpdev)
 
BOOL APIENTRY DrvAssertMode (IN DHPDEV dhpdev, IN BOOL bEnable)
 
ULONG APIENTRY DrvGetModes (IN HANDLE hDriver, IN ULONG cjSize, OUT DEVMODEW *pdm)
 
BOOL APIENTRY DrvSetPalette (IN DHPDEV dhpdev, IN PALOBJ *ppalo, IN FLONG fl, IN ULONG iStart, IN ULONG cColors)
 
ULONG APIENTRY DrvSetPointerShape (IN SURFOBJ *pso, IN SURFOBJ *psoMask, IN SURFOBJ *psoColor, IN XLATEOBJ *pxlo, IN LONG xHot, IN LONG yHot, IN LONG x, IN LONG y, IN RECTL *prcl, IN FLONG fl)
 
VOID APIENTRY DrvMovePointer (IN SURFOBJ *pso, IN LONG x, IN LONG y, IN RECTL *prcl)
 
BOOL IntInitScreenInfo (PPDEV ppdev, LPDEVMODEW pDevMode, PGDIINFO pGdiInfo, PDEVINFO pDevInfo)
 
BOOL IntInitDefaultPalette (PPDEV ppdev, PDEVINFO pDevInfo)
 
BOOL APIENTRY IntSetPalette (IN DHPDEV dhpdev, IN PPALETTEENTRY ppalent, IN ULONG iStart, IN ULONG cColors)
 
BOOL CopyMonoPointer (PPDEV ppdev, SURFOBJ *pso)
 
BOOL CopyColorPointer (PPDEV ppdev, SURFOBJ *psoMask, SURFOBJ *psoColor, XLATEOBJ *pxlo)
 

Macro Definition Documentation

◆ ALLOC_TAG

#define ALLOC_TAG   'FUBF'

Definition at line 98 of file framebufacc.h.

◆ DEVICE_NAME

#define DEVICE_NAME   L"framebuf"

Definition at line 97 of file framebufacc.h.

Typedef Documentation

◆ PDEV

typedef struct _PDEV PDEV

◆ PPDEV

typedef struct _PDEV * PPDEV

Function Documentation

◆ CopyColorPointer()

BOOL CopyColorPointer ( PPDEV  ppdev,
SURFOBJ psoMask,
SURFOBJ psoColor,
XLATEOBJ pxlo 
)

Definition at line 209 of file pointer.c.

213 {
214  /* FIXME unimplement */
215  return FALSE;
216 }

Referenced by DrvSetPointerShape().

◆ CopyMonoPointer()

BOOL CopyMonoPointer ( PPDEV  ppdev,
SURFOBJ pso 
)

Definition at line 219 of file pointer.c.

221 {
222  /* FIXME unimplement */
223  return FALSE;
224 }

Referenced by DrvSetPointerShape().

◆ DrvAssertMode()

BOOL APIENTRY DrvAssertMode ( IN DHPDEV  dhpdev,
IN BOOL  bEnable 
)

Definition at line 168 of file surface.c.

171 {
172  PPDEV ppdev = (PPDEV)dhpdev;
173  ULONG ulTemp;
174 
175  if (bEnable)
176  {
177  /*
178  * Reinitialize the device to a clean state.
179  */
180  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_CURRENT_MODE,
181  &(ppdev->ModeIndex), sizeof(ULONG), NULL, 0,
182  &ulTemp))
183  {
184  /* We failed, bail out */
185  return FALSE;
186  }
187  if (ppdev->BitsPerPixel == 8)
188  {
189  IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256);
190  }
191 
192  return TRUE;
193  }
194  else
195  {
196  /*
197  * Call the miniport driver to reset the device to a known state.
198  */
199  return !EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_RESET_DEVICE,
200  NULL, 0, NULL, 0, &ulTemp);
201  }
202 }
PALETTEENTRY * PaletteEntries
Definition: framebuf.h:49
#define TRUE
Definition: types.h:120
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:137
BOOL APIENTRY IntSetPalette(IN DHPDEV dhpdev, IN PPALETTEENTRY ppalent, IN ULONG iStart, IN ULONG cColors)
Definition: palette.c:110
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:152
HANDLE hDriver
Definition: framebuf.h:35
BYTE BitsPerPixel
Definition: framebuf.h:42
smooth NULL
Definition: ftsmooth.c:416
ULONG ModeIndex
Definition: framebuf.h:38
struct _PDEV * PPDEV
Definition: framebuf.h:33
_In_ BOOL bEnable
Definition: winddi.h:3426
unsigned int ULONG
Definition: retypes.h:1

◆ DrvCompletePDEV()

VOID APIENTRY DrvCompletePDEV ( IN DHPDEV  dhpdev,
IN HDEV  hdev 
)

Definition at line 132 of file enable.c.

135 {
136  ((PPDEV)dhpdev)->hDevEng = hdev;
137 }
struct _PDEV * PPDEV
_In_ HDEV hdev
Definition: winddi.h:3449

◆ DrvDisablePDEV()

VOID APIENTRY DrvDisablePDEV ( IN DHPDEV  dhpdev)

Definition at line 150 of file enable.c.

152 {
153  if (((PPDEV)dhpdev)->DefaultPalette)
154  {
156  }
157 
158  if (((PPDEV)dhpdev)->PaletteEntries != NULL)
159  {
160  EngFreeMem(((PPDEV)dhpdev)->PaletteEntries);
161  }
162 
163  EngFreeMem(dhpdev);
164 }
#define EngFreeMem
Definition: polytest.cpp:56
static const UCHAR DefaultPalette[]
Definition: blue.c:71
smooth NULL
Definition: ftsmooth.c:416
Definition: framebuf.h:33
ENGAPI BOOL APIENTRY EngDeletePalette(_In_ _Post_ptr_invalid_ HPALETTE hpal)

◆ DrvDisableSurface()

VOID APIENTRY DrvDisableSurface ( IN DHPDEV  dhpdev)

Definition at line 133 of file surface.c.

135 {
136  DWORD ulTemp;
137  VIDEO_MEMORY VideoMemory;
138  PPDEV ppdev = (PPDEV)dhpdev;
139 
140  EngDeleteSurface(ppdev->hSurfEng);
141  ppdev->hSurfEng = NULL;
142 
143 #ifdef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT
144  /* Clear all mouse pointer surfaces. */
145  DrvSetPointerShape(NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0);
146 #endif
147 
148  /*
149  * Unmap the framebuffer.
150  */
151 
152  VideoMemory.RequestedVirtualAddress = ((PPDEV)dhpdev)->ScreenPtr;
153  EngDeviceIoControl(((PPDEV)dhpdev)->hDriver, IOCTL_VIDEO_UNMAP_VIDEO_MEMORY,
154  &VideoMemory, sizeof(VIDEO_MEMORY), NULL, 0, &ulTemp);
155 }
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
PVOID RequestedVirtualAddress
Definition: ntddvdeo.h:274
smooth NULL
Definition: ftsmooth.c:416
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:179
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _PDEV * PPDEV
Definition: framebuf.h:33
HSURF hSurfEng
Definition: framebuf.h:37
BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:564
FN_DrvSetPointerShape DrvSetPointerShape

◆ DrvEnablePDEV()

DHPDEV APIENTRY DrvEnablePDEV ( IN DEVMODEW pdm,
IN LPWSTR  pwszLogAddress,
IN ULONG  cPat,
OUT HSURF phsurfPatterns,
IN ULONG  cjCaps,
OUT ULONG pdevcaps,
IN ULONG  cjDevInfo,
OUT DEVINFO pdi,
IN HDEV  hdev,
IN LPWSTR  pwszDeviceName,
IN HANDLE  hDriver 
)

Definition at line 78 of file enable.c.

90 {
91  PPDEV ppdev;
92  GDIINFO GdiInfo;
93  DEVINFO DevInfo;
94 
95  ppdev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PDEV), ALLOC_TAG);
96  if (ppdev == NULL)
97  {
98  return NULL;
99  }
100 
101  ppdev->hDriver = hDriver;
102 
103  if (!IntInitScreenInfo(ppdev, pdm, &GdiInfo, &DevInfo))
104  {
105  EngFreeMem(ppdev);
106  return NULL;
107  }
108 
109  if (!IntInitDefaultPalette(ppdev, &DevInfo))
110  {
111  EngFreeMem(ppdev);
112  return NULL;
113  }
114 
115  memcpy(pdi, &DevInfo, min(sizeof(DEVINFO), cjDevInfo));
116  memcpy(pdevcaps, &GdiInfo, min(sizeof(GDIINFO), cjCaps));
117 
118  return (DHPDEV)ppdev;
119 }
BOOL IntInitScreenInfo(PPDEV ppdev, LPDEVMODEW pDevMode, PGDIINFO pGdiInfo, PDEVINFO pDevInfo)
Definition: screen.c:115
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
#define EngFreeMem
Definition: polytest.cpp:56
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
BOOL IntInitDefaultPalette(PPDEV ppdev, PDEVINFO pDevInfo)
Definition: palette.c:60
#define ALLOC_TAG
Definition: btrfs_drv.h:91
HANDLE hDriver
Definition: framebuf.h:35
smooth NULL
Definition: ftsmooth.c:416
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
Definition: framebuf.h:33
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG cjDevInfo
Definition: winddi.h:3553
#define min(a, b)
Definition: monoChain.cc:55
_In_ LPWSTR _In_ ULONG _In_ ULONG cjCaps
Definition: winddi.h:3551
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3553

◆ DrvEnableSurface()

HSURF APIENTRY DrvEnableSurface ( IN DHPDEV  dhpdev)

Definition at line 34 of file surface.c.

36 {
37  PPDEV ppdev = (PPDEV)dhpdev;
38  HSURF hSurface;
39  ULONG BitmapType;
40  SIZEL ScreenSize;
41  VIDEO_MEMORY VideoMemory;
42  VIDEO_MEMORY_INFORMATION VideoMemoryInfo;
43  ULONG ulTemp;
44 
45  /*
46  * Set video mode of our adapter.
47  */
48 
49  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_CURRENT_MODE,
50  &(ppdev->ModeIndex), sizeof(ULONG), NULL, 0,
51  &ulTemp))
52  {
53  return FALSE;
54  }
55 
56  /*
57  * Map the framebuffer into our memory.
58  */
59 
60  VideoMemory.RequestedVirtualAddress = NULL;
61  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_MAP_VIDEO_MEMORY,
62  &VideoMemory, sizeof(VIDEO_MEMORY),
63  &VideoMemoryInfo, sizeof(VIDEO_MEMORY_INFORMATION),
64  &ulTemp))
65  {
66  return FALSE;
67  }
68 
69  ppdev->ScreenPtr = VideoMemoryInfo.FrameBufferBase;
70 
71  switch (ppdev->BitsPerPixel)
72  {
73  case 8:
74  IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256);
75  BitmapType = BMF_8BPP;
76  break;
77 
78  case 16:
79  BitmapType = BMF_16BPP;
80  break;
81 
82  case 24:
83  BitmapType = BMF_24BPP;
84  break;
85 
86  case 32:
87  BitmapType = BMF_32BPP;
88  break;
89 
90  default:
91  return FALSE;
92  }
93 
94  ppdev->iDitherFormat = BitmapType;
95 
96  ScreenSize.cx = ppdev->ScreenWidth;
97  ScreenSize.cy = ppdev->ScreenHeight;
98 
99  hSurface = (HSURF)EngCreateBitmap(ScreenSize, ppdev->ScreenDelta, BitmapType,
100  (ppdev->ScreenDelta > 0) ? BMF_TOPDOWN : 0,
101  ppdev->ScreenPtr);
102  if (hSurface == NULL)
103  {
104  return FALSE;
105  }
106 
107  /*
108  * Associate the surface with our device.
109  */
110 
111  if (!EngAssociateSurface(hSurface, ppdev->hDevEng, 0))
112  {
113  EngDeleteSurface(hSurface);
114  return FALSE;
115  }
116 
117  ppdev->hSurfEng = hSurface;
118 
119  return hSurface;
120 }
#define BMF_24BPP
Definition: winddi.h:359
PALETTEENTRY * PaletteEntries
Definition: framebuf.h:49
ULONG ScreenHeight
Definition: framebuf.h:40
#define BMF_32BPP
Definition: winddi.h:360
DWORD iDitherFormat
Definition: framebuf.h:61
#define BMF_TOPDOWN
Definition: winddi.h:1180
HDEV hDevEng
Definition: framebuf.h:36
Definition: xlate.c:10
BOOL APIENTRY IntSetPalette(IN DHPDEV dhpdev, IN PPALETTEENTRY ppalent, IN ULONG iStart, IN ULONG cColors)
Definition: palette.c:110
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:104
PVOID RequestedVirtualAddress
Definition: ntddvdeo.h:274
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:152
BOOL APIENTRY EngAssociateSurface(_In_ HSURF hsurf, _In_ HDEV hdev, _In_ FLONG flHooks)
Definition: surface.c:428
HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ ULONG fl, _In_opt_ PVOID pvBits)
Definition: surface.c:306
HANDLE hDriver
Definition: framebuf.h:35
BYTE BitsPerPixel
Definition: framebuf.h:42
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
#define BMF_16BPP
Definition: winddi.h:358
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
ULONG ModeIndex
Definition: framebuf.h:38
struct _PDEV * PPDEV
Definition: framebuf.h:33
PVOID ScreenPtr
Definition: framebuf.h:47
HSURF hSurfEng
Definition: framebuf.h:37
BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:564
unsigned int ULONG
Definition: retypes.h:1
LONG cy
Definition: windef.h:320
ULONG ScreenDelta
Definition: framebuf.h:41
ULONG ScreenWidth
Definition: framebuf.h:39

◆ DrvGetModes()

ULONG APIENTRY DrvGetModes ( IN HANDLE  hDriver,
IN ULONG  cjSize,
OUT DEVMODEW pdm 
)

Definition at line 357 of file screen.c.

361 {
362  ULONG ModeCount;
363  ULONG ModeInfoSize;
364  PVIDEO_MODE_INFORMATION ModeInfo, ModeInfoPtr;
365  ULONG OutputSize;
366 
367  ModeCount = GetAvailableModes(hDriver, &ModeInfo, &ModeInfoSize);
368  if (ModeCount == 0)
369  {
370  return 0;
371  }
372 
373  if (pdm == NULL)
374  {
375  EngFreeMem(ModeInfo);
376  return ModeCount * sizeof(DEVMODEW);
377  }
378 
379  /*
380  * Copy the information about supported modes into the output buffer.
381  */
382 
383  OutputSize = 0;
384  ModeInfoPtr = ModeInfo;
385 
386  while (ModeCount-- > 0)
387  {
388  if (ModeInfoPtr->Length == 0)
389  {
390  ModeInfoPtr = (PVIDEO_MODE_INFORMATION)(((ULONG_PTR)ModeInfoPtr) + ModeInfoSize);
391  continue;
392  }
393 
394  memset(pdm, 0, sizeof(DEVMODEW));
395  memcpy(pdm->dmDeviceName, DEVICE_NAME, sizeof(DEVICE_NAME));
396  pdm->dmSpecVersion =
397  pdm->dmDriverVersion = DM_SPECVERSION;
398  pdm->dmSize = sizeof(DEVMODEW);
399  pdm->dmDriverExtra = 0;
400  pdm->dmBitsPerPel = ModeInfoPtr->NumberOfPlanes * ModeInfoPtr->BitsPerPlane;
401  pdm->dmPelsWidth = ModeInfoPtr->VisScreenWidth;
402  pdm->dmPelsHeight = ModeInfoPtr->VisScreenHeight;
403  pdm->dmDisplayFrequency = ModeInfoPtr->Frequency;
404  pdm->dmDisplayFlags = 0;
405  pdm->dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT |
407 
408  ModeInfoPtr = (PVIDEO_MODE_INFORMATION)(((ULONG_PTR)ModeInfoPtr) + ModeInfoSize);
409  pdm = (LPDEVMODEW)(((ULONG_PTR)pdm) + sizeof(DEVMODEW));
410  OutputSize += sizeof(DEVMODEW);
411  }
412 
413  EngFreeMem(ModeInfo);
414  return OutputSize;
415 }
struct _devicemodeW * LPDEVMODEW
#define EngFreeMem
Definition: polytest.cpp:56
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
DWORD GetAvailableModes(HANDLE hDriver, PVIDEO_MODE_INFORMATION *ModeInfo, DWORD *ModeInfoSize)
Definition: screen.c:35
#define DM_PELSWIDTH
Definition: wingdi.h:1268
uint32_t ULONG_PTR
Definition: typedefs.h:63
struct _VIDEO_MODE_INFORMATION * PVIDEO_MODE_INFORMATION
smooth NULL
Definition: ftsmooth.c:416
#define DM_SPECVERSION
Definition: wingdi.h:1242
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1271
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DM_PELSHEIGHT
Definition: wingdi.h:1269
unsigned int ULONG
Definition: retypes.h:1
#define DM_BITSPERPEL
Definition: wingdi.h:1267
#define DEVICE_NAME
Definition: ext2fs.h:137
struct _devicemodeW DEVMODEW
#define memset(x, y, z)
Definition: compat.h:39
#define DM_DISPLAYFLAGS
Definition: wingdi.h:1270

◆ DrvMovePointer()

VOID APIENTRY DrvMovePointer ( IN SURFOBJ pso,
IN LONG  x,
IN LONG  y,
IN RECTL prcl 
)

Definition at line 62 of file pointer.c.

67 {
69 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
ENGAPI VOID APIENTRY EngMovePointer(_In_ SURFOBJ *pso, _In_ LONG x, _In_ LONG y, _In_ RECTL *prcl)
Definition: mouse.c:566

◆ DrvSetPalette()

BOOL APIENTRY DrvSetPalette ( IN DHPDEV  dhpdev,
IN PALOBJ ppalo,
IN FLONG  fl,
IN ULONG  iStart,
IN ULONG  cColors 
)

Definition at line 170 of file palette.c.

176 {
177  PPALETTEENTRY PaletteEntries;
178  BOOL bRet;
179 
180  if (cColors == 0)
181  return FALSE;
182 
183  PaletteEntries = EngAllocMem(0, cColors * sizeof(ULONG), ALLOC_TAG);
184  if (PaletteEntries == NULL)
185  {
186  return FALSE;
187  }
188 
189  if (PALOBJ_cGetColors(ppalo, iStart, cColors, (PULONG)PaletteEntries) !=
190  cColors)
191  {
192  EngFreeMem(PaletteEntries);
193  return FALSE;
194  }
195 
196  bRet = IntSetPalette(dhpdev, PaletteEntries, iStart, cColors);
197  EngFreeMem(PaletteEntries);
198  return bRet;
199 }
#define EngFreeMem
Definition: polytest.cpp:56
_In_ UINT iStart
Definition: wingdi.h:3615
ULONG APIENTRY PALOBJ_cGetColors(PALOBJ *PalObj, ULONG Start, ULONG Colors, ULONG *PaletteEntry)
Definition: palette.c:423
#define ALLOC_TAG
Definition: btrfs_drv.h:91
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
_In_ PALOBJ * ppalo
Definition: winddi.h:4012
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
BOOL APIENTRY IntSetPalette(IN DHPDEV dhpdev, IN PPALETTEENTRY ppalent, IN ULONG iStart, IN ULONG cColors)
Definition: palette.c:110
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

◆ DrvSetPointerShape()

ULONG APIENTRY DrvSetPointerShape ( IN SURFOBJ pso,
IN SURFOBJ psoMask,
IN SURFOBJ psoColor,
IN XLATEOBJ pxlo,
IN LONG  xHot,
IN LONG  yHot,
IN LONG  x,
IN LONG  y,
IN RECTL prcl,
IN FLONG  fl 
)

Definition at line 35 of file pointer.c.

46 {
47 /* return SPS_DECLINE;*/
49 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_In_ FLONG fl
Definition: winddi.h:1279
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ XLATEOBJ _In_ LONG _In_ LONG yHot
Definition: winddi.h:4049
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ XLATEOBJ _In_ LONG xHot
Definition: winddi.h:4049
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoColor
Definition: winddi.h:4049
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3433
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
ENGAPI ULONG APIENTRY EngSetPointerShape(_In_ SURFOBJ *pso, _In_opt_ SURFOBJ *psoMask, _In_opt_ SURFOBJ *psoColor, _In_opt_ XLATEOBJ *pxlo, _In_ LONG xHot, _In_ LONG yHot, _In_ LONG x, _In_ LONG y, _In_ RECTL *prcl, _In_ FLONG fl)
Definition: mouse.c:321
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

◆ IntInitDefaultPalette()

BOOL IntInitDefaultPalette ( PPDEV  ppdev,
PDEVINFO  pDevInfo 
)

Definition at line 60 of file palette.c.

63 {
64  ULONG ColorLoop;
65  PPALETTEENTRY PaletteEntryPtr;
66 
67  if (ppdev->BitsPerPixel > 8)
68  {
69  ppdev->DefaultPalette = pDevInfo->hpalDefault =
71  ppdev->RedMask, ppdev->GreenMask, ppdev->BlueMask);
72  }
73  else
74  {
75  ppdev->PaletteEntries = EngAllocMem(0, sizeof(PALETTEENTRY) << 8, ALLOC_TAG);
76  if (ppdev->PaletteEntries == NULL)
77  {
78  return FALSE;
79  }
80 
81  for (ColorLoop = 256, PaletteEntryPtr = ppdev->PaletteEntries;
82  ColorLoop != 0;
83  ColorLoop--, PaletteEntryPtr++)
84  {
85  PaletteEntryPtr->peRed = ((ColorLoop >> 5) & 7) * 255 / 7;
86  PaletteEntryPtr->peGreen = ((ColorLoop >> 3) & 3) * 255 / 3;
87  PaletteEntryPtr->peBlue = (ColorLoop & 7) * 255 / 7;
88  PaletteEntryPtr->peFlags = 0;
89  }
90 
91  memcpy(ppdev->PaletteEntries, BASEPALETTE, 10 * sizeof(PALETTEENTRY));
92  memcpy(ppdev->PaletteEntries + 246, BASEPALETTE + 10, 10 * sizeof(PALETTEENTRY));
93 
94  ppdev->DefaultPalette = pDevInfo->hpalDefault =
95  EngCreatePalette(PAL_INDEXED, 256, (PULONG)ppdev->PaletteEntries, 0, 0, 0);
96  }
97 
98  return ppdev->DefaultPalette != NULL;
99 }
PALETTEENTRY * PaletteEntries
Definition: framebuf.h:49
ULONG GreenMask
Definition: framebuf.h:44
#define ALLOC_TAG
Definition: btrfs_drv.h:91
HPALETTE APIENTRY EngCreatePalette(ULONG iMode, ULONG cColors, ULONG *pulColors, ULONG flRed, ULONG flGreen, ULONG flBlue)
Definition: palette.c:375
ULONG BlueMask
Definition: framebuf.h:45
const PALETTEENTRY BASEPALETTE[20]
Definition: palette.c:28
BYTE BitsPerPixel
Definition: framebuf.h:42
HPALETTE hpalDefault
Definition: winddi.h:398
smooth NULL
Definition: ftsmooth.c:416
ULONG RedMask
Definition: framebuf.h:43
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HPALETTE DefaultPalette
Definition: framebuf.h:48
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

◆ IntInitScreenInfo()

BOOL IntInitScreenInfo ( PPDEV  ppdev,
LPDEVMODEW  pDevMode,
PGDIINFO  pGdiInfo,
PDEVINFO  pDevInfo 
)

Definition at line 115 of file screen.c.

120 {
121  ULONG ModeCount;
122  ULONG ModeInfoSize;
123  PVIDEO_MODE_INFORMATION ModeInfo, ModeInfoPtr, SelectedMode = NULL;
124  VIDEO_COLOR_CAPABILITIES ColorCapabilities;
125  ULONG Temp;
126 
127  /*
128  * Call miniport to get information about video modes.
129  */
130 
131  ModeCount = GetAvailableModes(ppdev->hDriver, &ModeInfo, &ModeInfoSize);
132  if (ModeCount == 0)
133  {
134  return FALSE;
135  }
136 
137  /*
138  * Select the video mode depending on the info passed in pDevMode.
139  */
140 
141  if (pDevMode->dmPelsWidth == 0 && pDevMode->dmPelsHeight == 0 &&
142  pDevMode->dmBitsPerPel == 0 && pDevMode->dmDisplayFrequency == 0)
143  {
144  ModeInfoPtr = ModeInfo;
145  while (ModeCount-- > 0)
146  {
147  if (ModeInfoPtr->Length == 0)
148  {
149  ModeInfoPtr = (PVIDEO_MODE_INFORMATION)
150  (((PUCHAR)ModeInfoPtr) + ModeInfoSize);
151  continue;
152  }
153  SelectedMode = ModeInfoPtr;
154  break;
155  }
156  }
157  else
158  {
159  ModeInfoPtr = ModeInfo;
160  while (ModeCount-- > 0)
161  {
162  if (ModeInfoPtr->Length > 0 &&
163  pDevMode->dmPelsWidth == ModeInfoPtr->VisScreenWidth &&
164  pDevMode->dmPelsHeight == ModeInfoPtr->VisScreenHeight &&
165  pDevMode->dmBitsPerPel == (ModeInfoPtr->BitsPerPlane *
166  ModeInfoPtr->NumberOfPlanes) &&
167  pDevMode->dmDisplayFrequency == ModeInfoPtr->Frequency)
168  {
169  SelectedMode = ModeInfoPtr;
170  break;
171  }
172 
173  ModeInfoPtr = (PVIDEO_MODE_INFORMATION)
174  (((PUCHAR)ModeInfoPtr) + ModeInfoSize);
175  }
176  }
177 
178  if (SelectedMode == NULL)
179  {
180  EngFreeMem(ModeInfo);
181  return FALSE;
182  }
183 
184  /*
185  * Fill in the GDIINFO data structure with the information returned from
186  * the kernel driver.
187  */
188 
189  ppdev->ModeIndex = SelectedMode->ModeIndex;
190  ppdev->ScreenWidth = SelectedMode->VisScreenWidth;
191  ppdev->ScreenHeight = SelectedMode->VisScreenHeight;
192  ppdev->ScreenDelta = SelectedMode->ScreenStride;
193  ppdev->BitsPerPixel = (UCHAR)(SelectedMode->BitsPerPlane * SelectedMode->NumberOfPlanes);
194 
195  ppdev->MemWidth = SelectedMode->VideoMemoryBitmapWidth;
196  ppdev->MemHeight = SelectedMode->VideoMemoryBitmapHeight;
197 
198  ppdev->RedMask = SelectedMode->RedMask;
199  ppdev->GreenMask = SelectedMode->GreenMask;
200  ppdev->BlueMask = SelectedMode->BlueMask;
201 
202  pGdiInfo->ulVersion = GDI_DRIVER_VERSION;
203  pGdiInfo->ulTechnology = DT_RASDISPLAY;
204  pGdiInfo->ulHorzSize = SelectedMode->XMillimeter;
205  pGdiInfo->ulVertSize = SelectedMode->YMillimeter;
206  pGdiInfo->ulHorzRes = SelectedMode->VisScreenWidth;
207  pGdiInfo->ulVertRes = SelectedMode->VisScreenHeight;
208  pGdiInfo->ulPanningHorzRes = SelectedMode->VisScreenWidth;
209  pGdiInfo->ulPanningVertRes = SelectedMode->VisScreenHeight;
210  pGdiInfo->cBitsPixel = SelectedMode->BitsPerPlane;
211  pGdiInfo->cPlanes = SelectedMode->NumberOfPlanes;
212  pGdiInfo->ulVRefresh = SelectedMode->Frequency;
213  pGdiInfo->ulBltAlignment = 1;
214  pGdiInfo->ulLogPixelsX = pDevMode->dmLogPixels;
215  pGdiInfo->ulLogPixelsY = pDevMode->dmLogPixels;
216  pGdiInfo->flTextCaps = TC_RA_ABLE;
217  pGdiInfo->flRaster = 0;
218  pGdiInfo->ulDACRed = SelectedMode->NumberRedBits;
219  pGdiInfo->ulDACGreen = SelectedMode->NumberGreenBits;
220  pGdiInfo->ulDACBlue = SelectedMode->NumberBlueBits;
221  pGdiInfo->ulAspectX = 0x24;
222  pGdiInfo->ulAspectY = 0x24;
223  pGdiInfo->ulAspectXY = 0x33;
224  pGdiInfo->xStyleStep = 1;
225  pGdiInfo->yStyleStep = 1;
226  pGdiInfo->denStyleStep = 3;
227  pGdiInfo->ptlPhysOffset.x = 0;
228  pGdiInfo->ptlPhysOffset.y = 0;
229  pGdiInfo->szlPhysSize.cx = 0;
230  pGdiInfo->szlPhysSize.cy = 0;
231 
232  /*
233  * Try to get the color info from the miniport.
234  */
235 
236  if (!EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES,
237  NULL, 0, &ColorCapabilities,
238  sizeof(VIDEO_COLOR_CAPABILITIES), &Temp))
239  {
240  pGdiInfo->ciDevice.Red.x = ColorCapabilities.RedChromaticity_x;
241  pGdiInfo->ciDevice.Red.y = ColorCapabilities.RedChromaticity_y;
242  pGdiInfo->ciDevice.Green.x = ColorCapabilities.GreenChromaticity_x;
243  pGdiInfo->ciDevice.Green.y = ColorCapabilities.GreenChromaticity_y;
244  pGdiInfo->ciDevice.Blue.x = ColorCapabilities.BlueChromaticity_x;
245  pGdiInfo->ciDevice.Blue.y = ColorCapabilities.BlueChromaticity_y;
246  pGdiInfo->ciDevice.AlignmentWhite.x = ColorCapabilities.WhiteChromaticity_x;
247  pGdiInfo->ciDevice.AlignmentWhite.y = ColorCapabilities.WhiteChromaticity_y;
248  pGdiInfo->ciDevice.AlignmentWhite.Y = ColorCapabilities.WhiteChromaticity_Y;
249  if (ColorCapabilities.AttributeFlags & VIDEO_DEVICE_COLOR)
250  {
251  pGdiInfo->ciDevice.RedGamma = ColorCapabilities.RedGamma;
252  pGdiInfo->ciDevice.GreenGamma = ColorCapabilities.GreenGamma;
253  pGdiInfo->ciDevice.BlueGamma = ColorCapabilities.BlueGamma;
254  }
255  else
256  {
257  pGdiInfo->ciDevice.RedGamma = ColorCapabilities.WhiteGamma;
258  pGdiInfo->ciDevice.GreenGamma = ColorCapabilities.WhiteGamma;
259  pGdiInfo->ciDevice.BlueGamma = ColorCapabilities.WhiteGamma;
260  }
261  }
262  else
263  {
264  pGdiInfo->ciDevice.Red.x = 6700;
265  pGdiInfo->ciDevice.Red.y = 3300;
266  pGdiInfo->ciDevice.Green.x = 2100;
267  pGdiInfo->ciDevice.Green.y = 7100;
268  pGdiInfo->ciDevice.Blue.x = 1400;
269  pGdiInfo->ciDevice.Blue.y = 800;
270  pGdiInfo->ciDevice.AlignmentWhite.x = 3127;
271  pGdiInfo->ciDevice.AlignmentWhite.y = 3290;
272  pGdiInfo->ciDevice.AlignmentWhite.Y = 0;
273  pGdiInfo->ciDevice.RedGamma = 20000;
274  pGdiInfo->ciDevice.GreenGamma = 20000;
275  pGdiInfo->ciDevice.BlueGamma = 20000;
276  }
277 
278  pGdiInfo->ciDevice.Red.Y = 0;
279  pGdiInfo->ciDevice.Green.Y = 0;
280  pGdiInfo->ciDevice.Blue.Y = 0;
281  pGdiInfo->ciDevice.Cyan.x = 0;
282  pGdiInfo->ciDevice.Cyan.y = 0;
283  pGdiInfo->ciDevice.Cyan.Y = 0;
284  pGdiInfo->ciDevice.Magenta.x = 0;
285  pGdiInfo->ciDevice.Magenta.y = 0;
286  pGdiInfo->ciDevice.Magenta.Y = 0;
287  pGdiInfo->ciDevice.Yellow.x = 0;
288  pGdiInfo->ciDevice.Yellow.y = 0;
289  pGdiInfo->ciDevice.Yellow.Y = 0;
290  pGdiInfo->ciDevice.MagentaInCyanDye = 0;
291  pGdiInfo->ciDevice.YellowInCyanDye = 0;
292  pGdiInfo->ciDevice.CyanInMagentaDye = 0;
293  pGdiInfo->ciDevice.YellowInMagentaDye = 0;
294  pGdiInfo->ciDevice.CyanInYellowDye = 0;
295  pGdiInfo->ciDevice.MagentaInYellowDye = 0;
296  pGdiInfo->ulDevicePelsDPI = 0;
297  pGdiInfo->ulPrimaryOrder = PRIMARY_ORDER_CBA;
298  pGdiInfo->ulHTPatternSize = HT_PATSIZE_4x4_M;
299  pGdiInfo->flHTFlags = HT_FLAG_ADDITIVE_PRIMS;
300 
301  pDevInfo->flGraphicsCaps = 0;
302  pDevInfo->lfDefaultFont = SystemFont;
303  pDevInfo->lfAnsiVarFont = AnsiVariableFont;
304  pDevInfo->lfAnsiFixFont = AnsiFixedFont;
305  pDevInfo->cFonts = 0;
306  pDevInfo->cxDither = 0;
307  pDevInfo->cyDither = 0;
308  pDevInfo->hpalDefault = 0;
309  pDevInfo->flGraphicsCaps2 = 0;
310 
311  if (ppdev->BitsPerPixel == 8)
312  {
313  pGdiInfo->ulNumColors = 20;
314  pGdiInfo->ulNumPalReg = 1 << ppdev->BitsPerPixel;
315  pGdiInfo->ulHTOutputFormat = HT_FORMAT_8BPP;
316  pDevInfo->flGraphicsCaps |= GCAPS_PALMANAGED;
317  pDevInfo->iDitherFormat = BMF_8BPP;
318  /* Assuming palette is orthogonal - all colors are same size. */
319  ppdev->PaletteShift = (UCHAR)(8 - pGdiInfo->ulDACRed);
320  }
321  else
322  {
323  pGdiInfo->ulNumColors = (ULONG)(-1);
324  pGdiInfo->ulNumPalReg = 0;
325  switch (ppdev->BitsPerPixel)
326  {
327  case 16:
328  pGdiInfo->ulHTOutputFormat = HT_FORMAT_16BPP;
329  pDevInfo->iDitherFormat = BMF_16BPP;
330  break;
331 
332  case 24:
333  pGdiInfo->ulHTOutputFormat = HT_FORMAT_24BPP;
334  pDevInfo->iDitherFormat = BMF_24BPP;
335  break;
336 
337  default:
338  pGdiInfo->ulHTOutputFormat = HT_FORMAT_32BPP;
339  pDevInfo->iDitherFormat = BMF_32BPP;
340  }
341  }
342 
343  EngFreeMem(ModeInfo);
344  return TRUE;
345 }
ULONG ulDevicePelsDPI
Definition: winddi.h:904
SIZEL szlPhysSize
Definition: winddi.h:901
#define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES
Definition: ntddvdeo.h:110
#define BMF_24BPP
Definition: winddi.h:359
#define VIDEO_DEVICE_COLOR
Definition: ntddvdeo.h:403
LDECI4 MagentaInCyanDye
Definition: winddi.h:295
LDECI4 y
Definition: winddi.h:241
#define TRUE
Definition: types.h:120
ULONG ScreenHeight
Definition: framebuf.h:40
LDECI4 CyanInYellowDye
Definition: winddi.h:299
#define BMF_32BPP
Definition: winddi.h:360
ULONG ulDACRed
Definition: winddi.h:891
CIECHROMA Yellow
Definition: winddi.h:290
CIECHROMA Green
Definition: winddi.h:286
#define HT_FORMAT_16BPP
Definition: winddi.h:820
ULONG ulHTOutputFormat
Definition: winddi.h:907
ULONG ulPrimaryOrder
Definition: winddi.h:905
#define EngFreeMem
Definition: polytest.cpp:56
ULONG GreenMask
Definition: framebuf.h:44
unsigned char * PUCHAR
Definition: retypes.h:3
CIECHROMA Blue
Definition: winddi.h:287
LDECI4 YellowInCyanDye
Definition: winddi.h:296
ULONG ulAspectY
Definition: winddi.h:895
Definition: xlate.c:10
LONG denStyleStep
Definition: winddi.h:899
ULONG ulLogPixelsY
Definition: winddi.h:889
LDECI4 MagentaInYellowDye
Definition: winddi.h:300
ULONG ulPanningHorzRes
Definition: winddi.h:911
static LOGFONTW AnsiFixedFont
Definition: screen.c:25
ULONG cPlanes
Definition: winddi.h:885
DWORD dmBitsPerPel
Definition: wingdi.h:1642
ULONG flTextCaps
Definition: winddi.h:890
LOGFONTW lfAnsiVarFont
Definition: winddi.h:392
CIECHROMA Cyan
Definition: winddi.h:288
#define DT_RASDISPLAY
Definition: wingdi.h:707
DWORD GetAvailableModes(HANDLE hDriver, PVIDEO_MODE_INFORMATION *ModeInfo, DWORD *ModeInfoSize)
Definition: screen.c:35
LONG y
Definition: windef.h:315
USHORT cyDither
Definition: winddi.h:397
ULONG flHTFlags
Definition: winddi.h:908
LDECI4 GreenGamma
Definition: winddi.h:293
ULONG ulNumPalReg
Definition: winddi.h:902
ULONG ulVertSize
Definition: winddi.h:881
LDECI4 BlueGamma
Definition: winddi.h:294
struct _VIDEO_MODE_INFORMATION * PVIDEO_MODE_INFORMATION
#define GDI_DRIVER_VERSION
Definition: winddi.h:109
ULONG ulDACGreen
Definition: winddi.h:892
POINTL ptlPhysOffset
Definition: winddi.h:900
ULONG BlueMask
Definition: framebuf.h:45
ULONG ulVersion
Definition: winddi.h:878
WORD dmLogPixels
Definition: wingdi.h:1641
CIECHROMA AlignmentWhite
Definition: winddi.h:291
HANDLE hDriver
Definition: framebuf.h:35
BYTE BitsPerPixel
Definition: framebuf.h:42
HPALETTE hpalDefault
Definition: winddi.h:398
CIECHROMA Magenta
Definition: winddi.h:289
ULONG ulHorzRes
Definition: winddi.h:882
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
ULONG ulTechnology
Definition: winddi.h:879
LONG yStyleStep
Definition: winddi.h:898
ULONG iDitherFormat
Definition: winddi.h:395
ULONG ulAspectXY
Definition: winddi.h:896
#define BMF_16BPP
Definition: winddi.h:358
LDECI4 YellowInMagentaDye
Definition: winddi.h:298
ULONG ulBltAlignment
Definition: winddi.h:910
ULONG ulDACBlue
Definition: winddi.h:893
#define TC_RA_ABLE
Definition: wingdi.h:819
LDECI4 x
Definition: winddi.h:240
LONG x
Definition: windef.h:314
LDECI4 Y
Definition: winddi.h:242
ULONG ulHTPatternSize
Definition: winddi.h:906
ULONG MemWidth
Definition: framebuf.h:63
ULONG cFonts
Definition: winddi.h:394
ULONG ModeIndex
Definition: framebuf.h:38
#define HT_FLAG_ADDITIVE_PRIMS
Definition: winddi.h:827
ULONG ulHorzSize
Definition: winddi.h:880
DWORD dmPelsWidth
Definition: wingdi.h:1643
ULONG RedMask
Definition: framebuf.h:43
unsigned char UCHAR
Definition: xmlstorage.h:181
#define PRIMARY_ORDER_CBA
Definition: winddi.h:785
ULONG flRaster
Definition: winddi.h:887
ULONG ulVRefresh
Definition: winddi.h:909
LDECI4 CyanInMagentaDye
Definition: winddi.h:297
ULONG cBitsPixel
Definition: winddi.h:884
ULONG ulAspectX
Definition: winddi.h:894
ULONG MemHeight
Definition: framebuf.h:62
DWORD dmDisplayFrequency
Definition: wingdi.h:1649
BYTE PaletteShift
Definition: framebuf.h:46
FLONG flGraphicsCaps
Definition: winddi.h:390
USHORT cxDither
Definition: winddi.h:396
LDECI4 RedGamma
Definition: winddi.h:292
ULONG ulPanningVertRes
Definition: winddi.h:912
ULONG ulNumColors
Definition: winddi.h:886
DWORD dmPelsHeight
Definition: wingdi.h:1644
#define HT_PATSIZE_4x4_M
Definition: winddi.h:792
#define HT_FORMAT_24BPP
Definition: winddi.h:821
COLORINFO ciDevice
Definition: winddi.h:903
unsigned int ULONG
Definition: retypes.h:1
CIECHROMA Red
Definition: winddi.h:285
LOGFONTW lfDefaultFont
Definition: winddi.h:391
ULONG ulLogPixelsX
Definition: winddi.h:888
ULONG ulVertRes
Definition: winddi.h:883
#define HT_FORMAT_32BPP
Definition: winddi.h:822
#define GCAPS_PALMANAGED
Definition: winddi.h:341
#define HT_FORMAT_8BPP
Definition: winddi.h:819
LONG cy
Definition: windef.h:320
ULONG ScreenDelta
Definition: framebuf.h:41
FLONG flGraphicsCaps2
Definition: winddi.h:399
static LOGFONTW AnsiVariableFont
Definition: screen.c:24
static LOGFONTW SystemFont
Definition: screen.c:23
ULONG ScreenWidth
Definition: framebuf.h:39
LONG xStyleStep
Definition: winddi.h:897
LOGFONTW lfAnsiFixFont
Definition: winddi.h:393

◆ IntSetPalette()

BOOL APIENTRY IntSetPalette ( IN DHPDEV  dhpdev,
IN PPALETTEENTRY  ppalent,
IN ULONG  iStart,
IN ULONG  cColors 
)

Definition at line 110 of file palette.c.

115 {
116  PVIDEO_CLUT pClut;
117  ULONG ClutSize;
118 
119  ClutSize = sizeof(VIDEO_CLUT) + (cColors * sizeof(ULONG));
120  pClut = EngAllocMem(0, ClutSize, ALLOC_TAG);
121  pClut->FirstEntry = iStart;
122  pClut->NumEntries = cColors;
123  memcpy(&pClut->LookupTable[0].RgbLong, ppalent, sizeof(ULONG) * cColors);
124 
125  if (((PPDEV)dhpdev)->PaletteShift)
126  {
127  while (cColors--)
128  {
129  pClut->LookupTable[cColors].RgbArray.Red >>= ((PPDEV)dhpdev)->PaletteShift;
130  pClut->LookupTable[cColors].RgbArray.Green >>= ((PPDEV)dhpdev)->PaletteShift;
131  pClut->LookupTable[cColors].RgbArray.Blue >>= ((PPDEV)dhpdev)->PaletteShift;
132  pClut->LookupTable[cColors].RgbArray.Unused = 0;
133  }
134  }
135  else
136  {
137  while (cColors--)
138  {
139  pClut->LookupTable[cColors].RgbArray.Unused = 0;
140  }
141  }
142 
143  /*
144  * Set the palette registers.
145  */
146 
147  if (EngDeviceIoControl(((PPDEV)dhpdev)->hDriver, IOCTL_VIDEO_SET_COLOR_REGISTERS,
148  pClut, ClutSize, NULL, 0, &cColors))
149  {
150  EngFreeMem(pClut);
151  return FALSE;
152  }
153 
154  EngFreeMem(pClut);
155  return TRUE;
156 }
#define TRUE
Definition: types.h:120
ULONG RgbLong
Definition: ntddvdeo.h:523
#define EngFreeMem
Definition: polytest.cpp:56
USHORT FirstEntry
Definition: ntddvdeo.h:520
union VIDEO_CLUT::@3047 LookupTable[1]
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
_In_ UINT iStart
Definition: wingdi.h:3615
VIDEO_CLUTDATA RgbArray
Definition: ntddvdeo.h:522
#define ALLOC_TAG
Definition: btrfs_drv.h:91
smooth NULL
Definition: ftsmooth.c:416
USHORT NumEntries
Definition: ntddvdeo.h:519
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
struct _PDEV * PPDEV
Definition: framebuf.h:33
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int ULONG
Definition: retypes.h:1
#define IOCTL_VIDEO_SET_COLOR_REGISTERS
Definition: ntddvdeo.h:149

Referenced by DrvSetPalette().