mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
more work on KMGDI subsystem
svn path=/trunk/; revision=589
This commit is contained in:
parent
0584d3755f
commit
932d4770ec
12 changed files with 1194 additions and 463 deletions
|
@ -2,10 +2,52 @@
|
|||
* WinDDI.h - definition of the GDI - DDI interface
|
||||
*/
|
||||
|
||||
#ifndef __DDK_WINDDI_H
|
||||
#define __DDK_WINDDI_H
|
||||
|
||||
#if defined(WIN32_LEAN_AND_MEAN) && defined(_GNU_H_WINDOWS32_STRUCTURES)
|
||||
#error "windows.h cannot be included before winddi.h if WIN32_LEAN_AND_MEAN is defined"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32_LEAN_AND_MEAN
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#define OUT
|
||||
#define OPTIONAL
|
||||
#endif
|
||||
|
||||
#ifndef PTRDIFF
|
||||
typedef DWORD PTRDIFF;
|
||||
#endif
|
||||
|
||||
/* FIXME: find definitions for these structs */
|
||||
typedef PVOID PCOLORADJUSTMENT;
|
||||
typedef PVOID PDD_CALLBACKS;
|
||||
typedef PVOID PDD_HALINFO;
|
||||
typedef PVOID PDD_PALETTECALLBACKS;
|
||||
typedef PVOID PDD_SURFACECALLBACKS;
|
||||
typedef PVOID PFONTINFO;
|
||||
typedef PVOID PGAMMA_TABLES;
|
||||
typedef PVOID PGLYPHDATA;
|
||||
typedef PVOID PLINEATTRS;
|
||||
typedef DWORD MIX;
|
||||
typedef DWORD ROP4;
|
||||
typedef PVOID PSTROBJ;
|
||||
typedef PVOID PTTPOLYGONHEADER;
|
||||
typedef PVOID PVIDEOMEMORY;
|
||||
|
||||
#define DDI_DRIVER_VERSION 0x00010000
|
||||
|
||||
/* FIXME: how big should this constant be? */
|
||||
#define HS_DDI_MAX 6
|
||||
|
||||
/* EngCreateBitmap format types */
|
||||
enum _BMF_TYPES
|
||||
{
|
||||
|
@ -156,7 +198,7 @@ enum _DRV_HOOK_FUNCS
|
|||
INDEX_DrvStrokePath,
|
||||
INDEX_DrvFillPath,
|
||||
INDEX_DrvStrokeAndFillPath,
|
||||
INDEX_DrvPaint
|
||||
INDEX_DrvPaint,
|
||||
INDEX_DrvBitBlt,
|
||||
INDEX_DrvCopyBits,
|
||||
INDEX_DrvStretchBlt,
|
||||
|
@ -262,20 +304,12 @@ enum _SURF_TYPES
|
|||
#define WOC_CHANGED 0x00000010
|
||||
#define WOC_DELETE 0x00000020
|
||||
|
||||
enum _WIN_CHARSET
|
||||
{
|
||||
ANSI_CHARSET = 1,
|
||||
SYMBOL_CHARSET,
|
||||
SHIFTJIS_CHARSET,
|
||||
HANGEUL_CHARSET,
|
||||
CHINESEBIG5_CHARSET,
|
||||
OEM_CHARSET
|
||||
};
|
||||
|
||||
typedef HANDLE HDEV;
|
||||
typedef HANDLE HGLYPH;
|
||||
typedef HANDLE HSURF;
|
||||
typedef HANDLE DHPDEV;
|
||||
typedef ULONG (*PFN)();
|
||||
typedef VOID (CALLBACK * WNDOBJCHANGEPROC)(PWNDOBJ WndObj, ULONG Flags);
|
||||
typedef HANDLE DHSURF;
|
||||
typedef ULONG (*PFN)(VOID);
|
||||
|
||||
typedef struct _DRVFN
|
||||
{
|
||||
|
@ -294,13 +328,43 @@ typedef struct _DRVENABLEDATA
|
|||
ULONG c;
|
||||
DRVFN *pdrvfn;
|
||||
} DRVENABLEDATA, *PDRVENABLEDATA;
|
||||
|
||||
|
||||
/* FIXME: replace this with correct def for LDECI4 */
|
||||
typedef DWORD LDECI4;
|
||||
|
||||
typedef struct _CIECHROMA
|
||||
{
|
||||
LDECI4 x;
|
||||
LDECI4 y;
|
||||
LDECI4 Y;
|
||||
} CIECHROMA, *PCIECHROMA;
|
||||
|
||||
typedef struct _COLORINFO
|
||||
{
|
||||
CIECHROMA Red;
|
||||
CIECHROMA Green;
|
||||
CIECHROMA Blue;
|
||||
CIECHROMA Cyan;
|
||||
CIECHROMA Magenta;
|
||||
CIECHROMA Yellow;
|
||||
CIECHROMA AlignmentWhite;
|
||||
LDECI4 RedGamma;
|
||||
LDECI4 GreenGamma;
|
||||
LDECI4 BlueGamma;
|
||||
LDECI4 MagentaInCyanDye;
|
||||
LDECI4 YellowInCyanDye;
|
||||
LDECI4 CyanInMagentaDye;
|
||||
LDECI4 YellowInMagentaDye;
|
||||
LDECI4 CyanInYellowDye;
|
||||
LDECI4 MagentaInYellowDye;
|
||||
} COLORINFO, *PCOLORINFO;
|
||||
|
||||
typedef struct _DEVINFO
|
||||
{
|
||||
ULONG flGraphicsCaps;
|
||||
LOGFONTW lfDefaultFont;
|
||||
LOGFONTW lfAnsiVarFont;
|
||||
LOGFONTW lfAnsiFixFont;
|
||||
LOGFONT lfDefaultFont;
|
||||
LOGFONT lfAnsiVarFont;
|
||||
LOGFONT lfAnsiFixFont;
|
||||
ULONG cFonts;
|
||||
ULONG iDitherFormat;
|
||||
USHORT cxDither;
|
||||
|
@ -308,6 +372,45 @@ typedef struct _DEVINFO
|
|||
HPALETTE hpalDefault;
|
||||
} DEVINFO, *PDEVINFO;
|
||||
|
||||
typedef struct _GDIINFO
|
||||
{
|
||||
ULONG ulVersion;
|
||||
ULONG ulTechnology;
|
||||
ULONG ulHorzSize;
|
||||
ULONG ulVertSize;
|
||||
ULONG ulHorzRes;
|
||||
ULONG ulVertRes;
|
||||
ULONG cBitsPixel;
|
||||
ULONG cPlanes;
|
||||
ULONG ulNumColors;
|
||||
ULONG flRaster;
|
||||
ULONG ulLogPixelsX;
|
||||
ULONG ulLogPixelsY;
|
||||
ULONG flTextCaps;
|
||||
ULONG ulDACRed;
|
||||
ULONG ulDACGreen;
|
||||
ULONG ulDACBlue;
|
||||
ULONG ulAspectX;
|
||||
ULONG ulAspectY;
|
||||
ULONG ulAspectXY;
|
||||
LONG xStyleStep;
|
||||
LONG yStyleStep;
|
||||
LONG denStyleStep;
|
||||
POINTL ptlPhysOffset;
|
||||
SIZEL szlPhysSize;
|
||||
ULONG ulNumPalReg;
|
||||
COLORINFO ciDevice;
|
||||
ULONG ulDevicePelsDPI;
|
||||
ULONG ulPrimaryOrder;
|
||||
ULONG ulHTPatternSize;
|
||||
ULONG ulHTOutputFormat;
|
||||
ULONG flHTFlags;
|
||||
ULONG ulVRefresh;
|
||||
ULONG ulBltAlignment;
|
||||
ULONG ulPanningHorzRes;
|
||||
ULONG ulPanningVertRes;
|
||||
} GDIINFO, *PGDIINFO;
|
||||
|
||||
typedef struct _DEVMODEW
|
||||
{
|
||||
WCHAR dmDeviceName[DMMAXDEVICENAME];
|
||||
|
@ -336,7 +439,7 @@ typedef struct _DEVMODEW
|
|||
DWORD dmPelsHeight;
|
||||
DWORD dmDisplayFlags;
|
||||
DWORD dmDisplayFrequency;
|
||||
} DEVMODEW;
|
||||
} DEVMODEW, *PDEVMODEW;
|
||||
|
||||
typedef struct _BRUSHOBJ
|
||||
{
|
||||
|
@ -465,10 +568,24 @@ typedef struct _SURFOBJ
|
|||
USHORT fjBitmap;
|
||||
} SURFOBJ, *PSURFOBJ;
|
||||
|
||||
typedef struct _WNDOBJ
|
||||
{
|
||||
CLIPOBJ coClient;
|
||||
PVOID pvConsumer;
|
||||
RECTL rclClient;
|
||||
} WNDOBJ, *PWNDOBJ;
|
||||
|
||||
typedef VOID (CALLBACK * WNDOBJCHANGEPROC)(PWNDOBJ WndObj, ULONG Flags);
|
||||
|
||||
typedef struct _XFORMOBJ
|
||||
{
|
||||
/* FIXME: what does this beast look like? */
|
||||
} XFORMOBJ, *PXFORMOBJ;
|
||||
|
||||
typedef struct _XLATEOBJ
|
||||
{
|
||||
ULONG iUniq;
|
||||
FLONG flXlate;
|
||||
ULONG flXlate;
|
||||
USHORT iSrcType;
|
||||
USHORT iDstType;
|
||||
ULONG cEntries;
|
||||
|
@ -778,7 +895,7 @@ EngCreateEvent
|
|||
*/
|
||||
|
||||
HPALETTE EngCreatePalette(IN ULONG Mode,
|
||||
IN ULONG Colors,
|
||||
IN ULONG NumColors,
|
||||
IN PULONG *Colors,
|
||||
IN ULONG Red,
|
||||
IN ULONG Green,
|
||||
|
@ -898,7 +1015,7 @@ ULONG FONTOBJ_cGetGlyphs(IN PFONTOBJ FontObj,
|
|||
IN ULONG NumGlyphs,
|
||||
IN HGLYPH *GlyphHandles,
|
||||
IN PVOID *OutGlyphs);
|
||||
GAMMA_TABLES *FONTOBJ_pGetGammaTables(IN PFONTOBJ FontObj);
|
||||
PGAMMA_TABLES FONTOBJ_pGetGammaTables(IN PFONTOBJ FontObj);
|
||||
IFIMETRICS *FONTOBJ_pifi(IN PFONTOBJ FontObj);
|
||||
PVOID FONTOBJ_pvTrueTypeFontFile(IN PFONTOBJ FontObj,
|
||||
IN ULONG *FileSize);
|
||||
|
@ -942,3 +1059,5 @@ XLATEOBJ_iXlate
|
|||
XLATEOBJ_piVector
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
#ifndef __WIN32K_BITMAPS_H
|
||||
#define __WIN32K_BITMAPS_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <win32k/dc.h>
|
||||
|
||||
BOOL W32kBitBlt(HDC hDCDest,
|
||||
INT XDest,
|
||||
|
@ -144,5 +149,5 @@ INT W32kStretchDIBits(HDC hDC,
|
|||
DWORD ROP);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
#ifndef __WIN32K_BRUSH_H
|
||||
#define __WIN32K_BRUSH_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
HBRUSH W32kCreateBrushIndirect(CONST LOGBRUSH *lb);
|
||||
HBRUSH W32kCreateDIBPatternBrush(HGLOBAL hDIBPacked,
|
||||
UINT ColorSpec);
|
||||
|
@ -20,3 +25,5 @@ BOOL W32kSetBrushOrgEx(HDC hDC,
|
|||
INT YOrg,
|
||||
LPPOINT Point);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,21 +1,169 @@
|
|||
|
||||
#ifndef __WIN32K_DC_H
|
||||
#define __WIN32K_DC_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <win32k/driver.h>
|
||||
|
||||
/* (RJJ) Taken from WINE */
|
||||
typedef struct _WIN_DC_INFO
|
||||
{
|
||||
int flags;
|
||||
#if 0
|
||||
const DeviceCaps *devCaps;
|
||||
#endif
|
||||
|
||||
HRGN hClipRgn; /* Clip region (may be 0) */
|
||||
|
||||
#if 0
|
||||
HRGN hVisRgn; /* Visible region (must never be 0) */
|
||||
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
|
||||
#endif
|
||||
|
||||
HPEN hPen;
|
||||
HBRUSH hBrush;
|
||||
HFONT hFont;
|
||||
|
||||
#if 0
|
||||
HBITMAP hBitmap;
|
||||
HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
|
||||
HANDLE hDevice;
|
||||
HPALETTE hPalette;
|
||||
|
||||
GdiPath path;
|
||||
#endif
|
||||
|
||||
WORD ROPmode;
|
||||
WORD polyFillMode;
|
||||
WORD stretchBltMode;
|
||||
WORD relAbsMode;
|
||||
WORD backgroundMode;
|
||||
COLORREF backgroundColor;
|
||||
COLORREF textColor;
|
||||
|
||||
short brushOrgX;
|
||||
short brushOrgY;
|
||||
|
||||
WORD textAlign; /* Text alignment from SetTextAlign() */
|
||||
short charExtra; /* Spacing from SetTextCharacterExtra() */
|
||||
short breakTotalExtra; /* Total extra space for justification */
|
||||
short breakCount; /* Break char. count */
|
||||
short breakExtra; /* breakTotalExtra / breakCount */
|
||||
short breakRem; /* breakTotalExtra % breakCount */
|
||||
|
||||
RECT totalExtent;
|
||||
BYTE bitsPerPixel;
|
||||
|
||||
INT MapMode;
|
||||
INT GraphicsMode; /* Graphics mode */
|
||||
INT DCOrgX; /* DC origin */
|
||||
INT DCOrgY;
|
||||
|
||||
#if 0
|
||||
FARPROC lpfnPrint; /* AbortProc for Printing */
|
||||
#endif
|
||||
|
||||
INT CursPosX; /* Current position */
|
||||
INT CursPosY;
|
||||
INT ArcDirection;
|
||||
|
||||
#if 0
|
||||
XFORM xformWorld2Wnd; /* World-to-window transformation */
|
||||
XFORM xformWorld2Vport; /* World-to-viewport transformation */
|
||||
XFORM xformVport2World; /* Inverse of the above transformation */
|
||||
BOOL vport2WorldValid; /* Is xformVport2World valid? */
|
||||
#endif
|
||||
} WIN_DC_INFO;
|
||||
|
||||
#define GDI_DC_TYPE (1)
|
||||
|
||||
typedef struct _DC
|
||||
{
|
||||
WORD Type;
|
||||
struct _DC *NextDC;
|
||||
|
||||
DHPDEV PDev;
|
||||
DEVMODEW DMW;
|
||||
HSURF FillPatternSurfaces[HS_DDI_MAX];
|
||||
GDIINFO GDIInfo;
|
||||
DEVINFO DevInfo;
|
||||
HSURF Surface = NULL;
|
||||
HSURF Surface;
|
||||
|
||||
DRIVER_FUNCTIONS DriverFunctions;
|
||||
PWSTR DriverName;
|
||||
HANDLE DeviceDriver;
|
||||
|
||||
WIN_DC_INFO WinDCInfo;
|
||||
INT wndOrgX; /* Window origin */
|
||||
INT wndOrgY;
|
||||
INT wndExtX; /* Window extent */
|
||||
INT wndExtY;
|
||||
INT vportOrgX; /* Viewport origin */
|
||||
INT vportOrgY;
|
||||
INT vportExtX; /* Viewport extent */
|
||||
INT vportExtY;
|
||||
|
||||
WIN_DC_INFO w;
|
||||
} DC, *PDC;
|
||||
|
||||
/* Internal functions */
|
||||
|
||||
PDC DC_AllocDC(LPCWSTR Driver);
|
||||
void DC_InitDC(PDC DCToInit);
|
||||
PDC DC_FindOpenDC(LPCWSTR Driver);
|
||||
void DC_FreeDC(PDC DCToFree);
|
||||
HDC DC_PtrToHandle(PDC pDC);
|
||||
PDC DC_HandleToPtr(HDC hDC);
|
||||
|
||||
/* User entry points */
|
||||
|
||||
BOOL STDCALL W32kCancelDC(HDC hDC);
|
||||
HDC STDCALL W32kCreateCompatableDC(HDC hDC);
|
||||
HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||
LPCWSTR Device,
|
||||
LPCWSTR Output,
|
||||
CONST PDEVMODEW InitData);
|
||||
BOOL STDCALL W32kDeleteDC(HDC hDC);
|
||||
INT STDCALL W32kDrawEscape(HDC hDC,
|
||||
INT nEscape,
|
||||
INT cbInput,
|
||||
LPCSTR lpszInData);
|
||||
|
||||
/* FIXME: this typedef should go somewhere else... */
|
||||
typedef VOID (*GOBJENUMPROC)(PVOID, LPARAM);
|
||||
|
||||
INT STDCALL W32kEnumObjects(HDC hDC,
|
||||
INT ObjectType,
|
||||
GOBJENUMPROC ObjectFunc,
|
||||
LPARAM lParam);
|
||||
|
||||
COLORREF STDCALL W32kGetBkColor(HDC hDC);
|
||||
INT STDCALL W32kGetBkMode(HDC hDC);
|
||||
BOOL STDCALL W32kGetBrushOrgEx(HDC hDC, LPPOINT brushOrg);
|
||||
HRGN STDCALL W32kGetClipRgn(HDC hDC);
|
||||
HGDIOBJ STDCALL W32kGetCurrentObject(HDC hDC, UINT ObjectType);
|
||||
BOOL STDCALL W32kGetCurrentPositionEx(HDC hDC, LPPOINT currentPosition);
|
||||
BOOL STDCALL W32kGetDCOrgEx(HDC hDC, LPPOINT Point);
|
||||
INT STDCALL W32kGetDeviceCaps(HDC hDC, INT Index);
|
||||
INT STDCALL W32kGetMapMode(HDC hDC);
|
||||
INT STDCALL W32kGetPolyFillMode(HDC hDC);
|
||||
INT STDCALL W32kGetRelAbs(HDC hDC);
|
||||
INT STDCALL W32kGetROP2(HDC hDC);
|
||||
INT STDCALL W32kGetStretchBltMode(HDC hDC);
|
||||
COLORREF STDCALL W32kGetTextColor(HDC hDC);
|
||||
UINT STDCALL W32kGetTextAlign(HDC hDC);
|
||||
BOOL STDCALL W32kGetViewportExtEx(HDC hDC, LPSIZE viewportExt);
|
||||
BOOL STDCALL W32kGetViewportOrgEx(HDC hDC, LPPOINT viewportOrg);
|
||||
BOOL STDCALL W32kGetWindowExtEx(HDC hDC, LPSIZE windowExt);
|
||||
BOOL STDCALL W32kGetWindowOrgEx(HDC hDC, LPPOINT windowOrg);
|
||||
HDC STDCALL W32kResetDC(HDC hDC, CONST DEVMODE *InitData);
|
||||
BOOL STDCALL W32kRestoreDC(HDC hDC, INT SavedDC);
|
||||
INT STDCALL W32kSaveDC(HDC hDC);
|
||||
HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ GDIObj);
|
||||
INT STDCALL W32kSetBkMode(HDC hDC, INT backgroundMode);
|
||||
INT STDCALL W32kSetPolyFillMode(HDC hDC, INT polyFillMode);
|
||||
INT STDCALL W32kSetRelAbs(HDC hDC, INT relAbsMode);
|
||||
INT STDCALL W32kSetROP2(HDC hDC, INT ROPmode);
|
||||
INT STDCALL W32kSetStretchBltMode(HDC hDC, INT stretchBltMode);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,6 +1,27 @@
|
|||
|
||||
#ifndef __WIN32K_DRIVER_H
|
||||
#define __WIN32K_DRIVER_H
|
||||
|
||||
BOOL (*PGD_ENABLEDRIVER)(ULONG, ULONG, PDRVENABLEDATA);
|
||||
#include <ddk/winddi.h>
|
||||
|
||||
typedef BOOL (*PGD_ENABLEDRIVER)(ULONG, ULONG, PDRVENABLEDATA);
|
||||
typedef DHPDEV (*PGD_ENABLEPDEV)(DEVMODEW *,
|
||||
LPWSTR,
|
||||
ULONG,
|
||||
HSURF *,
|
||||
ULONG,
|
||||
ULONG *,
|
||||
ULONG,
|
||||
DEVINFO *,
|
||||
LPWSTR,
|
||||
LPWSTR,
|
||||
HANDLE);
|
||||
typedef VOID (*PGD_COMPLETEPDEV)(DHPDEV, HDEV);
|
||||
typedef VOID (*PGD_DISABLEPDEV)(DHPDEV);
|
||||
typedef HSURF (*PGD_ENABLESURFACE)(DHPDEV);
|
||||
typedef VOID (*PGD_DISABLESURFACE)(DHPDEV);
|
||||
typedef VOID (*PGD_ASSERTMODE)(DHPDEV, BOOL);
|
||||
typedef BOOL (*PGD_RESETPDEV)(DHPDEV, DHPDEV);
|
||||
|
||||
typedef struct _DRIVER_FUNCTIONS
|
||||
{
|
||||
|
@ -65,8 +86,12 @@ typedef struct _DRIVER_FUNCTIONS
|
|||
#endif
|
||||
} DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS;
|
||||
|
||||
BOOL DRIVER_RegisterDriver(PWSTR Name, GD_ENABLEDRIVER EnableDriver);
|
||||
PDRIVER_FUNCTIONS DRIVER_FindDriver(PWSTR Name);
|
||||
BOOL DRIVER_BuildFunctions(PWSTR Name, PDRVENABLEDATA DED);
|
||||
BOOL DRIVER_UnregisterDriver(PWSTR Name);
|
||||
BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver);
|
||||
PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name);
|
||||
HANDLE DRIVER_FindMPDriver(LPCWSTR Name);
|
||||
BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED,
|
||||
PDRIVER_FUNCTIONS DF);
|
||||
BOOL DRIVER_UnregisterDriver(LPCWSTR Name);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,123 +0,0 @@
|
|||
/*
|
||||
* DC.C - Device context functions
|
||||
*
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <win32k/dc.h>
|
||||
#include <win32k/driver.h>
|
||||
|
||||
// --------------------------------------------------------- File Statics
|
||||
|
||||
/* FIXME: these should probably be placed in an object in the future */
|
||||
DC gSurfaceDC;
|
||||
|
||||
// ----------------------------------------------------- Public Functions
|
||||
|
||||
BOOL W32kCancelDC(HDC DC)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS W32kCreateDC(HDC *DC,
|
||||
LPCWSTR Driver,
|
||||
LPCWSTR Device,
|
||||
CONST PDEVMODE InitData)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PGD_ENABLEDRIVER GDEnableDriver;
|
||||
UNICODE_STRING DeviceName, ErrorMsg;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
|
||||
/* Get the DDI driver's entry point */
|
||||
if ((GDEnableDriver = DRIVER_FindDriver(Driver)) == NULL)
|
||||
{
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
/* FIXME: left off here... */
|
||||
/* FIXME: allocate a DC object */
|
||||
/* FIXME: recode the rest of the function to use the allocated DC */
|
||||
|
||||
/* FIXME: should get the device name from the DRIVER funcs */
|
||||
RtlInitUnicodeString(&DeviceName, L"\\Device\\DISPLAY");
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&DeviceName,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
Status = ZwOpenFile(&NewDC->DeviceDriver,
|
||||
FILE_ALL_ACCESS,
|
||||
&ObjectAttributes,
|
||||
NULL,
|
||||
0,
|
||||
FILE_SYNCHRONOUS_IO_ALERT);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("Failed to open display device\n");
|
||||
DbgGetErrorText(Status, &ErrorMsg, 0xf);
|
||||
DbgPrint("%W\n", &ErrorMsg);
|
||||
RtlFreeUnicodeString(&ErrorMsg);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* Call DrvEnableDriver */
|
||||
/* FIXME: we should only call this once, so the data should be stored in
|
||||
* DRIVER funcs */
|
||||
RtlZeroMemory(&gDED, sizeof(gDED));
|
||||
if (!GDEnableDriver(DDI_DRIVER_VERSION, sizeof(gDED), &gDED))
|
||||
{
|
||||
DbgPrint("DrvEnableDriver failed\n");
|
||||
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
/* Allocate a phyical device handle from the driver */
|
||||
/* FIXME: get mode selection information from somewhere */
|
||||
if (Device != NULL)
|
||||
{
|
||||
wcsncpy(gDMW.dmDeviceName, Device, DMMAXDEVICENAME);
|
||||
}
|
||||
gSurfaceDC.DMW.dmSize = sizeof(gSurfaceDC.DMW);
|
||||
gSurfaceDC.DMW.dmFields = 0x000fc000;
|
||||
gSurfaceDC.DMW.dmLogPixels = 96;
|
||||
gSurfaceDC.DMW.BitsPerPel = 8;
|
||||
gSurfaceDC.DMW.dmPelsWidth = 640;
|
||||
gSurfaceDC.DMW.dmPelsHeight = 480;
|
||||
gSurfaceDC.DMW.dmDisplayFlags = 0;
|
||||
gSurfaceDC.DMW.dmDisplayFrequency = 0;
|
||||
/* FIXME: get the function pointer from the DED struct */
|
||||
gSurfaceDC.PDev = GDEnablePDEV(&NewDC->DMW,
|
||||
L"",
|
||||
HS_DDI_MAX,
|
||||
NewDC->FillPatternSurfaces,
|
||||
sizeof(NewDC->GDIInfo),
|
||||
&NewDC->GDIInfo,
|
||||
sizeof(NewDC->DevInfo),
|
||||
&NewDC->DevInfo,
|
||||
NULL,
|
||||
L"",
|
||||
NewDC->DeviceDriver);
|
||||
if (NewDC->PDev == NULL)
|
||||
{
|
||||
DbgPrint("DrvEnablePDEV failed\n");
|
||||
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
/* FIXME: get func pointer from DED */
|
||||
GDCompletePDEV(NewDC->PDev, NewDC);
|
||||
|
||||
/* FIXME: get func pointer from DED */
|
||||
NewDC->Surface = GDEnableSurface(NewDC->PDev);
|
||||
*DC = NewDC;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS W32kDeleteDC(HDC DC)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
|
@ -2,313 +2,397 @@
|
|||
* Entry Point for win32k.sys
|
||||
*/
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/winddi.h>
|
||||
#include <internal/service.h>
|
||||
#include <internal/hal.h>
|
||||
|
||||
#if 0
|
||||
#include "win32k/vectors.h"
|
||||
#include <win32k/dc.h>
|
||||
#include <win32k/bitmaps.h>
|
||||
#include <win32k/brush.h>
|
||||
|
||||
PFN Win32kVectors[] =
|
||||
SERVICE_TABLE W32kServiceTable[] =
|
||||
{
|
||||
(PFN) W32kAbortDoc,
|
||||
(PFN) W32kAbortPath,
|
||||
(PFN) W32kAddFontResource,
|
||||
(PFN) W32kAngleArc,
|
||||
(PFN) W32kAnimatePalette,
|
||||
(PFN) W32kArc,
|
||||
(PFN) W32kArcTo,
|
||||
(PFN) W32kBeginPath,
|
||||
(PFN) W32kBitBlt,
|
||||
(PFN) W32kCancelDC,
|
||||
(PFN) W32kCheckColorsInGamut,
|
||||
(PFN) W32kChoosePixelFormat,
|
||||
(PFN) W32kChord,
|
||||
(PFN) W32kCloseEnhMetaFile,
|
||||
(PFN) W32kCloseFigure,
|
||||
(PFN) W32kCloseMetaFile,
|
||||
(PFN) W32kColorMatchToTarget,
|
||||
(PFN) W32kCombineRgn,
|
||||
(PFN) W32kCombineTransform,
|
||||
(PFN) W32kCopyEnhMetaFile,
|
||||
(PFN) W32kCopyMetaFile,
|
||||
(PFN) W32kCreateBitmap,
|
||||
(PFN) W32kCreateBitmapIndirect,
|
||||
(PFN) W32kCreateBrushIndirect,
|
||||
(PFN) W32kCreateColorSpace,
|
||||
(PFN) W32kCreateCompatibleBitmap,
|
||||
(PFN) W32kCreateCompatibleDC,
|
||||
(PFN) W32kCreateDC,
|
||||
(PFN) W32kCreateDIBPatternBrush,
|
||||
(PFN) W32kCreateDIBPatternBrushPt,
|
||||
(PFN) W32kCreateDIBSection,
|
||||
(PFN) W32kCreateDIBitmap,
|
||||
(PFN) W32kCreateDiscardableBitmap,
|
||||
(PFN) W32kCreateEllipticRgn,
|
||||
(PFN) W32kCreateEllipticRgnIndirect,
|
||||
(PFN) W32kCreateEnhMetaFile,
|
||||
(PFN) W32kCreateFontIndirect,
|
||||
(PFN) W32kCreateFont,
|
||||
(PFN) W32kCreateHalftonePalette,
|
||||
(PFN) W32kCreateHatchBrush,
|
||||
(PFN) W32kCreateIC,
|
||||
(PFN) W32kCreateMetaFile,
|
||||
(PFN) W32kCreatePalette,
|
||||
(PFN) W32kCreatePatternBrush,
|
||||
(PFN) W32kCreatePen,
|
||||
(PFN) W32kCreatePenIndirect,
|
||||
(PFN) W32kCreatePolyPolygonRgn,
|
||||
(PFN) W32kCreatePolygonRgn,
|
||||
(PFN) W32kCreateRectRgn,
|
||||
(PFN) W32kCreateRectRgnIndirect,
|
||||
(PFN) W32kCreateRoundRectRgn,
|
||||
(PFN) W32kCreateScalableFontResource,
|
||||
(PFN) W32kCreateSolidBrush,
|
||||
(PFN) W32kDPtoLP,
|
||||
(PFN) W32kDeleteColorSpace,
|
||||
(PFN) W32kDeleteDC,
|
||||
(PFN) W32kDeleteEnhMetaFile,
|
||||
(PFN) W32kDeleteMetaFile,
|
||||
(PFN) W32kDeleteObject,
|
||||
(PFN) W32kDescribePixelFormat,
|
||||
(PFN) W32kDeviceCapabilitiesEx,
|
||||
(PFN) W32kDrawEscape,
|
||||
(PFN) W32kEllipse,
|
||||
(PFN) W32kEndDoc,
|
||||
(PFN) W32kEndPage,
|
||||
(PFN) W32kEndPath,
|
||||
(PFN) W32kEnumEnhMetaFile,
|
||||
(PFN) W32kEnumFontFamiliesEx,
|
||||
(PFN) W32kEnumFontFamilies,
|
||||
(PFN) W32kEnumFonts,
|
||||
(PFN) W32kEnumICMProfiles,
|
||||
(PFN) W32kEnumMetaFile,
|
||||
(PFN) W32kEnumObjects,
|
||||
(PFN) W32kEqualRgn,
|
||||
(PFN) W32kEscape,
|
||||
(PFN) W32kExcludeClipRect,
|
||||
(PFN) W32kExtCreatePen,
|
||||
(PFN) W32kExtCreateRegion,
|
||||
(PFN) W32kExtEscape,
|
||||
(PFN) W32kExtFloodFill,
|
||||
(PFN) W32kExtSelectClipRgn,
|
||||
(PFN) W32kExtTextOut,
|
||||
(PFN) W32kFillPath,
|
||||
(PFN) W32kFillRgn,
|
||||
(PFN) W32kFixBrushOrgEx,
|
||||
(PFN) W32kFlattenPath,
|
||||
(PFN) W32kFloodFill,
|
||||
(PFN) W32kFrameRgn,
|
||||
(PFN) W32kGdiComment,
|
||||
(PFN) W32kGdiFlush,
|
||||
(PFN) W32kGdiGetBatchLimit,
|
||||
(PFN) W32kGdiPlayDCScript,
|
||||
(PFN) W32kGdiPlayJournal,
|
||||
(PFN) W32kGdiPlayScript,
|
||||
(PFN) W32kGdiSetBatchLimit,
|
||||
(PFN) W32kGetArcDirection,
|
||||
(PFN) W32kGetAspectRatioFilterEx,
|
||||
(PFN) W32kGetBitmapBits,
|
||||
(PFN) W32kGetBitmapDimensionEx,
|
||||
(PFN) W32kGetBkColor,
|
||||
(PFN) W32kGetBkMode,
|
||||
(PFN) W32kGetBoundsRect,
|
||||
(PFN) W32kGetBrushOrgEx,
|
||||
(PFN) W32kGetCharABCWidthsFloat,
|
||||
(PFN) W32kGetCharABCWidths,
|
||||
(PFN) W32kGetCharWidth32,
|
||||
(PFN) W32kGetCharWidthFloat,
|
||||
(PFN) W32kGetCharWidth,
|
||||
(PFN) W32kGetCharacterPlacement,
|
||||
(PFN) W32kGetClipBox,
|
||||
(PFN) W32kGetClipRgn,
|
||||
(PFN) W32kGetColorAdjustment,
|
||||
(PFN) W32kGetColorSpace,
|
||||
(PFN) W32kGetCurrentObject,
|
||||
(PFN) W32kGetCurrentPositionEx,
|
||||
(PFN) W32kGetDCOrgEx,
|
||||
(PFN) W32kGetDIBColorTable,
|
||||
(PFN) W32kGetDIBits,
|
||||
(PFN) W32kGetDeviceCaps,
|
||||
(PFN) W32kGetDeviceGammaRamp,
|
||||
(PFN) W32kGetEnhMetaFileBits,
|
||||
(PFN) W32kGetEnhMetaFileDescription,
|
||||
(PFN) W32kGetEnhMetaFileHeader,
|
||||
(PFN) W32kGetEnhMetaFilePaletteEntries,
|
||||
(PFN) W32kGetEnhMetaFilePixelFormat,
|
||||
(PFN) W32kGetEnhMetaFile,
|
||||
(PFN) W32kGetFontLanguageInfo,
|
||||
(PFN) W32kGetFontResourceInfo,
|
||||
(PFN) W32kGetGlyphOutline,
|
||||
(PFN) W32kGetGlyphOutlineWow,
|
||||
(PFN) W32kGetGraphicsMode,
|
||||
(PFN) W32kGetICMProfile,
|
||||
(PFN) W32kGetKerningPairs,
|
||||
(PFN) W32kGetLogColorSpace,
|
||||
(PFN) W32kGetMapMode,
|
||||
(PFN) W32kGetMetaFileBitsEx,
|
||||
(PFN) W32kGetMetaFile,
|
||||
(PFN) W32kGetMetaRgn,
|
||||
(PFN) W32kGetMiterLimit,
|
||||
(PFN) W32kGetNearestColor,
|
||||
(PFN) W32kGetNearestPaletteIndex,
|
||||
(PFN) W32kGetObjectType,
|
||||
(PFN) W32kGetObject,
|
||||
(PFN) W32kGetOutlineTextMetrics,
|
||||
(PFN) W32kGetPaletteEntries,
|
||||
(PFN) W32kGetPath,
|
||||
(PFN) W32kGetPixel,
|
||||
(PFN) W32kGetPixelFormat,
|
||||
(PFN) W32kGetPolyFillMode,
|
||||
(PFN) W32kGetROP2,
|
||||
(PFN) W32kGetRandomRgn,
|
||||
(PFN) W32kGetRasterizerCaps,
|
||||
(PFN) W32kGetRelAbs,
|
||||
(PFN) W32kGetRgnBox,
|
||||
(PFN) W32kGetStockObject,
|
||||
(PFN) W32kGetStretchBltMode,
|
||||
(PFN) W32kGetSystemPaletteEntries,
|
||||
(PFN) W32kGetSystemPaletteUse,
|
||||
(PFN) W32kGetTextAlign,
|
||||
(PFN) W32kGetTextCharset,
|
||||
(PFN) W32kGetTextCharsetInfo,
|
||||
(PFN) W32kGetTextColor,
|
||||
(PFN) W32kGetTextExtentExPoint,
|
||||
(PFN) W32kGetTextExtentPoint32,
|
||||
(PFN) W32kGetTextExtentPoint,
|
||||
(PFN) W32kGetTextFace,
|
||||
(PFN) W32kGetTextMetrics,
|
||||
(PFN) W32kGetViewportExtEx,
|
||||
(PFN) W32kGetViewportOrgEx,
|
||||
(PFN) W32kGetWinMetaFileBits,
|
||||
(PFN) W32kGetWindowExtEx,
|
||||
(PFN) W32kGetWindowOrgEx,
|
||||
(PFN) W32kGetWorldTransform,
|
||||
(PFN) W32kIntersectClipRect,
|
||||
(PFN) W32kInvertRgn,
|
||||
(PFN) W32kLPtoDP,
|
||||
(PFN) W32kLineTo,
|
||||
(PFN) W32kMaskBlt,
|
||||
(PFN) W32kModifyWorldTransform,
|
||||
(PFN) W32kMoveToEx,
|
||||
(PFN) W32kOffsetClipRgn,
|
||||
(PFN) W32kOffsetRgn,
|
||||
(PFN) W32kOffsetViewportOrgEx,
|
||||
(PFN) W32kOffsetWindowOrgEx,
|
||||
(PFN) W32kPaintRgn,
|
||||
(PFN) W32kPatBlt,
|
||||
(PFN) W32kPathToRegion,
|
||||
(PFN) W32kPie,
|
||||
(PFN) W32kPlayEnhMetaFile,
|
||||
(PFN) W32kPlayEnhMetaFileRecord,
|
||||
(PFN) W32kPlayMetaFile,
|
||||
(PFN) W32kPlayMetaFileRecord,
|
||||
(PFN) W32kPlgBlt,
|
||||
(PFN) W32kPolyBezier,
|
||||
(PFN) W32kPolyBezierTo,
|
||||
(PFN) W32kPolyDraw,
|
||||
(PFN) W32kPolyPolygon,
|
||||
(PFN) W32kPolyPolyline,
|
||||
(PFN) W32kPolyTextOut,
|
||||
(PFN) W32kPolygon,
|
||||
(PFN) W32kPolyline,
|
||||
(PFN) W32kPolylineTo,
|
||||
(PFN) W32kPtInRegion,
|
||||
(PFN) W32kPtVisible,
|
||||
(PFN) W32kRealizePalette,
|
||||
(PFN) W32kRectInRegion,
|
||||
(PFN) W32kRectVisible,
|
||||
(PFN) W32kRectangle,
|
||||
(PFN) W32kRemoveFontResource,
|
||||
(PFN) W32kResetDC,
|
||||
(PFN) W32kResizePalette,
|
||||
(PFN) W32kRestoreDC,
|
||||
(PFN) W32kRoundRect,
|
||||
(PFN) W32kSaveDC,
|
||||
(PFN) W32kScaleViewportExtEx,
|
||||
(PFN) W32kScaleWindowExtEx,
|
||||
(PFN) W32kSelectBrushLocal,
|
||||
(PFN) W32kSelectClipPath,
|
||||
(PFN) W32kSelectClipRgn,
|
||||
(PFN) W32kSelectFontLocal,
|
||||
(PFN) W32kSelectObject,
|
||||
(PFN) W32kSelectPalette,
|
||||
(PFN) W32kSetAbortProc,
|
||||
(PFN) W32kSetArcDirection,
|
||||
(PFN) W32kSetBitmapBits,
|
||||
(PFN) W32kSetBitmapDimensionEx,
|
||||
(PFN) W32kSetBkColor,
|
||||
(PFN) W32kSetBkMode,
|
||||
(PFN) W32kSetBoundsRect,
|
||||
(PFN) W32kSetBrushOrgEx,
|
||||
(PFN) W32kSetColorAdjustment,
|
||||
(PFN) W32kSetColorSpace,
|
||||
(PFN) W32kSetDIBColorTable,
|
||||
(PFN) W32kSetDIBits,
|
||||
(PFN) W32kSetDIBitsToDevice,
|
||||
(PFN) W32kSetDeviceGammaRamp,
|
||||
(PFN) W32kSetEnhMetaFileBits,
|
||||
(PFN) W32kSetFontEnumeration,
|
||||
(PFN) W32kSetGraphicsMode,
|
||||
(PFN) W32kSetICMMode,
|
||||
(PFN) W32kSetICMProfile,
|
||||
(PFN) W32kSetMapMode,
|
||||
(PFN) W32kSetMapperFlags,
|
||||
(PFN) W32kSetMetaFileBitsEx,
|
||||
(PFN) W32kSetMetaRgn,
|
||||
(PFN) W32kSetMiterLimit,
|
||||
(PFN) W32kSetPaletteEntries,
|
||||
(PFN) W32kSetPixel,
|
||||
(PFN) W32kSetPixelFormat,
|
||||
(PFN) W32kSetPixelV,
|
||||
(PFN) W32kSetPolyFillMode,
|
||||
(PFN) W32kSetROP2,
|
||||
(PFN) W32kSetRectRgn,
|
||||
(PFN) W32kSetRelAbs,
|
||||
(PFN) W32kSetStretchBltMode,
|
||||
(PFN) W32kSetSystemPaletteUse,
|
||||
(PFN) W32kSetTextAlign,
|
||||
(PFN) W32kSetTextColor,
|
||||
(PFN) W32kSetTextJustification,
|
||||
(PFN) W32kSetViewportExtEx,
|
||||
(PFN) W32kSetViewportOrgEx,
|
||||
(PFN) W32kSetWinMetaFileBits,
|
||||
(PFN) W32kSetWindowExtEx,
|
||||
(PFN) W32kSetWindowOrgEx,
|
||||
(PFN) W32kSetWorldTransform,
|
||||
(PFN) W32kStartDoc,
|
||||
(PFN) W32kStartPage,
|
||||
(PFN) W32kStretchBlt,
|
||||
(PFN) W32kStretchDIBits,
|
||||
(PFN) W32kStrokeAndFillPath,
|
||||
(PFN) W32kStrokePath,
|
||||
(PFN) W32kSwapBuffers,
|
||||
(PFN) W32kTextOut,
|
||||
(PFN) W32kTranslateCharsetInfo,
|
||||
(PFN) W32kUnrealizeObject,
|
||||
(PFN) W32kUpdateColors,
|
||||
(PFN) W32kUpdateICMRegKey,
|
||||
(PFN) W32kWidenPath,
|
||||
(PFN) W32kgdiPlaySpoolStream
|
||||
#if 0
|
||||
{?, (ULONG) W32kAbortDoc},
|
||||
{?, (ULONG) W32kAbortPath},
|
||||
{?, (ULONG) W32kAddFontResource},
|
||||
{?, (ULONG) W32kAngleArc},
|
||||
{?, (ULONG) W32kAnimatePalette},
|
||||
{?, (ULONG) W32kArc},
|
||||
{?, (ULONG) W32kArcTo},
|
||||
{?, (ULONG) W32kBeginPath},
|
||||
#endif
|
||||
{36, (ULONG) W32kBitBlt},
|
||||
{4, (ULONG) W32kCancelDC},
|
||||
#if 0
|
||||
{?, (ULONG) W32kCheckColorsInGamut},
|
||||
{?, (ULONG) W32kChoosePixelFormat},
|
||||
{?, (ULONG) W32kChord},
|
||||
{?, (ULONG) W32kCloseEnhMetaFile},
|
||||
{?, (ULONG) W32kCloseFigure},
|
||||
{?, (ULONG) W32kCloseMetaFile},
|
||||
{?, (ULONG) W32kColorMatchToTarget},
|
||||
{?, (ULONG) W32kCombineRgn},
|
||||
{?, (ULONG) W32kCombineTransform},
|
||||
{?, (ULONG) W32kCopyEnhMetaFile},
|
||||
{?, (ULONG) W32kCopyMetaFile},
|
||||
#endif
|
||||
{20, (ULONG) W32kCreateBitmap},
|
||||
{4, (ULONG) W32kCreateBitmapIndirect},
|
||||
{4, (ULONG) W32kCreateBrushIndirect},
|
||||
#if 0
|
||||
{?, (ULONG) W32kCreateColorSpace},
|
||||
{?, (ULONG) W32kCreateCompatibleBitmap},
|
||||
#endif
|
||||
{4, (ULONG) W32kCreateCompatableDC},
|
||||
{16, (ULONG) W32kCreateDC},
|
||||
{24, (ULONG) W32kCreateDIBitmap},
|
||||
{8, (ULONG) W32kCreateDIBPatternBrush},
|
||||
{8, (ULONG) W32kCreateDIBPatternBrushPt},
|
||||
{24, (ULONG) W32kCreateDIBSection},
|
||||
{12, (ULONG) W32kCreateDiscardableBitmap},
|
||||
#if 0
|
||||
{?, (ULONG) W32kCreateEllipticRgn},
|
||||
{?, (ULONG) W32kCreateEllipticRgnIndirect},
|
||||
{?, (ULONG) W32kCreateEnhMetaFile},
|
||||
{?, (ULONG) W32kCreateFontIndirect},
|
||||
{?, (ULONG) W32kCreateFont},
|
||||
{?, (ULONG) W32kCreateHalftonePalette},
|
||||
#endif
|
||||
{8, (ULONG) W32kCreateHatchBrush},
|
||||
#if 0
|
||||
{?, (ULONG) W32kCreateIC},
|
||||
{?, (ULONG) W32kCreateMetaFile},
|
||||
{?, (ULONG) W32kCreatePalette},
|
||||
#endif
|
||||
{4, (ULONG) W32kCreatePatternBrush},
|
||||
#if 0
|
||||
{?, (ULONG) W32kCreatePen},
|
||||
{?, (ULONG) W32kCreatePenIndirect},
|
||||
{?, (ULONG) W32kCreatePolyPolygonRgn},
|
||||
{?, (ULONG) W32kCreatePolygonRgn},
|
||||
{?, (ULONG) W32kCreateRectRgn},
|
||||
{?, (ULONG) W32kCreateRectRgnIndirect},
|
||||
{?, (ULONG) W32kCreateRoundRectRgn},
|
||||
{?, (ULONG) W32kCreateScalableFontResource},
|
||||
#endif
|
||||
{4, (ULONG) W32kCreateSolidBrush},
|
||||
#if 0
|
||||
{?, (ULONG) W32kDPtoLP},
|
||||
{?, (ULONG) W32kDeleteColorSpace},
|
||||
#endif
|
||||
{4, (ULONG) W32kDeleteDC},
|
||||
#if 0
|
||||
{?, (ULONG) W32kDeleteEnhMetaFile},
|
||||
{?, (ULONG) W32kDeleteMetaFile},
|
||||
{?, (ULONG) W32kDeleteObject},
|
||||
{?, (ULONG) W32kDescribePixelFormat},
|
||||
{?, (ULONG) W32kDeviceCapabilitiesEx},
|
||||
#endif
|
||||
{16, (ULONG) W32kDrawEscape},
|
||||
#if 0
|
||||
{?, (ULONG) W32kEllipse},
|
||||
{?, (ULONG) W32kEndDoc},
|
||||
{?, (ULONG) W32kEndPage},
|
||||
{?, (ULONG) W32kEndPath},
|
||||
{?, (ULONG) W32kEnumEnhMetaFile},
|
||||
{?, (ULONG) W32kEnumFontFamiliesEx},
|
||||
{?, (ULONG) W32kEnumFontFamilies},
|
||||
{?, (ULONG) W32kEnumFonts},
|
||||
{?, (ULONG) W32kEnumICMProfiles},
|
||||
{?, (ULONG) W32kEnumMetaFile},
|
||||
#endif
|
||||
{16, (ULONG) W32kEnumObjects},
|
||||
#if 0
|
||||
{?, (ULONG) W32kEqualRgn},
|
||||
{?, (ULONG) W32kEscape},
|
||||
{?, (ULONG) W32kExcludeClipRect},
|
||||
{?, (ULONG) W32kExtCreatePen},
|
||||
{?, (ULONG) W32kExtCreateRegion},
|
||||
{?, (ULONG) W32kExtEscape},
|
||||
#endif
|
||||
{20, (ULONG) W32kExtFloodFill},
|
||||
#if 0
|
||||
{?, (ULONG) W32kExtSelectClipRgn},
|
||||
{?, (ULONG) W32kExtTextOut},
|
||||
{?, (ULONG) W32kFillPath},
|
||||
{?, (ULONG) W32kFillRgn},
|
||||
#endif
|
||||
{0, (ULONG) W32kFixBrushOrgEx},
|
||||
#if 0
|
||||
{?, (ULONG) W32kFlattenPath},
|
||||
#endif
|
||||
{16, (ULONG) W32kFloodFill},
|
||||
#if 0
|
||||
{?, (ULONG) W32kFrameRgn},
|
||||
{?, (ULONG) W32kGdiComment},
|
||||
{?, (ULONG) W32kGdiFlush},
|
||||
{?, (ULONG) W32kGdiGetBatchLimit},
|
||||
{?, (ULONG) W32kGdiPlayDCScript},
|
||||
{?, (ULONG) W32kGdiPlayJournal},
|
||||
{?, (ULONG) W32kGdiPlayScript},
|
||||
{?, (ULONG) W32kGdiSetBatchLimit},
|
||||
{?, (ULONG) W32kGetArcDirection},
|
||||
{?, (ULONG) W32kGetAspectRatioFilterEx},
|
||||
#endif
|
||||
{12, (ULONG) W32kGetBitmapBits},
|
||||
{8, (ULONG) W32kGetBitmapDimensionEx},
|
||||
{4, (ULONG) W32kGetBkColor},
|
||||
{4, (ULONG) W32kGetBkMode},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetBoundsRect},
|
||||
#endif
|
||||
{8, (ULONG) W32kGetBrushOrgEx},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetCharABCWidthsFloat},
|
||||
{?, (ULONG) W32kGetCharABCWidths},
|
||||
{?, (ULONG) W32kGetCharWidth32},
|
||||
{?, (ULONG) W32kGetCharWidthFloat},
|
||||
{?, (ULONG) W32kGetCharWidth},
|
||||
{?, (ULONG) W32kGetCharacterPlacement},
|
||||
{?, (ULONG) W32kGetClipBox},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetClipRgn},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetColorAdjustment},
|
||||
{?, (ULONG) W32kGetColorSpace},
|
||||
#endif
|
||||
{8, (ULONG) W32kGetCurrentObject},
|
||||
{8, (ULONG) W32kGetCurrentPositionEx},
|
||||
{8, (ULONG) W32kGetDCOrgEx},
|
||||
{16, (ULONG) W32kGetDIBColorTable},
|
||||
{28, (ULONG) W32kGetDIBits},
|
||||
{8, (ULONG) W32kGetDeviceCaps},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetDeviceGammaRamp},
|
||||
{?, (ULONG) W32kGetEnhMetaFileBits},
|
||||
{?, (ULONG) W32kGetEnhMetaFileDescription},
|
||||
{?, (ULONG) W32kGetEnhMetaFileHeader},
|
||||
{?, (ULONG) W32kGetEnhMetaFilePaletteEntries},
|
||||
{?, (ULONG) W32kGetEnhMetaFilePixelFormat},
|
||||
{?, (ULONG) W32kGetEnhMetaFile},
|
||||
{?, (ULONG) W32kGetFontLanguageInfo},
|
||||
{?, (ULONG) W32kGetFontResourceInfo},
|
||||
{?, (ULONG) W32kGetGlyphOutline},
|
||||
{?, (ULONG) W32kGetGlyphOutlineWow},
|
||||
{?, (ULONG) W32kGetGraphicsMode},
|
||||
{?, (ULONG) W32kGetICMProfile},
|
||||
{?, (ULONG) W32kGetKerningPairs},
|
||||
{?, (ULONG) W32kGetLogColorSpace},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetMapMode},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetMetaFileBitsEx},
|
||||
{?, (ULONG) W32kGetMetaFile},
|
||||
{?, (ULONG) W32kGetMetaRgn},
|
||||
{?, (ULONG) W32kGetMiterLimit},
|
||||
{?, (ULONG) W32kGetNearestColor},
|
||||
{?, (ULONG) W32kGetNearestPaletteIndex},
|
||||
{?, (ULONG) W32kGetObject},
|
||||
{?, (ULONG) W32kGetObjectType},
|
||||
{?, (ULONG) W32kGetOutlineTextMetrics},
|
||||
{?, (ULONG) W32kGetPaletteEntries},
|
||||
{?, (ULONG) W32kGetPath},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetPixel},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetPixelFormat},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetPolyFillMode},
|
||||
{4, (ULONG) W32kGetROP2},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetRandomRgn},
|
||||
{?, (ULONG) W32kGetRasterizerCaps},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetRelAbs},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetRgnBox},
|
||||
{?, (ULONG) W32kGetStockObject},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetStretchBltMode},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetSystemPaletteEntries},
|
||||
{?, (ULONG) W32kGetSystemPaletteUse},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetTextAlign},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetTextCharset},
|
||||
{?, (ULONG) W32kGetTextCharsetInfo},
|
||||
#endif
|
||||
{4, (ULONG) W32kGetTextColor},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetTextExtentExPoint},
|
||||
{?, (ULONG) W32kGetTextExtentPoint32},
|
||||
{?, (ULONG) W32kGetTextExtentPoint},
|
||||
{?, (ULONG) W32kGetTextFace},
|
||||
{?, (ULONG) W32kGetTextMetrics},
|
||||
#endif
|
||||
{8, (ULONG) W32kGetViewportExtEx},
|
||||
{8, (ULONG) W32kGetViewportOrgEx},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetWinMetaFileBits},
|
||||
#endif
|
||||
{8, (ULONG) W32kGetWindowExtEx},
|
||||
{8, (ULONG) W32kGetWindowOrgEx},
|
||||
#if 0
|
||||
{?, (ULONG) W32kGetWorldTransform},
|
||||
{?, (ULONG) W32kIntersectClipRect},
|
||||
{?, (ULONG) W32kInvertRgn},
|
||||
{?, (ULONG) W32kLPtoDP},
|
||||
{?, (ULONG) W32kLineTo},
|
||||
#endif
|
||||
{48, (ULONG) W32kMaskBlt},
|
||||
#if 0
|
||||
{?, (ULONG) W32kModifyWorldTransform},
|
||||
{?, (ULONG) W32kMoveToEx},
|
||||
{?, (ULONG) W32kOffsetClipRgn},
|
||||
{?, (ULONG) W32kOffsetRgn},
|
||||
{?, (ULONG) W32kOffsetViewportOrgEx},
|
||||
{?, (ULONG) W32kOffsetWindowOrgEx},
|
||||
{?, (ULONG) W32kPaintRgn},
|
||||
#endif
|
||||
{24, (ULONG) W32kPatBlt},
|
||||
#if 0
|
||||
{?, (ULONG) W32kPathToRegion},
|
||||
{?, (ULONG) W32kPie},
|
||||
{?, (ULONG) W32kPlayEnhMetaFile},
|
||||
{?, (ULONG) W32kPlayEnhMetaFileRecord},
|
||||
{?, (ULONG) W32kPlayMetaFile},
|
||||
{?, (ULONG) W32kPlayMetaFileRecord},
|
||||
#endif
|
||||
{40, (ULONG) W32kPlgBlt},
|
||||
#if 0
|
||||
{?, (ULONG) W32kPolyBezier},
|
||||
{?, (ULONG) W32kPolyBezierTo},
|
||||
{?, (ULONG) W32kPolyDraw},
|
||||
{?, (ULONG) W32kPolyPolygon},
|
||||
{?, (ULONG) W32kPolyPolyline},
|
||||
{?, (ULONG) W32kPolyTextOut},
|
||||
{?, (ULONG) W32kPolygon},
|
||||
{?, (ULONG) W32kPolyline},
|
||||
{?, (ULONG) W32kPolylineTo},
|
||||
{?, (ULONG) W32kPtInRegion},
|
||||
{?, (ULONG) W32kPtVisible},
|
||||
{?, (ULONG) W32kRealizePalette},
|
||||
{?, (ULONG) W32kRectInRegion},
|
||||
{?, (ULONG) W32kRectVisible},
|
||||
{?, (ULONG) W32kRectangle},
|
||||
{?, (ULONG) W32kRemoveFontResource},
|
||||
#endif
|
||||
{8, (ULONG) W32kResetDC},
|
||||
#if 0
|
||||
{?, (ULONG) W32kResizePalette},
|
||||
#endif
|
||||
{8, (ULONG) W32kRestoreDC},
|
||||
#if 0
|
||||
{?, (ULONG) W32kRoundRect},
|
||||
#endif
|
||||
{4, (ULONG) W32kSaveDC},
|
||||
#if 0
|
||||
{?, (ULONG) W32kScaleViewportExtEx},
|
||||
{?, (ULONG) W32kScaleWindowExtEx},
|
||||
{?, (ULONG) W32kSelectBrushLocal},
|
||||
{?, (ULONG) W32kSelectClipPath},
|
||||
{?, (ULONG) W32kSelectClipRgn},
|
||||
{?, (ULONG) W32kSelectFontLocal},
|
||||
#endif
|
||||
{8, (ULONG) W32kSelectObject},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSelectPalette},
|
||||
{?, (ULONG) W32kSetAbortProc},
|
||||
{?, (ULONG) W32kSetArcDirection},
|
||||
#endif
|
||||
{12, (ULONG) W32kSetBitmapBits},
|
||||
{16, (ULONG) W32kSetBitmapDimensionEx},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetBkColor},
|
||||
#endif
|
||||
{8, (ULONG) W32kSetBkMode},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetBoundsRect},
|
||||
#endif
|
||||
{16, (ULONG) W32kSetBrushOrgEx},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetColorAdjustment},
|
||||
{?, (ULONG) W32kSetColorSpace},
|
||||
#endif
|
||||
{16, (ULONG) W32kSetDIBColorTable},
|
||||
{28, (ULONG) W32kSetDIBits},
|
||||
{48, (ULONG) W32kSetDIBitsToDevice},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetDeviceGammaRamp},
|
||||
{?, (ULONG) W32kSetEnhMetaFileBits},
|
||||
{?, (ULONG) W32kSetFontEnumeration},
|
||||
{?, (ULONG) W32kSetGraphicsMode},
|
||||
{?, (ULONG) W32kSetICMMode},
|
||||
{?, (ULONG) W32kSetICMProfile},
|
||||
{?, (ULONG) W32kSetMapMode},
|
||||
{?, (ULONG) W32kSetMapperFlags},
|
||||
{?, (ULONG) W32kSetMetaFileBitsEx},
|
||||
{?, (ULONG) W32kSetMetaRgn},
|
||||
{?, (ULONG) W32kSetMiterLimit},
|
||||
{?, (ULONG) W32kSetPaletteEntries},
|
||||
#endif
|
||||
{16, (ULONG) W32kSetPixel},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetPixelFormat},
|
||||
#endif
|
||||
{16, (ULONG) W32kSetPixelV},
|
||||
{8, (ULONG) W32kSetPolyFillMode},
|
||||
{8, (ULONG) W32kSetROP2},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetRectRgn},
|
||||
#endif
|
||||
// {8, (ULONG) W32kSetRelAbs},
|
||||
{8, (ULONG) W32kSetStretchBltMode},
|
||||
#if 0
|
||||
{?, (ULONG) W32kSetSystemPaletteUse},
|
||||
{?, (ULONG) W32kSetTextAlign},
|
||||
{?, (ULONG) W32kSetTextColor},
|
||||
{?, (ULONG) W32kSetTextJustification},
|
||||
{?, (ULONG) W32kSetViewportExtEx},
|
||||
{?, (ULONG) W32kSetViewportOrgEx},
|
||||
{?, (ULONG) W32kSetWinMetaFileBits},
|
||||
{?, (ULONG) W32kSetWindowExtEx},
|
||||
{?, (ULONG) W32kSetWindowOrgEx},
|
||||
{?, (ULONG) W32kSetWorldTransform},
|
||||
{?, (ULONG) W32kStartDoc},
|
||||
{?, (ULONG) W32kStartPage},
|
||||
#endif
|
||||
{44, (ULONG) W32kStretchBlt},
|
||||
{52, (ULONG) W32kStretchDIBits},
|
||||
#if 0
|
||||
{?, (ULONG) W32kStrokeAndFillPath},
|
||||
{?, (ULONG) W32kStrokePath},
|
||||
{?, (ULONG) W32kSwapBuffers},
|
||||
{?, (ULONG) W32kTextOut},
|
||||
{?, (ULONG) W32kTranslateCharsetInfo},
|
||||
{?, (ULONG) W32kUnrealizeObject},
|
||||
{?, (ULONG) W32kUpdateColors},
|
||||
{?, (ULONG) W32kUpdateICMRegKey},
|
||||
{?, (ULONG) W32kWidenPath},
|
||||
{?, (ULONG) W32kgdiPlaySpoolStream},
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
WINBOOL STDCALL DllMain(HANDLE hInst,
|
||||
ULONG ul_reason_for_call,
|
||||
LPVOID lpReserved)
|
||||
WINBOOL STDCALL DllMain(VOID)
|
||||
{
|
||||
DbgPrint("win32k:DllMain(hInst %x, ul_reason_for_call %d)\n",
|
||||
hInst,
|
||||
ul_reason_for_call);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PVOID W32kGetVectors(VOID)
|
||||
{
|
||||
DbgPrint("Unimplemented\n");
|
||||
return 0;
|
||||
#if 0
|
||||
return Win32kVectors;
|
||||
#endif
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Register user mode call interface (svc mask is 0x10000000) */
|
||||
Status = HalRegisterServiceTable(0xF0000000,
|
||||
0x10000000,
|
||||
W32kServiceTable,
|
||||
sizeof(W32kServiceTable) /
|
||||
sizeof(W32kServiceTable[0]));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
#
|
||||
|
||||
MAIN_OBJECTS = main/dllmain.o
|
||||
STUBS_OBJECTS = stubs/stubs.o
|
||||
MISC_OBJECTS = misc/driver.o
|
||||
OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/dc.o
|
||||
RESOURCE_OBJECT = win32k.coff
|
||||
OBJECTS = $(MAIN_OBJECTS) $(STUBS_OBJECTS) $(RESOURCE_OBJECT)
|
||||
STUBS_OBJECTS = stubs/stubs.o
|
||||
|
||||
OBJECTS = $(MAIN_OBJECTS) $(MISC_OBJECTS) $(OBJECTS_OBJECTS) \
|
||||
$(RESOURCE_OBJECT) $(STUBS_OBJECTS)
|
||||
|
||||
all: win32k.sys
|
||||
|
||||
|
@ -13,11 +17,11 @@ win32k.coff: win32k.rc ../../include/reactos/resource.h
|
|||
$(RC) win32k.rc win32k.coff
|
||||
|
||||
ifeq ($(DOSCLI),yes)
|
||||
CLEAN_FILES = main\*.o stubs\*.o win32k.coff win32k.o win32k.a junk.tmp base.tmp \
|
||||
temp.exp win32k.sys win32k.sym
|
||||
CLEAN_FILES = main\*.o misc\*.o stubs\*.o objects\*.o win32k.coff win32k.o \
|
||||
win32k.a junk.tmp base.tmp temp.exp win32k.sys win32k.sym
|
||||
else
|
||||
CLEAN_FILES = main/*.o stubs/*.o win32k.coff win32k.o win32k.a junk.tmp base.tmp \
|
||||
temp.exp win32k.sys win32k.sym
|
||||
CLEAN_FILES = main/*.o misc/*.o stubs/*.o objects/*.o win32k.coff win32k.o \
|
||||
win32k.a junk.tmp base.tmp temp.exp win32k.sys win32k.sym
|
||||
endif
|
||||
|
||||
win32k.sys: $(OBJECTS) win32k.def
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: driver.c,v 1.1 1999/06/15 02:26:43 rex Exp $
|
||||
/* $Id: driver.c,v 1.2 1999/07/12 23:26:57 rex Exp $
|
||||
*
|
||||
* GDI Driver support routines
|
||||
* (mostly swiped from Wine)
|
||||
|
@ -6,6 +6,11 @@
|
|||
*/
|
||||
|
||||
#include <win32k/driver.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <wchar.h>
|
||||
|
||||
//#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
typedef struct _GRAPHICS_DRIVER
|
||||
{
|
||||
|
@ -17,7 +22,7 @@ typedef struct _GRAPHICS_DRIVER
|
|||
static PGRAPHICS_DRIVER DriverList;
|
||||
static PGRAPHICS_DRIVER GenericDriver;
|
||||
|
||||
BOOL DRIVER_RegisterDriver(PWSTR Name, PGD_ENABLEDRIVER EnableDriver)
|
||||
BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver)
|
||||
{
|
||||
PGRAPHICS_DRIVER Driver = ExAllocatePool(NonPagedPool, sizeof(*Driver));
|
||||
if (!Driver)
|
||||
|
@ -42,12 +47,12 @@ BOOL DRIVER_RegisterDriver(PWSTR Name, PGD_ENABLEDRIVER EnableDriver)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
Driver->name = NULL;
|
||||
Driver->Name = NULL;
|
||||
GenericDriver = Driver;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PGD_ENABLEDRIVER DRIVER_FindDriver(PWSTR Name)
|
||||
PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name)
|
||||
{
|
||||
GRAPHICS_DRIVER *Driver = DriverList;
|
||||
|
||||
|
@ -63,7 +68,65 @@ PGD_ENABLEDRIVER DRIVER_FindDriver(PWSTR Name)
|
|||
return GenericDriver ? GenericDriver->EnableDriver : NULL;
|
||||
}
|
||||
|
||||
BOOL DRIVER_UnregisterDriver(PWSTR Name)
|
||||
BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED,
|
||||
PDRIVER_FUNCTIONS DF)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
HANDLE DRIVER_FindMPDriver(LPCWSTR Name)
|
||||
{
|
||||
PWSTR lName;
|
||||
HANDLE DriverHandle;
|
||||
NTSTATUS Status;
|
||||
UNICODE_STRING DeviceName;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
|
||||
if (Name[0] != '\\')
|
||||
{
|
||||
lName = ExAllocatePool(NonPagedPool, wcslen(Name) * sizeof(WCHAR) +
|
||||
10 * sizeof(WCHAR));
|
||||
wcscpy(lName, L"\\Devices\\");
|
||||
wcscat(lName, Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
lName = Name;
|
||||
}
|
||||
|
||||
RtlInitUnicodeString(&DeviceName, lName);
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&DeviceName,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
Status = ZwOpenFile(&DriverHandle,
|
||||
FILE_ALL_ACCESS,
|
||||
&ObjectAttributes,
|
||||
NULL,
|
||||
0,
|
||||
FILE_SYNCHRONOUS_IO_ALERT);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("Failed to open display device\n");
|
||||
DbgPrint("%08lx\n", Status);
|
||||
if (Name[0] != '\\')
|
||||
{
|
||||
ExFreePool(lName);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (Name[0] != '\\')
|
||||
{
|
||||
ExFreePool(lName);
|
||||
}
|
||||
|
||||
return DriverHandle;
|
||||
}
|
||||
|
||||
BOOL DRIVER_UnregisterDriver(LPCWSTR Name)
|
||||
{
|
||||
PGRAPHICS_DRIVER Driver = NULL;
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <win32k/bitmaps.h>
|
||||
|
||||
// #define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
BOOL W32kBitBlt(HDC hDCDest,
|
||||
INT XDest,
|
||||
INT YDest,
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <win32k/brush.h>
|
||||
|
||||
// #define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
HBRUSH W32kCreateBrushIndirect(CONST LOGBRUSH *lb)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
|
|
391
reactos/subsys/win32k/objects/dc.c
Normal file
391
reactos/subsys/win32k/objects/dc.c
Normal file
|
@ -0,0 +1,391 @@
|
|||
/*
|
||||
* DC.C - Device context functions
|
||||
*
|
||||
*/
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <win32k/driver.h>
|
||||
#include <win32k/dc.h>
|
||||
|
||||
// #define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* FIXME: DCs should probably be thread safe */
|
||||
|
||||
/*
|
||||
* DC device-independent Get/SetXXX functions
|
||||
* (RJJ) swiped from WINE
|
||||
*/
|
||||
|
||||
#define DC_GET_VAL( func_type, func_name, dc_field ) \
|
||||
func_type STDCALL func_name( HDC hdc ) \
|
||||
{ \
|
||||
PDC dc = DC_HandleToPtr( hdc ); \
|
||||
if (!dc) return 0; \
|
||||
return dc->dc_field; \
|
||||
}
|
||||
|
||||
/* DC_GET_VAL_EX is used to define functions returning a POINT or a SIZE. It is
|
||||
* important that the function has the right signature, for the implementation
|
||||
* we can do whatever we want.
|
||||
*/
|
||||
#define DC_GET_VAL_EX( func_name, ret_x, ret_y, type ) \
|
||||
BOOL STDCALL func_name( HDC hdc, LP##type pt ) \
|
||||
{ \
|
||||
PDC dc = DC_HandleToPtr( hdc ); \
|
||||
if (!dc) return FALSE; \
|
||||
((LPPOINT)pt)->x = dc->ret_x; \
|
||||
((LPPOINT)pt)->y = dc->ret_y; \
|
||||
return TRUE; \
|
||||
}
|
||||
|
||||
#define DC_SET_MODE( func_name, dc_field, min_val, max_val ) \
|
||||
INT STDCALL func_name( HDC hdc, INT mode ) \
|
||||
{ \
|
||||
INT prevMode; \
|
||||
PDC dc = DC_HandleToPtr( hdc ); \
|
||||
if(!dc) return 0; \
|
||||
if ((mode < min_val) || (mode > max_val)) return 0; \
|
||||
prevMode = dc->dc_field; \
|
||||
dc->dc_field = mode; \
|
||||
return prevMode; \
|
||||
}
|
||||
|
||||
// --------------------------------------------------------- File Statics
|
||||
|
||||
|
||||
// ----------------------------------------------------- Public Functions
|
||||
|
||||
BOOL STDCALL W32kCancelDC(HDC hDC)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
HDC STDCALL W32kCreateCompatableDC(HDC hDC)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||
LPCWSTR Device,
|
||||
LPCWSTR Output,
|
||||
CONST PDEVMODEW InitData)
|
||||
{
|
||||
PGD_ENABLEDRIVER GDEnableDriver;
|
||||
PDC NewDC;
|
||||
DRVENABLEDATA DED;
|
||||
|
||||
/* Check for existing DC object */
|
||||
if ((NewDC = DC_FindOpenDC(Driver)) != NULL)
|
||||
{
|
||||
return DC_PtrToHandle(NewDC);
|
||||
}
|
||||
|
||||
/* Allocate a DC object */
|
||||
if ((NewDC = DC_AllocDC(Driver)) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Open the miniport driver */
|
||||
if ((NewDC->DeviceDriver = DRIVER_FindMPDriver(Driver)) == NULL)
|
||||
{
|
||||
DbgPrint("FindMPDriver failed\n");
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
/* Get the DDI driver's entry point */
|
||||
if ((GDEnableDriver = DRIVER_FindDDIDriver(Driver)) == NULL)
|
||||
{
|
||||
DbgPrint("FindDDIDriver failed\n");
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
/* Call DDI driver's EnableDriver function */
|
||||
RtlZeroMemory(&DED, sizeof(DED));
|
||||
if (!GDEnableDriver(DDI_DRIVER_VERSION, sizeof(DED), &DED))
|
||||
{
|
||||
DbgPrint("DrvEnableDriver failed\n");
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
/* Construct DDI driver function dispatch table */
|
||||
if (!DRIVER_BuildDDIFunctions(&DED, &NewDC->DriverFunctions))
|
||||
{
|
||||
DbgPrint("BuildDDIFunctions failed\n");
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
/* Allocate a phyical device handle from the driver */
|
||||
if (Device != NULL)
|
||||
{
|
||||
wcsncpy(NewDC->DMW.dmDeviceName, Device, DMMAXDEVICENAME);
|
||||
}
|
||||
NewDC->DMW.dmSize = sizeof(NewDC->DMW);
|
||||
NewDC->DMW.dmFields = 0x000fc000;
|
||||
|
||||
/* FIXME: get mode selection information from somewhere */
|
||||
|
||||
NewDC->DMW.dmLogPixels = 96;
|
||||
NewDC->DMW.dmBitsPerPel = 8;
|
||||
NewDC->DMW.dmPelsWidth = 640;
|
||||
NewDC->DMW.dmPelsHeight = 480;
|
||||
NewDC->DMW.dmDisplayFlags = 0;
|
||||
NewDC->DMW.dmDisplayFrequency = 0;
|
||||
NewDC->PDev = NewDC->DriverFunctions.EnablePDev(&NewDC->DMW,
|
||||
L"",
|
||||
HS_DDI_MAX,
|
||||
NewDC->FillPatternSurfaces,
|
||||
sizeof(NewDC->GDIInfo),
|
||||
&NewDC->GDIInfo,
|
||||
sizeof(NewDC->DevInfo),
|
||||
&NewDC->DevInfo,
|
||||
NULL,
|
||||
L"",
|
||||
NewDC->DeviceDriver);
|
||||
if (NewDC->PDev == NULL)
|
||||
{
|
||||
DbgPrint("DrvEnablePDEV failed\n");
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
/* Complete initialization of the physical device */
|
||||
NewDC->DriverFunctions.CompletePDev(NewDC->PDev, NewDC);
|
||||
|
||||
/* Enable the drawing surface */
|
||||
NewDC->Surface = NewDC->DriverFunctions.EnableSurface(NewDC->PDev);
|
||||
|
||||
/* Initialize the DC state */
|
||||
DC_InitDC(NewDC);
|
||||
|
||||
return DC_PtrToHandle(NewDC);
|
||||
|
||||
Failure:
|
||||
DC_FreeDC(NewDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL STDCALL W32kDeleteDC(HDC DCHandle)
|
||||
{
|
||||
PDC DCToDelete;
|
||||
|
||||
UNIMPLEMENTED;
|
||||
|
||||
DCToDelete = DC_HandleToPtr(DCHandle);
|
||||
|
||||
/* FIXME: Call driver shutdown/deallocate routines here */
|
||||
|
||||
DC_FreeDC(DCToDelete);
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
INT W32kDrawEscape(HDC hDC,
|
||||
INT nEscape,
|
||||
INT cbInput,
|
||||
LPCSTR lpszInData)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
INT W32kEnumObjects(HDC hDC,
|
||||
INT ObjectType,
|
||||
GOBJENUMPROC ObjectFunc,
|
||||
LPARAM lParam)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
DC_GET_VAL( COLORREF, W32kGetBkColor, w.backgroundColor )
|
||||
DC_GET_VAL( INT, W32kGetBkMode, w.backgroundMode )
|
||||
DC_GET_VAL_EX( W32kGetBrushOrgEx, w.brushOrgX, w.brushOrgY, POINT )
|
||||
DC_GET_VAL( HRGN, W32kGetClipRgn, w.hClipRgn )
|
||||
|
||||
HGDIOBJ W32kGetCurrentObject(HDC hDC,
|
||||
UINT ObjectType)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
DC_GET_VAL_EX( W32kGetCurrentPositionEx, w.CursPosX, w.CursPosY, POINT )
|
||||
|
||||
BOOL W32kGetDCOrgEx(HDC hDC,
|
||||
LPPOINT Point)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
INT W32kGetDeviceCaps(HDC hDC,
|
||||
INT Index)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
DC_GET_VAL( INT, W32kGetMapMode, w.MapMode )
|
||||
DC_GET_VAL( INT, W32kGetPolyFillMode, w.polyFillMode )
|
||||
DC_GET_VAL( INT, W32kGetRelAbs, w.relAbsMode )
|
||||
DC_GET_VAL( INT, W32kGetROP2, w.ROPmode )
|
||||
DC_GET_VAL( INT, W32kGetStretchBltMode, w.stretchBltMode )
|
||||
DC_GET_VAL( UINT, W32kGetTextAlign, w.textAlign )
|
||||
DC_GET_VAL( COLORREF, W32kGetTextColor, w.textColor )
|
||||
DC_GET_VAL_EX( W32kGetViewportExtEx, vportExtX, vportExtY, SIZE )
|
||||
DC_GET_VAL_EX( W32kGetViewportOrgEx, vportOrgX, vportOrgY, POINT )
|
||||
DC_GET_VAL_EX( W32kGetWindowExtEx, wndExtX, wndExtY, SIZE )
|
||||
DC_GET_VAL_EX( W32kGetWindowOrgEx, wndOrgX, wndOrgY, POINT )
|
||||
|
||||
HDC W32kResetDC(HDC hDC, CONST DEVMODE *InitData)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
BOOL W32kRestoreDC(HDC hDC, INT SavedDC)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
INT W32kSaveDC(HDC hDC)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
HGDIOBJ W32kSelectObject(HDC hDC, HGDIOBJ GDIObj)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
DC_SET_MODE( W32kSetBkMode, w.backgroundMode, TRANSPARENT, OPAQUE )
|
||||
DC_SET_MODE( W32kSetPolyFillMode, w.polyFillMode, ALTERNATE, WINDING )
|
||||
// DC_SET_MODE( W32kSetRelAbs, w.relAbsMode, ABSOLUTE, RELATIVE )
|
||||
DC_SET_MODE( W32kSetROP2, w.ROPmode, R2_BLACK, R2_WHITE )
|
||||
DC_SET_MODE( W32kSetStretchBltMode, w.stretchBltMode, BLACKONWHITE, HALFTONE )
|
||||
|
||||
COLORREF STDCALL W32kSetBkColor(HDC hDC, COLORREF color)
|
||||
{
|
||||
COLORREF oldColor;
|
||||
PDC dc = DC_HandleToPtr(hDC);
|
||||
|
||||
if (!dc)
|
||||
{
|
||||
return 0x80000000;
|
||||
}
|
||||
|
||||
oldColor = dc->w.backgroundColor;
|
||||
dc->w.backgroundColor = color;
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
COLORREF STDCALL W32kSetTextColor(HDC hDC, COLORREF color)
|
||||
{
|
||||
COLORREF oldColor;
|
||||
PDC dc = DC_HandleToPtr(hDC);
|
||||
|
||||
if (!dc)
|
||||
{
|
||||
return 0x80000000;
|
||||
}
|
||||
|
||||
oldColor = dc->w.textColor;
|
||||
dc->w.textColor = color;
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------- Private Interface
|
||||
|
||||
PDC DCList = NULL;
|
||||
|
||||
PDC DC_AllocDC(LPCWSTR Driver)
|
||||
{
|
||||
PDC NewDC;
|
||||
|
||||
NewDC = ExAllocatePool(NonPagedPool, sizeof(DC));
|
||||
if (NewDC == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RtlZeroMemory(NewDC, sizeof(DC));
|
||||
NewDC->Type = GDI_DC_TYPE;
|
||||
NewDC->DriverName = ExAllocatePool(NonPagedPool,
|
||||
wcslen(Driver) * sizeof(WCHAR));
|
||||
wcscpy(NewDC->DriverName, Driver);
|
||||
NewDC->NextDC = DCList;
|
||||
DCList = NewDC;
|
||||
|
||||
return NewDC;
|
||||
}
|
||||
|
||||
void DC_InitDC(PDC DCToInit)
|
||||
{
|
||||
HDC DCHandle;
|
||||
|
||||
DCHandle = DC_PtrToHandle(DCToInit);
|
||||
// W32kRealizeDefaultPalette(DCHandle);
|
||||
W32kSetTextColor(DCHandle, DCToInit->w.textColor);
|
||||
W32kSetBkColor(DCHandle, DCToInit->w.backgroundColor);
|
||||
W32kSelectObject(DCHandle, DCToInit->w.hPen);
|
||||
W32kSelectObject(DCHandle, DCToInit->w.hBrush);
|
||||
W32kSelectObject(DCHandle, DCToInit->w.hFont);
|
||||
// CLIPPING_UpdateGCRegion(DCToInit);
|
||||
}
|
||||
|
||||
PDC DC_FindOpenDC(LPCWSTR Driver)
|
||||
{
|
||||
PDC DCToReturn = DCList;
|
||||
|
||||
if (Driver == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (DCToReturn != NULL)
|
||||
{
|
||||
if (DCToReturn->DriverName != NULL &&
|
||||
!wcscmp(DCToReturn->DriverName, Driver))
|
||||
{
|
||||
break;
|
||||
}
|
||||
DCToReturn = DCToReturn->NextDC;
|
||||
}
|
||||
|
||||
return DCToReturn;
|
||||
}
|
||||
|
||||
void DC_FreeDC(PDC DCToFree)
|
||||
{
|
||||
PDC Tmp;
|
||||
|
||||
if (DCList == DCToFree)
|
||||
{
|
||||
DCList = DCList->NextDC;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tmp = DCList;
|
||||
while (Tmp->NextDC != NULL && Tmp->NextDC != DCToFree)
|
||||
{
|
||||
Tmp = Tmp->NextDC;
|
||||
}
|
||||
Tmp->NextDC = Tmp->NextDC->NextDC;
|
||||
}
|
||||
ExFreePool(DCToFree->DriverName);
|
||||
ExFreePool(DCToFree);
|
||||
}
|
||||
|
||||
HDC DC_PtrToHandle(PDC pDC)
|
||||
{
|
||||
/* FIXME: this should actually return a handle obtained from the pointer */
|
||||
return (HDC) pDC;
|
||||
}
|
||||
|
||||
|
||||
PDC DC_HandleToPtr(HDC hDC)
|
||||
{
|
||||
/* FIXME: this should actually return a pointer obtained from the handle */
|
||||
return (PDC) hDC;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue