Author: jimtabor
Date: Mon Apr 30 18:33:10 2007
New Revision: 26591
URL: 
http://svn.reactos.org/svn/reactos?rev=26591&view=rev
Log:
Win32k/Gdi32
- Remove NtGdiCreateD/IC, it served us well.
- Add a note to NtGdiCreateEnhMetaFile.
Modified:
    trunk/reactos/include/reactos/win32k/ntgdibad.h
    trunk/reactos/subsystems/win32/win32k/objects/dc.c
    trunk/reactos/subsystems/win32/win32k/objects/metafile.c
    trunk/reactos/tools/nci/w32ksvc.db
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Mon Apr 30 18:33:10 2007
@@ -127,25 +127,6 @@
     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
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Mon Apr 30 18:33:10 2007
@@ -930,136 +930,6 @@
   }
   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
Modified: trunk/reactos/subsystems/win32/win32k/objects/metafile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/metafile.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/metafile.c Mon Apr 30 18:33:10 2007
@@ -280,7 +280,11 @@
   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 @@
            * 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());
Modified: trunk/reactos/tools/nci/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/nci/w32ksvc.db?rev=2…
==============================================================================
--- trunk/reactos/tools/nci/w32ksvc.db (original)
+++ trunk/reactos/tools/nci/w32ksvc.db Mon Apr 30 18:33:10 2007
@@ -25,7 +25,6 @@
 NtGdiCreateColorSpace                  1
 NtGdiCreateCompatibleBitmap            3
 NtGdiCreateCompatibleDC                        1
-NtGdiCreateDC                          4
 NtGdiCreateDIBitmap                    6
 NtGdiCreateDIBBrush                    6
 NtGdiCreateDIBSection                  9
@@ -35,7 +34,6 @@
 NtGdiCreateEnhMetaFile                 4
 NtGdiCreateHalftonePalette             1
 NtGdiCreateHatchBrushInternal          3
-NtGdiCreateIC                          4
 NtGdiCreateMetaFile                    1
 NtGdiCreatePalette                     1
 NtGdiCreatePatternBrushInternal        3