Incremental changes, adding new Create and Delete DC functions and support structures.

svn path=/trunk/; revision=24704
This commit is contained in:
James Tabor
2006-11-09 01:45:42 +00:00
parent 73ce7bc885
commit 8110686c9c
4 changed files with 127 additions and 0 deletions
+101
View File
@@ -3,6 +3,74 @@
#define NDEBUG
#include <debug.h>
HDC
FASTCALL
IntCreateDICW ( LPCWSTR lpwszDriver,
LPCWSTR lpwszDevice,
LPCWSTR lpwszOutput,
PDEVMODEW lpInitData,
ULONG iType )
{
UNICODE_STRING Device, Output;
HDC hDC = NULL;
BOOL Display = FALSE;
ULONG UMdhpdev = 0;
HANDLE hspool = NULL;
if ((!lpwszDevice) && (!lpwszDriver)) return hDC;
else
{
if (lpwszDevice) // First
{
if (!_wcsnicmp(lpwszDevice, L"\\\\.\\DISPLAY",11)) Display = TRUE;
RtlInitUnicodeString(&Device, lpwszDevice);
}
else
{
if (lpwszDriver) // Second
{
if ((!_wcsnicmp(lpwszDriver, L"DISPLAY",7)) ||
(!_wcsnicmp(lpwszDriver, L"\\\\.\\DISPLAY",11))) Display = TRUE;
RtlInitUnicodeString(&Device, lpwszDriver);
}
}
}
if (lpwszOutput) RtlInitUnicodeString(&Output, lpwszOutput);
if (!Display)
{
//Handle Print device or something else.
DPRINT1("Not a DISPLAY device! %wZ\n", &Device);
}
hDC = NtGdiOpenDCW( &Device,
(PDEVMODEW) lpInitData,
(lpwszOutput ? &Output : NULL),
iType, // DCW 0 and ICW 1.
hspool,
(PVOID) NULL, // NULL for now.
(PVOID) &UMdhpdev );
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
PDC_ATTR Dc_Attr;
PLDC pLDC;
GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr);
pLDC = LocalAlloc(LMEM_ZEROINIT, sizeof(LDC));
Dc_Attr->pvLDC = pLDC;
pLDC->hDC = hDC;
pLDC->iType = LDC_LDC; // 1 (init) local DC, 2 EMF LDC
}
return hDC;
}
/*
* @implemented
@@ -191,6 +259,39 @@ CreateICA(
*/
BOOL
STDCALL
NEWDeleteDC(HDC hDC)
{
BOOL Ret = TRUE;
PDC_ATTR Dc_Attr;
PLDC pLDC;
Ret = GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr);
if ( !Ret ) return FALSE;
if ( Dc_Attr )
{
pLDC = Dc_Attr->pvLDC;
if ( pLDC )
{
DPRINT1("Delete the Local DC structure\n");
LocalFree( pLDC );
}
}
Ret = NtGdiDeleteObjectApp(hDC);
return Ret;
}
/*
* @implemented
*/
BOOL
STDCALL
DeleteObject(HGDIOBJ hObject)
{
/* From Wine: DeleteObject does not SetLastError() on a null object */
+12
View File
@@ -93,6 +93,9 @@
#define DC_LAST_CLIPRGN_VALID 0x00008000
#define DC_PRIMARY_DISPLAY 0x00010000
#define LDC_LDC 0x01 // (init) local DC other than a normal DC
#define LDC_EMFLDC 0x02 // Enhance Meta File local DC
/* TYPES *********************************************************************/
typedef struct _GDI_TABLE_ENTRY
@@ -110,6 +113,15 @@ typedef struct _RGNATTR
RECTL Rect;
} RGNATTR,*PRGNATTR;
// Local DC structure (_DC_ATTR) PVOID pvLDC;
typedef struct _LDC
{
HDC hDC;
ULONG Flags;
INT iType;
ABORTPROC pAbortProc; /* AbortProc for Printing */
} LDC, *PLDC;
typedef struct _DC_ATTR
{
PVOID pvLDC;
@@ -1038,6 +1038,19 @@ NtGdiCreateIC(PUNICODE_STRING Driver,
return Ret;
}
HDC STDCALL
NtGdiOpenDCW( PUNICODE_STRING pustrDevice,
DEVMODEW *pdm,
PUNICODE_STRING pustrLogAddr,
ULONG iType,
HANDLE hspool,
VOID *pDriverInfo2,
VOID *pUMdhpdev )
{
UNIMPLEMENTED;
return 0;
}
BOOL STDCALL
NtGdiDeleteObjectApp(HANDLE DCHandle)
{
+1
View File
@@ -182,6 +182,7 @@ NtGdiOffsetClipRgn 3
NtGdiOffsetRgn 3
NtGdiOffsetViewportOrgEx 4
NtGdiOffsetWindowOrgEx 4
NtGdiOpenDCW 7
NtGdiPaintRgn 2
NtGdiPatBlt 6
NtGdiPathToRegion 1