diff --git a/reactos/subsystems/win32/win32k/include/ntuser.h b/reactos/subsystems/win32/win32k/include/ntuser.h index 83b21556862..3a82f9d9f18 100644 --- a/reactos/subsystems/win32/win32k/include/ntuser.h +++ b/reactos/subsystems/win32/win32k/include/ntuser.h @@ -10,6 +10,7 @@ #define UserLeaveCo UserLeave extern PSERVERINFO gpsi; +extern PTHREADINFO gptiCurrent; INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID); VOID FASTCALL CleanupUserImpl(VOID); diff --git a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c index 3a214adfaaa..8ab32f2887d 100644 --- a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c @@ -1157,14 +1157,45 @@ NtUserFillWindow(HWND hWndPaint, } /* - * @unimplemented + * @implemented */ BOOL APIENTRY NtUserFlashWindowEx(IN PFLASHWINFO pfwi) { - STUB + PWND pWnd; + FLASHWINFO finfo = {0}; + BOOL Ret = TRUE; - return 1; + UserEnterExclusive(); + + _SEH2_TRY + { + ProbeForRead(pfwi, sizeof(FLASHWINFO), sizeof(ULONG)); + RtlCopyMemory(&finfo, pfwi, sizeof(FLASHWINFO)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + Ret = FALSE; + } + _SEH2_END + + if (!Ret) goto Exit; + + if (!(pWnd = (PWND)UserGetObject(gHandleTable, finfo.hwnd, otWindow)) || + finfo.cbSize != sizeof(FLASHWINFO) || + finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) ) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + Ret = FALSE; + goto Exit; + } + + //Ret = IntFlashWindowEx(pWnd, &finfo); + +Exit: + UserLeave(); + return Ret; } /* diff --git a/reactos/subsystems/win32/win32k/ntuser/ntuser.c b/reactos/subsystems/win32/win32k/ntuser/ntuser.c index 6ed9f8f262d..832c4a399db 100644 --- a/reactos/subsystems/win32/win32k/ntuser/ntuser.c +++ b/reactos/subsystems/win32/win32k/ntuser/ntuser.c @@ -17,9 +17,12 @@ BOOL InitSysParams(); /* GLOBALS *******************************************************************/ +PTHREADINFO gptiCurrent = NULL; ERESOURCE UserLock; ATOM AtomMessage; // Window Message atom. ATOM AtomWndObj; // Window Object atom. +ATOM AtomLayer; // Window Layer atom. +ATOM AtomFlashWndState; // Window Flash State atom. BOOL gbInitialized; HINSTANCE hModClient = NULL; BOOL ClientPfnInit = FALSE; @@ -46,6 +49,8 @@ InitUserAtoms(VOID) gpsi->atomContextHelpIdProp = IntAddGlobalAtom(L"SysCH", TRUE); AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE); + AtomLayer = IntAddGlobalAtom(L"SysLayer", TRUE); + AtomFlashWndState = IntAddGlobalAtom(L"FlashWState", TRUE); return STATUS_SUCCESS; } @@ -222,6 +227,7 @@ VOID FASTCALL UserEnterExclusive(VOID) ASSERT_NOGDILOCKS(); KeEnterCriticalRegion(); ExAcquireResourceExclusiveLite(&UserLock, TRUE); + gptiCurrent = PsGetCurrentThreadWin32Thread(); } VOID FASTCALL UserLeave(VOID)