mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:57:57 +00:00
UI: DbErrorManager: Fix dir share mode
This commit is contained in:
parent
a255e13375
commit
40c47b60d8
@ -21,7 +21,9 @@ bool DirInfo::open()
|
||||
{
|
||||
close();
|
||||
|
||||
m_handle = CreateFileW((LPCWSTR) path().utf16(), GENERIC_READ, FILE_SHARE_READ, nullptr,
|
||||
constexpr DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||
|
||||
m_handle = CreateFileW((LPCWSTR) path().utf16(), GENERIC_READ, shareMode, nullptr,
|
||||
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr);
|
||||
|
||||
return isOpen();
|
||||
|
@ -58,7 +58,8 @@ static bool isDriveMounted(WCHAR drive)
|
||||
{
|
||||
const WCHAR volume[] = { L'\\', L'\\', L'.', L'\\', drive, L':', L'\0' };
|
||||
|
||||
const DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||
constexpr DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||
|
||||
const HANDLE volumeHandle =
|
||||
CreateFileW(volume, GENERIC_READ, shareMode, nullptr, OPEN_EXISTING, 0, nullptr);
|
||||
|
||||
@ -293,8 +294,10 @@ QString realPath(const QString &path)
|
||||
if (path.isEmpty())
|
||||
return path;
|
||||
|
||||
const HANDLE fileHandle = CreateFileW((LPCWSTR) path.utf16(), GENERIC_READ, FILE_SHARE_READ,
|
||||
nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS /* open dir */, nullptr);
|
||||
constexpr DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||
|
||||
const HANDLE fileHandle = CreateFileW((LPCWSTR) path.utf16(), GENERIC_READ, shareMode, nullptr,
|
||||
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS /* open dir */, nullptr);
|
||||
|
||||
QString resPath;
|
||||
if (fileHandle != INVALID_HANDLE_VALUE) {
|
||||
|
Loading…
Reference in New Issue
Block a user