1 | /******************************Module*Header*******************************\
|
---|
2 | *
|
---|
3 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
4 | *
|
---|
5 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
6 | * available from http://www.virtualbox.org. This file is free software;
|
---|
7 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
8 | * General Public License (GPL) as published by the Free Software
|
---|
9 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
10 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
11 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
12 | *
|
---|
13 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
14 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
15 | * additional information or have any questions.
|
---|
16 | *
|
---|
17 | * Based in part on Microsoft DDK sample code
|
---|
18 | *
|
---|
19 | * *******************
|
---|
20 | * * GDI SAMPLE CODE *
|
---|
21 | * *******************
|
---|
22 | *
|
---|
23 | * Module Name: driver.h
|
---|
24 | *
|
---|
25 | * contains prototypes for the frame buffer driver.
|
---|
26 | *
|
---|
27 | * Copyright (c) 1992-1998 Microsoft Corporation
|
---|
28 | \**************************************************************************/
|
---|
29 |
|
---|
30 | #define DBG 1
|
---|
31 |
|
---|
32 | #include "stddef.h"
|
---|
33 |
|
---|
34 | #include <stdarg.h>
|
---|
35 |
|
---|
36 | #include "windef.h"
|
---|
37 | #include "wingdi.h"
|
---|
38 | #include "winddi.h"
|
---|
39 | #include "devioctl.h"
|
---|
40 | #include "ntddvdeo.h"
|
---|
41 | #include "debug.h"
|
---|
42 |
|
---|
43 | typedef struct _PDEV
|
---|
44 | {
|
---|
45 | HANDLE hDriver; // Handle to \Device\Screen
|
---|
46 | HDEV hdevEng; // Engine's handle to PDEV
|
---|
47 | HSURF hsurfEng; // Engine's handle to surface
|
---|
48 | //@todo Make work without palette
|
---|
49 | HPALETTE hpalDefault; // Handle to the default palette for device.
|
---|
50 | PBYTE pjScreen; // This is pointer to base screen address
|
---|
51 | ULONG cxScreen; // Visible screen width
|
---|
52 | ULONG cyScreen; // Visible screen height
|
---|
53 | POINTL ptlOrg; // Where this display is anchored in
|
---|
54 | // the virtual desktop.
|
---|
55 | ULONG ulMode; // Mode the mini-port driver is in.
|
---|
56 | LONG lDeltaScreen; // Distance from one scan to the next.
|
---|
57 | ULONG cScreenSize; // size of video memory, including
|
---|
58 | // offscreen memory.
|
---|
59 | PVOID pOffscreenList; // linked list of DCI offscreen surfaces.
|
---|
60 | FLONG flRed; // For bitfields device, Red Mask
|
---|
61 | FLONG flGreen; // For bitfields device, Green Mask
|
---|
62 | FLONG flBlue; // For bitfields device, Blue Mask
|
---|
63 | ULONG cPaletteShift; // number of bits the 8-8-8 palette must
|
---|
64 | // be shifted by to fit in the hardware
|
---|
65 | // palette.
|
---|
66 | ULONG ulBitCount; // # of bits per pel 8,16,24,32 are only supported.
|
---|
67 | POINTL ptlHotSpot; // adjustment for pointer hot spot
|
---|
68 | VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
|
---|
69 | PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes
|
---|
70 | DWORD cjPointerAttributes; // Size of buffer allocated
|
---|
71 | BOOL fHwCursorActive; // Are we currently using the hw cursor
|
---|
72 | PALETTEENTRY *pPal; // If this is pal managed, this is the pal
|
---|
73 | BOOL bSupportDCI; // Does the miniport support DCI?
|
---|
74 |
|
---|
75 | //@todo Make work without allocation
|
---|
76 | PVOID pvTmpBuffer; // ptr to MIRRSURF bits for screen surface
|
---|
77 | } PDEV, *PPDEV;
|
---|
78 |
|
---|
79 | typedef struct _MIRRSURF {
|
---|
80 | PPDEV *pdev;
|
---|
81 | ULONG cx;
|
---|
82 | ULONG cy;
|
---|
83 | ULONG lDelta;
|
---|
84 | ULONG ulBitCount;
|
---|
85 | BOOL bIsScreen;
|
---|
86 |
|
---|
87 | } MIRRSURF, *PMIRRSURF;
|
---|
88 |
|
---|
89 | DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *);
|
---|
90 | BOOL bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *);
|
---|
91 | BOOL bInitSURF(PPDEV, BOOL);
|
---|
92 | BOOL bInitPaletteInfo(PPDEV, DEVINFO *);
|
---|
93 | BOOL bInitPointer(PPDEV, DEVINFO *);
|
---|
94 | BOOL bInit256ColorPalette(PPDEV);
|
---|
95 | VOID vDisablePalette(PPDEV);
|
---|
96 | VOID vDisableSURF(PPDEV);
|
---|
97 |
|
---|
98 | #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
|
---|
99 |
|
---|
100 | //
|
---|
101 | // Determines the size of the DriverExtra information in the DEVMODE
|
---|
102 | // structure passed to and from the display driver.
|
---|
103 | //
|
---|
104 |
|
---|
105 | #define DRIVER_EXTRA_SIZE 0
|
---|
106 |
|
---|
107 | #define DLL_NAME L"vrdpdd" // Name of the DLL in UNICODE
|
---|
108 | #define STANDARD_DEBUG_PREFIX "vrdpdd: " // All debug output is prefixed
|
---|
109 | #define ALLOC_TAG 'rvDD' // Four byte tag (characters in
|
---|
110 | // reverse order) used for memory
|
---|
111 | // allocations
|
---|
112 |
|
---|