Re: Getting a StringPtr from Gestalt on 64-bit
Re: Getting a StringPtr from Gestalt on 64-bit
- Subject: Re: Getting a StringPtr from Gestalt on 64-bit
- From: Scott Lahteine <email@hidden>
- Date: Thu, 3 Sep 2009 15:35:51 -0400
On Sep 3, 2009, at 3:14 PM, Clark Cox wrote:
At this point, as far as I can tell Gestalt() is still a viable
solution,
and the returned pointer is just guaranteed to be in the low 4GB of
RAM.
Not possible. On 64-bit Intel (at least with the default settings),
there is no such thing as a valid pointer in the low 4GB of RAM. *All*
valid pointers are outside of that first 4GB; in fact, trying to
dereference such a pointer is treated in exactly the same manner as
trying to dereference NULL.
Fascinating information. Thank you for the insight. And sysctlbyname()
works just great.
As it turns out Gestalt(gestaltUserVisibleMachineName) returns error
-5551 in a 64 bit binary anyway. I wasn't seeing this because
apparently my build architecture - "Standard Universal (32/64 bit)" -
was/is for some reason launching the 32 bit binary. I had to
explicitly specify "64-bit Intel" to get it to launch exactly the
binary I wanted. Maybe this is because my system is booted into the 32-
bit kernel...?
Anyhow, thanks for the help!
--
Scott Lahteine
Thinkyhead Software
http://thinkyhead.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden