Minor Windows WTFs



  • Pop quiz. You work for a company that produces custom hardware and distributes drivers and an API for it. You're using 64-bit Windows and working on compatibility with a third-party software suite that requires your API's DLLs to be located in Windows' system directories.

    1) For 32-bit executables, where do you put them?

    2) For 64-bit executables, where do you put them?

    The answers are SysWow64 and System32 respectively. No I didn't switch those. SysWow64 is for 32-bit, and System32 is for 64-bit.

    Further complicating the issue is the driver framework we use having subtle differences between 32-bit and 64-bit Windows that requires us to ship three sets of Windows binaries. 32-bit binaries for 32-bit Windows, 32-bit binaries for 64-bit Windows, and 64-bit binaries for 64-bit Windows. Yes, we have two sets of 32-bit Windows binaries depending on whether you're using 32-bit or 64-bit Windows, and they do not work if switched!

    Confused yet?


  • Discourse touched me in a no-no place

    Just wait until you get to write stuff that belongs in Program Files.



  • @mott555 said:

    1) For 32-bit executables, where do you put them?

    2) For 64-bit executables, where do you put them?

    The answers are SysWow64 and System32 respectively. No I didn't switch those. SysWow64 is for 32-bit, and System32 is for 64-bit.

    I believe the explanation is something like this:

    32 bit Windows puts DLLs in \Windows\system32. When Microsoft created 64 bit Windows they automatically (and correctly) assumed that there were lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32 (instead of using %SYSTEM% or whatever the correct system variable is) and so when those programs were ported to x64 they would still expect to use \System32. So 64 bit Windows also uses \System32, even though they are now putting x64 stuff in there.

    To accomodate 32 bit programs running on 64 bit Windows they created WoW64 which is an abbreviation for Windows 32-bit On Windows 64-bit.

    So yes, it is weird and the opposite of what you think it would be, but it's not really a Windows WTF so much as Microsoft trying to accomodate legacy apps written by stupid programmers.

     



  • @El_Heffe said:

    lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32
     

    That's just because a stupid, incompetent programmer in the Windows design team decided to hard code the bit width in the folder name.



  • @dhromed said:

    @El_Heffe said:
    lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32
    That's just because a stupid, incompetent programmer in the Windows design team decided to hard code the bit width in the folder name.

    They should have named it "Windows\System-New" and then when 64-bit came along they could have named it "Windows\System-New-Two".

    Look, sometimes a sequence of rational sensible decisions still turns into a WTF years down the line. That's the lesson to be learned here.



  •  Why use different folders at all?



  • @dhromed said:

     Why use different folders at all?

    FTFY



  • @blakeyrat said:

    @dhromed said:
    @El_Heffe said:
    lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32
    That's just because a stupid, incompetent programmer in the Windows design team decided to hard code the bit width in the folder name.

    They should have named it "Windows\System-New" and then when 64-bit came along they could have named it "Windows\System-New-Two".

    Look, sometimes a sequence of rational sensible decisions still turns into a WTF years down the line. That's the lesson to be learned here.

    C:\WINDOWS\Copy of System (2)


  • @dhromed said:

     Why use different folders at all?

     

     

    so 64 bit DLLs and 32 bit DLL can carry the same name

     



  • @dhromed said:

    @El_Heffe said:
    lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32
     

    That's just because a stupid, incompetent programmer in the Windows design team decided to hard code the bit width in the folder name.

    Yes, I forgot to include that some of the stupid, incompetent programmers work for Microsoft. However, Microsoft actually tries pretty hard to accomodate legacy apps and stupid programmers, which has the unfortunate side effect of sometimes making things confusing and counter-intuitive.

    It's like the issues around the Program Files directory. Since 64 bit Windows can run 32 bit programs it makes no sense to have separate Program Files directories for 32 and x64. You just put everything in \Program Files.  Oh wait, you're installing the 64 bit version of Photoshop CS4 on Windows x64 and the installer informs you that it is going to install both the 32 and 64 bit versions, with no apparent way to prevent it from doing that.

     



  • @El_Heffe said:

    Oh wait, you're installing the 64 bit version of Photoshop CS4 on Windows x64 and the installer informs you that it is going to install both the 32 and 64 bit versions, with no apparent way to prevent it from doing that.

    Because fuck your hard drive, that's why.



  • @blakeyrat said:

    Look, sometimes a sequence of rational sensible decisions still turns into a WTF years down the line. That's the lesson to be learned here.

    Precisely. I love the SysWow64 and Program Files (x86) story- Each individual decision makes sense at the time it was made, more or less, and yet it adds up to one giant mess.

    I'm eagerly waiting for 128 bit windows, so see how this gets worse

    If you're playing at home and still not following, you had 64 bit Windows before WoW64 let you run 32 bit binaries. So by the time it came to find a place to put the 32 bit stuff, the 64 bit stuff was already there.



  • @El_Heffe said:

    Oh wait, you're installing the 64 bit version of Photoshop CS4 on Windows x64 and the installer informs you that it is going to install both the 32 and 64 bit versions, with no apparent way to prevent it from doing that.

     

    Not really, there's a checkbox. You can install either one or both.

     



  • @mott555 said:

    32-bit binaries for 32-bit Windows, 32-bit binaries for 64-bit Windows, and 64-bit binaries for 64-bit Windows. Yes, we have two sets of 32-bit Windows binaries depending on whether you're using 32-bit or 64-bit Windows, and they do not work if switched!
    It's a shame you guys haven't heard of PVOID64 and IoIs32BitProcess. Use of either one would have made 32 bit binaries for 64 bit windows unnecessary.



  • @ratchet freak said:

    @dhromed said:

     Why use different folders at all?

     

    so 64 bit DLLs and 32 bit DLL can carry the same name

     

    You have to vary the path in your code whether it's the folder name or the dll anyway, so why not name your dlls different?

     



  • You use the appropriate environment variable and call it done, avoiding any sort of problem or complication and maintaining compatibility regardless of the version of Windows or where it's installed.



  • @dhromed said:

    @ratchet freak said:

    @dhromed said:

     Why use different folders at all?

     

    so 64 bit DLLs and 32 bit DLL can carry the same name

     

    You have to vary the path in your code whether it's the folder name or the dll anyway, so why not name your dlls different?

     

    Nope. The path is always Windows\System32. For a 32-bit process it gets redirected to SysWoW64. Although placing application's DLLs to System32 is mauvais tone.



  • @dhromed said:

    @El_Heffe said:

    lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32
     

    That's just because a stupid, incompetent programmer in the Windows design team decided to hard code the bit width in the folder name.

     

    That's because on the transition from 16 to 32 bits, the Windows design team needed a separated folder to put the 32 bit version of the stuf that go on \Windows\System. I think the name is quite apt.

    But on the transition from 32 to 64 bits, the design team decided they didn't need an alternative place to put the 64 bits stuff, because Windwos would be 64 bits only, and kept the 64 bits libraries at System32.

    Then the market disagreed, and required that Windows support legacy 32 bits programs, and they needed toput those somewhere.

     



  •  ok.



  • @alegr said:

    @mott555 said:
    32-bit binaries for 32-bit Windows, 32-bit binaries for 64-bit Windows, and 64-bit binaries for 64-bit Windows. Yes, we have two sets of 32-bit Windows binaries depending on whether you're using 32-bit or 64-bit Windows, and they do not work if switched!
    It's a shame you guys haven't heard of PVOID64 and IoIs32BitProcess. Use of either one would have made 32 bit binaries for 64 bit windows unnecessary.

    It's a shame that it's the fault of a third-party driver framework we use, otherwise we'd fix it and have universal 32-bit binaries.



  • @El_Heffe said:

    32 bit Windows puts DLLs in \Windows\system32. When Microsoft created 64 bit Windows they automatically (and correctly) assumed that there were lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32 (instead of using %SYSTEM% or whatever the correct system variable is) and so when those programs were ported to x64 they would still expect to use \System32. So 64 bit Windows also uses \System32, even though they are now putting x64 stuff in there.

    I never understood this. (Badly written) legacy/32-bit programs assume its \Windows\System32. So why not keep that for 32-bit stuff (it will keep working) and put 64-bit stuff in \Windows\System64?
    (Newer) 64-bit programs will have to be made/changed anyway so there's no reason to keep the path the same for them. What's the reason?

    Making the system folder bit-independant seems like a reasonable one at first glance, but why not put everything in \Windows\system then? It can't conflict with 16-bit programs because those don't work in the 64-bit OS'ses anyway.



  • @Mona2000 said:

    @El_Heffe said:

    Oh wait, you're installing the 64 bit version of Photoshop CS4 on Windows x64 and the installer informs you that it is going to install both the 32 and 64 bit versions, with no apparent way to prevent it from doing that.

     

    Not really, there's a checkbox. You can install either one or both.

     

    Now there is.that option. But a few years ago, if you installed x64 you got 32 bit also whether you wanted it or not. If there was a way to not install the 32 bit version it was very non-obvious. I think it was only that one version, circa 2007-2008 and then they realized how stupid it was and fixed it.

     



  • @dtech said:

    I never understood this. (Badly written) legacy/32-bit programs assume its \Windows\System32. So why not keep that for 32-bit stuff (it will keep working) and put 64-bit stuff in \Windows\System64?

    Because when a program or a batch file wants to open the hard-coded path “\windows\system32\notepad.exe”, this has better succeed on 64-bit Windows.


  • Discourse touched me in a no-no place

    @VinDuv said:

    @dtech said:
    I never understood this. (Badly written) legacy/32-bit programs assume its \Windows\System32. So why not keep that for 32-bit stuff (it will keep working) and put 64-bit stuff in \Windows\System64?

    Because when a program or a batch file wants to open the hard-coded path “\windows\system32\notepad.exe”, this has better succeed on 64-bit Windows.
    Why are there programs in there in the first place? (Because that's how it ended up and we're stuck with it. Yeah, I know.)



  • @alegr said:

    IoIs32BitProcess
    I pasted that into an editor with a different font to check if the prefix was LOLS. I was disappointed.



  • @dkf said:

    Why are there programs
     

    We must ponder this for a while.



  • @El_Heffe said:

    @mott555 said:

    1) For 32-bit executables, where do you put them?

    2) For 64-bit executables, where do you put them?

    The answers are SysWow64 and System32 respectively. No I didn't switch those. SysWow64 is for 32-bit, and System32 is for 64-bit.

    I believe the explanation is something like this:

    32 bit Windows puts DLLs in \Windows\system32. When Microsoft created 64 bit Windows they automatically (and correctly) assumed that there were lots of stupid, incompetent programmers who had hard-coded their programs to use \Windows\System32 (instead of using %SYSTEM% or whatever the correct system variable is) and so when those programs were ported to x64 they would still expect to use \System32. So 64 bit Windows also uses \System32, even though they are now putting x64 stuff in there.

    To accomodate 32 bit programs running on 64 bit Windows they created WoW64 which is an abbreviation for Windows 32-bit On Windows 64-bit.

    So yes, it is weird and the opposite of what you think it would be, but it's not really a Windows WTF so much as Microsoft trying to accomodate legacy apps written by stupid programmers.

     

     

    So bottom line: developers are TRWTF.

     



  • @Zacrath said:

    So bottom line: developers are TRWTF.
    Who is TRWTF?



  • @Zecc said:

    I pasted that into an editor with a different font to check if the prefix was LOLS. I was disappointed.
     

    Sans-serif fonts are TRWTF?



  • Could be worse.  It's not as though Windows boots from a "System partition" and then loads the system from a "Boot partition".

     

    Wait... Never mind.


  • Discourse touched me in a no-no place

    @dhromed said:

    @dkf said:
    Why are there programs
    We must ponder this for a while.
    Ommmmm…


Log in to reply