ReactOS  0.4.15-dev-5492-g47f3a4e
enable.c File Reference
#include "framebuf.h"
Include dependency graph for enable.c:

Go to the source code of this file.

Functions

BOOL APIENTRY DrvEnableDirectDraw (DHPDEV dhpdev, DD_CALLBACKS *pCallbacks, DD_SURFACECALLBACKS *pSurfaceCallbacks, DD_PALETTECALLBACKS *pPaletteCallbacks)
 
VOID APIENTRY DrvDisableDirectDraw (DHPDEV dhpdev)
 
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 168 of file enable.c.

171 {
172  ((PPDEV)dhpdev)->hDevEng = hdev;
173 }
struct _PDEV * PPDEV
_In_ HDEV hdev
Definition: winddi.h:3449

◆ DrvDisableDirectDraw()

VOID APIENTRY DrvDisableDirectDraw ( DHPDEV  dhpdev)

Definition at line 69 of file enable.c.

71 {
72 }

◆ DrvDisablePDEV()

VOID APIENTRY DrvDisablePDEV ( IN DHPDEV  dhpdev)

Definition at line 186 of file enable.c.

188 {
189  if (((PPDEV)dhpdev)->DefaultPalette)
190  {
192  }
193 
194  if (((PPDEV)dhpdev)->PaletteEntries != NULL)
195  {
196  EngFreeMem(((PPDEV)dhpdev)->PaletteEntries);
197  }
198 
199  EngFreeMem(dhpdev);
200 }
#define EngFreeMem
Definition: polytest.cpp:56
static const UCHAR DefaultPalette[]
Definition: blue.c:69
Definition: framebuf.h:33
ENGAPI BOOL APIENTRY EngDeletePalette(_In_ _Post_ptr_invalid_ HPALETTE hpal)
#define NULL
Definition: types.h:112

◆ DrvEnableDirectDraw()

BOOL APIENTRY DrvEnableDirectDraw ( DHPDEV  dhpdev,
DD_CALLBACKS pCallbacks,
DD_SURFACECALLBACKS pSurfaceCallbacks,
DD_PALETTECALLBACKS pPaletteCallbacks 
)

Definition at line 45 of file enable.c.

50 {
51  RtlZeroMemory(pCallbacks, sizeof(*pCallbacks));
52  RtlZeroMemory(pSurfaceCallbacks, sizeof(*pSurfaceCallbacks));
53  RtlZeroMemory(pPaletteCallbacks, sizeof(*pPaletteCallbacks));
54 
55  pCallbacks->dwSize = sizeof(*pCallbacks);
56  pSurfaceCallbacks->dwSize = sizeof(*pSurfaceCallbacks);
57  pPaletteCallbacks->dwSize = sizeof(*pPaletteCallbacks);
58 
59  /* We don't support any optional callback */
60 
61  return TRUE;
62 }
#define TRUE
Definition: types.h:120
DWORD dwSize
Definition: ddrawint.h:498
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ DrvEnableDriver()

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

Definition at line 86 of file enable.c.

90 {
91  if (cj >= sizeof(DRVENABLEDATA))
92  {
93  pded->c = sizeof(DrvFunctionTable) / sizeof(DRVFN);
94  pded->pdrvfn = DrvFunctionTable;
96  return TRUE;
97  }
98  else
99  {
100  return FALSE;
101  }
102 }
_In_ ULONG cj
Definition: winddi.h:3540
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DDI_DRIVER_VERSION_NT5
Definition: winddi.h:537
DRVFN * pdrvfn
Definition: winddi.h:544
static DRVFN DrvFunctionTable[]
Definition: enable.c:23
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 114 of file enable.c.

126 {
127  PPDEV ppdev;
128  GDIINFO GdiInfo;
129  DEVINFO DevInfo;
130 
131  ppdev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PDEV), ALLOC_TAG);
132  if (ppdev == NULL)
133  {
134  return NULL;
135  }
136 
137  ppdev->hDriver = hDriver;
138 
139  if (!IntInitScreenInfo(ppdev, pdm, &GdiInfo, &DevInfo))
140  {
141  EngFreeMem(ppdev);
142  return NULL;
143  }
144 
145  if (!IntInitDefaultPalette(ppdev, &DevInfo))
146  {
147  EngFreeMem(ppdev);
148  return NULL;
149  }
150 
151  memcpy(pdi, &DevInfo, min(sizeof(DEVINFO), cjDevInfo));
152  memcpy(pdevcaps, &GdiInfo, min(sizeof(GDIINFO), cjCaps));
153 
154  return (DHPDEV)ppdev;
155 }
BOOL IntInitScreenInfo(PPDEV ppdev, LPDEVMODEW pDevMode, PGDIINFO pGdiInfo, PDEVINFO pDevInfo)
Definition: screen.c:120
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:87
HANDLE hDriver
Definition: framebuf.h:35
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
#define NULL
Definition: types.h:112
_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

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:186
#define INDEX_DrvDisableDirectDraw
Definition: winddi.h:477
#define INDEX_DrvAssertMode
Definition: winddi.h:421
BOOL APIENTRY DrvEnableDirectDraw(DHPDEV dhpdev, DD_CALLBACKS *pCallbacks, DD_SURFACECALLBACKS *pSurfaceCallbacks, DD_PALETTECALLBACKS *pPaletteCallbacks)
Definition: enable.c:45
FN_DrvSetPalette DrvSetPalette
#define INDEX_DrvSetPointerShape
Definition: winddi.h:445
#define INDEX_DrvSetPalette
Definition: winddi.h:438
#define INDEX_DrvEnableDirectDraw
Definition: winddi.h:476
#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:114
#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:168
VOID APIENTRY DrvDisableDirectDraw(DHPDEV dhpdev)
Definition: enable.c:69
#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().