http://bugs.winehq.org/show_bug.cgi?id=21512
Summary: Windows PowerShell 1.x/2.x needs HKEY_CURRENT_USER\Environment registry key present Product: Wine Version: 1.1.37 Platform: x86 URL: http://www.microsoft.com/downloads/details.aspx?Family Id=60cb5b6c-6532-45e0-ab0f-a94ae9ababf5&displaylang=en OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net
Hello,
prerequisite: .NET 2.0 SP1 + Windows Management Framework Core (contains PowerShell 2.0)
The shell must be started with wineconsole otherwise it refuses to work at all (GetConsoleScreenBufferInfo).
--- snip --- $ pwd /home/focht/.wine/drive_c/windows/system32/WindowsPowerShell/v1.0
$ wineconsole PowerShell.exe err:wineconsole:WCUSER_SetFont wrong font err:wineconsole:WCUSER_SetFont wrong font err:wineconsole:WCUSER_SetFont wrong font err:wineconsole:WCUSER_SetFont wrong font fixme:sync:CreateMemoryResourceNotification (0) stub fixme:advapi:RegisterEventSourceW (L".",L"PowerShell"): stub fixme:advapi:ReportEventW (0xcafe4242,0x0001,0x0001,0x00000067,(nil),0x0002,0x00000000,0x9e3d08,0x9e3bb0): stub err:eventlog:ReportEventW L"Object reference not set to an instance of an object." err:eventlog:ReportEventW L"\tExceptionClass=NullReferenceException\n\tErrorCategory=\n\tErrorId=\n\tErrorMessage=Object reference not set to an instance of an object.\n\n\tSeverity=Error\n\n\tSequenceNumber=\n\n\tHostName=ConsoleHost\n\tHostVersion=2.0\n\tHostId=6bba2119-20f0-4b91-b68d-db6df8c2a470\n\tEngineVersion=2.0\n\tRuns"... --- snip ---
The relay log shows that the app queries the "PSMODULEPATH" environment variable from different locations.
process -> GetEnvironmentVariable() machine -> registry, HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment user -> registry, HKEY_CURRENT_USER\Environment
The latter one isn't present, hence it fails.
--- snip --- ... 0032:Call advapi32.RegOpenKeyExW(80000001,030d24ac L"Environment",00000000,00020019,0033e484) ret=00dcac27 0032:Call ntdll.RtlInitUnicodeString(0033e3b0,030d24ac L"Environment") ret=6832a7ee 0032:Ret ntdll.RtlInitUnicodeString() retval=0033e3b0 ret=6832a7ee 0032:Call ntdll.NtOpenKey(0033e484,00020019,0033e3b8) ret=6832a80a 0032:Ret ntdll.NtOpenKey() retval=c0000034 ret=6832a80a 0032:Call ntdll.RtlNtStatusToDosError(c0000034) ret=6832a815 0032:Ret ntdll.RtlNtStatusToDosError() retval=00000002 ret=6832a815 0032:Ret advapi32.RegOpenKeyExW() retval=00000002 ret=00dcac27 ... 0032:trace:seh:raise_exception code=c0000005 flags=0 addr=0x33b36ca ip=033b36ca tid=0032 ... --- snip ---
Creating "HKEY_CURRENT_USER\Environment" key lets the shell successfully proceed. Add to wine.inf.in
Regards
http://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #1 from Anastasius Focht focht@gmx.net 2010-01-28 12:47:37 --- Hello,
thanks, fixed by commit 49be8db6b1f16518cafb0a7fba12f53dd9941191
Regards
http://bugs.winehq.org/show_bug.cgi?id=21512
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Alexandre Julliard julliard@winehq.org 2010-02-05 11:39:23 --- Closing bugs fixed in 1.1.38.
http://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Fixed by SHA1| |49be8db6b1f16518cafb0a7fba1 | |2f53dd9941191 Component|-unknown |shell32
--- Comment #3 from Anastasius Focht focht@gmx.net 2011-10-11 15:15:17 CDT --- Hello,
filling/correcting fields ...
Regards
http://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Status|CLOSED |REOPENED Resolution|FIXED | Ever Confirmed|0 |1
--- Comment #4 from Anastasius Focht focht@gmx.net 2012-05-09 16:47:44 CDT --- Hello,
reopening. This issue was fixed 2 years ago with commit http://source.winehq.org/git/wine.git/commit/49be8db6b1f16518cafb0a7fba12f53...) and seems to have reappeared (last time I tested was long ago).
"HKEY_CURRENT_USER\Environment" is no longer present -> bug
"HKEY_CURRENT_USER\Volatile Environment" is present.
--- snip --- ... 002b:Call advapi32.RegOpenKeyExW(80000001,790e367c L"Environment",00000000,00020019,0032ea54) ret=0039a6a7 002b:Call ntdll.RtlInitUnicodeString(0032e980,790e367c L"Environment") ret=7ed66502 002b:Ret ntdll.RtlInitUnicodeString() retval=0032e980 ret=7ed66502 002b:Call ntdll.NtOpenKey(0032ea54,00020019,0032e988) ret=7ed65bdb 002b:Ret ntdll.NtOpenKey() retval=c0000034 ret=7ed65bdb 002b:Call ntdll.RtlNtStatusToDosError(c0000034) ret=7ed66526 002b:Ret ntdll.RtlNtStatusToDosError() retval=00000002 ret=7ed66526 002b:Ret advapi32.RegOpenKeyExW() retval=00000002 ret=0039a6a7 002b:Call KERNEL32.InterlockedCompareExchange(00763448,00000004,00000008) ret=79eb089c 002b:Ret KERNEL32.InterlockedCompareExchange() retval=00000008 ret=79eb089c 002b:trace:seh:raise_exception code=c0000005 flags=0 addr=0x793f3852 ip=793f3852 tid=002b 002b:trace:seh:raise_exception info[0]=00000000 002b:trace:seh:raise_exception info[1]=00000000 002b:trace:seh:raise_exception eax=00000000 ebx=008d923c ecx=00000000 edx=008d7f4c esi=00000001 edi=008d7f4c 002b:trace:seh:raise_exception ebp=0032eb00 esp=0032eacc cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010246 002b:trace:seh:call_stack_handlers calling handler at 0x79f07fee code=c0000005 flags=0 ... Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Environment.GetEnvironmentVariable(String variable, EnvironmentVariableTarget target) at System.Management.Automation.ModuleIntrinsics.SetModulePath() at System.Management.Automation.ExecutionContext.InitializeCommon(AutomationEngine engine, PSHost hostInterface) at System.Management.Automation.ExecutionContext..ctor(AutomationEngine engine, PSHost hostInterface, RunspaceConfiguration runspaceConfiguration) at System.Management.Automation.AutomationEngine..ctor(PSHost hostInterface, RunspaceConfiguration runspaceConfiguration, InitialSessionState iss) at System.Management.Automation.Runspaces.LocalRunspace.DoOpenHelper() at System.Management.Automation.Runspaces.LocalRunspace.OpenHelper(Boolean syncCall) at System.Management.Automation.Runspaces.RunspaceBase.CoreOpen(Boolean syncCall) at System.Management.Automation.Runspaces.RunspaceBase.Open() ... --- snip ---
$ wine --version wine-1.5.3-243-g9c0486d
Regards
http://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Platform|x86 |x86-64
--- Comment #5 from Anastasius Focht focht@gmx.net 2012-05-09 19:26:04 CDT --- Hello,
it seems this problem is related to shared Wow64 builds of Wine. I did some regression testing with pure Wine 32-bit builds (faster) and it works.
The "HKEY_CURRENT_USER\Environment" registry subkey is present when the WINEPREFIX is created for the first time.
With Wine64+32 the "Environment" registry subkey disappears after second bootstrapping.
This happens for both, 64-bit and pure 32-bit WINEPREFIXES (WINEARCH=win32).
Reproduce:
$ rm -rf ~/.wine $ wine regedit (shows "HKEY_CURRENT_USER\Environment") $ wineserver -w (wait until complete shutdown) $ wine regedit ("HKEY_CURRENT_USER\Environment" gone along with "AppEvents")
Regards
http://bugs.winehq.org/show_bug.cgi?id=21512
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2012-05-10 01:03:50 CDT --- It works fine here. Are you sure your wow64 build is setup properly?
http://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED
--- Comment #7 from Anastasius Focht focht@gmx.net 2012-05-10 01:43:24 CDT --- Hello Alexandre,
the WoW64 build setup is fine but I found out my working tree was not clean. There was still a single patch applied on top of master to work around the breakage from bug 21483 (changed token security). I needed that to be able to debug managed .NET apps. This seems to cause an unintended side-effect in Wow64 builds I never noticed before.
Sorry for the noise. I guess I should get more sleep. Marking fixed again.
Regards
http://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|regression |
http://bugs.winehq.org/show_bug.cgi?id=21512
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Austin English austinenglish@gmail.com 2012-05-10 13:39:26 CDT --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=21512
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.microsoft.com/do |https://web.archive.org/web |wnloads/details.aspx?Family |/20120604201356/http://down |Id=60cb5b6c-6532-45e0-ab0f- |load.microsoft.com/download |a94ae9ababf5&displaylang=en |/E/C/E/ECE99583-2003-455D-B | |681-68DB610B44A4/WindowsXP- | |KB968930-x86-ENG.exe