mirror of
https://github.com/reactos/reactos.git
synced 2024-11-19 05:22:59 +00:00
SelectObject with a NULL DC returns 0 and sets ERROR_INVALID_HANDLE.
svn path=/trunk/; revision=21014
This commit is contained in:
parent
d81a4d5c75
commit
aeffcda51e
1 changed files with 11 additions and 2 deletions
|
@ -2069,8 +2069,17 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
HRGN hVisRgn;
|
HRGN hVisRgn;
|
||||||
BOOLEAN Failed;
|
BOOLEAN Failed;
|
||||||
|
|
||||||
if(!hDC || !hGDIObj) return NULL;
|
if (!hDC || !hGDIObj)
|
||||||
|
{
|
||||||
|
/* From Wine:
|
||||||
|
* SelectObject() with a NULL DC returns 0 and sets ERROR_INVALID_HANDLE.
|
||||||
|
* Note: Under XP at least invalid ptrs can also be passed, not just NULL;
|
||||||
|
* Don't test that here in case it crashes earlier win versions.
|
||||||
|
*/
|
||||||
|
if (!hDC) SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (NULL == dc)
|
if (NULL == dc)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue