[ros-diffs] [jimtabor] 33284: Impement DxEngSetDCState, DxEngIsHdevLockedByCurrentThread and DxEngUn & ReferenceHdev.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Mon May 5 01:17:11 CEST 2008


Author: jimtabor
Date: Sun May  4 18:17:10 2008
New Revision: 33284

URL: http://svn.reactos.org/svn/reactos?rev=33284&view=rev
Log:
Impement DxEngSetDCState, DxEngIsHdevLockedByCurrentThread and DxEngUn & ReferenceHdev.

Modified:
    trunk/reactos/include/reactos/drivers/directx/dxeng.h
    trunk/reactos/subsystems/win32/win32k/include/dc.h
    trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
    trunk/reactos/subsystems/win32/win32k/objects/dc.c

Modified: trunk/reactos/include/reactos/drivers/directx/dxeng.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/directx/dxeng.h?rev=33284&r1=33283&r2=33284&view=diff
==============================================================================
--- trunk/reactos/include/reactos/drivers/directx/dxeng.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/drivers/directx/dxeng.h [iso-8859-1] Sun May  4 18:17:10 2008
@@ -81,7 +81,7 @@
 BOOLEAN STDCALL DxEngLockHdev(HDEV hdev);
 BOOLEAN STDCALL DxEngUnlockHdev(HDEV hdev);
 DWORD_PTR STDCALL DxEngGetDCState(HDC hDC, DWORD type);
-DWORD STDCALL DxEngReferenceHdev(HDEV hdev);
+BOOLEAN STDCALL DxEngReferenceHdev(HDEV hdev);
 BOOLEAN STDCALL DxEngLockShareSem();
 BOOLEAN STDCALL DxEngUnlockShareSem();
 DWORD STDCALL DxEngScreenAccessCheck();
@@ -99,14 +99,14 @@
 
 HDC STDCALL DxEngCreateMemoryDC(HDEV hDev);
 
-DWORD STDCALL DxEngIsHdevLockedByCurrentThread(DWORD x1);
-DWORD STDCALL DxEngUnreferenceHdev(DWORD x1);
+BOOLEAN STDCALL DxEngIsHdevLockedByCurrentThread(HDEV hDev);
+BOOLEAN STDCALL DxEngUnreferenceHdev(HDEV hDev);
 DWORD STDCALL DxEngSpTearDownSprites(DWORD x1, DWORD x2, DWORD x3);
 DWORD STDCALL DxEngSpUnTearDownSprites(DWORD x1, DWORD x2, DWORD x3);
 DWORD STDCALL DxEngSpSpritesVisible(DWORD x1);
 HDC STDCALL DxEngGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd);
 BOOLEAN STDCALL DxEngDeleteDC(HDC hdc, BOOL Force);
-DWORD STDCALL DxEngSetDCState(DWORD x1, DWORD x2, DWORD x3);
+BOOLEAN STDCALL DxEngSetDCState(HDC hDC, DWORD SetType, DWORD Set);
 DWORD STDCALL DxEngSelectBitmap(DWORD x1, DWORD x2);
 DWORD STDCALL DxEngSetBitmapOwner(DWORD x1, DWORD x2);
 DWORD STDCALL DxEngDeleteSurface(DWORD x1);

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=33284&r1=33283&r2=33284&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Sun May  4 18:17:10 2008
@@ -261,5 +261,7 @@
 UINT STDCALL  IntGdiGetTextAlign(HDC  hDC);
 COLORREF STDCALL  IntGdiGetTextColor(HDC  hDC);
 INT STDCALL  IntGdiSetStretchBltMode(HDC  hDC, INT  stretchBltMode);
+VOID FASTCALL IntGdiReferencePdev(PGDIDEVICE pPDev);
+VOID FASTCALL IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType);
 
 #endif /* not __WIN32K_DC_H */

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=33284&r1=33283&r2=33284&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] Sun May  4 18:17:10 2008
@@ -592,12 +592,11 @@
 /************************************************************************/
 /* DxEngReferenceHdev                                                   */
 /************************************************************************/
-DWORD
+BOOLEAN
 STDCALL
 DxEngReferenceHdev(HDEV hDev)
 {
-    UNIMPLEMENTED;
-
+    IntGdiReferencePdev((PGDIDEVICE) hDev);;
     /* ALWAYS return true */
     return TRUE;
 }
@@ -680,24 +679,24 @@
 /************************************************************************/
 /* DxEngIsHdevLockedByCurrentThread                                     */
 /************************************************************************/
-DWORD
-STDCALL
-DxEngIsHdevLockedByCurrentThread(DWORD x1)
-{
-    UNIMPLEMENTED;
-    return FALSE;
+BOOLEAN
+STDCALL
+DxEngIsHdevLockedByCurrentThread(HDEV hDev)
+{   // base on EngIsSemaphoreOwnedByCurrentThread w/o the Ex call.
+    PERESOURCE pSem = ((PGDIDEVICE)hDev)->hsemDevLock;
+    return pSem->OwnerEntry.OwnerThread == (ERESOURCE_THREAD)PsGetCurrentThread();
 }
 
 
 /************************************************************************/
 /* DxEngUnreferenceHdev                                                 */
 /************************************************************************/
-DWORD
-STDCALL
-DxEngUnreferenceHdev(DWORD x1)
-{
-    UNIMPLEMENTED;
-    return FALSE;
+BOOLEAN
+STDCALL
+DxEngUnreferenceHdev(HDEV hDev)
+{
+    IntGdiUnreferencePdev((PGDIDEVICE) hDev, 0);
+    return TRUE; // Always true.
 }
 
 /************************************************************************/
@@ -757,10 +756,27 @@
 /************************************************************************/
 /* DxEngSetDCState                                                      */
 /************************************************************************/
-DWORD STDCALL DxEngSetDCState(DWORD x1, DWORD x2, DWORD x3)
-{
-    UNIMPLEMENTED;
-    return FALSE;
+BOOLEAN
+STDCALL
+DxEngSetDCState(HDC hDC, DWORD SetType, DWORD Set)
+{
+   BOOLEAN Ret = FALSE;
+   PDC pDC = DC_LockDc(hDC);
+
+   if (pDC)
+   {
+      if (SetType == 1)
+      {   
+        if ( Set )
+            pDC->DC_Flags |= DC_FLAG_FULLSCREEN;
+        else
+            pDC->DC_Flags &= ~DC_FLAG_FULLSCREEN;
+        Ret = TRUE;
+      }
+      DC_UnlockDc(pDC);
+      return Ret; // Everything else returns FALSE.
+   }
+   return Ret;
 }
 
 /************************************************************************/

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=33284&r1=33283&r2=33284&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Sun May  4 18:17:10 2008
@@ -2699,6 +2699,19 @@
    return &PrimarySurface;
 }
 
+VOID FASTCALL
+IntGdiReferencePdev(PGDIDEVICE pPDev)
+{
+  pPDev->cPdevRefs++;
+}
+
+VOID FASTCALL
+IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType) 
+{
+  pPDev->cPdevRefs--;
+}
+
+
 #define SIZEOF_DEVMODEW_300 188
 #define SIZEOF_DEVMODEW_400 212
 #define SIZEOF_DEVMODEW_500 220



More information about the Ros-diffs mailing list