Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows GetBasePath should use GetModuleFileNameExW() and check for o…
…verflows. Apparently you might get strange paths from GetModuleFileName(), such as short path names or UNC filenames, so this avoids that problem. Since you have to tapdance with linking different libraries and defining macros depending on what Windows you plan to target, we dynamically load the API we need, which works on all versions of Windows (on Win7, it'll load a compatibility wrapper for the newer API location). What a mess. This also now does the right thing if there isn't enough space to store the path, looping with a larger allocated buffer each try. Fixes Bugzilla #2435.
- Loading branch information
Showing with 42 additions and 5 deletions.