mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-31 06:48:26 -04:00
[misc] try to support folks who use a symlink for their temp dir
* Microsoft's WIM mounting APIs can't use symlinked directories and some folks want to use a symlinked temp dir... * Closes #2084
This commit is contained in:
parent
71e99add76
commit
3e81b38c2d
4 changed files with 42 additions and 6 deletions
|
@ -724,6 +724,21 @@ static __inline DWORD GetModuleFileNameExU(HANDLE hProcess, HMODULE hModule, cha
|
|||
return ret;
|
||||
}
|
||||
|
||||
static __inline DWORD GetFinalPathNameByHandleU(HANDLE hFile, char* lpszFilePath, DWORD cchFilePath, DWORD dwFlags)
|
||||
{
|
||||
DWORD ret = 0, err = ERROR_INVALID_DATA;
|
||||
walloc(lpszFilePath, cchFilePath);
|
||||
ret = GetFinalPathNameByHandleW(hFile, wlpszFilePath, cchFilePath, dwFlags);
|
||||
err = GetLastError();
|
||||
if ((ret != 0)
|
||||
&& ((ret = wchar_to_utf8_no_alloc(wlpszFilePath, lpszFilePath, cchFilePath)) == 0)) {
|
||||
err = GetLastError();
|
||||
}
|
||||
wfree(lpszFilePath);
|
||||
SetLastError(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline DWORD GetFileVersionInfoSizeU(const char* lpFileName, LPDWORD lpdwHandle)
|
||||
{
|
||||
DWORD ret = 0, err = ERROR_INVALID_DATA;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue