mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:15:10 +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();
|
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);
|
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr);
|
||||||
|
|
||||||
return isOpen();
|
return isOpen();
|
||||||
|
@ -58,7 +58,8 @@ static bool isDriveMounted(WCHAR drive)
|
|||||||
{
|
{
|
||||||
const WCHAR volume[] = { L'\\', L'\\', L'.', L'\\', drive, L':', L'\0' };
|
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 =
|
const HANDLE volumeHandle =
|
||||||
CreateFileW(volume, GENERIC_READ, shareMode, nullptr, OPEN_EXISTING, 0, nullptr);
|
CreateFileW(volume, GENERIC_READ, shareMode, nullptr, OPEN_EXISTING, 0, nullptr);
|
||||||
|
|
||||||
@ -293,8 +294,10 @@ QString realPath(const QString &path)
|
|||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
return path;
|
return path;
|
||||||
|
|
||||||
const HANDLE fileHandle = CreateFileW((LPCWSTR) path.utf16(), GENERIC_READ, FILE_SHARE_READ,
|
constexpr DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||||
nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS /* open dir */, nullptr);
|
|
||||||
|
const HANDLE fileHandle = CreateFileW((LPCWSTR) path.utf16(), GENERIC_READ, shareMode, nullptr,
|
||||||
|
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS /* open dir */, nullptr);
|
||||||
|
|
||||||
QString resPath;
|
QString resPath;
|
||||||
if (fileHandle != INVALID_HANDLE_VALUE) {
|
if (fileHandle != INVALID_HANDLE_VALUE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user