Solved Why did they name it "System32" in 64-bit Vista?

Cytherian

Vista Guru
Back in the early days of Windows 3.11, it was a 16 bit operating system. As part of it's structure, system files were located in an aptly named "System" folder off the "Windows" root. Later on as processors became more advanced and capable of addressing 32 bits, Windows NT was developed. Implicitly, its system folder was named "System32". In order to extend compatibility with Windows 3.11, a System32 folder was added so that "System" and "System32" co-existed together.

When 64-bit processing became possible, Microsoft was faced with a dilemma. Should they now start naming the new system folder "System64" and leave "System32" around for backward compatibility? The trouble was legacy. By this time, Windows development policies and guidelines did not prohibit programs from directly referencing System32. Also, if a software engineer developed a program for 32-bit and then provided a 64-bit version, they'd have to be careful about changing the System32 reference. In the end, Microsoft just didn't want to take chances.


To make matters more complicated, Microsoft also introduced another folder called "Winsxs" (Windows Side-by(x)-Side assemblies) which allows multiple versions of a system file to co-exist, under 32 bit and 64 bit. That's because some programs may be written to work with an older version of a system file and be incompatible with a later one. In the past, installing the program would replace the system file. Now Windows makes sure that multiple versions can co-exist, depending upon what program needs them. How does Windows know which version is needed for a given program? There is a manifest file that provides a guide to the library of files available for the redirector.

Two different naming conventions are used under Winsxs: "amd64_microsoft-windows" and "x86_microsoft-windows". "amd64" was chosen because AMD was the first CPU company to create a 64 bit processor. And because 32 bit was started on the old Intel 8086 architecture, x86 was chosen. Thus, dynamic file redirection is used to access one system file or the other, depending upon which type of program is running (32 bit or 64 bit).

I'm not totally sure how System32 and Winsxs work together. I believe System32 is the "default" system files, with Winsxs as the alternate when required. If I'm wrong, someone please correct me.

Next, there's also the folder SysWow64. This is essential the System for Windows on Windows, providing the ability for 32 bit programs to make function calls to the native 64 bit system. This is the 2nd time Microsoft has done this. In Windows 95/98, there was a SysWow32, so that 16 bit programs could make function calls to the native 32 bit system.


Ultimately, it would have probably been better for Microsoft to never change the name of "System", leaving it as the default for whatever version of the operating system is installed. Then, for legacy system versions there would be a number system (e.g. Sys16 for 16 bit, Sys32 for 32 bit). Thus, the developer would never have to worry about hard coded references to System, and then Windows would handle redirection accordingly. But, we aren't privy to Microsoft's internal decisions. There was probably a good reason why the naming convention was chosen as-is, which is just unfortunately a bit mystifying to the uninitiated.


For more information about the Windows x64 system, I suggest reading the Sepago blog on Windows x64.
 

My Computer

System One

  • Manufacturer/Model
    HP Pavillion dv5t
    CPU
    Intel Core Duo 2.53GHz
    Memory
    4Gb
    Graphics card(s)
    NVidia GeForce 9600M GT 512Mb
    Screen Resolution
    1280x800 32bit
    Hard Drives
    Seagate Momentus XT 500Gb Hitachi Travelstar HTS543225L9A300 250Gb
    Mouse
    Microsoft 4000
Nice post Gary! Another thing to add is the mystery of the Sysnative folder. Here, try it out for yourself and see if you can work it out:

Open a command prompt Window, and run this command:

echo test > %systemroot%\system32\a.txt

Then close that command prompt window and run these two command prompts:

C:\Windows\system32\cmd.exe
C:\Windows\SysWow64\cmd.exe


Then put the Windows side by side, so you can see both and run the following command in each:

type C:\Windows\sysnative\a.txt

Any idea as to why that's happening? No Googling :p

Tom
 

My Computer

System One

  • Manufacturer/Model
    Build #1
    CPU
    Intel Core i7 3770K @4.4GHz
    Motherboard
    ASUS P8Z77-V PRO
    Memory
    Corsair Vengeance 2x4GB DDR3 1600MHz Low Profile (White)
    Graphics card(s)
    Gigabyte Radeon HD 7850 (2GB GDDR5)
    Sound Card
    Integrated on motherboard
    Monitor(s) Displays
    23" LG LCD/LED IPS
    Screen Resolution
    1920*1080
    Hard Drives
    Samsung EVO 128GB SSD Seagate Barracuda 2TB 7200rpm 2x500GB Seagate FreeAgent 5400rpm
    PSU
    Corsair TX650W V2 (80+ Bronze)
    Case
    NZXT Phantom 410
    Cooling
    Corsair H100 Water Cooler, 1x140mm and 1x120mm stock fans
    Mouse
    Microsoft Desktop 2000 Wireless Mouse
    Keyboard
    Microsoft Desktop 2000 Wireless Keyboard
    Internet Speed
    95 Mb/s Download 70 Mb/s Upload
Thanks, Tom. :) It's of course from a pseudo-layman's perspective (I'm software technical, but have long ago dropped my Windows SDK programming skills). I figured some folks might find it useful.

Curious, I hadn't heard of "Sysnative" before. Interesting how the command prompt needs to be executed from the 32 bit libraries in order to see the file via Sysnative. Looks like some kind of secretive redirection for 32 bit, as SysWow64 allows access while System32 does not. What's the intended purpose?
 

My Computer

System One

  • Manufacturer/Model
    HP Pavillion dv5t
    CPU
    Intel Core Duo 2.53GHz
    Memory
    4Gb
    Graphics card(s)
    NVidia GeForce 9600M GT 512Mb
    Screen Resolution
    1280x800 32bit
    Hard Drives
    Seagate Momentus XT 500Gb Hitachi Travelstar HTS543225L9A300 250Gb
    Mouse
    Microsoft 4000
Wow, I never knew you were a programmer! You learn something new every day :)

In x64 installations, when x86 software tries to access C:\Windows\system32, it is automatically redirected to C:\Windows\SysWow64 because of reasons outlined in your post above. If things actually need to access the x64 components (to perform replacements etc.) then instead, the filepath should be C:\Windows\sysnative and Windows will recognise this as a special case and not perform the redirection :)

Edit: See here for more info: http://msdn.microsoft.com/en-gb/library/windows/desktop/aa384187(v=vs.85).aspx

32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access. This mechanism is flexible and easy to use, therefore, it is the recommended mechanism to bypass file system redirection. Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one.
 

My Computer

System One

  • Manufacturer/Model
    Build #1
    CPU
    Intel Core i7 3770K @4.4GHz
    Motherboard
    ASUS P8Z77-V PRO
    Memory
    Corsair Vengeance 2x4GB DDR3 1600MHz Low Profile (White)
    Graphics card(s)
    Gigabyte Radeon HD 7850 (2GB GDDR5)
    Sound Card
    Integrated on motherboard
    Monitor(s) Displays
    23" LG LCD/LED IPS
    Screen Resolution
    1920*1080
    Hard Drives
    Samsung EVO 128GB SSD Seagate Barracuda 2TB 7200rpm 2x500GB Seagate FreeAgent 5400rpm
    PSU
    Corsair TX650W V2 (80+ Bronze)
    Case
    NZXT Phantom 410
    Cooling
    Corsair H100 Water Cooler, 1x140mm and 1x120mm stock fans
    Mouse
    Microsoft Desktop 2000 Wireless Mouse
    Keyboard
    Microsoft Desktop 2000 Wireless Keyboard
    Internet Speed
    95 Mb/s Download 70 Mb/s Upload
Consequently, I ended up discovering Sysnative.com and spied you as a member there. :) How is that forum relative to ones like VF and SF?

Thanks for link reference. Good example of the purpose; makes a lot of sense to me. It's also encouraging to see how much Vista and W7 have in common under the hood.
 

My Computer

System One

  • Manufacturer/Model
    HP Pavillion dv5t
    CPU
    Intel Core Duo 2.53GHz
    Memory
    4Gb
    Graphics card(s)
    NVidia GeForce 9600M GT 512Mb
    Screen Resolution
    1280x800 32bit
    Hard Drives
    Seagate Momentus XT 500Gb Hitachi Travelstar HTS543225L9A300 250Gb
    Mouse
    Microsoft 4000
Consequently, I ended up discovering Sysnative.com and spied you as a member there. :) How is that forum relative to ones like VF and SF?

Thanks for link reference. Good example of the purpose; makes a lot of sense to me. It's also encouraging to see how much Vista and W7 have in common under the hood.

I can't go into much detail I'm afraid as I might wake up tomorrow to a ban for promoting a competitors website, but I think (well I hope!) I'm okay to say that it's more BSOD and Windows Update orientated than VF and SF :) But VF and SF are much bigger and there are always threads around here if you want one.

Yeah, they're very similar :) Take Vista, add a few features, make loads of cosmetic changes and you have Windows 7 - they didn't really change much at all.

Tom
 

My Computer

System One

  • Manufacturer/Model
    Build #1
    CPU
    Intel Core i7 3770K @4.4GHz
    Motherboard
    ASUS P8Z77-V PRO
    Memory
    Corsair Vengeance 2x4GB DDR3 1600MHz Low Profile (White)
    Graphics card(s)
    Gigabyte Radeon HD 7850 (2GB GDDR5)
    Sound Card
    Integrated on motherboard
    Monitor(s) Displays
    23" LG LCD/LED IPS
    Screen Resolution
    1920*1080
    Hard Drives
    Samsung EVO 128GB SSD Seagate Barracuda 2TB 7200rpm 2x500GB Seagate FreeAgent 5400rpm
    PSU
    Corsair TX650W V2 (80+ Bronze)
    Case
    NZXT Phantom 410
    Cooling
    Corsair H100 Water Cooler, 1x140mm and 1x120mm stock fans
    Mouse
    Microsoft Desktop 2000 Wireless Mouse
    Keyboard
    Microsoft Desktop 2000 Wireless Keyboard
    Internet Speed
    95 Mb/s Download 70 Mb/s Upload
Back
Top