more work on KMGDI subsystem

svn path=/trunk/; revision=589
This commit is contained in:
Rex Jolliff 1999-07-12 23:26:57 +00:00
parent 0584d3755f
commit 932d4770ec
12 changed files with 1194 additions and 463 deletions

View file

@ -2,10 +2,52 @@
* WinDDI.h - definition of the GDI - DDI interface * 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> #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 #define DDI_DRIVER_VERSION 0x00010000
/* FIXME: how big should this constant be? */
#define HS_DDI_MAX 6
/* EngCreateBitmap format types */ /* EngCreateBitmap format types */
enum _BMF_TYPES enum _BMF_TYPES
{ {
@ -156,7 +198,7 @@ enum _DRV_HOOK_FUNCS
INDEX_DrvStrokePath, INDEX_DrvStrokePath,
INDEX_DrvFillPath, INDEX_DrvFillPath,
INDEX_DrvStrokeAndFillPath, INDEX_DrvStrokeAndFillPath,
INDEX_DrvPaint INDEX_DrvPaint,
INDEX_DrvBitBlt, INDEX_DrvBitBlt,
INDEX_DrvCopyBits, INDEX_DrvCopyBits,
INDEX_DrvStretchBlt, INDEX_DrvStretchBlt,
@ -262,20 +304,12 @@ enum _SURF_TYPES
#define WOC_CHANGED 0x00000010 #define WOC_CHANGED 0x00000010
#define WOC_DELETE 0x00000020 #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 HDEV;
typedef HANDLE HGLYPH;
typedef HANDLE HSURF;
typedef HANDLE DHPDEV; typedef HANDLE DHPDEV;
typedef ULONG (*PFN)(); typedef HANDLE DHSURF;
typedef VOID (CALLBACK * WNDOBJCHANGEPROC)(PWNDOBJ WndObj, ULONG Flags); typedef ULONG (*PFN)(VOID);
typedef struct _DRVFN typedef struct _DRVFN
{ {
@ -294,13 +328,43 @@ typedef struct _DRVENABLEDATA
ULONG c; ULONG c;
DRVFN *pdrvfn; DRVFN *pdrvfn;
} DRVENABLEDATA, *PDRVENABLEDATA; } 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 typedef struct _DEVINFO
{ {
ULONG flGraphicsCaps; ULONG flGraphicsCaps;
LOGFONTW lfDefaultFont; LOGFONT lfDefaultFont;
LOGFONTW lfAnsiVarFont; LOGFONT lfAnsiVarFont;
LOGFONTW lfAnsiFixFont; LOGFONT lfAnsiFixFont;
ULONG cFonts; ULONG cFonts;
ULONG iDitherFormat; ULONG iDitherFormat;
USHORT cxDither; USHORT cxDither;
@ -308,6 +372,45 @@ typedef struct _DEVINFO
HPALETTE hpalDefault; HPALETTE hpalDefault;
} DEVINFO, *PDEVINFO; } 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 typedef struct _DEVMODEW
{ {
WCHAR dmDeviceName[DMMAXDEVICENAME]; WCHAR dmDeviceName[DMMAXDEVICENAME];
@ -336,7 +439,7 @@ typedef struct _DEVMODEW
DWORD dmPelsHeight; DWORD dmPelsHeight;
DWORD dmDisplayFlags; DWORD dmDisplayFlags;
DWORD dmDisplayFrequency; DWORD dmDisplayFrequency;
} DEVMODEW; } DEVMODEW, *PDEVMODEW;
typedef struct _BRUSHOBJ typedef struct _BRUSHOBJ
{ {
@ -465,10 +568,24 @@ typedef struct _SURFOBJ
USHORT fjBitmap; USHORT fjBitmap;
} SURFOBJ, *PSURFOBJ; } 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 typedef struct _XLATEOBJ
{ {
ULONG iUniq; ULONG iUniq;
FLONG flXlate; ULONG flXlate;
USHORT iSrcType; USHORT iSrcType;
USHORT iDstType; USHORT iDstType;
ULONG cEntries; ULONG cEntries;
@ -778,7 +895,7 @@ EngCreateEvent
*/ */
HPALETTE EngCreatePalette(IN ULONG Mode, HPALETTE EngCreatePalette(IN ULONG Mode,
IN ULONG Colors, IN ULONG NumColors,
IN PULONG *Colors, IN PULONG *Colors,
IN ULONG Red, IN ULONG Red,
IN ULONG Green, IN ULONG Green,
@ -898,7 +1015,7 @@ ULONG FONTOBJ_cGetGlyphs(IN PFONTOBJ FontObj,
IN ULONG NumGlyphs, IN ULONG NumGlyphs,
IN HGLYPH *GlyphHandles, IN HGLYPH *GlyphHandles,
IN PVOID *OutGlyphs); IN PVOID *OutGlyphs);
GAMMA_TABLES *FONTOBJ_pGetGammaTables(IN PFONTOBJ FontObj); PGAMMA_TABLES FONTOBJ_pGetGammaTables(IN PFONTOBJ FontObj);
IFIMETRICS *FONTOBJ_pifi(IN PFONTOBJ FontObj); IFIMETRICS *FONTOBJ_pifi(IN PFONTOBJ FontObj);
PVOID FONTOBJ_pvTrueTypeFontFile(IN PFONTOBJ FontObj, PVOID FONTOBJ_pvTrueTypeFontFile(IN PFONTOBJ FontObj,
IN ULONG *FileSize); IN ULONG *FileSize);
@ -942,3 +1059,5 @@ XLATEOBJ_iXlate
XLATEOBJ_piVector XLATEOBJ_piVector
*/ */
#endif

View file

@ -1,4 +1,9 @@
#ifndef __WIN32K_BITMAPS_H
#define __WIN32K_BITMAPS_H
#include <windows.h>
#include <win32k/dc.h>
BOOL W32kBitBlt(HDC hDCDest, BOOL W32kBitBlt(HDC hDCDest,
INT XDest, INT XDest,
@ -144,5 +149,5 @@ INT W32kStretchDIBits(HDC hDC,
DWORD ROP); DWORD ROP);
#endif

View file

@ -1,4 +1,9 @@
#ifndef __WIN32K_BRUSH_H
#define __WIN32K_BRUSH_H
#include <windows.h>
HBRUSH W32kCreateBrushIndirect(CONST LOGBRUSH *lb); HBRUSH W32kCreateBrushIndirect(CONST LOGBRUSH *lb);
HBRUSH W32kCreateDIBPatternBrush(HGLOBAL hDIBPacked, HBRUSH W32kCreateDIBPatternBrush(HGLOBAL hDIBPacked,
UINT ColorSpec); UINT ColorSpec);
@ -20,3 +25,5 @@ BOOL W32kSetBrushOrgEx(HDC hDC,
INT YOrg, INT YOrg,
LPPOINT Point); LPPOINT Point);
#endif

View file

@ -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 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; } WIN_DC_INFO;
#define GDI_DC_TYPE (1)
typedef struct _DC typedef struct _DC
{ {
WORD Type;
struct _DC *NextDC;
DHPDEV PDev; DHPDEV PDev;
DEVMODEW DMW; DEVMODEW DMW;
HSURF FillPatternSurfaces[HS_DDI_MAX]; HSURF FillPatternSurfaces[HS_DDI_MAX];
GDIINFO GDIInfo; GDIINFO GDIInfo;
DEVINFO DevInfo; DEVINFO DevInfo;
HSURF Surface = NULL; HSURF Surface;
DRIVER_FUNCTIONS DriverFunctions; DRIVER_FUNCTIONS DriverFunctions;
PWSTR DriverName;
HANDLE DeviceDriver; 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; } 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

View file

@ -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 typedef struct _DRIVER_FUNCTIONS
{ {
@ -65,8 +86,12 @@ typedef struct _DRIVER_FUNCTIONS
#endif #endif
} DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS; } DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS;
BOOL DRIVER_RegisterDriver(PWSTR Name, GD_ENABLEDRIVER EnableDriver); BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver);
PDRIVER_FUNCTIONS DRIVER_FindDriver(PWSTR Name); PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name);
BOOL DRIVER_BuildFunctions(PWSTR Name, PDRVENABLEDATA DED); HANDLE DRIVER_FindMPDriver(LPCWSTR Name);
BOOL DRIVER_UnregisterDriver(PWSTR Name); BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED,
PDRIVER_FUNCTIONS DF);
BOOL DRIVER_UnregisterDriver(LPCWSTR Name);
#endif

View file

@ -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;
}

View file

@ -2,313 +2,397 @@
* Entry Point for win32k.sys * Entry Point for win32k.sys
*/ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <ddk/winddi.h>
#include <internal/service.h>
#include <internal/hal.h>
#if 0 #include <win32k/dc.h>
#include "win32k/vectors.h" #include <win32k/bitmaps.h>
#include <win32k/brush.h>
PFN Win32kVectors[] = SERVICE_TABLE W32kServiceTable[] =
{ {
(PFN) W32kAbortDoc, #if 0
(PFN) W32kAbortPath, {?, (ULONG) W32kAbortDoc},
(PFN) W32kAddFontResource, {?, (ULONG) W32kAbortPath},
(PFN) W32kAngleArc, {?, (ULONG) W32kAddFontResource},
(PFN) W32kAnimatePalette, {?, (ULONG) W32kAngleArc},
(PFN) W32kArc, {?, (ULONG) W32kAnimatePalette},
(PFN) W32kArcTo, {?, (ULONG) W32kArc},
(PFN) W32kBeginPath, {?, (ULONG) W32kArcTo},
(PFN) W32kBitBlt, {?, (ULONG) W32kBeginPath},
(PFN) W32kCancelDC, #endif
(PFN) W32kCheckColorsInGamut, {36, (ULONG) W32kBitBlt},
(PFN) W32kChoosePixelFormat, {4, (ULONG) W32kCancelDC},
(PFN) W32kChord, #if 0
(PFN) W32kCloseEnhMetaFile, {?, (ULONG) W32kCheckColorsInGamut},
(PFN) W32kCloseFigure, {?, (ULONG) W32kChoosePixelFormat},
(PFN) W32kCloseMetaFile, {?, (ULONG) W32kChord},
(PFN) W32kColorMatchToTarget, {?, (ULONG) W32kCloseEnhMetaFile},
(PFN) W32kCombineRgn, {?, (ULONG) W32kCloseFigure},
(PFN) W32kCombineTransform, {?, (ULONG) W32kCloseMetaFile},
(PFN) W32kCopyEnhMetaFile, {?, (ULONG) W32kColorMatchToTarget},
(PFN) W32kCopyMetaFile, {?, (ULONG) W32kCombineRgn},
(PFN) W32kCreateBitmap, {?, (ULONG) W32kCombineTransform},
(PFN) W32kCreateBitmapIndirect, {?, (ULONG) W32kCopyEnhMetaFile},
(PFN) W32kCreateBrushIndirect, {?, (ULONG) W32kCopyMetaFile},
(PFN) W32kCreateColorSpace, #endif
(PFN) W32kCreateCompatibleBitmap, {20, (ULONG) W32kCreateBitmap},
(PFN) W32kCreateCompatibleDC, {4, (ULONG) W32kCreateBitmapIndirect},
(PFN) W32kCreateDC, {4, (ULONG) W32kCreateBrushIndirect},
(PFN) W32kCreateDIBPatternBrush, #if 0
(PFN) W32kCreateDIBPatternBrushPt, {?, (ULONG) W32kCreateColorSpace},
(PFN) W32kCreateDIBSection, {?, (ULONG) W32kCreateCompatibleBitmap},
(PFN) W32kCreateDIBitmap, #endif
(PFN) W32kCreateDiscardableBitmap, {4, (ULONG) W32kCreateCompatableDC},
(PFN) W32kCreateEllipticRgn, {16, (ULONG) W32kCreateDC},
(PFN) W32kCreateEllipticRgnIndirect, {24, (ULONG) W32kCreateDIBitmap},
(PFN) W32kCreateEnhMetaFile, {8, (ULONG) W32kCreateDIBPatternBrush},
(PFN) W32kCreateFontIndirect, {8, (ULONG) W32kCreateDIBPatternBrushPt},
(PFN) W32kCreateFont, {24, (ULONG) W32kCreateDIBSection},
(PFN) W32kCreateHalftonePalette, {12, (ULONG) W32kCreateDiscardableBitmap},
(PFN) W32kCreateHatchBrush, #if 0
(PFN) W32kCreateIC, {?, (ULONG) W32kCreateEllipticRgn},
(PFN) W32kCreateMetaFile, {?, (ULONG) W32kCreateEllipticRgnIndirect},
(PFN) W32kCreatePalette, {?, (ULONG) W32kCreateEnhMetaFile},
(PFN) W32kCreatePatternBrush, {?, (ULONG) W32kCreateFontIndirect},
(PFN) W32kCreatePen, {?, (ULONG) W32kCreateFont},
(PFN) W32kCreatePenIndirect, {?, (ULONG) W32kCreateHalftonePalette},
(PFN) W32kCreatePolyPolygonRgn, #endif
(PFN) W32kCreatePolygonRgn, {8, (ULONG) W32kCreateHatchBrush},
(PFN) W32kCreateRectRgn, #if 0
(PFN) W32kCreateRectRgnIndirect, {?, (ULONG) W32kCreateIC},
(PFN) W32kCreateRoundRectRgn, {?, (ULONG) W32kCreateMetaFile},
(PFN) W32kCreateScalableFontResource, {?, (ULONG) W32kCreatePalette},
(PFN) W32kCreateSolidBrush, #endif
(PFN) W32kDPtoLP, {4, (ULONG) W32kCreatePatternBrush},
(PFN) W32kDeleteColorSpace, #if 0
(PFN) W32kDeleteDC, {?, (ULONG) W32kCreatePen},
(PFN) W32kDeleteEnhMetaFile, {?, (ULONG) W32kCreatePenIndirect},
(PFN) W32kDeleteMetaFile, {?, (ULONG) W32kCreatePolyPolygonRgn},
(PFN) W32kDeleteObject, {?, (ULONG) W32kCreatePolygonRgn},
(PFN) W32kDescribePixelFormat, {?, (ULONG) W32kCreateRectRgn},
(PFN) W32kDeviceCapabilitiesEx, {?, (ULONG) W32kCreateRectRgnIndirect},
(PFN) W32kDrawEscape, {?, (ULONG) W32kCreateRoundRectRgn},
(PFN) W32kEllipse, {?, (ULONG) W32kCreateScalableFontResource},
(PFN) W32kEndDoc, #endif
(PFN) W32kEndPage, {4, (ULONG) W32kCreateSolidBrush},
(PFN) W32kEndPath, #if 0
(PFN) W32kEnumEnhMetaFile, {?, (ULONG) W32kDPtoLP},
(PFN) W32kEnumFontFamiliesEx, {?, (ULONG) W32kDeleteColorSpace},
(PFN) W32kEnumFontFamilies, #endif
(PFN) W32kEnumFonts, {4, (ULONG) W32kDeleteDC},
(PFN) W32kEnumICMProfiles, #if 0
(PFN) W32kEnumMetaFile, {?, (ULONG) W32kDeleteEnhMetaFile},
(PFN) W32kEnumObjects, {?, (ULONG) W32kDeleteMetaFile},
(PFN) W32kEqualRgn, {?, (ULONG) W32kDeleteObject},
(PFN) W32kEscape, {?, (ULONG) W32kDescribePixelFormat},
(PFN) W32kExcludeClipRect, {?, (ULONG) W32kDeviceCapabilitiesEx},
(PFN) W32kExtCreatePen, #endif
(PFN) W32kExtCreateRegion, {16, (ULONG) W32kDrawEscape},
(PFN) W32kExtEscape, #if 0
(PFN) W32kExtFloodFill, {?, (ULONG) W32kEllipse},
(PFN) W32kExtSelectClipRgn, {?, (ULONG) W32kEndDoc},
(PFN) W32kExtTextOut, {?, (ULONG) W32kEndPage},
(PFN) W32kFillPath, {?, (ULONG) W32kEndPath},
(PFN) W32kFillRgn, {?, (ULONG) W32kEnumEnhMetaFile},
(PFN) W32kFixBrushOrgEx, {?, (ULONG) W32kEnumFontFamiliesEx},
(PFN) W32kFlattenPath, {?, (ULONG) W32kEnumFontFamilies},
(PFN) W32kFloodFill, {?, (ULONG) W32kEnumFonts},
(PFN) W32kFrameRgn, {?, (ULONG) W32kEnumICMProfiles},
(PFN) W32kGdiComment, {?, (ULONG) W32kEnumMetaFile},
(PFN) W32kGdiFlush, #endif
(PFN) W32kGdiGetBatchLimit, {16, (ULONG) W32kEnumObjects},
(PFN) W32kGdiPlayDCScript, #if 0
(PFN) W32kGdiPlayJournal, {?, (ULONG) W32kEqualRgn},
(PFN) W32kGdiPlayScript, {?, (ULONG) W32kEscape},
(PFN) W32kGdiSetBatchLimit, {?, (ULONG) W32kExcludeClipRect},
(PFN) W32kGetArcDirection, {?, (ULONG) W32kExtCreatePen},
(PFN) W32kGetAspectRatioFilterEx, {?, (ULONG) W32kExtCreateRegion},
(PFN) W32kGetBitmapBits, {?, (ULONG) W32kExtEscape},
(PFN) W32kGetBitmapDimensionEx, #endif
(PFN) W32kGetBkColor, {20, (ULONG) W32kExtFloodFill},
(PFN) W32kGetBkMode, #if 0
(PFN) W32kGetBoundsRect, {?, (ULONG) W32kExtSelectClipRgn},
(PFN) W32kGetBrushOrgEx, {?, (ULONG) W32kExtTextOut},
(PFN) W32kGetCharABCWidthsFloat, {?, (ULONG) W32kFillPath},
(PFN) W32kGetCharABCWidths, {?, (ULONG) W32kFillRgn},
(PFN) W32kGetCharWidth32, #endif
(PFN) W32kGetCharWidthFloat, {0, (ULONG) W32kFixBrushOrgEx},
(PFN) W32kGetCharWidth, #if 0
(PFN) W32kGetCharacterPlacement, {?, (ULONG) W32kFlattenPath},
(PFN) W32kGetClipBox, #endif
(PFN) W32kGetClipRgn, {16, (ULONG) W32kFloodFill},
(PFN) W32kGetColorAdjustment, #if 0
(PFN) W32kGetColorSpace, {?, (ULONG) W32kFrameRgn},
(PFN) W32kGetCurrentObject, {?, (ULONG) W32kGdiComment},
(PFN) W32kGetCurrentPositionEx, {?, (ULONG) W32kGdiFlush},
(PFN) W32kGetDCOrgEx, {?, (ULONG) W32kGdiGetBatchLimit},
(PFN) W32kGetDIBColorTable, {?, (ULONG) W32kGdiPlayDCScript},
(PFN) W32kGetDIBits, {?, (ULONG) W32kGdiPlayJournal},
(PFN) W32kGetDeviceCaps, {?, (ULONG) W32kGdiPlayScript},
(PFN) W32kGetDeviceGammaRamp, {?, (ULONG) W32kGdiSetBatchLimit},
(PFN) W32kGetEnhMetaFileBits, {?, (ULONG) W32kGetArcDirection},
(PFN) W32kGetEnhMetaFileDescription, {?, (ULONG) W32kGetAspectRatioFilterEx},
(PFN) W32kGetEnhMetaFileHeader, #endif
(PFN) W32kGetEnhMetaFilePaletteEntries, {12, (ULONG) W32kGetBitmapBits},
(PFN) W32kGetEnhMetaFilePixelFormat, {8, (ULONG) W32kGetBitmapDimensionEx},
(PFN) W32kGetEnhMetaFile, {4, (ULONG) W32kGetBkColor},
(PFN) W32kGetFontLanguageInfo, {4, (ULONG) W32kGetBkMode},
(PFN) W32kGetFontResourceInfo, #if 0
(PFN) W32kGetGlyphOutline, {?, (ULONG) W32kGetBoundsRect},
(PFN) W32kGetGlyphOutlineWow, #endif
(PFN) W32kGetGraphicsMode, {8, (ULONG) W32kGetBrushOrgEx},
(PFN) W32kGetICMProfile, #if 0
(PFN) W32kGetKerningPairs, {?, (ULONG) W32kGetCharABCWidthsFloat},
(PFN) W32kGetLogColorSpace, {?, (ULONG) W32kGetCharABCWidths},
(PFN) W32kGetMapMode, {?, (ULONG) W32kGetCharWidth32},
(PFN) W32kGetMetaFileBitsEx, {?, (ULONG) W32kGetCharWidthFloat},
(PFN) W32kGetMetaFile, {?, (ULONG) W32kGetCharWidth},
(PFN) W32kGetMetaRgn, {?, (ULONG) W32kGetCharacterPlacement},
(PFN) W32kGetMiterLimit, {?, (ULONG) W32kGetClipBox},
(PFN) W32kGetNearestColor, #endif
(PFN) W32kGetNearestPaletteIndex, {4, (ULONG) W32kGetClipRgn},
(PFN) W32kGetObjectType, #if 0
(PFN) W32kGetObject, {?, (ULONG) W32kGetColorAdjustment},
(PFN) W32kGetOutlineTextMetrics, {?, (ULONG) W32kGetColorSpace},
(PFN) W32kGetPaletteEntries, #endif
(PFN) W32kGetPath, {8, (ULONG) W32kGetCurrentObject},
(PFN) W32kGetPixel, {8, (ULONG) W32kGetCurrentPositionEx},
(PFN) W32kGetPixelFormat, {8, (ULONG) W32kGetDCOrgEx},
(PFN) W32kGetPolyFillMode, {16, (ULONG) W32kGetDIBColorTable},
(PFN) W32kGetROP2, {28, (ULONG) W32kGetDIBits},
(PFN) W32kGetRandomRgn, {8, (ULONG) W32kGetDeviceCaps},
(PFN) W32kGetRasterizerCaps, #if 0
(PFN) W32kGetRelAbs, {?, (ULONG) W32kGetDeviceGammaRamp},
(PFN) W32kGetRgnBox, {?, (ULONG) W32kGetEnhMetaFileBits},
(PFN) W32kGetStockObject, {?, (ULONG) W32kGetEnhMetaFileDescription},
(PFN) W32kGetStretchBltMode, {?, (ULONG) W32kGetEnhMetaFileHeader},
(PFN) W32kGetSystemPaletteEntries, {?, (ULONG) W32kGetEnhMetaFilePaletteEntries},
(PFN) W32kGetSystemPaletteUse, {?, (ULONG) W32kGetEnhMetaFilePixelFormat},
(PFN) W32kGetTextAlign, {?, (ULONG) W32kGetEnhMetaFile},
(PFN) W32kGetTextCharset, {?, (ULONG) W32kGetFontLanguageInfo},
(PFN) W32kGetTextCharsetInfo, {?, (ULONG) W32kGetFontResourceInfo},
(PFN) W32kGetTextColor, {?, (ULONG) W32kGetGlyphOutline},
(PFN) W32kGetTextExtentExPoint, {?, (ULONG) W32kGetGlyphOutlineWow},
(PFN) W32kGetTextExtentPoint32, {?, (ULONG) W32kGetGraphicsMode},
(PFN) W32kGetTextExtentPoint, {?, (ULONG) W32kGetICMProfile},
(PFN) W32kGetTextFace, {?, (ULONG) W32kGetKerningPairs},
(PFN) W32kGetTextMetrics, {?, (ULONG) W32kGetLogColorSpace},
(PFN) W32kGetViewportExtEx, #endif
(PFN) W32kGetViewportOrgEx, {4, (ULONG) W32kGetMapMode},
(PFN) W32kGetWinMetaFileBits, #if 0
(PFN) W32kGetWindowExtEx, {?, (ULONG) W32kGetMetaFileBitsEx},
(PFN) W32kGetWindowOrgEx, {?, (ULONG) W32kGetMetaFile},
(PFN) W32kGetWorldTransform, {?, (ULONG) W32kGetMetaRgn},
(PFN) W32kIntersectClipRect, {?, (ULONG) W32kGetMiterLimit},
(PFN) W32kInvertRgn, {?, (ULONG) W32kGetNearestColor},
(PFN) W32kLPtoDP, {?, (ULONG) W32kGetNearestPaletteIndex},
(PFN) W32kLineTo, {?, (ULONG) W32kGetObject},
(PFN) W32kMaskBlt, {?, (ULONG) W32kGetObjectType},
(PFN) W32kModifyWorldTransform, {?, (ULONG) W32kGetOutlineTextMetrics},
(PFN) W32kMoveToEx, {?, (ULONG) W32kGetPaletteEntries},
(PFN) W32kOffsetClipRgn, {?, (ULONG) W32kGetPath},
(PFN) W32kOffsetRgn, #endif
(PFN) W32kOffsetViewportOrgEx, {4, (ULONG) W32kGetPixel},
(PFN) W32kOffsetWindowOrgEx, #if 0
(PFN) W32kPaintRgn, {?, (ULONG) W32kGetPixelFormat},
(PFN) W32kPatBlt, #endif
(PFN) W32kPathToRegion, {4, (ULONG) W32kGetPolyFillMode},
(PFN) W32kPie, {4, (ULONG) W32kGetROP2},
(PFN) W32kPlayEnhMetaFile, #if 0
(PFN) W32kPlayEnhMetaFileRecord, {?, (ULONG) W32kGetRandomRgn},
(PFN) W32kPlayMetaFile, {?, (ULONG) W32kGetRasterizerCaps},
(PFN) W32kPlayMetaFileRecord, #endif
(PFN) W32kPlgBlt, {4, (ULONG) W32kGetRelAbs},
(PFN) W32kPolyBezier, #if 0
(PFN) W32kPolyBezierTo, {?, (ULONG) W32kGetRgnBox},
(PFN) W32kPolyDraw, {?, (ULONG) W32kGetStockObject},
(PFN) W32kPolyPolygon, #endif
(PFN) W32kPolyPolyline, {4, (ULONG) W32kGetStretchBltMode},
(PFN) W32kPolyTextOut, #if 0
(PFN) W32kPolygon, {?, (ULONG) W32kGetSystemPaletteEntries},
(PFN) W32kPolyline, {?, (ULONG) W32kGetSystemPaletteUse},
(PFN) W32kPolylineTo, #endif
(PFN) W32kPtInRegion, {4, (ULONG) W32kGetTextAlign},
(PFN) W32kPtVisible, #if 0
(PFN) W32kRealizePalette, {?, (ULONG) W32kGetTextCharset},
(PFN) W32kRectInRegion, {?, (ULONG) W32kGetTextCharsetInfo},
(PFN) W32kRectVisible, #endif
(PFN) W32kRectangle, {4, (ULONG) W32kGetTextColor},
(PFN) W32kRemoveFontResource, #if 0
(PFN) W32kResetDC, {?, (ULONG) W32kGetTextExtentExPoint},
(PFN) W32kResizePalette, {?, (ULONG) W32kGetTextExtentPoint32},
(PFN) W32kRestoreDC, {?, (ULONG) W32kGetTextExtentPoint},
(PFN) W32kRoundRect, {?, (ULONG) W32kGetTextFace},
(PFN) W32kSaveDC, {?, (ULONG) W32kGetTextMetrics},
(PFN) W32kScaleViewportExtEx, #endif
(PFN) W32kScaleWindowExtEx, {8, (ULONG) W32kGetViewportExtEx},
(PFN) W32kSelectBrushLocal, {8, (ULONG) W32kGetViewportOrgEx},
(PFN) W32kSelectClipPath, #if 0
(PFN) W32kSelectClipRgn, {?, (ULONG) W32kGetWinMetaFileBits},
(PFN) W32kSelectFontLocal, #endif
(PFN) W32kSelectObject, {8, (ULONG) W32kGetWindowExtEx},
(PFN) W32kSelectPalette, {8, (ULONG) W32kGetWindowOrgEx},
(PFN) W32kSetAbortProc, #if 0
(PFN) W32kSetArcDirection, {?, (ULONG) W32kGetWorldTransform},
(PFN) W32kSetBitmapBits, {?, (ULONG) W32kIntersectClipRect},
(PFN) W32kSetBitmapDimensionEx, {?, (ULONG) W32kInvertRgn},
(PFN) W32kSetBkColor, {?, (ULONG) W32kLPtoDP},
(PFN) W32kSetBkMode, {?, (ULONG) W32kLineTo},
(PFN) W32kSetBoundsRect, #endif
(PFN) W32kSetBrushOrgEx, {48, (ULONG) W32kMaskBlt},
(PFN) W32kSetColorAdjustment, #if 0
(PFN) W32kSetColorSpace, {?, (ULONG) W32kModifyWorldTransform},
(PFN) W32kSetDIBColorTable, {?, (ULONG) W32kMoveToEx},
(PFN) W32kSetDIBits, {?, (ULONG) W32kOffsetClipRgn},
(PFN) W32kSetDIBitsToDevice, {?, (ULONG) W32kOffsetRgn},
(PFN) W32kSetDeviceGammaRamp, {?, (ULONG) W32kOffsetViewportOrgEx},
(PFN) W32kSetEnhMetaFileBits, {?, (ULONG) W32kOffsetWindowOrgEx},
(PFN) W32kSetFontEnumeration, {?, (ULONG) W32kPaintRgn},
(PFN) W32kSetGraphicsMode, #endif
(PFN) W32kSetICMMode, {24, (ULONG) W32kPatBlt},
(PFN) W32kSetICMProfile, #if 0
(PFN) W32kSetMapMode, {?, (ULONG) W32kPathToRegion},
(PFN) W32kSetMapperFlags, {?, (ULONG) W32kPie},
(PFN) W32kSetMetaFileBitsEx, {?, (ULONG) W32kPlayEnhMetaFile},
(PFN) W32kSetMetaRgn, {?, (ULONG) W32kPlayEnhMetaFileRecord},
(PFN) W32kSetMiterLimit, {?, (ULONG) W32kPlayMetaFile},
(PFN) W32kSetPaletteEntries, {?, (ULONG) W32kPlayMetaFileRecord},
(PFN) W32kSetPixel, #endif
(PFN) W32kSetPixelFormat, {40, (ULONG) W32kPlgBlt},
(PFN) W32kSetPixelV, #if 0
(PFN) W32kSetPolyFillMode, {?, (ULONG) W32kPolyBezier},
(PFN) W32kSetROP2, {?, (ULONG) W32kPolyBezierTo},
(PFN) W32kSetRectRgn, {?, (ULONG) W32kPolyDraw},
(PFN) W32kSetRelAbs, {?, (ULONG) W32kPolyPolygon},
(PFN) W32kSetStretchBltMode, {?, (ULONG) W32kPolyPolyline},
(PFN) W32kSetSystemPaletteUse, {?, (ULONG) W32kPolyTextOut},
(PFN) W32kSetTextAlign, {?, (ULONG) W32kPolygon},
(PFN) W32kSetTextColor, {?, (ULONG) W32kPolyline},
(PFN) W32kSetTextJustification, {?, (ULONG) W32kPolylineTo},
(PFN) W32kSetViewportExtEx, {?, (ULONG) W32kPtInRegion},
(PFN) W32kSetViewportOrgEx, {?, (ULONG) W32kPtVisible},
(PFN) W32kSetWinMetaFileBits, {?, (ULONG) W32kRealizePalette},
(PFN) W32kSetWindowExtEx, {?, (ULONG) W32kRectInRegion},
(PFN) W32kSetWindowOrgEx, {?, (ULONG) W32kRectVisible},
(PFN) W32kSetWorldTransform, {?, (ULONG) W32kRectangle},
(PFN) W32kStartDoc, {?, (ULONG) W32kRemoveFontResource},
(PFN) W32kStartPage, #endif
(PFN) W32kStretchBlt, {8, (ULONG) W32kResetDC},
(PFN) W32kStretchDIBits, #if 0
(PFN) W32kStrokeAndFillPath, {?, (ULONG) W32kResizePalette},
(PFN) W32kStrokePath, #endif
(PFN) W32kSwapBuffers, {8, (ULONG) W32kRestoreDC},
(PFN) W32kTextOut, #if 0
(PFN) W32kTranslateCharsetInfo, {?, (ULONG) W32kRoundRect},
(PFN) W32kUnrealizeObject, #endif
(PFN) W32kUpdateColors, {4, (ULONG) W32kSaveDC},
(PFN) W32kUpdateICMRegKey, #if 0
(PFN) W32kWidenPath, {?, (ULONG) W32kScaleViewportExtEx},
(PFN) W32kgdiPlaySpoolStream {?, (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, WINBOOL STDCALL DllMain(VOID)
ULONG ul_reason_for_call,
LPVOID lpReserved)
{ {
DbgPrint("win32k:DllMain(hInst %x, ul_reason_for_call %d)\n", NTSTATUS Status;
hInst,
ul_reason_for_call); /* Register user mode call interface (svc mask is 0x10000000) */
Status = HalRegisterServiceTable(0xF0000000,
return TRUE; 0x10000000,
} W32kServiceTable,
sizeof(W32kServiceTable) /
PVOID W32kGetVectors(VOID) sizeof(W32kServiceTable[0]));
{ if (!NT_SUCCESS(Status))
DbgPrint("Unimplemented\n"); {
return 0; return FALSE;
#if 0 }
return Win32kVectors;
#endif return TRUE;
} }

View file

@ -3,9 +3,13 @@
# #
MAIN_OBJECTS = main/dllmain.o 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 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 all: win32k.sys
@ -13,11 +17,11 @@ win32k.coff: win32k.rc ../../include/reactos/resource.h
$(RC) win32k.rc win32k.coff $(RC) win32k.rc win32k.coff
ifeq ($(DOSCLI),yes) ifeq ($(DOSCLI),yes)
CLEAN_FILES = main\*.o stubs\*.o win32k.coff win32k.o win32k.a junk.tmp base.tmp \ CLEAN_FILES = main\*.o misc\*.o stubs\*.o objects\*.o win32k.coff win32k.o \
temp.exp win32k.sys win32k.sym win32k.a junk.tmp base.tmp temp.exp win32k.sys win32k.sym
else else
CLEAN_FILES = main/*.o stubs/*.o win32k.coff win32k.o win32k.a junk.tmp base.tmp \ CLEAN_FILES = main/*.o misc/*.o stubs/*.o objects/*.o win32k.coff win32k.o \
temp.exp win32k.sys win32k.sym win32k.a junk.tmp base.tmp temp.exp win32k.sys win32k.sym
endif endif
win32k.sys: $(OBJECTS) win32k.def win32k.sys: $(OBJECTS) win32k.def

View file

@ -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 * GDI Driver support routines
* (mostly swiped from Wine) * (mostly swiped from Wine)
@ -6,6 +6,11 @@
*/ */
#include <win32k/driver.h> #include <win32k/driver.h>
#include <ddk/ntddk.h>
#include <wchar.h>
//#define NDEBUG
#include <internal/debug.h>
typedef struct _GRAPHICS_DRIVER typedef struct _GRAPHICS_DRIVER
{ {
@ -17,7 +22,7 @@ typedef struct _GRAPHICS_DRIVER
static PGRAPHICS_DRIVER DriverList; static PGRAPHICS_DRIVER DriverList;
static PGRAPHICS_DRIVER GenericDriver; 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)); PGRAPHICS_DRIVER Driver = ExAllocatePool(NonPagedPool, sizeof(*Driver));
if (!Driver) if (!Driver)
@ -42,12 +47,12 @@ BOOL DRIVER_RegisterDriver(PWSTR Name, PGD_ENABLEDRIVER EnableDriver)
return FALSE; return FALSE;
} }
Driver->name = NULL; Driver->Name = NULL;
GenericDriver = Driver; GenericDriver = Driver;
return TRUE; return TRUE;
} }
PGD_ENABLEDRIVER DRIVER_FindDriver(PWSTR Name) PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name)
{ {
GRAPHICS_DRIVER *Driver = DriverList; GRAPHICS_DRIVER *Driver = DriverList;
@ -63,7 +68,65 @@ PGD_ENABLEDRIVER DRIVER_FindDriver(PWSTR Name)
return GenericDriver ? GenericDriver->EnableDriver : NULL; 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; PGRAPHICS_DRIVER Driver = NULL;

View file

@ -1,7 +1,11 @@
#undef WIN32_LEAN_AND_MEAN
#include <win32k/bitmaps.h> #include <win32k/bitmaps.h>
// #define NDEBUG
#include <internal/debug.h>
BOOL W32kBitBlt(HDC hDCDest, BOOL W32kBitBlt(HDC hDCDest,
INT XDest, INT XDest,
INT YDest, INT YDest,

View file

@ -1,7 +1,11 @@
#undef WIN32_LEAN_AND_MEAN
#include <win32k/brush.h> #include <win32k/brush.h>
// #define NDEBUG
#include <internal/debug.h>
HBRUSH W32kCreateBrushIndirect(CONST LOGBRUSH *lb) HBRUSH W32kCreateBrushIndirect(CONST LOGBRUSH *lb)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;

View 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;
}