there's a bug in Kix 4.60 on 64-Bit Windows: while WOW64AlternateRegView works as expected, WOW64FileRedirection doesn't cause any different behavior and leads to inconsistencies in existing scripts.
"ON" shall be the default value -> mismatch, $default reported back as OFF expected result: directory path "c:\program files (x86)\test-ON" effective result: directory path "c:\program files\test-ON" -> mismatch
Could anybody please confirm that WOW64FileRedirection has no effect at all? I also would like this to be accepted as a bug and an updated Kix shall be created, please.
Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
This is actually more complicated than it may seem..
The file redirection functionality that was built into the 64-bit versions of Windows only affects the %WINDIR%\SYSTEM32 directory. It does not affect the Program Files directory (even though a new x86 version of the Program Files directory was introduced in 64-bit Windows. So if you want to this feature, you need to change your script to create a sub-directory below %WINDIR%\SYSTEM32.
As for Program Files... note that on Windows Server 2008 and Vista, the Program Files directory *is* affected by the file virtualization feature of *User Access Control*. So if you write to this directory on those versions of Windows, your changes can wind up in the Virtual Store, depending on the actual access permissions you have on the system. This functionality is not affected by WOW64FileRedirection.
Lastly: the fact that SetOption returns "OFF" to be the default setting of WOW64FileRedirection is indeed incorrect. File Redirection is always on by default. I'll see if I can fix this in the next update.
Okay... I think there is some weirdness going on within the 64bit OS, fileredirection, and kixtart.
So my understanding is, a 32 bit app, which kixtart is, should not be able to see files in the system32 directory UNLESS fileredirection is turned OFF. A second way for 32 bit apps to see system32 files is to use %windir%\SYSNATIVE. Based on Ruud's comments above, Fileredirection should be ON, by default, but appears to be OFF
Returns:
So my thought was, if this is true, then I should be able to check if the hosts file exists, which is stored in system32\drivers\etc. Again, in a 64bit OS, if fileredirection is ON, kixtart should not be able to see it, but if it OFF, it should. However with the following code, you will see that Kixtart finds the file no matter what the setting is.
Returns:
As the original poster said, it appears that the FileRedirection setting is not working as expected.
It's actually kinda tricky to see the file redir feature in action. One way to see it, is by for example checking the file size of USER32.DLL. This is present both in SYSTEM32 and SYSWOW64, but of a different size.
So if you run this bit of script, you should see some real results:
Thanks for the link Ruud. That's the first time I have seen any reference to exceptions for the redirects.
The other simple test I had used was to use notepad(32bit) to look for the drivers\etc folder, and I swear could not find the hosts file. But upon doing it again, I can find it just like you said I should able to. So weird.