Page 1 of 1 1
Topic Options
#187063 - 2008-04-18 12:03 AM [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger
trood Offline
Fresh Scripter

Registered: 2004-10-05
Posts: 11
Loc: Germany, NRW
Hi guys,
Hi Ruud,

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.

Registry WOW-Mode

 Code:
$default = setoption("WOW64AlternateRegView", "OFF")
$r = writevalue("HKLM\Software\Test-OFF", "myValue", "test", "REG_SZ")


"OFF" shall be the default value
-> okay
expected result: key "HKLM\Software\Wow6232Node\Test-OFF\myValue"
effective result: key "HKLM\Software\Wow6232Node\Test-OFF\myValue"
-> okay

Registry native mode

 Code:
$r = setoption("WOW64AlternateRegView", "ON")
$r = writevalue("HKLM\Software\Test-ON", "myValue", "test", "REG_SZ")

expected result: key "HKLM\Software\Test-ON\myValue"
effective result: key "HKLM\Software\Test-ON\myValue"
-> okay

FileSystem WOW-mode

 Code:
$default = setoption("WOW64FileRedirection", "ON")
md "c:\program files\test-ON"


"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


FileSystem native mode

 Code:
$r = setoption("WOW64FileRedirection", "OFF")
md "c:\program files\test-OFF"


expected result: directory path "c:\program files\test-OFF"
effective result: directory path "c:\program files\test-OFF"
-> okay

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.

Thanks
Thorsten

Top
#191556 - 2009-01-02 04:20 PM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: trood]
Ruud van Velsen Moderator Offline
Developer
*****

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.

Kind regards,

Ruud

Top
#191616 - 2009-01-05 08:21 PM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: Ruud van Velsen]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11627
Loc: CA
Thanks Ruud,

Would you happen to have a url link to any documentation on this subject for further review of the 64 Bit redirection mechanism.

Thanks.

Top
#193023 - 2009-03-20 12:35 AM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: NTDOC]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Here are a few links.

http://www.tipandtrick.net/2008/how-to-s...with-sysnative/
http://support.microsoft.com/kb/942589
http://www.nynaeve.net/?p=133

Top
#193024 - 2009-03-20 12:43 AM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
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
? "Default Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")

Returns:
Default Wow64FileRedirection Setting=OFF 


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.

cls
? @kix
? @producttype + " " + iif(@onwow64,"64","32") + "bit"
? "Default Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")
? "Hosts file="
if exist("%systemroot%\system32\drivers\etc\hosts.")
"found"
else
"not found"
endif
$RC=SETOPTION("Wow64FileRedirection","OFF")
? "Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")
? "Hosts file="
if exist("%systemroot%\system32\drivers\etc\hosts.")
"found"
else
"not found"
endif
$RC=SETOPTION("Wow64FileRedirection","ON")
? "Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")
? "Hosts file="
if exist("%systemroot%\system32\drivers\etc\hosts.")
"found"
else
"not found"
endif
?
? "Hosts file(SysNative)="
if exist("%systemroot%\sysnative\drivers\etc\hosts.")
"found"
else
"not found"
endif

Returns:
4.61 Beta 1
Windows Vista Business Edition 64bit
Default Wow64FileRedirection Setting=OFF
Hosts file=found
Wow64FileRedirection Setting=OFF
Hosts file=found
Wow64FileRedirection Setting=ON
Hosts file=found


Hosts file(SysNative)=found


As the original poster said, it appears that the FileRedirection setting is not working as expected.




Top
#195615 - 2009-08-26 06:16 PM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Hey Ruud... just wanted to bump this thread, and let you know I get the same results with 4.61RC1. I'd be interested in your thoughts.

Edited by Allen (2009-08-26 09:18 PM)

Top
#195681 - 2009-08-30 02:21 PM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: Allen]
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Hi Allen,

ah... as it happens, the drivers\etc directory is excluded from the wow64 File Redirection feature, as documented here: http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx

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:

-------------------------------
$file = "user32.dll"

? "Default Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")
? $file + " = " GetFileSize("%systemroot%\system32\" + $file)

$RC=SETOPTION("Wow64FileRedirection","OFF")
? "Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")
? $file + " = " GetFileSize("%systemroot%\system32\" + $file)

$RC=SETOPTION("Wow64FileRedirection","ON")
? "Wow64FileRedirection Setting=" + SETOPTION("Wow64FileRedirection")
? $file + " = " GetFileSize("%systemroot%\system32\" + $file)
------------------------------

Btw: I have fixed the default setting in the latest build (Rc2), as that was indeed wrong.

Ruud

Top
#195685 - 2009-08-30 05:24 PM Re: [Bug-Report Kix 4.60] x64 - WOW64FileRedirection does not trigger [Re: Ruud van Velsen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
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.

Thanks for looking and clearing this up.

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 360 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.148 seconds in which 0.107 seconds were spent on a total of 13 queries. Zlib compression enabled.