The problem is that ReadInput causes abnormal slow down of the application: window resizing, text entering to textbox and so on. CPU usage (including kernel) is less than 5 percents. ReadInput returns data buffer, but is very slow.

Another problem is that GetInput does not return any data (returns with false).