[NTUSER] NtUserBuildHwndList should return NTSTATUS (#4487)

A follow-up to #4485 (c2a51c7). CORE-18173
This commit is contained in:
Katayama Hirofumi MZ 2022-05-05 22:53:15 +09:00 committed by GitHub
parent c2a51c7249
commit 056bb94edc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1514,7 +1514,7 @@ NtUserBuildHwndList(
ULONG dwCount = 0; ULONG dwCount = 0;
if (pcHwndNeeded == NULL) if (pcHwndNeeded == NULL)
return ERROR_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
UserEnterExclusive(); UserEnterExclusive();
@ -1527,7 +1527,7 @@ NtUserBuildHwndList(
{ {
if(hDesktop == NULL && !(Desktop = IntGetActiveDesktop())) if(hDesktop == NULL && !(Desktop = IntGetActiveDesktop()))
{ {
Status = ERROR_INVALID_HANDLE; Status = STATUS_INVALID_HANDLE;
goto Quit; goto Quit;
} }
@ -1539,7 +1539,7 @@ NtUserBuildHwndList(
&Desktop); &Desktop);
if(!NT_SUCCESS(Status)) if(!NT_SUCCESS(Status))
{ {
Status = ERROR_INVALID_HANDLE; Status = STATUS_INVALID_HANDLE;
goto Quit; goto Quit;
} }
} }
@ -1615,14 +1615,14 @@ NtUserBuildHwndList(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
ERR("Thread Id is not valid!\n"); ERR("Thread Id is not valid!\n");
Status = ERROR_INVALID_PARAMETER; Status = STATUS_INVALID_PARAMETER;
goto Quit; goto Quit;
} }
if (!(W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread)) if (!(W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread))
{ {
ObDereferenceObject(Thread); ObDereferenceObject(Thread);
TRACE("Tried to enumerate windows of a non gui thread\n"); TRACE("Tried to enumerate windows of a non gui thread\n");
Status = ERROR_INVALID_PARAMETER; Status = STATUS_INVALID_PARAMETER;
goto Quit; goto Quit;
} }