Use the `GetTempPath2` APIs instead of the `GetTempPath` APIs in native code across the OpenJDK repository to retrieve the temporary directory path, as `GetTempPath2` provides enhanced security. While `GetTempPath` may still function without errors, using `GetTempPath2` reduces the risk of potential exploits for users.
Note that `GetTempPath2` is only available on Windows 11 and later. Therefore, you should load it dynamically and fall back to `GetTempPath` if `GetTempPath2` is not available.
Note that `GetTempPath2` is only available on Windows 11 and later. Therefore, you should load it dynamically and fall back to `GetTempPath` if `GetTempPath2` is not available.
- links to
-
Review(master) openjdk/jdk/20600