Page 1 of 1 1
Topic Options
#212806 - 2017-11-01 06:28 PM Bug: Disabling WOW64FileRedirection breaks group functions
morganw Offline
Fresh Scripter

Registered: 2015-10-20
Posts: 14
Loc: UK
Apologies if this is the wrong place to post this, I couldn't see an obvious place to raise a bug for a non-beta version.

If you haven't called group functions before disabling WOW64 file redirection, all subsequent calls to those functions return no results. The simplest test I can find is:
 Code:
;EnumGroup(0)
;InGroup("TEST")

$rc = SetOption("WOW64FileRedirection","OFF")

$index = 0
Do
	$group = EnumGroup($index)
	? $group
	$index = $index + 1
Until Len($group) = 0

Uncommenting either of the first two lines lets your group membership be printed, but with both commented out no groups will be printed.

Top
#212808 - 2017-11-01 07:06 PM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: morganw]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Interesting. I have not confirmed this, but I can imagine the reason this behavior has not been found before now is because you almost always put Wow64Redection line in the first few lines of a script.
Top
#212809 - 2017-11-01 10:55 PM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: Allen]
morganw Offline
Fresh Scripter

Registered: 2015-10-20
Posts: 14
Loc: UK
It is more the other way around; if you toggle it "off" and "on" where you definitely need the redirection to be disabled everything is fine, but if you set it to "off" at the start of the script (to ensure you are never redirected) it will break the group lookups.

This isn't just in 4.67, I've seen the issue in previous releases but have only just tracked it down to the ordering of the function calls.


Edited by morganw (2017-11-01 10:57 PM)

Top
#212810 - 2017-11-02 12:23 AM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: morganw]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
I wasn't able to reproduce this on Win10 x64. What OS/bits are you on?
Top
#212811 - 2017-11-02 12:46 AM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Here is my slightly revised version of your script.

 Code:
break on
Dim $index, $RC, $Group

? "Redirection: " + SetOption("WOW64FileRedirection")
$rc = SetOption("WOW64FileRedirection","OFF")
? "Redirection: " + SetOption("WOW64FileRedirection")

$index=0
$Group=Enumgroup($index)
While len($Group)
  $index=$index+1
  $Group=Enumgroup($index)
loop 

? "Number of Groups:  " + $index

if ingroup(Enumgroup(0))
  ? "In Group 0"
else
  ? "Not in Group 0"
endif


With Redirection Turned off
 Quote:

Redirection: ON
Redirection: OFF
Number of Groups: 14
In Group 0


With Redirection Turned On
 Quote:

Redirection: ON
Redirection: ON
Number of Groups: 14
In Group 0



Top
#212814 - 2017-11-02 11:41 AM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: Allen]
morganw Offline
Fresh Scripter

Registered: 2015-10-20
Posts: 14
Loc: UK
I've got some automation available so I tested on all Windows machines which happened to be running:
 Code:
If InGroup("Everyone")
	? "@PRODUCTTYPE @DOS Build @BUILD --> Working"
Else
	? "@PRODUCTTYPE @DOS Build @BUILD --> Not Working"
EndIf

 Quote:

Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows 7 Professional Edition 6.1 Build 7601 --> Working
Windows Server 2012 R2 6.3 Build 9600 --> Working
Windows Server 2012 R2 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2016 Datacenter Edition 10.0 Build 14393 --> Working

 Code:
$rc = SetOption("WOW64FileRedirection","OFF")

If InGroup("Everyone")
	? "@PRODUCTTYPE @DOS Build @BUILD --> Working"
Else
	? "@PRODUCTTYPE @DOS Build @BUILD --> Not Working"
EndIf

 Quote:
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows 7 Professional Edition 6.1 Build 7601 --> Not Working
Windows Server 2012 R2 6.3 Build 9600 --> Working
Windows Server 2012 R2 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2012 R2 Datacenter Edition 6.3 Build 9600 --> Working
Windows Server 2016 Datacenter Edition 10.0 Build 14393 --> Working


All of the above are 64 bit. I've also tried on my own Windows 10 (64 bit) machine and Server 2008R2, both of which stay working when the redirection is off.

Top
#212816 - 2017-11-02 02:02 PM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: morganw]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
So Win 7 x64 is the one not working? I don't have a single instance of Win 7 anymore in my environment. Someone with a Win7 box, can you verify this.
Top
#212819 - 2017-11-02 06:50 PM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: Allen]
morganw Offline
Fresh Scripter

Registered: 2015-10-20
Posts: 14
Loc: UK
I've re-tested in a brand new VM (Windows 7 64 bit SP1, installed from a volume license ISO, no updates applied) and I still see the same problem.
I've also checked a 32 bit one, and that doesn't have the problem, but equally there is nothing to redirect if the OS is 32 bit.

Top
#212824 - 2017-11-03 07:33 PM Re: Bug: Disabling WOW64FileRedirection breaks group functions [Re: morganw]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
I can confirm I see a similar result on Win 7 Enterprise / 64-bit.
 Code:
If InGroup("Everyone")
	? "@PRODUCTTYPE @DOS Build @BUILD --> Working"
Else
	? "@PRODUCTTYPE @DOS Build @BUILD --> Not Working"
EndIf
Results in "Windows 7 Enterprise Edition 6.1 Build 7601 --> Working"

Whereas...
 Code:
$rc = SetOption("WOW64FileRedirection","OFF")
If InGroup("Everyone")
	? "@PRODUCTTYPE @DOS Build @BUILD --> Working"
Else
	? "@PRODUCTTYPE @DOS Build @BUILD --> Not Working"
EndIf
Results in "Windows 7 Enterprise Edition 6.1 Build 7601 --> Not Working"


Edited by ShaneEP (2017-11-03 07:34 PM)

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 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

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