Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GetTempPath2 on Windows if available #104642

Merged
merged 1 commit into from
Jul 10, 2024

Commits on Jul 9, 2024

  1. Use GetTempPath2 on Windows if available

    Since Windows 10 Build 20348, there is a new API to get the temporary files path called [`GetTempPath2`](https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-gettemppath2w). This API returns a directory inaccessible to non-SYSTEM processes if the calling process runs as SYSTEM, and [it is recommended to call this function instead of `GetTempPath`](https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-gettemppathw#remarks).
    
    This PR tries to find `GetTempPath2A` / `GetTempPath2W` and uses that, otherwise it falls back to `GetTempPathA` / `GetTempPathW`.
    
    *Note:* this PR removes an unused function `GetTempPathWrapper` that which referenced `GetTempPathW`
    hoyosjs authored and tommcdon committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    9cfbf78 View commit details
    Browse the repository at this point in the history