Skip to content

Commit

Permalink
[NTUSER] Error of co_UserCreateWindowEx should display class name (#5682
Browse files Browse the repository at this point in the history
)

The error messsage of co_UserCreateWindowEx
was unfriendly to the debugger.
Show the window class name by using "%wZ" in
co_UserCreateWindowEx.
  • Loading branch information
katahiromz committed Sep 11, 2023
1 parent 1961d70 commit bcd916b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions win32ss/user/ntuser/window.c
Expand Up @@ -2194,7 +2194,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
pti = GetW32ThreadInfo();
if (pti == NULL || pti->rpdesk == NULL)
{
ERR("Thread is not attached to a desktop! Cannot create window!\n");
ERR("Thread is not attached to a desktop! Cannot create window (%wZ)\n", ClassName);
return NULL; // There is nothing to cleanup.
}
WinSta = pti->rpdesk->rpwinstaParent;
Expand Down Expand Up @@ -2229,7 +2229,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
}
else if ((Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
{
ERR("Cannot create a child window without a parent!\n");
ERR("Cannot create a child window (%wZ) without a parent\n", ClassName);
EngSetLastError(ERROR_TLW_WITH_WSCHILD);
goto cleanup; /* WS_CHILD needs a parent, but WS_POPUP doesn't */
}
Expand All @@ -2249,12 +2249,12 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,

if (hWndParent && !ParentWindow)
{
ERR("Got invalid parent window handle\n");
ERR("Got invalid parent window handle for %wZ\n", ClassName);
goto cleanup;
}
else if (hWndOwner && !OwnerWindow)
{
ERR("Got invalid owner window handle\n");
ERR("Got invalid owner window handle for %wZ\n", ClassName);
ParentWindow = NULL;
goto cleanup;
}
Expand Down Expand Up @@ -2293,7 +2293,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
dwVer );
if(!Window)
{
ERR("IntCreateWindow failed!\n");
ERR("IntCreateWindow(%wZ) failed\n", ClassName);
goto cleanup;
}

Expand Down Expand Up @@ -2419,7 +2419,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
Result = co_IntSendMessage(UserHMGetHandle(Window), WM_NCCREATE, 0, (LPARAM) Cs);
if (!Result)
{
ERR("co_UserCreateWindowEx(): NCCREATE message failed\n");
ERR("co_UserCreateWindowEx(%wZ): NCCREATE message failed\n", ClassName);
goto cleanup;
}

Expand Down Expand Up @@ -2479,7 +2479,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
Result = co_IntSendMessage(UserHMGetHandle(Window), WM_CREATE, 0, (LPARAM) Cs);
if (Result == (LRESULT)-1)
{
ERR("co_UserCreateWindowEx(): WM_CREATE message failed\n");
ERR("co_UserCreateWindowEx(%wZ): WM_CREATE message failed\n", ClassName);
goto cleanup;
}

Expand Down Expand Up @@ -2570,7 +2570,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
co_IntUserManualGuiCheck(TRUE);
}

TRACE("co_UserCreateWindowEx(): Created window %p\n", hWnd);
TRACE("co_UserCreateWindowEx(%wZ): Created window %p\n", ClassName, hWnd);
ret = Window;

cleanup:
Expand Down

0 comments on commit bcd916b

Please sign in to comment.