[Mono-dev] [PATCH] System.Environment fixes for Windows

Bill Holmes billholmes54 at gmail.com
Thu Dec 18 16:04:47 EST 2008


HI,

The attached patch fixes two problems we found System.Environment.

Calling Environment.GetEnvironmentVariable ("IsNotSet",
EnvironmentVariableTarget.User) causes a nre with mono on Windows.

Calling Environment.SetEnvironmentVariable (...,
EnvironmentVariableTarget.User) does not notify the OS that a variable
has changed.
See http://msdn.microsoft.com/en-us/library/ms682653(VS.85).aspx

Thanks
-bill

2008-12-18  Bill Holmes  <billholmes54 at gmail.com>

	* Environment.cs (GetEnvironmentVariable) :  Avoiding an nre if
	  the variable is not set.

	* Environment.cs (SetEnvironmentVariable) : Adding a call to
	  internalBroadcastSettingChange to notify Windows that an environment
	  variable has changed.

	* icall-def.h : Adding an internal call definition for
	  System.Environment.internalBroadcastSettingChange.

	* icall.c : Adding a Windows only implementation to broadcast a
	  WM_SETTINGCHANGE when an environment variable has changed.

	Contributed under MIT/X11 license.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EnvVars.patch
Type: text/x-diff
Size: 4731 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081218/0c02b26c/attachment.bin 


More information about the Mono-devel-list mailing list