ReactOS 0.4.15-dev-8236-g99f0937
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}
static const UCHAR DefaultPalette[]
Definition: blue.c:69
#define NULL
Definition: types.h:112
#define EngFreeMem
Definition: polytest.cpp:56
Definition: framebuf.h:34
ENGAPI BOOL APIENTRY EngDeletePalette(_In_ _Post_ptr_invalid_ HPALETTE hpal)

◆ 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);
96 return TRUE;
97 }
98 else
99 {
100 return FALSE;
101 }
102}
#define FALSE
Definition: types.h:117
Definition: winddi.h:529
ULONG iDriverVersion
Definition: winddi.h:542
DRVFN * pdrvfn
Definition: winddi.h:544
static DRVFN DrvFunctionTable[]
Definition: enable.c:23
_In_ ULONG cj
Definition: winddi.h:3540
#define DDI_DRIVER_VERSION_NT5
Definition: winddi.h:537

◆ 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}
#define ALLOC_TAG
Definition: btrfs_drv.h:87
BOOL IntInitScreenInfo(PPDEV ppdev, LPDEVMODEW pDevMode, PGDIINFO pGdiInfo, PDEVINFO pDevInfo)
Definition: screen.c:120
BOOL IntInitDefaultPalette(PPDEV ppdev, PDEVINFO pDevInfo)
Definition: palette.c:60
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
HANDLE hDriver
Definition: framebuf.h:35
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG cjDevInfo
Definition: winddi.h:3553
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3554
_In_ LPWSTR _In_ ULONG _In_ ULONG cjCaps
Definition: winddi.h:3551
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3557

Variable Documentation

◆ DrvFunctionTable

DRVFN DrvFunctionTable[]
static
Initial value:
=
{
}
#define INDEX_DrvSetPointerShape
Definition: winddi.h:445
LONG_PTR(APIENTRY * PFN)()
Definition: winddi.h:133
FN_DrvDisableDirectDraw DrvDisableDirectDraw
FN_DrvSetPalette DrvSetPalette
#define INDEX_DrvDisableSurface
Definition: winddi.h:420
#define INDEX_DrvEnableDirectDraw
Definition: winddi.h:476
#define INDEX_DrvMovePointer
Definition: winddi.h:446
#define INDEX_DrvDisableDirectDraw
Definition: winddi.h:477
FN_DrvSetPointerShape DrvSetPointerShape
FN_DrvGetModes DrvGetModes
#define INDEX_DrvCompletePDEV
Definition: winddi.h:417
#define INDEX_DrvSetPalette
Definition: winddi.h:438
FN_DrvEnableSurface DrvEnableSurface
#define INDEX_DrvEnablePDEV
Definition: winddi.h:416
FN_DrvMovePointer DrvMovePointer
FN_DrvCompletePDEV DrvCompletePDEV
#define INDEX_DrvAssertMode
Definition: winddi.h:421
FN_DrvEnableDirectDraw DrvEnableDirectDraw
FN_DrvEnablePDEV DrvEnablePDEV
FN_DrvAssertMode DrvAssertMode
FN_DrvDisableSurface DrvDisableSurface
FN_DrvDisablePDEV DrvDisablePDEV
#define INDEX_DrvEnableSurface
Definition: winddi.h:419
#define INDEX_DrvDisablePDEV
Definition: winddi.h:418
#define INDEX_DrvGetModes
Definition: winddi.h:457

Definition at line 23 of file enable.c.

Referenced by DrvEnableDriver().