diff --git a/reactos/subsystems/win32/win32k/ntuser/class.c b/reactos/subsystems/win32/win32k/ntuser/class.c index 2af4d15bc38..74c613c1a64 100644 --- a/reactos/subsystems/win32/win32k/ntuser/class.c +++ b/reactos/subsystems/win32/win32k/ntuser/class.c @@ -30,8 +30,8 @@ #include -#define NDEBUG -#include +//#define YDEBUG +#include /* WINDOWCLASS ***************************************************************/ @@ -827,6 +827,9 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx, RTL_ATOM Atom; NTSTATUS Status = STATUS_SUCCESS; + TRACE("lpwcx=%p ClassName=%wZ MenuName=%wZ wpExtra=%p dwFlags=%08x Desktop=%p pi=%p\n", + lpwcx, ClassName, MenuName, wpExtra, dwFlags, Desktop, pi); + if (!IntRegisterClassAtom(ClassName, &Atom)) { @@ -2100,12 +2103,19 @@ NtUserGetClassInfo( pi = GetW32ProcessInfo(); if (pi == NULL) { + ERR("GetW32ProcessInfo() returned NULL!\n"); goto Cleanup; } _SEH_TRY { /* probe the paramters */ CapturedClassName = ProbeForReadUnicodeString(ClassName); + + if (IS_ATOM(CapturedClassName.Buffer)) + TRACE("hInst %p atom %04X lpWndClassEx %p Ansi %d\n", hInstance, CapturedClassName.Buffer, lpWndClassEx, Ansi); + else + TRACE("hInst %p class %wZ lpWndClassEx %p Ansi %d\n", hInstance, &CapturedClassName, lpWndClassEx, Ansi); + if (CapturedClassName.Length & 1) { goto InvalidParameter; @@ -2121,6 +2131,7 @@ NtUserGetClassInfo( { if (!IS_ATOM(CapturedClassName.Buffer)) { + ERR("NtUserGetClassInfo() got ClassName instead of Atom!\n"); goto InvalidParameter; } } @@ -2151,7 +2162,6 @@ InvalidParameter: if (Ret) { lpWndClassEx->lpszClassName = CapturedClassName.Buffer; - /* FIXME - handle Class->Desktop == NULL!!!!! */ if (Class->MenuName != NULL && @@ -2168,6 +2178,7 @@ InvalidParameter: if (!(Class->Global || Class->System) && hInstance == NULL) { + WARN("Tried to get information of a non-existing class\n"); SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST); Ret = FALSE; } @@ -2175,6 +2186,7 @@ InvalidParameter: } else { + WARN("Tried to get information of a non-existing class\n"); SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST); } } diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index 8a83234c101..8ed84433508 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -31,8 +31,8 @@ #include -#define NDEBUG -#include +//#define YDEBUG +#include static VOID @@ -1694,6 +1694,8 @@ IntUnmapDesktopView(IN PDESKTOP_OBJECT DesktopObject) PW32HEAP_USER_MAPPING HeapMapping, *PrevLink = &PsGetCurrentProcessWin32Process()->HeapMappings.Next; NTSTATUS Status = STATUS_SUCCESS; + TRACE("DO %p\n"); + /* unmap if we're the last thread using the desktop */ HeapMapping = *PrevLink; while (HeapMapping != NULL) @@ -1756,6 +1758,7 @@ IntMapDesktopView(IN PDESKTOP_OBJECT DesktopObject) } /* we're the first, map the heap */ + DPRINT("Noone mapped the desktop heap %p yet, so - map it!\n", DesktopObject->hDesktopHeap); Offset.QuadPart = 0; Status = MmMapViewOfSection(DesktopObject->DesktopHeapSection, PsGetCurrentProcess(), @@ -1769,7 +1772,7 @@ IntMapDesktopView(IN PDESKTOP_OBJECT DesktopObject) PAGE_EXECUTE_READ); /* would prefer PAGE_READONLY, but thanks to RTL heaps... */ if (!NT_SUCCESS(Status)) { - DbgPrint("Failed to map desktop\n"); + DPRINT1("Failed to map desktop\n"); return Status; } @@ -1779,6 +1782,7 @@ IntMapDesktopView(IN PDESKTOP_OBJECT DesktopObject) { MmUnmapViewOfSection(PsGetCurrentProcess(), UserBase); + DPRINT1("UserHeapAlloc() failed!\n"); return STATUS_NO_MEMORY; } @@ -1786,6 +1790,7 @@ IntMapDesktopView(IN PDESKTOP_OBJECT DesktopObject) HeapMapping->KernelMapping = (PVOID)DesktopObject->hDesktopHeap; HeapMapping->UserMapping = UserBase; HeapMapping->Count = 1; + *PrevLink = HeapMapping; ObReferenceObject(DesktopObject); @@ -1812,6 +1817,7 @@ IntSetThreadDesktop(IN PDESKTOP_OBJECT DesktopObject, NTSTATUS Status; BOOL MapHeap; + DPRINT("IntSetThreadDesktop() DO=%p, FOF=%d\n", DesktopObject, FreeOnFailure); MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess); W32Thread = PsGetCurrentThreadWin32Thread();