mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 19:54:25 -04:00
[internal] align msapi_utf8.h to the one we use for libwdi
This commit is contained in:
parent
038e835886
commit
ff2548b559
2 changed files with 12 additions and 6 deletions
|
@ -681,7 +681,13 @@ static __inline DWORD GetFileAttributesU(const char* lpFileName)
|
|||
{
|
||||
DWORD ret = 0xFFFFFFFF, err = ERROR_INVALID_DATA;
|
||||
wconvert(lpFileName);
|
||||
ret = GetFileAttributesW(wlpFileName);
|
||||
// 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 = GetFileAttributesW(&wlpFileName[1]);
|
||||
} else {
|
||||
ret = GetFileAttributesW(wlpFileName);
|
||||
}
|
||||
err = GetLastError();
|
||||
wfree(lpFileName);
|
||||
SetLastError(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue