private static Formats getWindowsFormats() {
    var kernel32 = Native.load("Kernel32", Kernel32.class);
    int bufferSize = 128, rv;
    var buffer = new char[bufferSize];

    rv = kernel32.GetLocaleInfoEx(null, Kernel32.LOCALE_SSHORTDATE, buffer, bufferSize);
    if (rv < 2) throw new IllegalStateException("GetLocaleInfoEx: " + kernel32.GetLastError());
    var shortDate = fixWindowsFormat(new String(buffer, 0, rv - 1));

    rv = kernel32.GetLocaleInfoEx(null, Kernel32.LOCALE_SSHORTTIME, buffer, bufferSize);
    if (rv < 2) throw new IllegalStateException("GetLocaleInfoEx: " + kernel32.GetLastError());
    var shortTime = fixWindowsFormat(new String(buffer, 0, rv - 1));

    rv = kernel32.GetLocaleInfoEx(null, Kernel32.LOCALE_STIMEFORMAT, buffer, bufferSize);
    if (rv < 2) throw new IllegalStateException("GetLocaleInfoEx: " + kernel32.GetLastError());
    var mediumTime = fixWindowsFormat(new String(buffer, 0, rv - 1));

    var locale = Locale.getDefault(Locale.Category.FORMAT);
    return makeFormats(shortDate, shortTime, mediumTime, locale);
  }
private static Formats getWindowsFormats()