[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/Microsoft/Win32 Win32KeyProvi
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/Microsoft/Win32 Win32KeyProvider.cs, 1.4, 1.5 |
Date: |
Wed, 09 Jul 2003 19:02:26 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/Microsoft/Win32
In directory subversions:/tmp/cvs-serv22540/runtime/Microsoft/Win32
Modified Files:
Win32KeyProvider.cs
Log Message:
Detect Win32 in a way that doesn't produce the side-effect of printing
a low-level debug message on non-Win32 platforms.
Index: Win32KeyProvider.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/Microsoft/Win32/Win32KeyProvider.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Win32KeyProvider.cs 29 May 2003 05:38:18 -0000 1.4
--- Win32KeyProvider.cs 9 Jul 2003 23:02:24 -0000 1.5
***************
*** 55,79 ****
public static bool IsWin32()
{
! try
! {
! // We query the information about the
LocalMachine
! // hive to determine if the Win32
registry routines
! // are present or not. The runtime
engine will
! // throw a "MissingMethodException" if
it was unable
! // to resolve the function (i.e. on
non-Win32 platforms),
! // or if "winapi" calling conventions
are not supported.
! uint numSubKeys, numValues;
!
RegQueryInfoKey(HiveToHKey(RegistryHive.LocalMachine),
! null,
IntPtr.Zero, IntPtr.Zero,
! out
numSubKeys, IntPtr.Zero,
!
IntPtr.Zero, out numValues,
!
IntPtr.Zero, IntPtr.Zero,
!
IntPtr.Zero, IntPtr.Zero);
! return true;
! }
! catch(MissingMethodException)
! {
! return false;
! }
}
--- 55,59 ----
public static bool IsWin32()
{
! return (Environment.OSVersion.Platform !=
PlatformID.Unix);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/Microsoft/Win32 Win32KeyProvider.cs, 1.4, 1.5,
Rhys Weatherley <address@hidden> <=