mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-31 06:48:26 -04:00
[core] fix Win7 EFI boot file extraction when dual BIOS+UEFI is in use
* Closes #1292 * Also add "RISD" (Ricoh IDE SD Card reader) to list of card readers (#551) * Also make running Fido script read-only
This commit is contained in:
parent
1ecc771cbd
commit
661ba7b64c
5 changed files with 31 additions and 10 deletions
|
@ -694,6 +694,23 @@ static __inline DWORD GetFileAttributesU(const char* lpFileName)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static __inline BOOL SetFileAttributesU(const char* lpFileName, DWORD dwFileAttributes)
|
||||
{
|
||||
BOOL ret = FALSE, err = ERROR_INVALID_DATA;
|
||||
wconvert(lpFileName);
|
||||
// Unlike Microsoft's version, ours doesn't fail if the string is quoted
|
||||
if ((wlpFileName[0] == L'"') && (wlpFileName[wcslen(wlpFileName) - 1] == L'"')) {
|
||||
wlpFileName[wcslen(wlpFileName) - 1] = 0;
|
||||
ret = SetFileAttributesW(&wlpFileName[1], dwFileAttributes);
|
||||
} else {
|
||||
ret = SetFileAttributesW(wlpFileName, dwFileAttributes);
|
||||
}
|
||||
err = GetLastError();
|
||||
wfree(lpFileName);
|
||||
SetLastError(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline int SHCreateDirectoryExU(HWND hwnd, const char* pszPath, SECURITY_ATTRIBUTES *psa)
|
||||
{
|
||||
int ret = ERROR_INVALID_DATA;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue