ReactOS  0.4.14-dev-342-gdc047f9
enable.c File Reference
#include "framebufacc.h"
Include dependency graph for enable.c:

Go to the source code of this file.

Functions

BOOL APIENTRY DrvEnableDriver (ULONG iEngineVersion, ULONG cj, PDRVENABLEDATA pded)
 
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)
 

Variables

static DRVFN DrvFunctionTable []
 

Function Documentation

◆ DrvCompletePDEV()

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

Definition at line 164 of file enable.c.

167 {
168  ((PPDEV)dhpdev)->hDevEng = hdev;
169 }
struct _PDEV * PPDEV
_In_ HDEV hdev
Definition: winddi.h:3449

◆ DrvDisablePDEV()

VOID APIENTRY DrvDisablePDEV ( IN DHPDEV  dhpdev)

Definition at line 182 of file enable.c.

184 {
185  if (((PPDEV)dhpdev)->DefaultPalette)
186  {
188  }
189 
190  if (((PPDEV)dhpdev)->PaletteEntries != NULL)
191  {
192  EngFreeMem(((PPDEV)dhpdev)->PaletteEntries);
193  }
194 
195  EngFreeMem(dhpdev);
196 }
#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)

◆ DrvEnableDriver()

BOOL APIENTRY DrvEnableDriver ( ULONG  iEngineVersion,
ULONG  cj,
PDRVENABLEDATA  pded 
)

Definition at line 50 of file enable.c.

54 {
55  if (cj >= sizeof(DRVENABLEDATA))
56  {
57  pded->c = sizeof(DrvFunctionTable) / sizeof(DRVFN);
58  pded->pdrvfn = DrvFunctionTable;
60  return TRUE;
61  }
62  else
63  {
64  return FALSE;
65  }
66 }
#define TRUE
Definition: types.h:120
_In_ ULONG cj
Definition: winddi.h:3540
static DRVFN DrvFunctionTable[]
Definition: enable.c:23
#define DDI_DRIVER_VERSION_NT5
Definition: winddi.h:537
DRVFN * pdrvfn
Definition: winddi.h:544
ULONG iDriverVersion
Definition: winddi.h:542
Definition: winddi.h:529

◆ 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  ULONG returnedDataLength = 0;
95 
96  ppdev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PDEV), ALLOC_TAG);
97  if (ppdev == NULL)
98  {
99  return NULL;
100  }
101 
102  ppdev->hDriver = hDriver;
103 
104  if (!IntInitScreenInfo(ppdev, pdm, &GdiInfo, &DevInfo))
105  {
106  EngFreeMem(ppdev);
107  return NULL;
108  }
109 
110  /* hw mouse pointer */
111 
112  ppdev->pPointerAttributes = NULL;
113  ppdev->PointerAttributesSize = 0;
114 
115  /* Test see if the driver support hw mouse or not */
116  if (!EngDeviceIoControl(ppdev->hDriver,
118  NULL,
119  sizeof(PVIDEO_MODE),
120  &ppdev->PointerCapabilities,
122  &returnedDataLength))
123  {
124  /* Test see if we got a hw mouse or not */
127  {
128  /* determent the hw mouse mode */
130  {
131  DevInfo.flGraphicsCaps &= ~GCAPS_ASYNCMOVE;
132  }
133  else
134  {
135  DevInfo.flGraphicsCaps |= GCAPS_ASYNCMOVE;
136  }
137  }
138  }
139 
140  /* setup paletted */
141  if (!IntInitDefaultPalette(ppdev, &DevInfo))
142  {
143  EngFreeMem(ppdev);
144  return NULL;
145  }
146 
147  memcpy(pdi, &DevInfo, min(sizeof(DEVINFO), cjDevInfo));
148  memcpy(pdevcaps, &GdiInfo, min(sizeof(GDIINFO), cjCaps));
149 
150  return (DHPDEV)ppdev;
151 }
BOOL IntInitScreenInfo(PPDEV ppdev, LPDEVMODEW pDevMode, PGDIINFO pGdiInfo, PDEVINFO pDevInfo)
Definition: screen.c:115
VIDEO_POINTER_CAPABILITIES PointerCapabilities
Definition: driver.h:44
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
#define VIDEO_MODE_COLOR_POINTER
Definition: ntddvdeo.h:455
#define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES
Definition: ntddvdeo.h:128
#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 VIDEO_MODE_MONO_POINTER
Definition: ntddvdeo.h:454
#define ALLOC_TAG
Definition: btrfs_drv.h:91
#define GCAPS_ASYNCMOVE
Definition: winddi.h:335
HANDLE hDriver
Definition: framebuf.h:35
smooth NULL
Definition: ftsmooth.c:416
ULONG PointerAttributesSize
Definition: framebufacc.h:64
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
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes
Definition: driver.h:45
FLONG flGraphicsCaps
Definition: winddi.h:390
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG cjDevInfo
Definition: winddi.h:3553
#define min(a, b)
Definition: monoChain.cc:55
#define VIDEO_MODE_ASYNC_POINTER
Definition: ntddvdeo.h:453
_In_ LPWSTR _In_ ULONG _In_ ULONG cjCaps
Definition: winddi.h:3551
unsigned int ULONG
Definition: retypes.h:1
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3553

Variable Documentation

◆ DrvFunctionTable

DRVFN DrvFunctionTable[]
static
Initial value:
=
{
}
#define INDEX_DrvCompletePDEV
Definition: winddi.h:417
ULONG NTAPI DrvGetModes(HANDLE hDriver, ULONG cjSize, DEVMODEW *pdm)
Definition: enable.c:374
#define INDEX_DrvGetModes
Definition: winddi.h:457
HSURF NTAPI DrvEnableSurface(DHPDEV dhpdev)
Definition: enable.c:200
#define INDEX_DrvEnablePDEV
Definition: winddi.h:416
BOOL NTAPI DrvAssertMode(DHPDEV dhpdev, BOOL bEnable)
Definition: enable.c:302
VOID APIENTRY DrvDisablePDEV(IN DHPDEV dhpdev)
Definition: enable.c:150
#define INDEX_DrvAssertMode
Definition: winddi.h:421
FN_DrvSetPalette DrvSetPalette
#define INDEX_DrvSetPointerShape
Definition: winddi.h:445
#define INDEX_DrvSetPalette
Definition: winddi.h:438
#define INDEX_DrvDisableSurface
Definition: winddi.h:420
FN_DrvMovePointer DrvMovePointer
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: enable.c:78
#define INDEX_DrvEnableSurface
Definition: winddi.h:419
FN_DrvSetPointerShape DrvSetPointerShape
BOOLEAN(* PFN)(PARGS)
Definition: parse.h:47
VOID APIENTRY DrvCompletePDEV(IN DHPDEV dhpdev, IN HDEV hdev)
Definition: enable.c:132
#define INDEX_DrvDisablePDEV
Definition: winddi.h:418
#define INDEX_DrvMovePointer
Definition: winddi.h:446
VOID NTAPI DrvDisableSurface(DHPDEV dhpdev)
Definition: enable.c:287

Definition at line 23 of file enable.c.

Referenced by DrvEnableDriver().