2 * ReactOS Generic Framebuffer display driver
4 * Copyright (C) 2004 Filip Navara
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 static DRVFN DrvFunctionTable
[] =
25 {INDEX_DrvEnablePDEV
, (PFN
)DrvEnablePDEV
},
26 {INDEX_DrvCompletePDEV
, (PFN
)DrvCompletePDEV
},
27 {INDEX_DrvDisablePDEV
, (PFN
)DrvDisablePDEV
},
28 {INDEX_DrvEnableSurface
, (PFN
)DrvEnableSurface
},
29 {INDEX_DrvDisableSurface
, (PFN
)DrvDisableSurface
},
30 {INDEX_DrvAssertMode
, (PFN
)DrvAssertMode
},
31 {INDEX_DrvGetModes
, (PFN
)DrvGetModes
},
32 {INDEX_DrvSetPalette
, (PFN
)DrvSetPalette
},
33 {INDEX_DrvSetPointerShape
, (PFN
)DrvSetPointerShape
},
34 {INDEX_DrvMovePointer
, (PFN
)DrvMovePointer
}
41 * Initial driver entry point exported by the driver DLL. It fills in a
42 * DRVENABLEDATA structure with the driver's DDI version number and the
43 * calling addresses of all DDI functions supported by the driver.
55 if (cj
>= sizeof(DRVENABLEDATA
))
57 pded
->c
= sizeof(DrvFunctionTable
) / sizeof(DRVFN
);
58 pded
->pdrvfn
= DrvFunctionTable
;
59 pded
->iDriverVersion
= DDI_DRIVER_VERSION_NT5
;
71 * Returns a description of the physical device's characteristics to GDI.
80 IN LPWSTR pwszLogAddress
,
82 OUT HSURF
*phsurfPatterns
,
88 IN LPWSTR pwszDeviceName
,
95 ppdev
= EngAllocMem(FL_ZERO_MEMORY
, sizeof(PDEV
), ALLOC_TAG
);
101 ppdev
->hDriver
= hDriver
;
103 if (!IntInitScreenInfo(ppdev
, pdm
, &GdiInfo
, &DevInfo
))
109 if (!IntInitDefaultPalette(ppdev
, &DevInfo
))
115 memcpy(pdi
, &DevInfo
, min(sizeof(DEVINFO
), cjDevInfo
));
116 memcpy(pdevcaps
, &GdiInfo
, min(sizeof(GDIINFO
), cjCaps
));
118 return (DHPDEV
)ppdev
;
124 * Stores the GDI handle (hdev) of the physical device in dhpdev. The driver
125 * should retain this handle for use when calling GDI services.
136 ((PPDEV
)dhpdev
)->hDevEng
= hdev
;
142 * Release the resources allocated in DrvEnablePDEV. If a surface has been
143 * enabled DrvDisableSurface will have already been called.
153 if (((PPDEV
)dhpdev
)->DefaultPalette
)
155 EngDeletePalette(((PPDEV
)dhpdev
)->DefaultPalette
);
158 if (((PPDEV
)dhpdev
)->PaletteEntries
!= NULL
)
160 EngFreeMem(((PPDEV
)dhpdev
)->PaletteEntries
);