hyzhangzhy
hyzhangzhy

Reputation: 17

NtQueryInformationProcess ProcessConsoleHostProcess returns wrong Process ID

I am using NtQueryInformationProcess : ProcessConsoleHostProcess to query the process ID of the conhost.exe process that is associated with a console application in Windows 10 x64. The function returns a success status code, but I always get an odd number, which is always one more than the actual PID. See the screenshot. My code is complied for x64.

Is there anything wrong with this?

Upvotes: 0

Views: 362

Answers (1)

user10762593
user10762593

Reputation:

From memory, process ids are a multiple of 4. It wouldn't surprise me that the low two bits are being borrowed for some reason.

Upvotes: 1

Related Questions