@Override
    public synchronized String getEnvironment(final String name) {
      if (name == null) {
        throw new UnsupportedOperationException("getEnvironment() for name=NULL");
      }
      int psize = Kernel32.INSTANCE.GetEnvironmentVariable(name, null, 0);
      if (psize > 0) {
        for (;;) {
          char[] result = new char[psize];
          psize = Kernel32.INSTANCE.GetEnvironmentVariable(name, result, psize);
          if (psize == (result.length - 1)) {
            return new String(result, 0, psize);
          } else if (psize <= 0) {
            return null;
          }
        }
      } else {
        return null;
      }
    }
Implementation of {@link NativeCalls} for Windows platforms.
geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java