I’m looking for information about maximum PID number possible in Windows.
Formally it defined as DWORD.
But it’s different for 32-bit and 64-bit.
Some sources tell about 32K limit.
But is it correct for both 32 and 64 bit?
I don’t find reference on this “secret” in Microsoft. 
Thanks & Regards,
Michael.
Why? A dword is the same size on all architectures
d
Bent from my phone
From: xxxxx@saferpoint.commailto:xxxxx
Sent: ?10/?2/?2014 8:11 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] What maximum PID is possible?
I’m looking for information about maximum PID number possible in Windows.
Formally it defined as DWORD.
But it’s different for 32-bit and 64-bit.
Some sources tell about 32K limit.
But is it correct for both 32 and 64 bit?
I don’t find reference on this “secret” in Microsoft. 
Thanks & Regards,
Michael.
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
The type of PID used to call PID-using functions is a HANDLE, 32bit on 32bit OS and 64bit on 64bit OS.
Nevertheless, the senior 32 bits are always zeroes, and you can safely translate between 32 and 64bit representations by C/C++ casts.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> I’m looking for information about maximum PID number possible in Windows.
>
> Formally it defined as DWORD.
> But it’s different for 32-bit and 64-bit.
>
> Some sources tell about 32K limit.
> But is it correct for both 32 and 64 bit?
>
> I don’t find reference on this “secret” in Microsoft. 
>
> Thanks & Regards,
> Michael.
>
I’m looking for information about maximum PID number possible in Windows.
Formally it defined as DWORD.
But it’s different for 32-bit and 64-bit.
Some sources tell about 32K limit.
But is it correct for both 32 and 64 bit?
I don’t find reference on this “secret” in Microsoft. 
Thanks & Regards,
Michael.
xxxxx@saferpoint.com wrote:
I’m looking for information about maximum PID number possible in Windows.
Formally it defined as DWORD.
But it’s different for 32-bit and 64-bit.
Some sources tell about 32K limit.
But is it correct for both 32 and 64 bit?
I don’t find reference on this “secret” in Microsoft. 
So, you didn’t like any of the answers you got when you asked this exact
question last Thursday?
The exact range is neither documented nor guaranteed. Of what POSSIBLE
use could this information be to you?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> Formally it defined as DWORD.
In user mode.
In kernel mode it is HANDLE:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff551920(v=vs.85).aspx
NTSTATUS PsLookupProcessByProcessId(
In HANDLE ProcessId,
Out PEPROCESS *Process
);
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
So, you didn’t like any of the answers you got when you asked this exact
question last Thursday?
The exact range is neither documented nor guaranteed. Of what POSSIBLE
use could this information be to you?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
I keep PID in AVL table. And need sometimes to change it on unused to be sure avoid the doubles.
I’d like if word exist free range such as I may use it.
For 64-bit it’s negative UINT as Maxim noted.
But it’s not work for 32-bit.
Regards,
Micharl.
Am I seriously missing the problem here?
You (always) store the PID in your AVL table as a 64-bit unsigned value. For “unused” you use the value 0xFFFFFFFFFFFFFFFF. Or, if you want to be creative, use something like 0xF0F0F0F0F0F0F0F0. Or, 0xBADB00B00FFFFFFFF. Or…
Won’t that scheme just always work?
Peter
OSR
@OSRDrivers
So, you didn’t like any of the answers you got when you asked this exact
question last Thursday?
The exact range is neither documented nor guaranteed. Of what POSSIBLE
use could this information be to you?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
I keep PID in AVL table. And need sometimes to change it on unused to be sure avoid the doubles.
I’d like if word exist free range such as I may use it.
For 64-bit it’s negative UINT as Maxim noted.
But it’s not work for 32-bit.
Regards,
Micharl.
>And need sometimes to change it on unused to be sure avoid the doubles.
I’m not really sure what you mean. Are you using PID as a key to the tree? A tree cannot contain duplicates. All processes in the box will have different PIDs. When you need to remove a PID, you remove it from the tree. You don’t need to keep dummy/filler PID items there.
For a AVL tree, a range of possible keys doesn’t make difference. As long as the key comparison operation satisfies a couple of obvious requirements, it will work.