From a9a2a4be8fe7f1f985b3f3b01a370352b44fc325 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 2 Jul 2009 19:09:32 +0000 Subject: [PATCH] - In the process of rewriting IntGdiCreateDisplayDC, making it an intermediate level support function for IntGdiCreateDC. svn path=/trunk/; revision=41744 --- .../subsystems/win32/win32k/include/desktop.h | 9 ++------ .../subsystems/win32/win32k/ntddraw/dxeng.c | 15 +------------ .../subsystems/win32/win32k/ntuser/desktop.c | 21 +++++++++++++++++++ .../subsystems/win32/win32k/objects/dclife.c | 1 + 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/desktop.h b/reactos/subsystems/win32/win32k/include/desktop.h index 8b7d15a3a95..c7d28e6a1c6 100644 --- a/reactos/subsystems/win32/win32k/include/desktop.h +++ b/reactos/subsystems/win32/win32k/include/desktop.h @@ -110,22 +110,17 @@ IntValidateDesktopHandle( KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess, PDESKTOP *Object); - NTSTATUS FASTCALL IntParseDesktopPath(PEPROCESS Process, PUNICODE_STRING DesktopPath, HWINSTA *hWinSta, HDESK *hDesktop); - -BOOL FASTCALL -IntDesktopUpdatePerUserSettings(BOOL bEnable); - +BOOL FASTCALL IntDesktopUpdatePerUserSettings(BOOL bEnable); VOID APIENTRY UserRedrawDesktop(VOID); - BOOL IntRegisterShellHookWindow(HWND hWnd); BOOL IntDeRegisterShellHookWindow(HWND hWnd); - VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam); +HDC FASTCALL UserGetDesktopDC(ULONG,BOOL,BOOL); #define IntIsActiveDesktop(Desktop) \ ((Desktop)->WindowStation->ActiveDesktop == (Desktop)) diff --git a/reactos/subsystems/win32/win32k/ntddraw/dxeng.c b/reactos/subsystems/win32/win32k/ntddraw/dxeng.c index f29b860f125..1f0436e6db5 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/dxeng.c +++ b/reactos/subsystems/win32/win32k/ntddraw/dxeng.c @@ -698,20 +698,7 @@ HDC APIENTRY DxEngGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd) { - PWINDOW_OBJECT DesktopObject = 0; - HDC DesktopHDC = 0; - - if (DcType == DC_TYPE_DIRECT) - { - DesktopObject = UserGetDesktopWindow(); - DesktopHDC = (HDC)UserGetWindowDC(DesktopObject); - } - else - { - UNIMPLEMENTED; - } - - return DesktopHDC; + return UserGetDesktopDC(DcType, EmptyDC, ValidatehWnd); } /************************************************************************/ diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index bdaadf71feb..b04fbe84037 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -618,6 +618,27 @@ BOOL FASTCALL IntDesktopUpdatePerUserSettings(BOOL bEnable) /* PUBLIC FUNCTIONS ***********************************************************/ +HDC FASTCALL +UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd) +{ + PWINDOW_OBJECT DesktopObject = 0; + HDC DesktopHDC = 0; + + if (DcType == DC_TYPE_DIRECT) + { + DesktopObject = UserGetDesktopWindow(); + DesktopHDC = (HDC)UserGetWindowDC(DesktopObject); + } + else + { + HDEV hDev; + hDev = (HDEV)pPrimarySurface; + DesktopHDC = IntGdiCreateDisplayDC(hDev, DcType, EmptyDC); + } + + return DesktopHDC; +} + VOID APIENTRY UserRedrawDesktop() { diff --git a/reactos/subsystems/win32/win32k/objects/dclife.c b/reactos/subsystems/win32/win32k/objects/dclife.c index d204f96012e..e7805ba9c56 100644 --- a/reactos/subsystems/win32/win32k/objects/dclife.c +++ b/reactos/subsystems/win32/win32k/objects/dclife.c @@ -432,6 +432,7 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC) // // If NULL, first time through! Build the default (was window) dc! +// Setup clean DC state for the system. // if (hDC && !defaultDCstate) // Ultra HAX! Dedicated to GvG! { // This is a cheesy way to do this.