Whoops, sorry. There’s also a UlongToHandle macro as well.
BTW - For reference though, even on Windows Server 2008 x64, handle tables are still limited to 2^24 entries in the current implementation, so the actual limit conks out at a lot less than half a billion. (Wrote an experiment to test this awhile ago, in an attempt to see what would break with absurdly high numbers of handle / pointer references.) Of course, future implementations are not constrained to 2^24. Win32, as mentioned, continues to constrain itself to a 32-bit view of PID/TID values, even though the kernel views them as pointer-sized quantities.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Eric Diven
Sent: Friday, August 08, 2008 3:10 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] ThreadId to HANDLE for 64 bit?
Thanks for the help on this one guys, it now builds both ways.
There is a standard HandleToUlong macro to do this without the
warnings.
I had missed that one, but that goes the wrong way sadly. I need to
turn my ULONG32 into a HANDLE. It doesn’t look like there’s a function
to do that though. At least not that I’ve found on the MSDN. Though I
did turn up this gem:
http://msdn.microsoft.com/en-us/library/aa489638.aspx
DWORD32 and DWORD64. Are you serious? Thank goodness we’re still
fixated on the word size of a 16 bit processor, that way we can have
types with completely misleading names. Who would have imagined that
making typedefs based on the word size of the processor could possibly
cause problems down the road? (Okay, I’ll admit this is at least as
much C’s fault as it is MSFT’s for not having a standard way to declare
an x-bit integer for so long)
As long as you don’t have more than a half billion or so threads and
processes (they use a single shared handle table) you’ll be fine.
You’ve had this problem when you’ve tried to start 2^30 processes too?
Maybe by the time that’s a real issue, we’ll be running something
different.
Isn’t that how we ended up having the Y2K problem a couple years ago?
(And I’ll admit once again that it’s going to be how we’ll end up having
a Y2K37 problem in just 29 short years).
~Eric
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com