1 | /******************************Module*Header*******************************\
|
---|
2 | *
|
---|
3 | * *******************
|
---|
4 | * * GDI SAMPLE CODE *
|
---|
5 | * *******************
|
---|
6 | *
|
---|
7 | * Module Name: driver.h
|
---|
8 | *
|
---|
9 | * contains prototypes for the frame buffer driver.
|
---|
10 | *
|
---|
11 | * Copyright (c) 1992-1998 Microsoft Corporation
|
---|
12 | \**************************************************************************/
|
---|
13 |
|
---|
14 | #define DBG 1
|
---|
15 |
|
---|
16 | #include "stddef.h"
|
---|
17 |
|
---|
18 | #include <stdarg.h>
|
---|
19 |
|
---|
20 | #include "windef.h"
|
---|
21 | #include "wingdi.h"
|
---|
22 | #include "winddi.h"
|
---|
23 | #include "devioctl.h"
|
---|
24 | #include "ntddvdeo.h"
|
---|
25 | #include "debug.h"
|
---|
26 |
|
---|
27 | typedef struct _PDEV
|
---|
28 | {
|
---|
29 | HANDLE hDriver; // Handle to \Device\Screen
|
---|
30 | HDEV hdevEng; // Engine's handle to PDEV
|
---|
31 | HSURF hsurfEng; // Engine's handle to surface
|
---|
32 | //@todo Make work without palette
|
---|
33 | HPALETTE hpalDefault; // Handle to the default palette for device.
|
---|
34 | PBYTE pjScreen; // This is pointer to base screen address
|
---|
35 | ULONG cxScreen; // Visible screen width
|
---|
36 | ULONG cyScreen; // Visible screen height
|
---|
37 | POINTL ptlOrg; // Where this display is anchored in
|
---|
38 | // the virtual desktop.
|
---|
39 | ULONG ulMode; // Mode the mini-port driver is in.
|
---|
40 | LONG lDeltaScreen; // Distance from one scan to the next.
|
---|
41 | ULONG cScreenSize; // size of video memory, including
|
---|
42 | // offscreen memory.
|
---|
43 | PVOID pOffscreenList; // linked list of DCI offscreen surfaces.
|
---|
44 | FLONG flRed; // For bitfields device, Red Mask
|
---|
45 | FLONG flGreen; // For bitfields device, Green Mask
|
---|
46 | FLONG flBlue; // For bitfields device, Blue Mask
|
---|
47 | ULONG cPaletteShift; // number of bits the 8-8-8 palette must
|
---|
48 | // be shifted by to fit in the hardware
|
---|
49 | // palette.
|
---|
50 | ULONG ulBitCount; // # of bits per pel 8,16,24,32 are only supported.
|
---|
51 | POINTL ptlHotSpot; // adjustment for pointer hot spot
|
---|
52 | VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
|
---|
53 | PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes
|
---|
54 | DWORD cjPointerAttributes; // Size of buffer allocated
|
---|
55 | BOOL fHwCursorActive; // Are we currently using the hw cursor
|
---|
56 | PALETTEENTRY *pPal; // If this is pal managed, this is the pal
|
---|
57 | BOOL bSupportDCI; // Does the miniport support DCI?
|
---|
58 |
|
---|
59 | //@todo Make work without allocation
|
---|
60 | PVOID pvTmpBuffer; // ptr to MIRRSURF bits for screen surface
|
---|
61 | } PDEV, *PPDEV;
|
---|
62 |
|
---|
63 | typedef struct _MIRRSURF {
|
---|
64 | PPDEV *pdev;
|
---|
65 | ULONG cx;
|
---|
66 | ULONG cy;
|
---|
67 | ULONG lDelta;
|
---|
68 | ULONG ulBitCount;
|
---|
69 | BOOL bIsScreen;
|
---|
70 |
|
---|
71 | } MIRRSURF, *PMIRRSURF;
|
---|
72 |
|
---|
73 | DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *);
|
---|
74 | BOOL bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *);
|
---|
75 | BOOL bInitSURF(PPDEV, BOOL);
|
---|
76 | BOOL bInitPaletteInfo(PPDEV, DEVINFO *);
|
---|
77 | BOOL bInitPointer(PPDEV, DEVINFO *);
|
---|
78 | BOOL bInit256ColorPalette(PPDEV);
|
---|
79 | VOID vDisablePalette(PPDEV);
|
---|
80 | VOID vDisableSURF(PPDEV);
|
---|
81 |
|
---|
82 | #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
|
---|
83 |
|
---|
84 | //
|
---|
85 | // Determines the size of the DriverExtra information in the DEVMODE
|
---|
86 | // structure passed to and from the display driver.
|
---|
87 | //
|
---|
88 |
|
---|
89 | #define DRIVER_EXTRA_SIZE 0
|
---|
90 |
|
---|
91 | #define DLL_NAME L"vrdpdd" // Name of the DLL in UNICODE
|
---|
92 | #define STANDARD_DEBUG_PREFIX "vrdpdd: " // All debug output is prefixed
|
---|
93 | #define ALLOC_TAG 'rvDD' // Four byte tag (characters in
|
---|
94 | // reverse order) used for memory
|
---|
95 | // allocations
|
---|
96 |
|
---|