[Win32k]
authorJames Tabor <james.tabor@reactos.org>
Mon, 22 Aug 2011 19:58:32 +0000 (19:58 +0000)
committerJames Tabor <james.tabor@reactos.org>
Mon, 22 Aug 2011 19:58:32 +0000 (19:58 +0000)
- Implement FlashWindowEx without the state verification test via global atom and window properties list. Pass all but two in win:test_FlashWindowEx.
- Add missing atom's and global thread information pointer, based on patch from bug 5655.

svn path=/trunk/; revision=53385

reactos/subsystems/win32/win32k/include/ntuser.h
reactos/subsystems/win32/win32k/ntuser/ntstubs.c
reactos/subsystems/win32/win32k/ntuser/ntuser.c

index 83b2155..3a82f9d 100644 (file)
@@ -10,6 +10,7 @@
 #define UserLeaveCo UserLeave
 
 extern PSERVERINFO gpsi;
+extern PTHREADINFO gptiCurrent;
 
 INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID);
 VOID FASTCALL CleanupUserImpl(VOID);
index 3a214ad..8ab32f2 100644 (file)
@@ -1157,14 +1157,45 @@ NtUserFillWindow(HWND hWndPaint,
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL APIENTRY
 NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
 {
-   STUB
+   PWND pWnd;
+   FLASHWINFO finfo = {0};
+   BOOL Ret = TRUE;
+
+   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);
 
-   return 1;
+Exit:
+   UserLeave();
+   return Ret;
 }
 
 /*
index 6ed9f8f..832c4a3 100644 (file)
@@ -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)