[Win32k]
[reactos.git] / reactos / subsystems / win32 / win32k / ntuser / ntstubs.c
index 401af3d..1f7615d 100644 (file)
@@ -40,13 +40,13 @@ NtUserAttachThreadInput(
   Status = PsLookupThreadByThreadId((HANDLE)idAttach, &Thread);
   if (!NT_SUCCESS(Status))
   {
-     SetLastWin32Error(ERROR_INVALID_PARAMETER);
+     EngSetLastError(ERROR_INVALID_PARAMETER);
      goto Exit;
   }
   Status = PsLookupThreadByThreadId((HANDLE)idAttachTo, &ThreadTo);
   if (!NT_SUCCESS(Status))
   {
-     SetLastWin32Error(ERROR_INVALID_PARAMETER);
+     EngSetLastError(ERROR_INVALID_PARAMETER);
      ObDereferenceObject(Thread);
      goto Exit;
   }
@@ -292,7 +292,7 @@ NtUserGetMouseMovePointsEx(
    if ((cbSize != sizeof(MOUSEMOVEPOINT)) || (nBufPoints < 0) || (nBufPoints > 64))
    {
       UserLeave();
-      SetLastWin32Error(ERROR_INVALID_PARAMETER);
+      EngSetLastError(ERROR_INVALID_PARAMETER);
       return -1;
    }
 
@@ -304,7 +304,7 @@ NtUserGetMouseMovePointsEx(
    _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
    {
        SetLastNtError(_SEH2_GetExceptionCode());
-       SetLastWin32Error(ERROR_NOACCESS);
+       EngSetLastError(ERROR_NOACCESS);
    }
    _SEH2_END;
 
@@ -316,7 +316,7 @@ NtUserGetMouseMovePointsEx(
      case GMMP_USE_HIGH_RESOLUTION_POINTS:
           break;
      default:
-        SetLastWin32Error(GMMP_ERR_POINT_NOT_FOUND);
+        EngSetLastError(GMMP_ERR_POINT_NOT_FOUND);
         return GMMP_ERR_POINT_NOT_FOUND;
    }
   */
@@ -564,7 +564,7 @@ NtUserSetSysColors(
   }
   if (Ret)
   {
-     UserPostMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0);
+     UserSendNotifyMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0);
   }
   UserLeave();
   return Ret;
@@ -817,8 +817,45 @@ NtUserMinMaximize(
     UINT cmd, // Wine SW_ commands
     BOOL Hide)
 {
-    UNIMPLEMENTED;
-    return 0;
+  RECTL NewPos;
+  UINT SwFlags;
+  PWND pWnd;
+
+  DPRINT("Enter NtUserMinMaximize\n");
+  UserEnterExclusive();
+
+  pWnd = UserGetWindowObject(hWnd);
+  if ( !pWnd ||                          // FIXME:
+        pWnd == IntGetDesktopWindow() || // pWnd->fnid == FNID_DESKTOP
+        pWnd == IntGetMessageWindow() )  // pWnd->fnid == FNID_MESSAGEWND
+  {
+     goto Exit;
+  }
+
+  if ( cmd > SW_MAX || pWnd->state2 & WNDS2_INDESTROY)
+  {
+     EngSetLastError(ERROR_INVALID_PARAMETER);
+     goto Exit;
+  }
+
+  co_WinPosMinMaximize(pWnd, cmd, &NewPos);
+
+  SwFlags = Hide ? SWP_NOACTIVATE|SWP_NOZORDER|SWP_FRAMECHANGED : SWP_NOZORDER|SWP_FRAMECHANGED;
+
+  co_WinPosSetWindowPos( pWnd,
+                         NULL,
+                         NewPos.left,
+                         NewPos.top,
+                         NewPos.right,
+                         NewPos.bottom,
+                         SwFlags);
+
+  co_WinPosShowWindow(pWnd, cmd);
+
+Exit:
+  DPRINT("Leave NtUserMinMaximize\n");
+  UserLeave();
+  return 0; // Always NULL?
 }
 
 DWORD
@@ -1168,18 +1205,6 @@ NtUserDrawMenuBarTemp(
    return 0;
 }
 
-/*
- * @unimplemented
- */
-DWORD APIENTRY
-NtUserEndDeferWindowPosEx(DWORD Unknown0,
-                          DWORD Unknown1)
-{
-   UNIMPLEMENTED
-
-   return 0;
-}
-
 /*
  * FillWindow: Called from User; Dialog, Edit and ListBox procs during a WM_ERASEBKGND.
  */
@@ -1205,7 +1230,7 @@ NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
 {
    UNIMPLEMENTED
 
-   return 0;
+   return 1;
 }
 
 /*
@@ -1272,17 +1297,6 @@ NtUserSetLayeredWindowAttributes(HWND hwnd,
   return FALSE;
 }
 
-/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserSetLogonNotifyWindow(HWND hWnd)
-{
-   UNIMPLEMENTED
-
-   return 0;
-}
-
 /*
  * @unimplemented
  */
@@ -1316,25 +1330,6 @@ NtUserWindowFromPhysicalPoint(POINT Point)
    return NULL;
 }
 
-/*
- * @unimplemented
- */
-HDWP APIENTRY
-NtUserDeferWindowPos(HDWP WinPosInfo,
-                     HWND Wnd,
-                     HWND WndInsertAfter,
-                     int x,
-                     int y,
-                     int cx,
-                     int cy,
-                     UINT Flags)
-{
-   UNIMPLEMENTED
-
-   return 0;
-}
-
-
 /*
  * NtUserResolveDesktopForWOW
  *
@@ -1349,16 +1344,6 @@ NtUserResolveDesktopForWOW(DWORD Unknown0)
    return 0;
 }
 
-BOOL
-APIENTRY
-NtUserDragDetect(
-   HWND hWnd,
-   POINT pt) // Just like the User call.
-{
-   UNIMPLEMENTED
-   return 0;
-}
-
 /*
  * @unimplemented
  */