Author: janderwald
Date: Sun Feb 11 18:32:54 2007
New Revision: 25788
URL:
http://svn.reactos.org/svn/reactos?rev=25788&view=rev
Log:
- Fix a bug in NtUserOpenDesktop and simply the code
- Fix bug in NtUserEnumDisplayDevices
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c Sun Feb 11 18:32:54 2007
@@ -1068,6 +1068,7 @@
UNICODE_STRING SafeDesktopName;
NTSTATUS Status;
HDESK Desktop;
+ BOOL Result;
DECLARE_RETURN(HDESK);
DPRINT("Enter NtUserOpenDesktop: %wZ\n", lpszDesktopName);
@@ -1106,17 +1107,19 @@
RtlInitUnicodeString(&SafeDesktopName, NULL);
}
- if (!IntGetFullWindowStationName(&DesktopName, &WinStaObject->Name,
- lpszDesktopName))
- {
- SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
- ObDereferenceObject(WinStaObject);
- RtlFreeUnicodeString(&SafeDesktopName);
- RETURN( 0);
- }
+ Result = IntGetFullWindowStationName(&DesktopName, &WinStaObject->Name,
+ &SafeDesktopName);
RtlFreeUnicodeString(&SafeDesktopName);
ObDereferenceObject(WinStaObject);
+
+
+ if (!Result)
+ {
+ SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
+ RETURN( 0);
+ }
+
DPRINT("Trying to open desktop (%wZ)\n", &DesktopName);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c Sun Feb 11 18:32:54 2007
@@ -213,8 +213,8 @@
if (lpDisplayDevice->cb < sizeof(DISPLAY_DEVICE))
return FALSE;
- swprintf(lpDisplayDevice->DeviceName, L"\\\\.\\DISPLAY1");
- swprintf(lpDisplayDevice->DeviceString, L"<Unknown>");
+ wcscpy(lpDisplayDevice->DeviceName, L"\\\\.\\DISPLAY1");
+ wcscpy(lpDisplayDevice->DeviceString, L"<Unknown>");
lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
| DISPLAY_DEVICE_MODESPRUNED
| DISPLAY_DEVICE_PRIMARY_DEVICE