Win32k/Gdi32

- Remove NtGdiCreateD/IC, it served us well.
- Add a note to NtGdiCreateEnhMetaFile.

svn path=/trunk/; revision=26591
This commit is contained in:
James Tabor
2007-04-30 14:33:10 +00:00
parent aeb5637da4
commit 7a81790bac
4 changed files with 14 additions and 154 deletions
-19
View File
@@ -127,25 +127,6 @@ NtGdiGetCharWidth32(
LPINT Buffer
);
/* Use NtGdiOpenDCW */
HDC
NTAPI
NtGdiCreateDC(
PUNICODE_STRING Driver,
PUNICODE_STRING Device,
PUNICODE_STRING Output,
CONST PDEVMODEW InitData
);
HDC
NTAPI
NtGdiCreateIC(
PUNICODE_STRING Driver,
PUNICODE_STRING Device,
PUNICODE_STRING Output,
CONST PDEVMODEW DevMode
);
/* Use NtGdiAddFontResourceW */
int
STDCALL
@@ -932,136 +932,6 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
return hNewDC;
}
HDC STDCALL
NtGdiCreateDC(PUNICODE_STRING Driver,
PUNICODE_STRING Device,
PUNICODE_STRING Output,
CONST PDEVMODEW InitData)
{
UNICODE_STRING SafeDriver, SafeDevice;
DEVMODEW SafeInitData;
HDC Ret;
NTSTATUS Status = STATUS_SUCCESS;
if(InitData)
{
_SEH_TRY
{
ProbeForRead(InitData,
sizeof(DEVMODEW),
1);
RtlCopyMemory(&SafeInitData,
InitData,
sizeof(DEVMODEW));
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return NULL;
}
/* FIXME - InitData can have some more bytes! */
}
if(Driver)
{
Status = IntSafeCopyUnicodeString(&SafeDriver, Driver);
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return NULL;
}
}
if(Device)
{
Status = IntSafeCopyUnicodeString(&SafeDevice, Device);
if(!NT_SUCCESS(Status))
{
/* FIXME workaround for a real bug */
// RtlFreeUnicodeString(&SafeDriver);
// SetLastNtError(Status);
// DPRINT1("fail3\n");
// return NULL;
Device = NULL;
}
}
Ret = IntGdiCreateDC(NULL == Driver ? NULL : &SafeDriver,
NULL == Device ? NULL : &SafeDevice, NULL,
NULL == InitData ? NULL : &SafeInitData, FALSE);
return Ret;
}
HDC STDCALL
NtGdiCreateIC(PUNICODE_STRING Driver,
PUNICODE_STRING Device,
PUNICODE_STRING Output,
CONST PDEVMODEW InitData)
{
UNICODE_STRING SafeDriver, SafeDevice;
DEVMODEW SafeInitData;
HDC Ret;
NTSTATUS Status = STATUS_SUCCESS;
if(InitData)
{
_SEH_TRY
{
ProbeForRead(InitData,
sizeof(DEVMODEW),
1);
RtlCopyMemory(&SafeInitData,
InitData,
sizeof(DEVMODEW));
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return NULL;
}
/* FIXME - InitData can have some more bytes! */
}
if(Driver)
{
Status = IntSafeCopyUnicodeString(&SafeDriver, Driver);
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return NULL;
}
}
if(Device)
{
Status = IntSafeCopyUnicodeString(&SafeDevice, Device);
if(!NT_SUCCESS(Status))
{
RtlFreeUnicodeString(&SafeDriver);
SetLastNtError(Status);
return NULL;
}
}
Ret = IntGdiCreateDC(NULL == Driver ? NULL : &SafeDriver,
NULL == Device ? NULL : &SafeDevice, NULL,
NULL == InitData ? NULL : &SafeInitData, TRUE);
return Ret;
}
HDC STDCALL
NtGdiOpenDCW( PUNICODE_STRING Device,
DEVMODEW *InitData,
@@ -280,7 +280,11 @@ NtGdiCopyMetaFile(HMETAFILE Src,
UNIMPLEMENTED;
return 0;
}
//
//
// Rewrite is in progress, this function is subject to change at any time.
// 04/30/2007
//
HDC
STDCALL
NtGdiCreateEnhMetaFile(HDC hDCRef,
@@ -301,8 +305,15 @@ NtGdiCreateEnhMetaFile(HDC hDCRef,
* Shall we create hdc NtGdiHdcCompatible hdc ??
*/
UNICODE_STRING DriverName;
RtlInitUnicodeString(&DriverName, L"DISPLAY");
tempHDC = NtGdiCreateDC(&DriverName, NULL, NULL, NULL); //IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
RtlInitUnicodeString(&DriverName, L"DISPLAY");
//IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
tempHDC = NtGdiOpenDCW( &DriverName,
NULL,
NULL,
0, // DCW 0 and ICW 1.
NULL,
(PVOID) NULL,
(PVOID) NULL );
}
GDIOBJ_SetOwnership(GdiHandleTable, tempHDC, PsGetCurrentProcess());
-2
View File
@@ -25,7 +25,6 @@ NtGdiCreateBitmapIndirect 1
NtGdiCreateColorSpace 1
NtGdiCreateCompatibleBitmap 3
NtGdiCreateCompatibleDC 1
NtGdiCreateDC 4
NtGdiCreateDIBitmap 6
NtGdiCreateDIBBrush 6
NtGdiCreateDIBSection 9
@@ -35,7 +34,6 @@ NtGdiCreateEllipticRgnIndirect 1
NtGdiCreateEnhMetaFile 4
NtGdiCreateHalftonePalette 1
NtGdiCreateHatchBrushInternal 3
NtGdiCreateIC 4
NtGdiCreateMetaFile 1
NtGdiCreatePalette 1
NtGdiCreatePatternBrushInternal 3