microsoft / Windows-Dev-Performance

A repo for developers on Windows to file issues that impede their productivity, efficiency, and efficacy
MIT License
434 stars 20 forks source link

Tasklist doesn't read the correct status of UWP process #73

Closed float34 closed 3 years ago

float34 commented 3 years ago

Trying to read the status of suspended UWP process, but tasklist sees it as running: image

OS: Windows 10 Pro 20H2, build 19042.685

sylveon commented 3 years ago

As discussed on Discord, this is because UWP suspension is not the same as Win32 suspension, and tasklist only checks the latter.

It should be updated to also check UWP suspension. This can be done by calling NtQuerySystemInformation to get PROCESS_EXTENDED_BASIC_INFORMATION, and then the status of UWP suspension will be in the IsFrozen bit-field.

AvriMSFT commented 3 years ago

@sylveon Thanks for the solution 🙂. This should help @torquerrr

Eli-Black-Work commented 3 years ago

@AvriMSFT Can we reopen this? I think there are still actionable items on this, as per @sylveon's comment.