[Win32k]
authorJames Tabor <james.tabor@reactos.org>
Wed, 28 Nov 2012 23:05:57 +0000 (23:05 +0000)
committerJames Tabor <james.tabor@reactos.org>
Wed, 28 Nov 2012 23:05:57 +0000 (23:05 +0000)
- Fix crash when the exception is thrown.

svn path=/trunk/; revision=57779

reactos/win32ss/user/ntuser/painting.c

index f85adff..5779fff 100644 (file)
@@ -1088,6 +1088,8 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* pUnsafePs)
       RETURN(FALSE);
    }
 
+   UserRefObjectCo(Window, &Ref); // Here for the exception.
+
    _SEH2_TRY
    {
       ProbeForRead(pUnsafePs, sizeof(*pUnsafePs), 1);
@@ -1103,8 +1105,6 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* pUnsafePs)
       RETURN(FALSE);
    }
 
-   UserRefObjectCo(Window, &Ref);
-
    RETURN(IntEndPaint(Window, &Ps));
 
 CLEANUP: