Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a PID be negative on Windows?

I am writing a method that takes PID as parameter. Can it be a negative number on Windows? If it can't be I will add a negative check to my method. But I couldn't find information on the internet.

like image 537
Barış Akkurt Avatar asked Sep 15 '25 23:09

Barış Akkurt


1 Answers

We only know they cannot be 0 or -1 (see Invalid thread and process IDs).

So don't depend on them being positive (or, multiples of four).

like image 89
Richard Avatar answered Sep 19 '25 10:09

Richard