• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting a StringPtr from Gestalt on 64-bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Getting a StringPtr from Gestalt on 64-bit
      • From: David Duncan <email@hidden>
References: 
 >Re: Getting a StringPtr from Gestalt on 64-bit (From: Scott Lahteine <email@hidden>)
 >Re: Getting a StringPtr from Gestalt on 64-bit (From: Clark Cox <email@hidden>)

  • Prev by Date: Re: NSServices
  • Next by Date: Re: watch changes to any properties on an object
  • Previous by thread: Re: Getting a StringPtr from Gestalt on 64-bit
  • Next by thread: Re: Getting a StringPtr from Gestalt on 64-bit
  • Index(es):
    • Date
    • Thread