[NTDLL_WINETEST][NTOS:PS] Fix a few NtQueryInformationProcess(Process*) handling cases (#8136)

* [NTDLL_WINETEST] `test_query_process_debug_object_handle()`: one WINESYNC

Cherry-pick WineTest part of:
52d733b5c4
server: Implement retrieving the debug object of a process.
by: Alexandre Julliard <julliard@winehq.org>

* [NTOS:PS] Fix `NtQueryInformationProcess(ProcessDebugObjectHandle)`

Close the retrieved `DebugPort` on failure.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] Optimize `NtQueryInformationProcess(ProcessWow64Information)` on 32-bit.

No need to do the ExAcquire/ReleaseRundownProtection rigamarole since
we aren't retrieving the `Process->Wow64Process` on 32-bit builds.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] Fix `NtQueryInformationProcess(ProcessExecuteFlags)`

s/return/break/ on a failure case.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] NtQueryInformationProcess(): Optimize `*ReturnLength` assignment

Enter the SEH block only if we know we'll have to set `*ReturnLength` on return.
Addendum to commit 2278c2914 (r23175).
This commit is contained in:
Serge Gautherie 2025-06-19 18:47:31 +02:00 committed by GitHub
parent b8c5e9c209
commit 9832737843
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 22 deletions

View file

@ -1582,12 +1582,20 @@ static void test_query_process_debug_object_handle(int argc, char **argv)
debug_object = (HANDLE)0xdeadbeef;
status = pNtQueryInformationProcess(pi.hProcess, ProcessDebugObjectHandle,
&debug_object, sizeof(debug_object), NULL);
#ifndef __REACTOS__
todo_wine
#endif
ok(status == STATUS_SUCCESS,
"Expected NtQueryInformationProcess to return STATUS_SUCCESS, got 0x%08x\n", status);
#ifndef __REACTOS__
todo_wine
#endif
ok(debug_object != NULL,
"Expected debug object handle to be non-NULL, got %p\n", debug_object);
#ifdef __REACTOS__
status = NtClose( debug_object );
ok( !status, "NtClose failed %x\n", status );
#endif
for (;;)
{