mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 06:45:49 +03:00
Merge pull request #2801 from nextcloud/fix_cfapi_win32_build
Fix CfAPI Win32 build
This commit is contained in:
commit
8d5d45ea5c
1 changed files with 2 additions and 2 deletions
|
@ -346,13 +346,13 @@ OCC::CfApiWrapper::FileHandle OCC::CfApiWrapper::handleForPath(const QString &pa
|
|||
HANDLE handle = nullptr;
|
||||
const qint64 openResult = CfOpenFileWithOplock(path.toStdWString().data(), CF_OPEN_FILE_FLAG_NONE, &handle);
|
||||
if (openResult == S_OK) {
|
||||
return FileHandle(handle, CfCloseHandle);
|
||||
return {handle, [](HANDLE h) { CfCloseHandle(h); }};
|
||||
}
|
||||
} else {
|
||||
const auto handle = CreateFile(path.toStdWString().data(), 0, 0, nullptr,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (handle != INVALID_HANDLE_VALUE) {
|
||||
return FileHandle(handle, [](HANDLE h) { CloseHandle(h); });
|
||||
return {handle, [](HANDLE h) { CloseHandle(h); }};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue