Author: greatlrd
Date: Wed Apr 12 14:15:46 2006
New Revision: 21561
URL:
http://svn.reactos.ru/svn/reactos?rev=21561&view=rev
Log:
commiting file desktop.x from bug 252 , the patch is from j_anderw it make our win32k lile
more stable
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c Wed Apr 12 14:15:46 2006
@@ -790,7 +790,9 @@
CSR_API_MESSAGE Request;
PVOID DesktopHeapSystemBase = NULL;
SIZE_T DesktopInfoSize;
+ UNICODE_STRING SafeDesktopName;
DECLARE_RETURN(HDESK);
+
DPRINT("Enter NtUserCreateDesktop: %wZ\n", lpszDesktopName);
UserEnterExclusive();
@@ -808,15 +810,29 @@
SetLastNtError(Status);
RETURN( NULL);
}
+ if(lpszDesktopName != NULL)
+ {
+ Status = IntSafeCopyUnicodeString(&SafeDesktopName, lpszDesktopName);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ RETURN( NULL);
+ }
+ }
+ else
+ {
+ RtlInitUnicodeString(&SafeDesktopName, NULL);
+ }
if (! IntGetFullWindowStationName(&DesktopName, &WinStaObject->Name,
- lpszDesktopName))
+ &SafeDesktopName))
{
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
ObDereferenceObject(WinStaObject);
+ RtlFreeUnicodeString(&SafeDesktopName);
RETURN( NULL);
}
-
+ RtlFreeUnicodeString(&SafeDesktopName);
ObDereferenceObject(WinStaObject);
/*
@@ -998,6 +1014,7 @@
HWINSTA WinSta;
PWINSTATION_OBJECT WinStaObject;
UNICODE_STRING DesktopName;
+ UNICODE_STRING SafeDesktopName;
NTSTATUS Status;
HDESK Desktop;
DECLARE_RETURN(HDESK);
@@ -1024,14 +1041,30 @@
RETURN( 0);
}
+ if(lpszDesktopName != NULL)
+ {
+ Status = IntSafeCopyUnicodeString(&SafeDesktopName, lpszDesktopName);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ RETURN( NULL);
+ }
+ }
+ else
+ {
+ RtlInitUnicodeString(&SafeDesktopName, NULL);
+ }
+
if (!IntGetFullWindowStationName(&DesktopName, &WinStaObject->Name,
lpszDesktopName))
{
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
ObDereferenceObject(WinStaObject);
+ RtlFreeUnicodeString(&SafeDesktopName);
RETURN( 0);
}
+ RtlFreeUnicodeString(&SafeDesktopName);
ObDereferenceObject(WinStaObject);
DPRINT("Trying to open desktop (%wZ)\n", &DesktopName);