reactos/subsys/win32k/ntuser
diff -u -r1.1.4.15 -r1.1.4.16
--- ntuser.c 27 Sep 2004 12:26:31 -0000 1.1.4.15
+++ ntuser.c 27 Sep 2004 12:48:48 -0000 1.1.4.16
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: ntuser.c,v 1.1.4.15 2004/09/27 12:26:31 royce Exp $
+/* $Id: ntuser.c,v 1.1.4.16 2004/09/27 12:48:48 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -677,13 +677,13 @@
NtUserDefSetText(HWND hWnd, PUNICODE_STRING WindowText)
{
UNICODE_STRING WndText;
+ NTSTATUS Status;
NTUSER_USER_OBJECT(WINDOW, Window);
- BEGIN_BUFFERS();
BEGIN_NTUSER(BOOL, FALSE);
if(WindowText != NULL)
{
- NTUSER_COPY_BUFFER_NTERROR(&WndText, WindowText, sizeof(UNICODE_STRING));
+ Status = IntSafeCopyUnicodeString(&WndText, WindowText);
/* FIXME - probe the string */
}
else
@@ -695,6 +695,11 @@
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
Result = IntDefSetText(Window, &WndText);
LEAVE_CRITICAL();
+
+ if(WindowText != NULL)
+ {
+ RtlFreeUnicodeString(&WndText);
+ }
END_NTUSER();
}
@@ -1554,6 +1559,22 @@
}
BOOL STDCALL
+NtUserMoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint)
+{
+ NTUSER_USER_OBJECT(WINDOW, Window);
+ BEGIN_NTUSER(BOOL, FALSE);
+
+ ENTER_CRITICAL();
+ VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+ Result = WinPosSetWindowPos(Window, NULL, X, Y, nWidth, nHeight,
+ (bRepaint ? SWP_NOZORDER | SWP_NOACTIVATE
+ : SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW));
+ LEAVE_CRITICAL();
+
+ END_NTUSER();
+}
+
+BOOL STDCALL
NtUserPaintDesktop(HDC hDC)
{
BEGIN_NTUSER_NOERR(BOOL);
@@ -1848,6 +1869,29 @@
END_NTUSER();
}
+UINT STDCALL
+NtUserRegisterWindowMessage(PUNICODE_STRING MessageNameUnsafe)
+{
+ UNICODE_STRING SafeMessageName;
+ NTSTATUS Status;
+ BEGIN_NTUSER(UINT,0);
+
+ NTUSER_FAIL_INVALID_PARAMETER(MessageNameUnsafe,NULL);
+
+ Status = IntSafeCopyUnicodeStringTerminateNULL(&SafeMessageName, MessageNameUnsafe);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ return 0;
+ }
+
+ Result = (UINT)IntAddAtom(SafeMessageName.Buffer);
+
+ RtlFreeUnicodeString(&SafeMessageName);
+
+ END_NTUSER();
+}
+
INT STDCALL
NtUserReleaseDC(HWND hWnd, HDC hDc)
{
@@ -2239,28 +2283,6 @@
END_NTUSER();
}
-BOOL STDCALL
-NtUserMoveWindow (
- HWND hWnd,
- int X,
- int Y,
- int nWidth,
- int nHeight,
- BOOL bRepaint )
-{
- NTUSER_USER_OBJECT(WINDOW, Window);
- BEGIN_NTUSER(BOOL, FALSE);
-
- ENTER_CRITICAL();
- VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
- Result = WinPosSetWindowPos(Window, NULL, X, Y, nWidth, nHeight,
- (bRepaint ? SWP_NOZORDER | SWP_NOACTIVATE
- : SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW));
- LEAVE_CRITICAL();
-
- END_NTUSER();
-}
-
WORD STDCALL
NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
{
@@ -2461,26 +2483,3 @@
END_NTUSER_NOERR();
}
-
-UINT STDCALL
-NtUserRegisterWindowMessage(PUNICODE_STRING MessageNameUnsafe)
-{
- UNICODE_STRING SafeMessageName;
- NTSTATUS Status;
- BEGIN_NTUSER(UINT,0);
-
- NTUSER_FAIL_INVALID_PARAMETER(MessageNameUnsafe,NULL);
-
- Status = IntSafeCopyUnicodeStringTerminateNULL(&SafeMessageName, MessageNameUnsafe);
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return 0;
- }
-
- Result = (UINT)IntAddAtom(SafeMessageName.Buffer);
-
- RtlFreeUnicodeString(&SafeMessageName);
-
- END_NTUSER();
-}
reactos/subsys/win32k/ntuser
diff -u -r1.244.2.11 -r1.244.2.12
--- window.c 27 Sep 2004 01:13:52 -0000 1.244.2.11
+++ window.c 27 Sep 2004 12:48:48 -0000 1.244.2.12
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: window.c,v 1.244.2.11 2004/09/27 01:13:52 royce Exp $
+/* $Id: window.c,v 1.244.2.12 2004/09/27 12:48:48 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -1999,27 +1999,33 @@
return NULL;
}
+NTSTATUS STDCALL RtlDuplicateUnicodeString(
+ int add_nul,
+ const UNICODE_STRING *source,
+ UNICODE_STRING *destination);
BOOL INTERNAL_CALL
IntDefSetText(PWINDOW_OBJECT WindowObject, PUNICODE_STRING WindowText)
{
- /* WARNING - do not use or free the WindowText after this call ! */
ASSERT(WindowObject);
RtlFreeUnicodeString(&WindowObject->WindowName);
- WindowObject->WindowName = *WindowText;
- WindowObject->WindowName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowObject->WindowName.Length, TAG_STRING);
- if(WindowObject->WindowName.Buffer != NULL)
+ if(WindowText->Length > 0)
{
- RtlCopyUnicodeString(&WindowObject->WindowName, WindowText);
- }
- else
- {
- DPRINT1("Failed to allocate enough memory for the window text!\n");
- RtlZeroMemory(&WindowObject->WindowName, sizeof(UNICODE_STRING));
+ WindowObject->WindowName.Length = WindowText->Length;
+ WindowObject->WindowName.MaximumLength = WindowObject->WindowName.Length;
+ WindowObject->WindowName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowObject->WindowName.MaximumLength, TAG_STRING);
+ if(WindowObject->WindowName.Buffer != NULL)
+ {
+ RtlCopyMemory(WindowObject->WindowName.Buffer, WindowText->Buffer, WindowObject->WindowName.Length);
+ }
+ else
+ {
+ WindowObject->WindowName.Length = WindowObject->WindowName.MaximumLength = 0;
+ return FALSE;
+ }
}
-
- return FALSE;
+ return TRUE;
}
INT INTERNAL_CALL