mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -20,7 +20,7 @@
|
|||
#include <include/guicheck.h>
|
||||
#include <include/window.h>
|
||||
|
||||
//#define NDEBUG
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -249,9 +249,7 @@ NtUserReleaseDC(HWND hWnd, HDC hDc)
|
|||
HDC STDCALL
|
||||
NtUserGetDC(HWND hWnd)
|
||||
{
|
||||
if (!hWnd)
|
||||
return NtUserGetDCEx(0, 0, DCX_CACHE | DCX_WINDOW);
|
||||
return NtUserGetDCEx(hWnd, 0, DCX_USESTYLE);
|
||||
return NtUserGetDCEx(hWnd, NULL, NULL == hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE);
|
||||
}
|
||||
|
||||
DCE* DceAllocDCE(HWND hWnd, DCE_TYPE Type)
|
||||
|
@ -331,16 +329,24 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
|||
BOOL UpdateClipOrigin = FALSE;
|
||||
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);
|
||||
}
|
||||
|
||||
if (Window->Dce == NULL)
|
||||
if (NULL == Window || NULL == Window->Dce)
|
||||
{
|
||||
Flags |= DCX_CACHE;
|
||||
}
|
||||
|
||||
|
||||
if (Flags & DCX_USESTYLE)
|
||||
{
|
||||
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
||||
|
@ -380,7 +386,7 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
|||
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;
|
||||
}
|
||||
|
@ -444,7 +450,7 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
|||
DbgBreakPoint();
|
||||
}
|
||||
|
||||
if (Dce == NULL)
|
||||
if (NULL == Dce && NULL != Window)
|
||||
{
|
||||
W32kReleaseWindowObject(Window);
|
||||
return(NULL);
|
||||
|
@ -525,7 +531,11 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
|||
{
|
||||
W32kDeleteObject(hRgnVisible);
|
||||
}
|
||||
W32kReleaseWindowObject(Window);
|
||||
if (NULL != Window)
|
||||
{
|
||||
W32kReleaseWindowObject(Window);
|
||||
}
|
||||
|
||||
return(Dce->hDC);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue