private static int[] WindowsRegQueryInfoKey1(int hKey){
  int[] result=WindowsRegQueryInfoKey(hKey);
  if (result[ERROR_CODE] == ERROR_SUCCESS) {
    return result;
  }
 else {
    long sleepTime=INIT_SLEEP_TIME;
    for (int i=0; i < MAX_ATTEMPTS; i++) {
      try {
        Thread.sleep(sleepTime);
      }
 catch (      InterruptedException e) {
        return result;
      }
      sleepTime*=2;
      result=WindowsRegQueryInfoKey(hKey);
      if (result[ERROR_CODE] == ERROR_SUCCESS) {
        return result;
      }
    }
  }
  return result;
}

private static int [ ] WindowsRegQueryInfoKey1 ( int hKey ) { int [ ] result = WindowsRegQueryInfoKey ( hKey ) ; if ( result [ ERROR_CODE ] == ERROR_SUCCESS ) { return result ; } else { long sleepTime = INIT_SLEEP_TIME ; for ( int i = 0 ; i < MAX_ATTEMPTS ; i ++ ) { try { Thread . sleep ( sleepTime ) ; } catch ( InterruptedException e ) { return result ; } sleepTime *= 2 ; result = WindowsRegQueryInfoKey ( hKey ) ; if ( result [ ERROR_CODE ] == ERROR_SUCCESS ) { return result ; } } } return result ; }
retries regqueryinfokey ( ) max_attempts times before giving up .
