Description
Code (taken from WPF source code, MIT license):
[SecurityCritical]
|
[SuppressUnmanagedCodeSecurity]
|
[DllImport(ExternDll.User32, EntryPoint="RegisterClassEx", CharSet=CharSet.Unicode, SetLastError=true, BestFitMapping=false)] |
internal static extern UInt16 IntRegisterClassEx(NativeMethods.WNDCLASSEX_D wc_d); ///<SecurityNote> |
/// Critical - calls IntRegisterClassEx (the real PInvoke method) |
///</SecurityNote> |
[SecurityCritical]
|
internal static UInt16 RegisterClassEx(NativeMethods.WNDCLASSEX_D wc_d) |
{
|
UInt16 result = IntRegisterClassEx(wc_d);
|
if(result == 0) |
{
|
throw new Win32Exception(); |
}
|
|
return result; |
}
|
Exception:
System.TypeInitializationException: The type initializer for 'System.Windows.Window' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.FrameworkElement' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Media.Transform' threw an exception. ---> System.ComponentModel.Win32Exception: ERROR_INVALID_PARAMETER - The parameter is incorrect at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d) at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks) at System.Windows.Threading.Dispatcher..ctor() at System.Windows.Threading.Dispatcher.get_CurrentDispatcher() at System.Windows.Media.MatrixTransform..ctor(Matrix matrix) at System.Windows.Media.Transform.MakeIdentityTransform() at System.Windows.Media.Transform..cctor() — End of inner exception stack trace — at System.Windows.Media.Transform.get_Identity() at System.Windows.FrameworkElement..cctor() — End of inner exception stack trace — at System.Windows.Window..cctor() — End of inner exception stack trace — at System.Windows.Window..ctor() at TenEnv.TestTool.WpfTest..ctor() in D:\VSProjects\TenEnv\TenEnv.TestTool\WpfTest.xaml.cs:line 21 at TenEnv.TestTool.Test.Perform() in D:\VSProjects\TenEnv\TenEnv.TestTool\Tester.cs:line 20
Tested on .NET Framework 4.0, works fine in Windows XP. Affects a lot of .NET programs which are using WPF controls.
I'm newbie at testing/debugging ReactOS, exactly this .NET-stuff, so tell me how to improve my issue