File tree Expand file tree Collapse file tree
tools/keyboard-qualification Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,10 +30,11 @@ internal static class WindowsProbe
3030 static readonly ConcurrentQueue < string > Events = new ConcurrentQueue < string > ( ) ;
3131 static int EventCount , Overflow ;
3232 static uint HookThread ;
33- static void FlushEvents ( ) {
33+ static bool FlushEvents ( ) {
3434 string value ;
3535 while ( Events . TryDequeue ( out value ) ) { Interlocked . Decrement ( ref EventCount ) ; Log ( value ) ; }
36- if ( Interlocked . Exchange ( ref Overflow , 0 ) != 0 ) { Recording = false ; Log ( "BLOCKED: Event evidence overflowed or could not be recorded." ) ; }
36+ if ( Interlocked . Exchange ( ref Overflow , 0 ) != 0 ) { Recording = false ; Log ( "BLOCKED: Event evidence overflowed or could not be recorded." ) ; return false ; }
37+ return true ;
3738 }
3839 static AutomationElement OwnedKeyboard ( DateTime opened , ref int ownedPid ) {
3940 int expectedPid = ownedPid ;
@@ -96,7 +97,7 @@ [STAThread] static void Main() {
9697 } ;
9798 timer . Tick += ( s , e ) => {
9899 try {
99- FlushEvents ( ) ;
100+ if ( ! FlushEvents ( ) ) throw new Exception ( "Event evidence is incomplete; sequence cancelled" ) ;
100101 if ( root == null ) {
101102 if ( initiallyOpen ) {
102103 var process = Process . GetProcessesByName ( "osk" ) . FirstOrDefault ( ) ;
You can’t perform that action at this time.
0 commit comments