First Post - all things x64

Welcome to my stinkin' blog.  I just wanted a place to dump interesting & useful blobs of information about what I've been doing for the past 4 or 5 years of my life @ work:  x64.

My name is Kevin Frei, and I've been a developer on the x64 (aka AMD64, EM64T, and x86-64) compiler since it's inception.  I'm originally from Pocatello, ID, I really don't miss it one bit.  Except maybe the cost of housing :-)

 

So, here's the stuff I wanted to make public.  It's all generally about how to successfully use Windows XP Pro for x64 (and Win2003 Server for x64) in a normal day-to-day environment.  I'll probably toss out useful compiler/code gen things in the future, but for right now, this is it:

 

So, without further ado, here we go:

  • %windir%\syswow64\cmd.exe is your best friend

When you launch the 32 bit command prompt, PROCESSOR_ARCHITECTURE is set to x86, ProgramFiles is set to "c:\program files (x86)", and suddenly lots of things 'just work'

  • Use Internet Explorer (32 bit)

The 64 bit internet explorer works great, unless you need to run activeX controls, which are present on far too many web pages out there. Of course, the 64 bit version of IE is kind of nice, simply because there's no more irritating Flash advertisements, and no obnoxious addins. I've actually started using Avant Browser, and have found that it's quite pleasant, though always 32 bit...

  • 'Program Files (x86)' can cause lots of problems with scripts

If you have scripts that use %ProgramFiles%, this can act a little weird, due to parentheses parsing problems. You can work your way around it by doing this from inside your script:

 for %%D in ("%ProgramFiles%") do set ProgramFiles=%%~sD

This makes the variable use short pathnames: no more parenthese or spaces. It's actually a useful trick in general to get spaces & parentheses out of environment variables, in general.  Maybe I'll fix mine fixer script and put it up here in the future...

  • Detecting that you're running under WOW64 from 32 bit scripts

PROCESSOR_ARCHITEW6432 is set to the real processor architecture when you're running syswow64\cmd.exe

  • When is system32 not system32?

When it's been mapped to syswow64! If you're running under WoW64, your actual system32 directory isn't visible - it's a duplicate of syswow64. Magic! Sometimes this can be little confusing, though.

  • How can I see stuff in the real system32 from a 32 bit process?

From a 64 bit CMD, linkd [somewhere] %windir%\system32

Now, from 32 bit apps, you can see the contents of the real system32 [with all it’s 64 bit images] from a 32 bit process, from the [somewhere] directory. I don't know if linkd.exe is available outside of MSFT. I'm sure there's some other way to accomplish this...