private static int readCurrentTimeoutValue() {
    int currentTimeout = DEFAULT_TIMEOUT_MS;
    try {
      WinDef.UINTByReference result = new WinDef.UINTByReference();
      if (User32Ex.INSTANCE.SystemParametersInfo(new WinDef.UINT(0x2000 /* SPI_GETFOREGROUNDLOCKTIMEOUT */),
                                             new WinDef.UINT(), result, new WinDef.UINT())) {
        currentTimeout = result.getValue().intValue();
        if (LOG.isDebugEnabled()) {
          LOG.debug("Current foreground lock timeout: " + currentTimeout);
        }
      }
      else {
        LOG.warn("Failed to get foreground lock timeout using SystemParametersInfo, assuming default value of " + currentTimeout);
      }
    }
    catch (Exception e) {
      LOG.warn("Error getting foreground lock timeout using SystemParametersInfo, assuming default value of " + currentTimeout, e);
    }
    return currentTimeout;
  }
private static int readCurrentTimeoutValue()