nbulp's picture

Crash in OpenTK.Platform.Windows.WinRawKeyboard.GetRegistryKey

Project:The Open Toolkit library
Version:1.1.0-rc1
Component:Code
Category:bug report
Priority:critical
Assigned:ludwig44
Status:closed
Description

One of the input devices, on my computer, is simply called "VIRTUAL_DIGITIZER" (it would seem). The GetRegistryKey-function in WinRawKeyboard attempts to split that string, using "#" as the separator character. In this case, it will not split into the three strings that GetRegistryKey expects, which causes it to raise an IndexOutOfBoundsExecption, when accessing the non-existent second string.

The code looks like this:

            string[] split = name.Split('#');
 
            string id_01 = split[0];    // ACPI (Class code)
            string id_02 = split[1];    // PNP0303 (SubClass code)
            string id_03 = split[2];    // 3&13c0b0c5&0 (Protocol code)

So, my "VIRTUAL_DIGITIZER"-device does not contain a "subclass code" nor a "protocol code".

Raw exception info:

System.IndexOutOfRangeException was unhandled
  HResult=-2146233080
  Message=Index was outside the bounds of the array.
  Source=OpenTK
  StackTrace:
       at OpenTK.Platform.Windows.WinRawKeyboard.GetRegistryKey(String name)
       at OpenTK.Platform.Windows.WinRawKeyboard.RefreshDevices()
       at OpenTK.Platform.Windows.WinRawKeyboard..ctor(IntPtr windowHandle)
       at OpenTK.Platform.Windows.WinRawInput.CreateDrivers()
       at OpenTK.Platform.Windows.WinInputBase.ProcessEvents()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Cheers!
// Matko


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nbulp's picture

#1

P.S.: Same issue with WinRawMouse (and possibly in other places).

nbulp's picture

#2

Ah, just discovered that this bug is already in the process of being fixed, for Windows 8: http://www.opentk.com/node/3198

AndyKorth's picture

#3

Hey nbulp,

That fix was commit a while ago, so if you'd like, you can let me know if it's working in this branch:
https://github.com/andykorth/opentk/

There's been a handful of other fixes, including other Window input fixes on that branch as well.

koto's picture

#4

Hi

I also got this issue. It appeared when I run Windows 8 emulator. Turning off emulator made bug disappear.

Koto

the Fiddler's picture

#5

Status:open» fixed

This is fixed upstream: https://github.com/thefiddler/opentk

the Fiddler's picture

#6

Version:1.x-dev» 1.1-2014-01-02
Status:fixed» closed

Closing bugs fixed in OpenTK 1.1.

If this is still an issue please file a new bug report at https://github.com/opentk/opentk/issues

ludwig44's picture

#7

Priority:normal» critical
Assigned to:Anonymous» ludwig44
Status:closed» open

This problem isn't fixed. I am running into the error in visual studio 2012. For some reason, whenever I create a new file and run it, it gives me this error and doesn't run openTK 1.1 but instead it's running a later version even though I only have openTK 1.1 installed. The only way I have found a fix for this error is to restart my computer everytime I want to run the program.

the Fiddler's picture

#8

Version:1.1-2014-01-02» 1.1-dev
Status:open» fixed

Oh, you are right.

This is fixed in commit 1b3b510, which will be included in the next release.

ludwig44's picture

#9

Any estimated time on the update release? On another note my laptop is a touchscreen windows 8.1 and apparently those are the only ones affected with the openTK.Dll error.

the Fiddler's picture

#10

Version:1.1-dev» 1.1.0-rc1
Status:fixed» closed

This fix is included in 1.1-rc1.