[ros-diffs] [greatlrd] 31530: rename Pdev to hPDev in GDIDEVICE struct fixed bug in DxEngGetDCState

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Tue Jan 1 02:08:08 CET 2008


Author: greatlrd
Date: Tue Jan  1 04:08:07 2008
New Revision: 31530

URL: http://svn.reactos.org/svn/reactos?rev=31530&view=rev
Log:
rename Pdev to hPDev in GDIDEVICE struct
fixed bug in DxEngGetDCState

Modified:
    trunk/reactos/subsystems/win32/win32k/eng/driverobj.c
    trunk/reactos/subsystems/win32/win32k/eng/surface.c
    trunk/reactos/subsystems/win32/win32k/include/dc.h
    trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
    trunk/reactos/subsystems/win32/win32k/objects/dc.c
    trunk/reactos/subsystems/win32/win32k/objects/icm.c

Modified: trunk/reactos/subsystems/win32/win32k/eng/driverobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/driverobj.c?rev=31530&r1=31529&r2=31530&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/driverobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/driverobj.c Tue Jan  1 04:08:07 2008
@@ -84,7 +84,7 @@
   DrvObjUser->pvObj = pvObj;
   DrvObjUser->pFreeProc = pFreeObjProc;
   DrvObjUser->hdev = hdev;
-  DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev;
+  DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->hPDev;
 
   /* fill internal object */
   ExInitializeFastMutex(&DrvObjInt->Lock);

Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/surface.c?rev=31530&r1=31529&r2=31530&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/surface.c (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/surface.c Tue Jan  1 04:08:07 2008
@@ -458,7 +458,7 @@
 
   /* Associate the hdev */
   SurfObj->hdev = Dev;
-  SurfObj->dhpdev = Device->PDev;
+  SurfObj->dhpdev = Device->hPDev;
 
   /* Hook up specified functions */
   BitmapObj->flHooks = Hooks;

Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/dc.h?rev=31530&r1=31529&r2=31530&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h Tue Jan  1 04:08:07 2008
@@ -62,7 +62,7 @@
 
   PVOID  pvGammaRamp;
 
-  DHPDEV PDev;
+  DHPDEV hPDev;
   DEVMODEW DMW;
   HSURF FillPatterns[HS_DDI_MAX];
   DEVINFO DevInfo;

Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c?rev=31530&r1=31529&r2=31530&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c Tue Jan  1 04:08:07 2008
@@ -402,12 +402,18 @@
 /************************************************************************/
 /* DxEngGetDCState                                                      */
 /************************************************************************/
+/* Note type 0 = ? */
+/* Note type 1 = ? */
+/* Note type 2 = ? */
+/* Note type 3 = Get Driver hdev */
+
 DWORD
 DxEngGetDCState(HDC hDC,
                 DWORD type)
 {
-    PEDD_DIRECTDRAW_GLOBAL pEDDgpl = NULL;
     PDC pDC = DC_LockDc(hDC);
+    DWORD retVal = 0;
+
     if (pDC)
     {
         switch (type)
@@ -421,17 +427,16 @@
             case 3:
             {
                 PGDIDEVICE GDIDevice = (PGDIDEVICE)pDC->pPDev;
-                pEDDgpl = GDIDevice->pEDDgpl;
-                DC_UnlockDc(pDC);
-                return (DWORD)pEDDgpl;
+                retVal = (DWORD)GDIDevice->hPDev;
             }
             default:
                 UNIMPLEMENTED;
                 break;
         }
+        DC_UnlockDc(pDC);
     }
 
-    return 0;
+    return retVal;
 }
 
 /************************************************************************/

Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/dc.c?rev=31530&r1=31529&r2=31530&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Tue Jan  1 04:08:07 2008
@@ -460,7 +460,7 @@
       PrimarySurface.DMW.dmSize = sizeof (PrimarySurface.DMW);
       if (SetupDevMode(&PrimarySurface.DMW, DisplayNumber))
       {
-         PrimarySurface.PDev = PrimarySurface.DriverFunctions.EnablePDEV(
+         PrimarySurface.hPDev = PrimarySurface.DriverFunctions.EnablePDEV(
             &PrimarySurface.DMW,
             L"",
             HS_DDI_MAX,
@@ -472,7 +472,7 @@
             NULL,
             L"",
             (HANDLE) (PrimarySurface.VideoFileObject->DeviceObject));
-         DoDefault = (NULL == PrimarySurface.PDev);
+         DoDefault = (NULL == PrimarySurface.hPDev);
          if (DoDefault)
          {
             DPRINT1("DrvEnablePDev with registry parameters failed\n");
@@ -487,7 +487,7 @@
       {
          RtlZeroMemory(&(PrimarySurface.DMW), sizeof(DEVMODEW));
          PrimarySurface.DMW.dmSize = sizeof (PrimarySurface.DMW);
-         PrimarySurface.PDev = PrimarySurface.DriverFunctions.EnablePDEV(
+         PrimarySurface.hPDev = PrimarySurface.DriverFunctions.EnablePDEV(
             &PrimarySurface.DMW,
             L"",
             HS_DDI_MAX,
@@ -500,7 +500,7 @@
             L"",
             (HANDLE) (PrimarySurface.VideoFileObject->DeviceObject));
 
-         if (NULL == PrimarySurface.PDev)
+         if (NULL == PrimarySurface.hPDev)
          {
             ObDereferenceObject(PrimarySurface.VideoFileObject);
             DPRINT1("DrvEnablePDEV with default parameters failed\n");
@@ -532,7 +532,7 @@
 
       /* Complete initialization of the physical device */
       PrimarySurface.DriverFunctions.CompletePDEV(
-         PrimarySurface.PDev,
+         PrimarySurface.hPDev,
          (HDEV)&PrimarySurface);
 
       DPRINT("calling DRIVER_ReferenceDriver\n");
@@ -635,17 +635,17 @@
    DPRINT("calling EnableSurface\n");
    /* Enable the drawing surface */
    PrimarySurface.Handle =
-      PrimarySurface.DriverFunctions.EnableSurface(PrimarySurface.PDev);
+      PrimarySurface.DriverFunctions.EnableSurface(PrimarySurface.hPDev);
    if (NULL == PrimarySurface.Handle)
    {
-/*      PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.PDev, FALSE);*/
-      PrimarySurface.DriverFunctions.DisablePDEV(PrimarySurface.PDev);
+/*      PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.hPDev, FALSE);*/
+      PrimarySurface.DriverFunctions.DisablePDEV(PrimarySurface.hPDev);
       ObDereferenceObject(PrimarySurface.VideoFileObject);
       DPRINT1("DrvEnableSurface failed\n");
       return FALSE;
    }
 
-   PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.PDev, TRUE);
+   PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.hPDev, TRUE);
 
    calledFromUser = UserIsEntered(); //fixme: possibly upgrade a shared lock
    if (!calledFromUser){
@@ -656,7 +656,7 @@
    IntAttachMonitor(&PrimarySurface, PrimarySurface.DisplayNumber);
 
    SurfObj = EngLockSurface((HSURF)PrimarySurface.Handle);
-   SurfObj->dhpdev = PrimarySurface.PDev;
+   SurfObj->dhpdev = PrimarySurface.hPDev;
    SurfSize = SurfObj->sizlBitmap;
    SurfaceRect.left = SurfaceRect.top = 0;
    SurfaceRect.right = SurfObj->sizlBitmap.cx;
@@ -703,9 +703,9 @@
      */
 
     DPRINT("Reseting display\n" );
-    PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.PDev, FALSE);
-    PrimarySurface.DriverFunctions.DisableSurface(PrimarySurface.PDev);
-    PrimarySurface.DriverFunctions.DisablePDEV(PrimarySurface.PDev);
+    PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.hPDev, FALSE);
+    PrimarySurface.DriverFunctions.DisableSurface(PrimarySurface.hPDev);
+    PrimarySurface.DriverFunctions.DisablePDEV(PrimarySurface.hPDev);
     PrimarySurface.PreparedDriver = FALSE;
     KeSetEvent(&VideoDriverNeedsPreparation, 1, FALSE);
     KeResetEvent(&VideoDriverPrepared);
@@ -793,12 +793,12 @@
   NewDC->DC_Type = DC_TYPE_DIRECT;
   NewDC->IsIC = CreateAsIC;
 
-  NewDC->PDev = PrimarySurface.PDev;
+  NewDC->PDev = PrimarySurface.hPDev;
   if(pUMdhpdev) pUMdhpdev = NewDC->PDev;
   NewDC->pPDev = (PVOID)&PrimarySurface;
   NewDC->w.hBitmap = PrimarySurface.Handle;
 
-  NewDC->w.bitsPerPixel = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.cBitsPixel * 
+  NewDC->w.bitsPerPixel = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.cBitsPixel *
                                      ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.cPlanes;
   DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
 
@@ -1272,7 +1272,7 @@
   if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
   sDc_Attr = dcs->pDc_Attr;
   if(!sDc_Attr) sDc_Attr = &dcs->Dc_Attr;
-  
+
   dc->w.flags              = dcs->w.flags & ~DC_SAVED;
 
   dc->w.hFirstBitmap       = dcs->w.hFirstBitmap;
@@ -2386,7 +2386,7 @@
   }
   Dc_Attr = NewDC->pDc_Attr;
   if(!Dc_Attr) Dc_Attr = &NewDC->Dc_Attr;
-  
+
   NewDC->hHmgr = (HGDIOBJ) hDC; // Save the handle for this DC object.
   NewDC->w.xformWorld2Wnd.eM11 = 1.0f;
   NewDC->w.xformWorld2Wnd.eM12 = 0.0f;
@@ -2653,7 +2653,7 @@
   DC_UnlockDc(dc);
   if (!Resource) return;
   KeEnterCriticalRegion();
-  ExAcquireResourceExclusiveLite( Resource , TRUE);  
+  ExAcquireResourceExclusiveLite( Resource , TRUE);
 }
 
 VOID
@@ -3366,7 +3366,7 @@
   } while (pPDev != NULL);
   KeLeaveCriticalRegion();
   if (!pPDev) return NULL;
-  return pGdiDevice->PDev;
+  return pGdiDevice->hPDev;
 }
 
 /* EOF */

Modified: trunk/reactos/subsystems/win32/win32k/objects/icm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/icm.c?rev=31530&r1=31529&r2=31530&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/icm.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/icm.c Tue Jan  1 04:08:07 2008
@@ -98,7 +98,7 @@
         {
           int NewValue = i * 256;
           if (NewValue > 65535) NewValue = 65535;
-          
+
           Ramp->Red[i] = Ramp->Green[i] = Ramp->Blue[i] = ((WORD)NewValue);
         }
      return TRUE;
@@ -122,7 +122,7 @@
   dc = DC_LockDc(hDC);
   if (!dc)
   {
-     SetLastWin32Error(ERROR_INVALID_HANDLE);   
+     SetLastWin32Error(ERROR_INVALID_HANDLE);
      return FALSE;
   }
 
@@ -132,7 +132,7 @@
       DC_UnlockDc(dc);
       SetLastWin32Error(STATUS_NO_MEMORY);
       return FALSE;
-  }  
+  }
 
   Ret = IntGetDeviceGammaRamp((HDEV)dc->pPDev, SafeRamp);
 
@@ -208,7 +208,7 @@
       (pGDev->DevInfo.iDitherFormat == BMF_32BPP))
   {
      if (pGDev->DriverFunctions.IcmSetDeviceGammaRamp)
-         return pGDev->DriverFunctions.IcmSetDeviceGammaRamp( pGDev->PDev,
+         return pGDev->DriverFunctions.IcmSetDeviceGammaRamp( pGDev->hPDev,
                                                         IGRF_RGB_256WORDS,
                                                        pGDev->pvGammaRamp);
 
@@ -232,7 +232,7 @@
      // PALOBJ_cGetColors check mode flags and update Gamma Correction.
      // Set the HDEV to pal and go.
         palGDI->hPDev = hPDev;
-        Ret = pGDev->DriverFunctions.SetPalette(pGDev->PDev, 
+        Ret = pGDev->DriverFunctions.SetPalette(pGDev->hPDev,
                                                      palPtr,
                                                           0,
                                                           0,
@@ -270,9 +270,9 @@
      if (!pGDev->DriverFunctions.IcmSetDeviceGammaRamp)
      {  // No driver support
         if (!(pGDev->DevInfo.flGraphicsCaps2 & GCAPS2_CHANGEGAMMARAMP))
-        { // Driver does not support Gamma Ramp, so test to see we 
+        { // Driver does not support Gamma Ramp, so test to see we
           // have BMF_8BPP only and palette operation support.
-           if ((pGDev->DevInfo.iDitherFormat != BMF_8BPP) || 
+           if ((pGDev->DevInfo.iDitherFormat != BMF_8BPP) ||
               !(pGDev->GDIInfo.flRaster & RC_PALETTE))  return FALSE;
         }
      }
@@ -338,7 +338,7 @@
   dc = DC_LockDc(hDC);
   if (!dc)
   {
-     SetLastWin32Error(ERROR_INVALID_HANDLE);   
+     SetLastWin32Error(ERROR_INVALID_HANDLE);
      return FALSE;
   }
 
@@ -348,7 +348,7 @@
       DC_UnlockDc(dc);
       SetLastWin32Error(STATUS_NO_MEMORY);
       return FALSE;
-  }  
+  }
   _SEH_TRY
   {
      ProbeForRead( Ramp,




More information about the Ros-diffs mailing list