mirror of
https://github.com/reactos/reactos.git
synced 2025-07-12 21:44:20 +00:00
Fix GetDC(NULL), not complete yet
svn path=/trunk/; revision=4640
This commit is contained in:
parent
158fda092b
commit
e6f39d93f0
2 changed files with 21 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: class.c,v 1.14 2002/10/31 00:03:31 dwelch Exp $
|
/* $Id: class.c,v 1.15 2003/05/03 14:12:14 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
#include <include/guicheck.h>
|
#include <include/guicheck.h>
|
||||||
#include <include/window.h>
|
#include <include/window.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: windc.c,v 1.8 2003/03/08 13:16:51 gvg Exp $
|
/* $Id: windc.c,v 1.9 2003/05/03 14:12:14 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -249,9 +249,7 @@ NtUserReleaseDC(HWND hWnd, HDC hDc)
|
||||||
HDC STDCALL
|
HDC STDCALL
|
||||||
NtUserGetDC(HWND hWnd)
|
NtUserGetDC(HWND hWnd)
|
||||||
{
|
{
|
||||||
if (!hWnd)
|
return NtUserGetDCEx(hWnd, NULL, NULL == hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE);
|
||||||
return NtUserGetDCEx(0, 0, DCX_CACHE | DCX_WINDOW);
|
|
||||||
return NtUserGetDCEx(hWnd, 0, DCX_USESTYLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DCE* DceAllocDCE(HWND hWnd, DCE_TYPE Type)
|
DCE* DceAllocDCE(HWND hWnd, DCE_TYPE Type)
|
||||||
|
@ -331,16 +329,24 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
||||||
BOOL UpdateClipOrigin = FALSE;
|
BOOL UpdateClipOrigin = FALSE;
|
||||||
HANDLE hRgnVisible = NULL;
|
HANDLE hRgnVisible = NULL;
|
||||||
|
|
||||||
if ((Window = W32kGetWindowObject(hWnd)) == NULL)
|
if (NULL == hWnd)
|
||||||
|
__asm__("int $3\n");
|
||||||
|
if (NULL == hWnd)
|
||||||
|
{
|
||||||
|
Flags &= ~DCX_USESTYLE;
|
||||||
|
Window = NULL;
|
||||||
|
}
|
||||||
|
else if (NULL == (Window = W32kGetWindowObject(hWnd)))
|
||||||
{
|
{
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Window->Dce == NULL)
|
if (NULL == Window || NULL == Window->Dce)
|
||||||
{
|
{
|
||||||
Flags |= DCX_CACHE;
|
Flags |= DCX_CACHE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Flags & DCX_USESTYLE)
|
if (Flags & DCX_USESTYLE)
|
||||||
{
|
{
|
||||||
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
||||||
|
@ -380,7 +386,7 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
||||||
Flags = (Flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
|
Flags = (Flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(Window->Style & WS_CHILD) || Window->Parent == NULL)
|
if (NULL == Window || !(Window->Style & WS_CHILD) || NULL == Window->Parent)
|
||||||
{
|
{
|
||||||
Flags &= ~DCX_PARENTCLIP;
|
Flags &= ~DCX_PARENTCLIP;
|
||||||
}
|
}
|
||||||
|
@ -444,7 +450,7 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
||||||
DbgBreakPoint();
|
DbgBreakPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Dce == NULL)
|
if (NULL == Dce && NULL != Window)
|
||||||
{
|
{
|
||||||
W32kReleaseWindowObject(Window);
|
W32kReleaseWindowObject(Window);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
@ -525,7 +531,11 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
||||||
{
|
{
|
||||||
W32kDeleteObject(hRgnVisible);
|
W32kDeleteObject(hRgnVisible);
|
||||||
}
|
}
|
||||||
|
if (NULL != Window)
|
||||||
|
{
|
||||||
W32kReleaseWindowObject(Window);
|
W32kReleaseWindowObject(Window);
|
||||||
|
}
|
||||||
|
|
||||||
return(Dce->hDC);
|
return(Dce->hDC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue