mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 199473: Make downloads work if temporary directory is encrypted on Windows. r=jmathies
--HG-- extra : rebase_source : e88b316e071dd9bb8a57ab11e1bd13bc39d7d8eb
This commit is contained in:
parent
7ab8f39d53
commit
9b9de75895
@ -1470,10 +1470,23 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent,
|
||||
copyOK = ::CopyFileW(filePath.get(), destPath.get(), PR_TRUE);
|
||||
else {
|
||||
#ifndef WINCE
|
||||
copyOK = ::MoveFileExW(filePath.get(), destPath.get(),
|
||||
MOVEFILE_REPLACE_EXISTING |
|
||||
MOVEFILE_COPY_ALLOWED |
|
||||
MOVEFILE_WRITE_THROUGH);
|
||||
DWORD status;
|
||||
if (FileEncryptionStatusW(filePath.get(), &status)
|
||||
&& status == FILE_IS_ENCRYPTED)
|
||||
{
|
||||
copyOK = CopyFileExW(filePath.get(), destPath.get(), NULL, NULL, NULL,
|
||||
COPY_FILE_ALLOW_DECRYPTED_DESTINATION);
|
||||
|
||||
if (copyOK)
|
||||
DeleteFileW(filePath.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
copyOK = ::MoveFileExW(filePath.get(), destPath.get(),
|
||||
MOVEFILE_REPLACE_EXISTING |
|
||||
MOVEFILE_COPY_ALLOWED |
|
||||
MOVEFILE_WRITE_THROUGH);
|
||||
}
|
||||
#else
|
||||
DeleteFile(destPath.get());
|
||||
copyOK = :: MoveFileW(filePath.get(), destPath.get());
|
||||
|
Loading…
Reference in New Issue
Block a user