mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 19:54:25 -04:00
[core] make sure the system disk is never listed
* When using VHD or VMDK drives, it was possible for the system disk to be listed. * Closes #541
This commit is contained in:
parent
f04167c51c
commit
477674016e
6 changed files with 49 additions and 26 deletions
|
@ -407,6 +407,20 @@ static __inline DWORD GetCurrentDirectoryU(DWORD nBufferLength, char* lpBuffer)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static __inline UINT GetSystemDirectoryU(char* lpBuffer, UINT uSize)
|
||||
{
|
||||
UINT ret = 0, err = ERROR_INVALID_DATA;
|
||||
walloc(lpBuffer, uSize);
|
||||
ret = GetSystemDirectoryW(wlpBuffer, uSize);
|
||||
err = GetLastError();
|
||||
if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, uSize)) == 0)) {
|
||||
err = GetLastError();
|
||||
}
|
||||
wfree(lpBuffer);
|
||||
SetLastError(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline DWORD GetTempPathU(DWORD nBufferLength, char* lpBuffer)
|
||||
{
|
||||
DWORD ret = 0, err = ERROR_INVALID_DATA;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue